mcr-design-systems 1.0.113 → 1.0.115
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/components/ButtonFilter/helper/index.js +1 -1
- package/dist/components/ButtonFilter/index.d.ts +5 -1
- package/dist/components/ButtonFilter/index.js +135 -159
- package/dist/components/DatePicker/CalendarGrid.js +66 -63
- package/dist/components/DatePicker/DateRangePicker.js +251 -192
- package/dist/components/DatePicker/MonthGrid.js +43 -53
- package/dist/components/DatePicker/PresetSidebar.js +39 -36
- package/dist/components/DatePicker/YearGrid.js +35 -32
- package/dist/components/DatePicker/helper/variants.js +58 -53
- package/dist/components/DatePicker/index.d.ts +1 -1
- package/dist/components/DatePicker/index.js +79 -47
- package/dist/components/Dropdown/index.js +225 -208
- package/dist/components/Pagination/helper/PaginationRowsSelector.d.ts +1 -0
- package/dist/components/Pagination/helper/PaginationRowsSelector.js +37 -34
- package/dist/components/Pagination/helper/variants.js +3 -1
- package/dist/components/Pagination/index.d.ts +1 -0
- package/dist/components/Pagination/index.js +20 -18
- package/dist/components/Tab/helper/variants.js +1 -1
- package/dist/components/Table/Container/TableCell.d.ts +1 -0
- package/dist/components/Table/Container/TableCell.js +17 -15
- package/dist/components/Table/VirtualTable.js +36 -34
- package/dist/components/Table/helper.d.ts +12 -1
- package/dist/components/Table/helper.js +20 -4
- package/dist/components/Table/index.js +140 -137
- package/package.json +1 -1
- package/dist/components/Pagination/Pagination.d.ts +0 -66
|
@@ -80,6 +80,10 @@ export interface ButtonFilterProps extends React.ButtonHTMLAttributes<HTMLButton
|
|
|
80
80
|
* Whether the dropdown is open
|
|
81
81
|
*/
|
|
82
82
|
isOpen?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Whether to show clear button
|
|
85
|
+
*/
|
|
86
|
+
showClearButton?: boolean;
|
|
83
87
|
}
|
|
84
88
|
/**
|
|
85
89
|
* ButtonFilter component - specialized button for filtering with selected state support and dropdown functionality
|
|
@@ -107,4 +111,4 @@ export interface ButtonFilterProps extends React.ButtonHTMLAttributes<HTMLButton
|
|
|
107
111
|
* </ButtonFilter>
|
|
108
112
|
* ```
|
|
109
113
|
*/
|
|
110
|
-
export default function ButtonFilter({ variant, size, iconOnly, leadingIcon, trailingIcon, icon, loading, isChosen, count, onClose, className, children, disabled, dropdownItems, selectedValues, onSelectionChange, multiSelect, withDropdown, selectionMode, search, shouldShowSeparator, isOpen: externalIsOpen, ...props }: ButtonFilterProps): import("react/jsx-runtime").JSX.Element;
|
|
114
|
+
export default function ButtonFilter({ variant, size, iconOnly, leadingIcon, trailingIcon, icon, loading, isChosen, count, onClose, className, children, disabled, dropdownItems, selectedValues, onSelectionChange, multiSelect, withDropdown, selectionMode, search, shouldShowSeparator, showClearButton, isOpen: externalIsOpen, ...props }: ButtonFilterProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,62 +1,40 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { buttonFilter as
|
|
1
|
+
import { jsxs as h, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useState as w, useMemo as U } from "react";
|
|
3
|
+
import { buttonFilter as d } from "./helper/index.js";
|
|
4
4
|
import { cn as a } from "../../shared/utils/cn.js";
|
|
5
5
|
import { dataTestId as C } from "../../shared/utils/dataTestId.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { Dropdown as
|
|
9
|
-
function
|
|
10
|
-
variant:
|
|
11
|
-
size:
|
|
12
|
-
iconOnly:
|
|
6
|
+
import u from "../Icon/Icon.js";
|
|
7
|
+
import W from "../Badge/index.js";
|
|
8
|
+
import { Dropdown as X } from "../Dropdown/index.js";
|
|
9
|
+
function ae({
|
|
10
|
+
variant: l = "primary",
|
|
11
|
+
size: n = "medium",
|
|
12
|
+
iconOnly: Y = !1,
|
|
13
13
|
leadingIcon: k,
|
|
14
|
-
trailingIcon:
|
|
15
|
-
icon:
|
|
14
|
+
trailingIcon: F,
|
|
15
|
+
icon: L,
|
|
16
16
|
loading: e = !1,
|
|
17
|
-
isChosen:
|
|
18
|
-
count:
|
|
17
|
+
isChosen: P = !1,
|
|
18
|
+
count: z,
|
|
19
19
|
onClose: T,
|
|
20
20
|
className: y,
|
|
21
21
|
children: I,
|
|
22
|
-
disabled:
|
|
23
|
-
dropdownItems:
|
|
24
|
-
selectedValues:
|
|
25
|
-
onSelectionChange:
|
|
26
|
-
multiSelect:
|
|
27
|
-
withDropdown:
|
|
22
|
+
disabled: s,
|
|
23
|
+
dropdownItems: R = [],
|
|
24
|
+
selectedValues: o = [],
|
|
25
|
+
onSelectionChange: p,
|
|
26
|
+
multiSelect: B = !0,
|
|
27
|
+
withDropdown: b = !1,
|
|
28
28
|
selectionMode: A = "default",
|
|
29
|
-
search:
|
|
30
|
-
shouldShowSeparator:
|
|
29
|
+
search: S = !0,
|
|
30
|
+
shouldShowSeparator: q,
|
|
31
|
+
showClearButton: Z = !0,
|
|
31
32
|
isOpen: j,
|
|
32
33
|
...O
|
|
33
34
|
}) {
|
|
34
|
-
const [
|
|
35
|
-
} :
|
|
36
|
-
|
|
37
|
-
return console.log(
|
|
38
|
-
"ButtonFilter effectiveCount:",
|
|
39
|
-
r,
|
|
40
|
-
"selectedValues:",
|
|
41
|
-
c,
|
|
42
|
-
"count:",
|
|
43
|
-
x
|
|
44
|
-
), r;
|
|
45
|
-
}, [x, c]), b = K(() => {
|
|
46
|
-
if (p) {
|
|
47
|
-
const r = i > 0;
|
|
48
|
-
return console.log(
|
|
49
|
-
"ButtonFilter effectiveIsChosen (dropdown):",
|
|
50
|
-
r,
|
|
51
|
-
"effectiveCount:",
|
|
52
|
-
i,
|
|
53
|
-
"selectedValues:",
|
|
54
|
-
c
|
|
55
|
-
), r;
|
|
56
|
-
}
|
|
57
|
-
return console.log("ButtonFilter effectiveIsChosen (no dropdown):", F), F;
|
|
58
|
-
}, [F, p, i, c]), u = (() => {
|
|
59
|
-
switch (s) {
|
|
35
|
+
const [_, $] = w(!1), m = j !== void 0 ? j : _, E = j !== void 0 ? () => {
|
|
36
|
+
} : $, t = Y && !!L, f = U(() => z !== void 0 ? z : o?.length || 0, [z, o]), x = U(() => b ? f > 0 : P, [P, b, f, o]), i = (() => {
|
|
37
|
+
switch (n) {
|
|
60
38
|
case "xx-small":
|
|
61
39
|
return 16;
|
|
62
40
|
case "x-small":
|
|
@@ -69,8 +47,8 @@ function ie({
|
|
|
69
47
|
default:
|
|
70
48
|
return 24;
|
|
71
49
|
}
|
|
72
|
-
})(),
|
|
73
|
-
switch (
|
|
50
|
+
})(), G = () => {
|
|
51
|
+
switch (n) {
|
|
74
52
|
case "xx-small":
|
|
75
53
|
case "x-small":
|
|
76
54
|
case "small":
|
|
@@ -80,77 +58,77 @@ function ie({
|
|
|
80
58
|
default:
|
|
81
59
|
return "md";
|
|
82
60
|
}
|
|
83
|
-
},
|
|
84
|
-
if (Array.isArray(
|
|
85
|
-
|
|
61
|
+
}, H = (c) => {
|
|
62
|
+
if (Array.isArray(c))
|
|
63
|
+
p?.(c);
|
|
86
64
|
else {
|
|
87
|
-
if (
|
|
88
|
-
|
|
65
|
+
if (c === "") {
|
|
66
|
+
p?.([]);
|
|
89
67
|
return;
|
|
90
68
|
}
|
|
91
|
-
if (!
|
|
92
|
-
|
|
69
|
+
if (!B || A === "radio") {
|
|
70
|
+
p?.([c]);
|
|
93
71
|
return;
|
|
94
72
|
}
|
|
95
|
-
const
|
|
96
|
-
|
|
73
|
+
const g = o.includes(c) ? o.filter((D) => D !== c) : [...o, c];
|
|
74
|
+
p?.(g);
|
|
97
75
|
}
|
|
98
|
-
},
|
|
99
|
-
|
|
100
|
-
},
|
|
101
|
-
|
|
76
|
+
}, J = () => {
|
|
77
|
+
p?.([]), T?.();
|
|
78
|
+
}, N = e ? /* @__PURE__ */ r(
|
|
79
|
+
u,
|
|
102
80
|
{
|
|
103
81
|
name: "activity-heart",
|
|
104
|
-
size:
|
|
82
|
+
size: i,
|
|
105
83
|
className: "animate-spin",
|
|
106
84
|
"aria-hidden": "true"
|
|
107
85
|
}
|
|
108
|
-
) : null,
|
|
109
|
-
return
|
|
110
|
-
/* @__PURE__ */
|
|
111
|
-
|
|
86
|
+
) : null, v = k && !e ? /* @__PURE__ */ r(u, { name: k, size: i, "aria-hidden": "true" }) : null, M = F && !e && !x && !b ? /* @__PURE__ */ r(u, { name: F, size: i, "aria-hidden": "true" }) : null, K = b && !e ? /* @__PURE__ */ r(u, { name: "chevron-down", size: i, "aria-hidden": "true" }) : null, Q = t && !e ? /* @__PURE__ */ r(u, { name: L, size: i, "aria-hidden": "true" }) : null;
|
|
87
|
+
return b && !t ? x ? /* @__PURE__ */ h("div", { className: "inline-flex items-center", children: [
|
|
88
|
+
/* @__PURE__ */ r(
|
|
89
|
+
X,
|
|
112
90
|
{
|
|
113
|
-
items:
|
|
114
|
-
value:
|
|
115
|
-
open:
|
|
116
|
-
onOpenChange:
|
|
117
|
-
onValueChange:
|
|
118
|
-
disabled:
|
|
119
|
-
multiSelect:
|
|
120
|
-
search:
|
|
91
|
+
items: R,
|
|
92
|
+
value: o,
|
|
93
|
+
open: m,
|
|
94
|
+
onOpenChange: E,
|
|
95
|
+
onValueChange: H,
|
|
96
|
+
disabled: s,
|
|
97
|
+
multiSelect: B,
|
|
98
|
+
search: S,
|
|
121
99
|
searchPlaceholder: "Search",
|
|
122
100
|
selectionMode: A,
|
|
123
|
-
showClearButton:
|
|
124
|
-
shouldShowSeparator:
|
|
125
|
-
trigger: /* @__PURE__ */
|
|
101
|
+
showClearButton: Z,
|
|
102
|
+
shouldShowSeparator: q,
|
|
103
|
+
trigger: /* @__PURE__ */ h(
|
|
126
104
|
"button",
|
|
127
105
|
{
|
|
128
106
|
className: a(
|
|
129
|
-
|
|
130
|
-
variant:
|
|
131
|
-
size:
|
|
107
|
+
d({
|
|
108
|
+
variant: l,
|
|
109
|
+
size: n,
|
|
132
110
|
isChosen: !0,
|
|
133
|
-
isOpen:
|
|
134
|
-
spacing:
|
|
111
|
+
isOpen: m,
|
|
112
|
+
spacing: n
|
|
135
113
|
}),
|
|
136
114
|
"rounded-r-none border-r-[1px]"
|
|
137
115
|
),
|
|
138
|
-
disabled:
|
|
116
|
+
disabled: s || e,
|
|
139
117
|
type: "button",
|
|
140
118
|
...O,
|
|
141
119
|
children: [
|
|
142
|
-
e &&
|
|
143
|
-
!e &&
|
|
120
|
+
e && N,
|
|
121
|
+
!e && v,
|
|
144
122
|
!e && I,
|
|
145
|
-
|
|
146
|
-
|
|
123
|
+
f > 0 && /* @__PURE__ */ r(
|
|
124
|
+
W,
|
|
147
125
|
{
|
|
148
126
|
variant: "boldest",
|
|
149
|
-
size:
|
|
127
|
+
size: G(),
|
|
150
128
|
emphasize: !0,
|
|
151
|
-
disabled:
|
|
129
|
+
disabled: s,
|
|
152
130
|
className: "ml-xs-3 text-fg-selected-rest",
|
|
153
|
-
children:
|
|
131
|
+
children: f
|
|
154
132
|
}
|
|
155
133
|
)
|
|
156
134
|
]
|
|
@@ -158,160 +136,158 @@ function ie({
|
|
|
158
136
|
)
|
|
159
137
|
}
|
|
160
138
|
),
|
|
161
|
-
/* @__PURE__ */
|
|
139
|
+
/* @__PURE__ */ r(
|
|
162
140
|
"button",
|
|
163
141
|
{
|
|
164
142
|
type: "button",
|
|
165
143
|
className: a(
|
|
166
|
-
|
|
167
|
-
variant:
|
|
168
|
-
size:
|
|
144
|
+
d({
|
|
145
|
+
variant: l,
|
|
146
|
+
size: n,
|
|
169
147
|
isChosen: !0,
|
|
170
148
|
iconOnly: !0
|
|
171
149
|
}),
|
|
172
150
|
"rounded-l-none border-l-0"
|
|
173
151
|
),
|
|
174
|
-
onClick:
|
|
175
|
-
disabled:
|
|
152
|
+
onClick: J,
|
|
153
|
+
disabled: s,
|
|
176
154
|
"aria-label": "Clear all filters",
|
|
177
155
|
...C("button-filter-clear"),
|
|
178
|
-
children: /* @__PURE__ */
|
|
156
|
+
children: /* @__PURE__ */ r(u, { name: "x-close", size: i, "aria-hidden": "true" })
|
|
179
157
|
}
|
|
180
158
|
)
|
|
181
|
-
] }) : /* @__PURE__ */
|
|
182
|
-
|
|
159
|
+
] }) : /* @__PURE__ */ r(
|
|
160
|
+
X,
|
|
183
161
|
{
|
|
184
|
-
items:
|
|
185
|
-
value:
|
|
186
|
-
open:
|
|
187
|
-
onOpenChange:
|
|
188
|
-
onValueChange:
|
|
189
|
-
disabled:
|
|
190
|
-
multiSelect:
|
|
191
|
-
search:
|
|
162
|
+
items: R,
|
|
163
|
+
value: o,
|
|
164
|
+
open: m,
|
|
165
|
+
onOpenChange: E,
|
|
166
|
+
onValueChange: H,
|
|
167
|
+
disabled: s,
|
|
168
|
+
multiSelect: B,
|
|
169
|
+
search: S,
|
|
192
170
|
searchPlaceholder: "Search",
|
|
193
171
|
selectionMode: A,
|
|
194
172
|
showClearButton: !0,
|
|
195
|
-
shouldShowSeparator:
|
|
173
|
+
shouldShowSeparator: q,
|
|
196
174
|
className: y,
|
|
197
|
-
trigger: /* @__PURE__ */
|
|
175
|
+
trigger: /* @__PURE__ */ h(
|
|
198
176
|
"button",
|
|
199
177
|
{
|
|
200
178
|
className: a(
|
|
201
|
-
|
|
202
|
-
variant:
|
|
203
|
-
size:
|
|
179
|
+
d({
|
|
180
|
+
variant: l,
|
|
181
|
+
size: n,
|
|
204
182
|
iconOnly: t,
|
|
205
|
-
isChosen:
|
|
206
|
-
isOpen:
|
|
207
|
-
spacing: t ? void 0 :
|
|
183
|
+
isChosen: x,
|
|
184
|
+
isOpen: m,
|
|
185
|
+
spacing: t ? void 0 : n
|
|
208
186
|
}),
|
|
209
187
|
y
|
|
210
188
|
),
|
|
211
|
-
disabled:
|
|
189
|
+
disabled: s || e,
|
|
212
190
|
type: "button",
|
|
213
191
|
...C("button-filter"),
|
|
214
192
|
...O,
|
|
215
193
|
children: [
|
|
216
|
-
e &&
|
|
217
|
-
!e && !t &&
|
|
218
|
-
!e && t &&
|
|
194
|
+
e && N,
|
|
195
|
+
!e && !t && v,
|
|
196
|
+
!e && t && Q,
|
|
219
197
|
!t && I,
|
|
220
|
-
!e && !t &&
|
|
198
|
+
!e && !t && K
|
|
221
199
|
]
|
|
222
200
|
}
|
|
223
201
|
)
|
|
224
202
|
}
|
|
225
|
-
) :
|
|
203
|
+
) : x && !t ? /* @__PURE__ */ h(
|
|
226
204
|
"div",
|
|
227
205
|
{
|
|
228
206
|
className: a("inline-flex items-center", y),
|
|
229
207
|
...C("button-filter"),
|
|
230
208
|
children: [
|
|
231
|
-
/* @__PURE__ */
|
|
209
|
+
/* @__PURE__ */ h(
|
|
232
210
|
"button",
|
|
233
211
|
{
|
|
234
212
|
className: a(
|
|
235
|
-
|
|
236
|
-
variant:
|
|
237
|
-
size:
|
|
213
|
+
d({
|
|
214
|
+
variant: l,
|
|
215
|
+
size: n,
|
|
238
216
|
isChosen: !0,
|
|
239
|
-
isOpen:
|
|
240
|
-
|
|
241
|
-
spacing: s
|
|
217
|
+
isOpen: m,
|
|
218
|
+
spacing: n
|
|
242
219
|
}),
|
|
243
220
|
"rounded-r-none border-r-[1px]"
|
|
244
221
|
),
|
|
245
|
-
disabled:
|
|
222
|
+
disabled: s || e,
|
|
246
223
|
...O,
|
|
247
224
|
children: [
|
|
248
|
-
e &&
|
|
249
|
-
!e &&
|
|
225
|
+
e && N,
|
|
226
|
+
!e && v,
|
|
250
227
|
!e && I,
|
|
251
|
-
|
|
252
|
-
|
|
228
|
+
f > 0 && /* @__PURE__ */ r(
|
|
229
|
+
W,
|
|
253
230
|
{
|
|
254
231
|
variant: "boldest",
|
|
255
|
-
size:
|
|
232
|
+
size: G(),
|
|
256
233
|
emphasize: !0,
|
|
257
|
-
disabled:
|
|
234
|
+
disabled: s,
|
|
258
235
|
className: "ml-xs-3 text-fg-selected-rest",
|
|
259
|
-
children:
|
|
236
|
+
children: f
|
|
260
237
|
}
|
|
261
238
|
)
|
|
262
239
|
]
|
|
263
240
|
}
|
|
264
241
|
),
|
|
265
|
-
/* @__PURE__ */
|
|
242
|
+
/* @__PURE__ */ r(
|
|
266
243
|
"button",
|
|
267
244
|
{
|
|
268
245
|
type: "button",
|
|
269
246
|
className: a(
|
|
270
|
-
|
|
271
|
-
variant:
|
|
272
|
-
size:
|
|
247
|
+
d({
|
|
248
|
+
variant: l,
|
|
249
|
+
size: n,
|
|
273
250
|
isChosen: !0,
|
|
274
251
|
iconOnly: !0
|
|
275
252
|
}),
|
|
276
253
|
"rounded-l-none border-l-0"
|
|
277
254
|
),
|
|
278
|
-
onClick: T ||
|
|
279
|
-
disabled:
|
|
255
|
+
onClick: T || J,
|
|
256
|
+
disabled: s,
|
|
280
257
|
"aria-label": "Remove filter",
|
|
281
258
|
...C("button-filter-close"),
|
|
282
|
-
children: /* @__PURE__ */
|
|
259
|
+
children: /* @__PURE__ */ r(u, { name: "x-close", size: i, "aria-hidden": "true" })
|
|
283
260
|
}
|
|
284
261
|
)
|
|
285
262
|
]
|
|
286
263
|
}
|
|
287
|
-
) : /* @__PURE__ */
|
|
264
|
+
) : /* @__PURE__ */ h(
|
|
288
265
|
"button",
|
|
289
266
|
{
|
|
290
267
|
className: a(
|
|
291
|
-
|
|
292
|
-
variant:
|
|
293
|
-
size:
|
|
268
|
+
d({
|
|
269
|
+
variant: l,
|
|
270
|
+
size: n,
|
|
294
271
|
iconOnly: t,
|
|
295
|
-
isChosen:
|
|
296
|
-
isOpen:
|
|
297
|
-
|
|
298
|
-
spacing: t ? void 0 : s
|
|
272
|
+
isChosen: x,
|
|
273
|
+
isOpen: m,
|
|
274
|
+
spacing: t ? void 0 : n
|
|
299
275
|
}),
|
|
300
276
|
y
|
|
301
277
|
),
|
|
302
|
-
disabled:
|
|
278
|
+
disabled: s || e,
|
|
303
279
|
...C("button-filter"),
|
|
304
280
|
...O,
|
|
305
281
|
children: [
|
|
306
|
-
e &&
|
|
307
|
-
!e && !t &&
|
|
308
|
-
!e && t &&
|
|
282
|
+
e && N,
|
|
283
|
+
!e && !t && v,
|
|
284
|
+
!e && t && Q,
|
|
309
285
|
!t && I,
|
|
310
|
-
!e && !t && (
|
|
286
|
+
!e && !t && (M || K)
|
|
311
287
|
]
|
|
312
288
|
}
|
|
313
289
|
);
|
|
314
290
|
}
|
|
315
291
|
export {
|
|
316
|
-
|
|
292
|
+
ae as default
|
|
317
293
|
};
|