@tedi-design-system/react 18.0.0-rc.4 → 18.0.0-rc.6
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/_virtual/index.es13.js +2 -2
- package/_virtual/index.es14.js +2 -2
- package/bundle-stats.html +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.cjs.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.es.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.es.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/index.cjs.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/index.es.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.development.cjs.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.development.es.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.production.min.es.js +1 -1
- package/external/prop-types/external/react-is/index.cjs.js +1 -1
- package/external/prop-types/external/react-is/index.es.js +1 -1
- package/external/react-is/index.cjs.js +1 -1
- package/external/react-is/index.es.js +1 -1
- package/external/toposort/index.cjs.js +1 -1
- package/external/toposort/index.es.js +1 -1
- package/index.css +1 -1
- package/package.json +1 -1
- package/src/tedi/components/buttons/button-group/button-group.cjs.js +1 -1
- package/src/tedi/components/buttons/button-group/button-group.es.js +4 -4
- package/src/tedi/components/buttons/collapse/collapse.cjs.js +1 -1
- package/src/tedi/components/buttons/collapse/collapse.d.ts +15 -0
- package/src/tedi/components/buttons/collapse/collapse.es.js +55 -54
- package/src/tedi/components/content/calendar/calendar.cjs.js +1 -1
- package/src/tedi/components/content/calendar/calendar.d.ts +9 -1
- package/src/tedi/components/content/calendar/calendar.es.js +72 -71
- package/src/tedi/components/content/calendar/calendar.module.scss.cjs.js +1 -1
- package/src/tedi/components/content/calendar/calendar.module.scss.es.js +3 -2
- package/src/tedi/components/content/table/index.d.ts +6 -0
- package/src/tedi/components/content/table/table-columns-menu/table-columns-menu.cjs.js +1 -0
- package/src/tedi/components/content/table/table-columns-menu/table-columns-menu.d.ts +15 -0
- package/src/tedi/components/content/table/table-columns-menu/table-columns-menu.es.js +37 -0
- package/src/tedi/components/content/table/table-context.cjs.js +1 -0
- package/src/tedi/components/content/table/table-context.d.ts +3 -0
- package/src/tedi/components/content/table/table-context.es.js +11 -0
- package/src/tedi/components/content/table/table-header-button/table-header-button.cjs.js +1 -0
- package/src/tedi/components/content/table/table-header-button/table-header-button.d.ts +51 -0
- package/src/tedi/components/content/table/table-header-button/table-header-button.es.js +42 -0
- package/src/tedi/components/content/table/table-header-button/table-header-button.module.scss.cjs.js +1 -0
- package/src/tedi/components/content/table/table-header-button/table-header-button.module.scss.es.js +7 -0
- package/src/tedi/components/content/table/table-toolbar/table-toolbar.cjs.js +1 -0
- package/src/tedi/components/content/table/table-toolbar/table-toolbar.d.ts +21 -0
- package/src/tedi/components/content/table/table-toolbar/table-toolbar.es.js +9 -0
- package/src/tedi/components/content/table/table.cjs.js +1 -0
- package/src/tedi/components/content/table/table.d.ts +519 -0
- package/src/tedi/components/content/table/table.es.js +856 -0
- package/src/tedi/components/content/table/table.module.scss.cjs.js +1 -0
- package/src/tedi/components/content/table/table.module.scss.es.js +54 -0
- package/src/tedi/components/content/table/use-table-persistence.cjs.js +1 -0
- package/src/tedi/components/content/table/use-table-persistence.d.ts +13 -0
- package/src/tedi/components/content/table/use-table-persistence.es.js +53 -0
- package/src/tedi/components/filter/filter/filter-group-context.cjs.js +1 -0
- package/src/tedi/components/filter/filter/filter-group-context.d.ts +8 -0
- package/src/tedi/components/filter/filter/filter-group-context.es.js +5 -0
- package/src/tedi/components/filter/filter/filter-group.cjs.js +1 -0
- package/src/tedi/components/filter/filter/filter-group.d.ts +94 -0
- package/src/tedi/components/filter/filter/filter-group.es.js +64 -0
- package/src/tedi/components/filter/filter/filter.cjs.js +1 -0
- package/src/tedi/components/filter/filter/filter.d.ts +98 -0
- package/src/tedi/components/filter/filter/filter.es.js +236 -0
- package/src/tedi/components/filter/filter/filter.module.scss.cjs.js +1 -0
- package/src/tedi/components/filter/filter/filter.module.scss.es.js +21 -0
- package/src/tedi/components/filter/filter/index.d.ts +3 -0
- package/src/tedi/components/form/search/search.cjs.js +1 -1
- package/src/tedi/components/form/search/search.es.js +22 -20
- package/src/tedi/components/navigation/pagination/pagination.cjs.js +1 -1
- package/src/tedi/components/navigation/pagination/pagination.d.ts +7 -0
- package/src/tedi/components/navigation/pagination/pagination.es.js +132 -91
- package/src/tedi/components/navigation/pagination/pagination.module.scss.cjs.js +1 -1
- package/src/tedi/components/navigation/pagination/pagination.module.scss.es.js +7 -1
- package/src/tedi/components/navigation/pagination/pagination.types.d.ts +100 -0
- package/src/tedi/components/overlays/tooltip/tooltip.cjs.js +1 -1
- package/src/tedi/components/overlays/tooltip/tooltip.es.js +14 -6
- package/src/tedi/index.d.ts +2 -0
- package/src/tedi/providers/label-provider/labels-map.cjs.js +1 -1
- package/src/tedi/providers/label-provider/labels-map.d.ts +146 -6
- package/src/tedi/providers/label-provider/labels-map.es.js +163 -14
- package/tedi.cjs.js +1 -1
- package/tedi.es.js +205 -185
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { jsxs as p, Fragment as g, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import ue from "../../../../../external/classnames/index.es.js";
|
|
3
|
+
import Je, { forwardRef as Ke, useContext as Qe, useRef as Ue, useState as O, useMemo as S, useEffect as Ve, useCallback as C } from "react";
|
|
4
|
+
import { Icon as fe } from "../../base/icon/icon.es.js";
|
|
5
|
+
import { Button as J } from "../../buttons/button/button.es.js";
|
|
6
|
+
import { Checkbox as me } from "../../form/checkbox/checkbox.es.js";
|
|
7
|
+
import { Search as Xe } from "../../form/search/search.es.js";
|
|
8
|
+
import { Dropdown as c } from "../../overlays/dropdown/dropdown.es.js";
|
|
9
|
+
import { StatusBadge as Ye } from "../../tags/status-badge/status-badge.es.js";
|
|
10
|
+
import i from "./filter.module.scss.es.js";
|
|
11
|
+
import { FilterGroupContext as et } from "./filter-group-context.es.js";
|
|
12
|
+
import { useBreakpointProps as tt } from "../../../helpers/hooks/use-breakpoint-props.es.js";
|
|
13
|
+
import { useLabels as lt } from "../../../providers/label-provider/use-labels.es.js";
|
|
14
|
+
const he = (_) => _ === "large" ? 24 : 18, rt = (_) => {
|
|
15
|
+
const v = Je.useId();
|
|
16
|
+
return _ ?? `tedi-filter-${v.replace(/[^a-zA-Z0-9-]/g, "")}`;
|
|
17
|
+
}, it = Ke((_, v) => {
|
|
18
|
+
const { getCurrentBreakpointProps: pe } = tt(_.defaultServerBreakpoint), {
|
|
19
|
+
text: w,
|
|
20
|
+
value: k,
|
|
21
|
+
disabled: ve = !1,
|
|
22
|
+
className: be,
|
|
23
|
+
id: K,
|
|
24
|
+
selected: y,
|
|
25
|
+
defaultSelected: Q = !1,
|
|
26
|
+
onSelectedChange: I,
|
|
27
|
+
selectedValue: L,
|
|
28
|
+
defaultSelectedValue: ge,
|
|
29
|
+
onSelectedValueChange: d,
|
|
30
|
+
multiselect: U = !1,
|
|
31
|
+
selectedValues: u,
|
|
32
|
+
defaultSelectedValues: Se,
|
|
33
|
+
onSelectedValuesChange: s,
|
|
34
|
+
options: N = [],
|
|
35
|
+
searchable: _e = !1,
|
|
36
|
+
showSelectAll: we = !1,
|
|
37
|
+
selectAllLabel: Le,
|
|
38
|
+
showClear: V = !1,
|
|
39
|
+
clearLabel: Ne,
|
|
40
|
+
preserveLabel: X = !1,
|
|
41
|
+
children: Y,
|
|
42
|
+
onClear: P,
|
|
43
|
+
prepend: A,
|
|
44
|
+
hidePrependWhenSelected: xe = !0,
|
|
45
|
+
append: R,
|
|
46
|
+
placement: Ce = "bottom-start",
|
|
47
|
+
variant: ke = "primary",
|
|
48
|
+
size: M = "default",
|
|
49
|
+
searchLabel: ee
|
|
50
|
+
} = pe(_), { getLabel: te } = lt(), ye = Le ?? te("filter.select-all"), le = Ne ?? te("filter.clear-selection"), n = Qe(et), B = rt(K), Ie = Ue(null), G = N.length > 0, $ = !!Y, b = G || $, f = G && !U, m = G && U, F = !!(n != null && n.isManaged) && k !== void 0 && !b, D = F && !(n != null && n.multiselect), re = ve || ((n == null ? void 0 : n.disabled) ?? !1), [Be, $e] = O(Q), [Fe, ie] = O(ge ?? ""), [Oe, j] = O(Se ?? []);
|
|
51
|
+
$ && (Q || I) && y === void 0 && console.warn(
|
|
52
|
+
"[Filter] `defaultSelected` and `onSelectedChange` are not honoured in custom-content mode (when `children` is provided). Drive the selected state yourself via the controlled `selected` prop, e.g. `selected={Boolean(value)}`."
|
|
53
|
+
);
|
|
54
|
+
const T = y !== void 0 ? y : Be, h = L !== void 0 ? L : Fe, r = u !== void 0 ? u : Oe, x = S(() => F ? n.isSelected(k) : m ? r.length > 0 : f ? h !== "" : T, [F, k, n, m, r, f, h, T]), z = S(() => {
|
|
55
|
+
var e;
|
|
56
|
+
return !f || !h ? null : ((e = N.find((l) => l.value === h)) == null ? void 0 : e.label) ?? null;
|
|
57
|
+
}, [f, h, N]), Pe = S(() => f ? z && X ? `${w}: ${z}` : z ?? w : w, [f, z, X, w]), [E, ne] = O(!1), [W, se] = O("");
|
|
58
|
+
Ve(() => {
|
|
59
|
+
E || se("");
|
|
60
|
+
}, [E]);
|
|
61
|
+
const Z = S(() => {
|
|
62
|
+
const e = W.trim().toLowerCase();
|
|
63
|
+
return e ? N.filter((l) => l.label.toLowerCase().includes(e)) : N;
|
|
64
|
+
}, [W, N]), a = S(() => Z.filter((e) => !e.disabled), [Z]), q = S(() => a.length === 0 ? !1 : a.every((e) => r.includes(e.value)), [a, r]), Te = S(() => {
|
|
65
|
+
if (a.length === 0) return !1;
|
|
66
|
+
const e = a.filter((l) => r.includes(l.value)).length;
|
|
67
|
+
return e > 0 && e < a.length;
|
|
68
|
+
}, [a, r]), ze = C(
|
|
69
|
+
(e) => {
|
|
70
|
+
Ie.current = e, typeof v == "function" ? v(e) : v && (v.current = e);
|
|
71
|
+
},
|
|
72
|
+
[v]
|
|
73
|
+
), Ae = C(() => {
|
|
74
|
+
if (F) {
|
|
75
|
+
n.selectFilter(k);
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const e = !T;
|
|
79
|
+
y === void 0 && $e(e), I == null || I(e);
|
|
80
|
+
}, [F, n, k, T, y, I]), Re = C(
|
|
81
|
+
(e) => {
|
|
82
|
+
const l = h === e ? "" : e;
|
|
83
|
+
L === void 0 && ie(l), d == null || d(l);
|
|
84
|
+
},
|
|
85
|
+
[h, L, d]
|
|
86
|
+
), Me = C(
|
|
87
|
+
(e) => {
|
|
88
|
+
const l = r.includes(e) ? r.filter((o) => o !== e) : [...r, e];
|
|
89
|
+
u === void 0 && j(l), s == null || s(l);
|
|
90
|
+
},
|
|
91
|
+
[r, u, s]
|
|
92
|
+
), Ge = C(() => {
|
|
93
|
+
let e;
|
|
94
|
+
if (q) {
|
|
95
|
+
const l = new Set(a.map((o) => o.value));
|
|
96
|
+
e = r.filter((o) => !l.has(o));
|
|
97
|
+
} else {
|
|
98
|
+
const l = new Set(r);
|
|
99
|
+
a.forEach((o) => l.add(o.value)), e = [...l];
|
|
100
|
+
}
|
|
101
|
+
u === void 0 && j(e), s == null || s(e);
|
|
102
|
+
}, [q, a, r, u, s]), ae = C(() => {
|
|
103
|
+
$ ? P == null || P() : m ? (u === void 0 && j([]), s == null || s([])) : f && (L === void 0 && ie(""), d == null || d("")), ne(!1);
|
|
104
|
+
}, [
|
|
105
|
+
$,
|
|
106
|
+
P,
|
|
107
|
+
m,
|
|
108
|
+
u,
|
|
109
|
+
s,
|
|
110
|
+
f,
|
|
111
|
+
L,
|
|
112
|
+
d
|
|
113
|
+
]), De = x && xe, je = D ? "radio" : void 0, Ee = D ? x : void 0, We = !b && !D ? x : void 0, Ze = /* @__PURE__ */ p(g, { children: [
|
|
114
|
+
!b && x && /* @__PURE__ */ t(fe, { className: i["tedi-filter__icon"], name: "check", size: he(M), color: "inherit" }),
|
|
115
|
+
A != null && /* @__PURE__ */ t(
|
|
116
|
+
"span",
|
|
117
|
+
{
|
|
118
|
+
className: ue(i["tedi-filter__prepend"], {
|
|
119
|
+
[i["tedi-filter__prepend--hidden"]]: De
|
|
120
|
+
}),
|
|
121
|
+
children: A
|
|
122
|
+
}
|
|
123
|
+
),
|
|
124
|
+
/* @__PURE__ */ t("span", { className: i["tedi-filter__text"], children: Pe }),
|
|
125
|
+
R != null && /* @__PURE__ */ t("span", { className: i["tedi-filter__append"], children: R }),
|
|
126
|
+
m && x && r.length > 0 && /* @__PURE__ */ t(Ye, { className: i["tedi-filter__count"], color: re ? "neutral" : "brand", children: String(r.length) }),
|
|
127
|
+
b && /* @__PURE__ */ t(
|
|
128
|
+
fe,
|
|
129
|
+
{
|
|
130
|
+
className: i["tedi-filter__icon"],
|
|
131
|
+
name: "arrow_drop_down",
|
|
132
|
+
filled: !0,
|
|
133
|
+
size: he(M),
|
|
134
|
+
color: "inherit"
|
|
135
|
+
}
|
|
136
|
+
)
|
|
137
|
+
] }), oe = ue(
|
|
138
|
+
i["tedi-filter"],
|
|
139
|
+
i[`tedi-filter--${ke}`],
|
|
140
|
+
M === "large" && i["tedi-filter--large"],
|
|
141
|
+
x && i["tedi-filter--selected"],
|
|
142
|
+
be
|
|
143
|
+
), ce = /* @__PURE__ */ t(
|
|
144
|
+
J,
|
|
145
|
+
{
|
|
146
|
+
ref: ze,
|
|
147
|
+
id: K,
|
|
148
|
+
type: "button",
|
|
149
|
+
disabled: re,
|
|
150
|
+
className: i["tedi-filter__button"],
|
|
151
|
+
onClick: b ? void 0 : Ae,
|
|
152
|
+
role: b ? void 0 : je,
|
|
153
|
+
"aria-checked": Ee,
|
|
154
|
+
"aria-pressed": We,
|
|
155
|
+
noStyle: !0,
|
|
156
|
+
children: Ze
|
|
157
|
+
}
|
|
158
|
+
);
|
|
159
|
+
if (!b)
|
|
160
|
+
return /* @__PURE__ */ t("div", { className: oe, children: ce });
|
|
161
|
+
const H = m && we ? 0 : null, qe = H !== null ? 1 : 0, He = () => Z.map((e, l) => {
|
|
162
|
+
const o = m ? r.includes(e.value) : h === e.value, de = l + qe;
|
|
163
|
+
return m ? /* @__PURE__ */ t(c.Item, { index: de, asChild: !0, disabled: e.disabled, closeOnSelect: !1, children: /* @__PURE__ */ t(
|
|
164
|
+
me,
|
|
165
|
+
{
|
|
166
|
+
id: `${B}-option-${l}`,
|
|
167
|
+
label: e.label,
|
|
168
|
+
value: e.value,
|
|
169
|
+
checked: o,
|
|
170
|
+
disabled: e.disabled,
|
|
171
|
+
onChange: () => Me(e.value),
|
|
172
|
+
name: `${B}-options`
|
|
173
|
+
}
|
|
174
|
+
) }, e.value) : /* @__PURE__ */ t(
|
|
175
|
+
c.Item,
|
|
176
|
+
{
|
|
177
|
+
index: de,
|
|
178
|
+
disabled: e.disabled,
|
|
179
|
+
active: o,
|
|
180
|
+
onClick: () => Re(e.value),
|
|
181
|
+
children: e.label
|
|
182
|
+
},
|
|
183
|
+
e.value
|
|
184
|
+
);
|
|
185
|
+
});
|
|
186
|
+
return /* @__PURE__ */ t("div", { className: oe, children: /* @__PURE__ */ p(c, { open: E, onOpenChange: ne, placement: Ce, width: "auto", children: [
|
|
187
|
+
/* @__PURE__ */ t(c.Trigger, { children: ce }),
|
|
188
|
+
/* @__PURE__ */ t(c.Content, { children: $ ? /* @__PURE__ */ p(g, { children: [
|
|
189
|
+
/* @__PURE__ */ t("div", { className: i["tedi-filter-dropdown__custom-content"], children: Y }),
|
|
190
|
+
V && /* @__PURE__ */ p(g, { children: [
|
|
191
|
+
/* @__PURE__ */ t(c.Separator, {}),
|
|
192
|
+
/* @__PURE__ */ t("div", { className: i["tedi-filter-dropdown__clear"], children: /* @__PURE__ */ t(J, { visualType: "neutral", size: "small", type: "button", iconLeft: "refresh", onClick: ae, children: le }) })
|
|
193
|
+
] })
|
|
194
|
+
] }) : /* @__PURE__ */ p(g, { children: [
|
|
195
|
+
_e && /* @__PURE__ */ p(g, { children: [
|
|
196
|
+
/* @__PURE__ */ t("div", { className: i["tedi-filter-dropdown__search"], children: /* @__PURE__ */ t(
|
|
197
|
+
Xe,
|
|
198
|
+
{
|
|
199
|
+
id: `${B}-search`,
|
|
200
|
+
label: ee ?? w,
|
|
201
|
+
hideLabel: !0,
|
|
202
|
+
ariaLabel: ee ?? w,
|
|
203
|
+
value: W,
|
|
204
|
+
onChange: se
|
|
205
|
+
}
|
|
206
|
+
) }),
|
|
207
|
+
/* @__PURE__ */ t(c.Separator, {})
|
|
208
|
+
] }),
|
|
209
|
+
H !== null && /* @__PURE__ */ p(g, { children: [
|
|
210
|
+
/* @__PURE__ */ t(c.Item, { index: H, asChild: !0, closeOnSelect: !1, children: /* @__PURE__ */ t(
|
|
211
|
+
me,
|
|
212
|
+
{
|
|
213
|
+
id: `${B}-select-all`,
|
|
214
|
+
label: ye,
|
|
215
|
+
value: "select-all",
|
|
216
|
+
checked: q,
|
|
217
|
+
indeterminate: Te,
|
|
218
|
+
onChange: Ge,
|
|
219
|
+
name: `${B}-select-all`
|
|
220
|
+
}
|
|
221
|
+
) }),
|
|
222
|
+
/* @__PURE__ */ t(c.Separator, {})
|
|
223
|
+
] }),
|
|
224
|
+
He(),
|
|
225
|
+
V && /* @__PURE__ */ p(g, { children: [
|
|
226
|
+
/* @__PURE__ */ t(c.Separator, {}),
|
|
227
|
+
/* @__PURE__ */ t("div", { className: i["tedi-filter-dropdown__clear"], children: /* @__PURE__ */ t(J, { visualType: "neutral", size: "small", type: "button", iconLeft: "refresh", onClick: ae, children: le }) })
|
|
228
|
+
] })
|
|
229
|
+
] }) })
|
|
230
|
+
] }) });
|
|
231
|
+
});
|
|
232
|
+
it.displayName = "Filter";
|
|
233
|
+
export {
|
|
234
|
+
it as Filter,
|
|
235
|
+
it as default
|
|
236
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-filter":"tedi-filter-e3f2f618","tedi-filter__button":"tedi-filter__button-b7abc5ed","tedi-filter__text":"tedi-filter__text-2c4eaab6","tedi-filter__icon":"tedi-filter__icon-1b8e93f2","tedi-filter__prepend":"tedi-filter__prepend-68dc0007","tedi-filter__append":"tedi-filter__append-bdb27679","tedi-filter__prepend--hidden":"tedi-filter__prepend--hidden-5039af1e","tedi-filter__count":"tedi-filter__count-d72acead","tedi-filter--primary":"tedi-filter--primary-837108e8","tedi-filter--selected":"tedi-filter--selected-7273f310","tedi-filter--secondary":"tedi-filter--secondary-8aaf488e","tedi-filter--large":"tedi-filter--large-f7f46174","tedi-filter-group":"tedi-filter-group-9d16304d","tedi-filter-dropdown__custom-content":"tedi-filter-dropdown__custom-content-6e851b26","tedi-filter-dropdown__search":"tedi-filter-dropdown__search-dbb4e1a3","tedi-filter-dropdown__clear":"tedi-filter-dropdown__clear-fa4e6a11"};exports.default=e;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const e = {
|
|
2
|
+
"tedi-filter": "tedi-filter-e3f2f618",
|
|
3
|
+
"tedi-filter__button": "tedi-filter__button-b7abc5ed",
|
|
4
|
+
"tedi-filter__text": "tedi-filter__text-2c4eaab6",
|
|
5
|
+
"tedi-filter__icon": "tedi-filter__icon-1b8e93f2",
|
|
6
|
+
"tedi-filter__prepend": "tedi-filter__prepend-68dc0007",
|
|
7
|
+
"tedi-filter__append": "tedi-filter__append-bdb27679",
|
|
8
|
+
"tedi-filter__prepend--hidden": "tedi-filter__prepend--hidden-5039af1e",
|
|
9
|
+
"tedi-filter__count": "tedi-filter__count-d72acead",
|
|
10
|
+
"tedi-filter--primary": "tedi-filter--primary-837108e8",
|
|
11
|
+
"tedi-filter--selected": "tedi-filter--selected-7273f310",
|
|
12
|
+
"tedi-filter--secondary": "tedi-filter--secondary-8aaf488e",
|
|
13
|
+
"tedi-filter--large": "tedi-filter--large-f7f46174",
|
|
14
|
+
"tedi-filter-group": "tedi-filter-group-9d16304d",
|
|
15
|
+
"tedi-filter-dropdown__custom-content": "tedi-filter-dropdown__custom-content-6e851b26",
|
|
16
|
+
"tedi-filter-dropdown__search": "tedi-filter-dropdown__search-dbb4e1a3",
|
|
17
|
+
"tedi-filter-dropdown__clear": "tedi-filter-dropdown__clear-fa4e6a11"
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
e as default
|
|
21
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),i=require("../../../../../external/classnames/index.cjs.js"),v=require("react"),L=require("../../buttons/button/button.cjs.js"),N=require("../textfield/textfield.cjs.js"),s=require("./search.module.scss.cjs.js"),w=require("../../../providers/label-provider/use-labels.cjs.js"),u=v.forwardRef(({placeholder:c,isClearable:d=!0,searchIcon:n="search",onSearch:a,onChange:o,button:e,ariaLabel:f,className:h,input:x,...t},_)=>{const{getLabel:r}=w.useLabels(),b=j=>{j.key==="Enter"&&(a==null||a(t.value))},m=()=>{a==null||a(t.value)},p={...t,ref:_,inputClassName:i.default(s.default["tedi-search__input"],e&&s.default["tedi-search__input--has-button"],h),placeholder:c,isClearable:d,onKeyDown:b,onChange:o,input:{...x,role:"searchbox"},...e?{}:{icon:n}},q=c||r("search"),y=f??q;return l.jsxs("div",{className:i.default(s.default["tedi-search__wrapper"]),role:"search","aria-label":y,children:[l.jsx(N.TextField,{...p}),e&&l.jsx(L.Button,{...e,onClick:m,className:i.default(s.default["tedi-search__button"],e.className),"aria-label":e.children?void 0:r("search"),children:e.children??r("search")})]})});u.displayName="Search";exports.Search=u;
|
|
@@ -1,40 +1,42 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as w, jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import l from "../../../../../external/classnames/index.es.js";
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { Button as
|
|
3
|
+
import { forwardRef as L } from "react";
|
|
4
|
+
import { Button as b } from "../../buttons/button/button.es.js";
|
|
5
5
|
import { TextField as k } from "../textfield/textfield.es.js";
|
|
6
6
|
import a from "./search.module.scss.es.js";
|
|
7
7
|
import { useLabels as C } from "../../../providers/label-provider/use-labels.es.js";
|
|
8
|
-
const
|
|
8
|
+
const j = L(
|
|
9
9
|
({
|
|
10
10
|
placeholder: t,
|
|
11
|
-
isClearable:
|
|
12
|
-
searchIcon:
|
|
11
|
+
isClearable: o = !0,
|
|
12
|
+
searchIcon: m = "search",
|
|
13
13
|
onSearch: s,
|
|
14
14
|
onChange: d,
|
|
15
15
|
button: e,
|
|
16
16
|
ariaLabel: p,
|
|
17
17
|
className: n,
|
|
18
|
+
input: f,
|
|
18
19
|
...r
|
|
19
|
-
},
|
|
20
|
-
const { getLabel: i } = C(),
|
|
21
|
-
|
|
20
|
+
}, h) => {
|
|
21
|
+
const { getLabel: i } = C(), u = (v) => {
|
|
22
|
+
v.key === "Enter" && (s == null || s(r.value));
|
|
22
23
|
}, _ = () => {
|
|
23
24
|
s == null || s(r.value);
|
|
24
|
-
},
|
|
25
|
+
}, x = {
|
|
25
26
|
...r,
|
|
26
|
-
ref:
|
|
27
|
+
ref: h,
|
|
27
28
|
inputClassName: l(a["tedi-search__input"], e && a["tedi-search__input--has-button"], n),
|
|
28
29
|
placeholder: t,
|
|
29
|
-
isClearable:
|
|
30
|
-
onKeyDown:
|
|
30
|
+
isClearable: o,
|
|
31
|
+
onKeyDown: u,
|
|
31
32
|
onChange: d,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
input: { ...f, role: "searchbox" },
|
|
34
|
+
...e ? {} : { icon: m }
|
|
35
|
+
}, N = t || i("search"), y = p ?? N;
|
|
36
|
+
return /* @__PURE__ */ w("div", { className: l(a["tedi-search__wrapper"]), role: "search", "aria-label": y, children: [
|
|
37
|
+
/* @__PURE__ */ c(k, { ...x }),
|
|
36
38
|
e && /* @__PURE__ */ c(
|
|
37
|
-
|
|
39
|
+
b,
|
|
38
40
|
{
|
|
39
41
|
...e,
|
|
40
42
|
onClick: _,
|
|
@@ -46,7 +48,7 @@ const b = w(
|
|
|
46
48
|
] });
|
|
47
49
|
}
|
|
48
50
|
);
|
|
49
|
-
|
|
51
|
+
j.displayName = "Search";
|
|
50
52
|
export {
|
|
51
|
-
|
|
53
|
+
j as Search
|
|
52
54
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),_=require("../../../../../external/classnames/index.cjs.js"),n=require("react"),W=require("../../base/icon/icon.cjs.js"),A=require("../../base/typography/text/text.cjs.js"),C=require("../../buttons/button/button.cjs.js"),L=require("../../form/select/select.cjs.js"),a=require("./pagination.module.scss.cjs.js"),X=require("./use-pagination.cjs.js"),P=require("../../../helpers/hooks/use-breakpoint.cjs.js"),Y=require("../../../providers/label-provider/use-labels.cjs.js"),N=n.forwardRef((q,k)=>{const{pageCount:s,page:h,defaultPage:w=1,onPageChange:p,totalItems:j,pageSize:v,pageSizeOptions:c,onPageSizeChange:g,boundaryCount:M=1,siblingCount:I=1,labels:x,className:B}=q,{getLabel:o}=Y.useLabels(),l=n.useMemo(()=>({ariaLabel:o("pagination.title"),previous:o("pagination.prev-page"),next:o("pagination.next-page"),pageAriaLabel:e=>o("pagination.page",e,!1),currentPageAriaLabel:e=>o("pagination.page",e,!0),results:e=>o("pagination.results",e),pageSize:o("pagination.page-size"),pageStatus:(e,i)=>o("pagination.page-status",e,i),...x}),[o,x]),[O,$]=n.useState(w),r=h??O,b=X.usePagination({page:r,pageCount:s,boundaryCount:M,siblingCount:I}),m=n.useCallback(e=>{e===r||e<1||e>s||(h===void 0&&$(e),p==null||p(e))},[r,p,h,s]),y=n.useId(),f=n.useMemo(()=>Array.isArray(c)?c.map(e=>({value:String(e),label:String(e)})):[],[c]),R=n.useMemo(()=>v===void 0?f[0]??null:f.find(e=>e.value===String(v))??null,[v,f]),J=n.useCallback(e=>{const i=Array.isArray(e)?e[0]:e;i&&"value"in i&&(g==null||g(Number(i.value)))},[g]),T=_.default(a.default["tedi-pagination"],B),K=P.useBreakpoint(),S=P.isBreakpointBelow(K,"md"),U=j!==void 0,D=!S&&Array.isArray(c)&&c.length>0,E=b[0],F=b[b.length-1],G=b.slice(1,-1),z=e=>{const i=e.type==="previous"?l.previous:l.next,u=e.type==="previous"?"arrow_back":"arrow_forward";return t.jsx(C.Button,{type:"button",className:_.default(a.default["tedi-pagination__button"],a.default["tedi-pagination__button--nav"],a.default[`tedi-pagination__button--nav-${e.type}`]),"aria-label":i,disabled:e.disabled,onClick:()=>e.page!==null&&m(e.page),noStyle:!0,children:t.jsx(W.Icon,{name:u,size:18,color:"brand"})})},H=n.useMemo(()=>Array.from({length:s},(e,i)=>{const u=i+1;return{value:String(u),label:String(u)}}),[s]),Q=n.useMemo(()=>({value:String(r),label:`${r} / ${s}`}),[r,s]),V=n.useCallback(e=>{const i=Array.isArray(e)?e[0]:e;i&&"value"in i&&m(Number(i.value))},[m]);return t.jsxs("div",{ref:k,className:T,"data-name":"tedi-pagination",children:[t.jsx("span",{className:"visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true",children:s>1?l.pageStatus(r,s):""}),t.jsx("div",{className:a.default["tedi-pagination__slot-start"],role:"status","aria-live":"polite","aria-atomic":"true",children:U&&t.jsx(A.Text,{className:a.default["tedi-pagination__results"],color:"secondary",modifiers:"small",children:l.results(j)})}),t.jsx("div",{className:a.default["tedi-pagination__slot-center"],children:s>1&&t.jsxs("nav",{"aria-label":l.ariaLabel,className:a.default["tedi-pagination__nav"],children:[z(E),!S&&t.jsx("ul",{className:a.default["tedi-pagination__list"],children:G.map((e,i)=>{const u=`slot-${i}`;if(e.type==="ellipsis")return t.jsx("li",{className:_.default(a.default["tedi-pagination__item"],a.default["tedi-pagination__item--ellipsis"]),"aria-hidden":"true",children:"…"},u);const d=e.page;return t.jsx("li",{className:a.default["tedi-pagination__item"],children:t.jsx(C.Button,{type:"button",className:_.default(a.default["tedi-pagination__button"],{[a.default["tedi-pagination__button--selected"]]:e.selected}),"aria-label":e.selected?l.currentPageAriaLabel(d):l.pageAriaLabel(d),"aria-current":e.selected?"page":void 0,onClick:()=>m(d),noStyle:!0,children:t.jsx("span",{className:a.default["tedi-pagination__button-label"],children:d},d)})},u)})}),S&&t.jsx("div",{className:a.default["tedi-pagination__page-jump"],children:t.jsx(L.Select,{id:`tedi-pagination-jump-${y}`,className:a.default["tedi-pagination__page-jump-select"],label:l.ariaLabel,hideLabel:!0,size:"small",options:H,value:Q,onChange:V,isSearchable:!1,isClearable:!1})}),z(F)]})}),t.jsx("div",{className:a.default["tedi-pagination__slot-end"],children:D&&t.jsxs("div",{className:a.default["tedi-pagination__page-size"],children:[t.jsx(A.Text,{className:a.default["tedi-pagination__page-size-label"],color:"secondary",modifiers:"small",element:"span",children:l.pageSize}),t.jsx(L.Select,{id:`tedi-pagination-page-size-${y}`,className:a.default["tedi-pagination__select"],label:l.pageSize,hideLabel:!0,size:"small",options:f,value:R,onChange:J,isSearchable:!1,isClearable:!1})]})})]})});N.displayName="Pagination";exports.Pagination=N;exports.default=N;
|
|
@@ -41,6 +41,13 @@ export interface PaginationLabels {
|
|
|
41
41
|
* @default 'Show per page'
|
|
42
42
|
*/
|
|
43
43
|
pageSize: string;
|
|
44
|
+
/**
|
|
45
|
+
* Builds the message announced to screen readers (via a visually-hidden
|
|
46
|
+
* `aria-live="polite"` region) whenever the current page changes. Lets SR
|
|
47
|
+
* users know that the page transition happened without sighted feedback.
|
|
48
|
+
* @default (page, pageCount) => `Page ${page} of ${pageCount}`
|
|
49
|
+
*/
|
|
50
|
+
pageStatus: (page: number, pageCount: number) => string;
|
|
44
51
|
}
|
|
45
52
|
export interface PaginationProps {
|
|
46
53
|
/**
|