@yuno-payments/dashboard-design-system 2.3.2 → 2.3.3-beta.0
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/atoms/checkbox/checkbox.js +16 -16
- package/dist/components/atoms/filter/filter-date-range.d.ts +31 -1
- package/dist/components/atoms/filter/filter-date-range.js +140 -144
- package/dist/components/atoms/filter/filter-multi-input.d.ts +11 -0
- package/dist/components/atoms/filter/filter-multi-input.js +42 -36
- package/dist/components/atoms/filter/filter-translations.d.ts +75 -0
- package/dist/components/atoms/filter/filter-translations.js +450 -0
- package/dist/components/atoms/filter/filter.d.ts +30 -0
- package/dist/components/atoms/filter/filter.js +191 -171
- package/dist/components/atoms/filter/index.d.ts +2 -2
- package/dist/components/atoms/filter-dropdown/filter-dropdown.d.ts +17 -2
- package/dist/components/atoms/filter-dropdown/filter-dropdown.js +160 -151
- package/dist/components/atoms/icon/directional-icons.d.ts +12 -0
- package/dist/components/atoms/icon/directional-icons.js +38 -0
- package/dist/components/atoms/icon/icon.d.ts +6 -0
- package/dist/components/atoms/icon/icon.js +27 -21
- package/dist/components/atoms/icon/index.d.ts +1 -0
- package/dist/components/atoms/index.d.ts +1 -1
- package/dist/components/atoms/radio-group/radio-group-option.js +2 -2
- package/dist/components/atoms/select/select.js +2 -2
- package/dist/components/molecules/dialog-header/dialog-header.d.ts +1 -1
- package/dist/components/molecules/pagination/index.d.ts +1 -0
- package/dist/components/molecules/pagination/page-numbers.d.ts +3 -1
- package/dist/components/molecules/pagination/page-numbers.js +10 -9
- package/dist/components/molecules/pagination/pagination-translations.d.ts +33 -0
- package/dist/components/molecules/pagination/pagination-translations.js +82 -0
- package/dist/components/molecules/pagination/pagination.d.ts +9 -0
- package/dist/components/molecules/pagination/pagination.js +46 -38
- package/dist/components/organisms/data-table/components/column-header/data-table-column-header-menu.d.ts +3 -1
- package/dist/components/organisms/data-table/components/column-header/data-table-column-header-menu.js +28 -27
- package/dist/components/organisms/data-table/components/column-header/data-table-column-header.js +44 -41
- package/dist/components/organisms/data-table/components/data-table-header.js +11 -12
- package/dist/components/organisms/data-table/components/dialogs/data-table-manage-columns-dialog.d.ts +3 -1
- package/dist/components/organisms/data-table/components/dialogs/data-table-manage-columns-dialog.js +45 -44
- package/dist/components/organisms/data-table/data-table.d.ts +27 -2
- package/dist/components/organisms/data-table/data-table.js +146 -134
- package/dist/components/organisms/data-table/data-table.types.d.ts +68 -0
- package/dist/components/organisms/data-table/data-table.types.js +252 -0
- package/dist/components/organisms/data-table/index.d.ts +2 -1
- package/dist/components/organisms/data-table/utils/data-table-utils.js +11 -8
- package/dist/dashboard-design-system.css +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.esm.min.js +9394 -8512
- package/dist/index.js +208 -202
- package/dist/index.umd.min.js +25 -25
- package/dist/lib/utils.d.ts +13 -0
- package/dist/lib/utils.js +34 -10
- package/dist/vendor/shadcn/pagination.d.ts +19 -3
- package/dist/vendor/shadcn/pagination.js +41 -37
- package/dist/vendor/shadcn/select.js +33 -33
- package/dist/vendor/shadcn/switch.js +1 -1
- package/package.json +4 -2
- package/registry/components-registry.json +38 -12
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { j as e } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import { forwardRef as g, useId as
|
|
3
|
-
import { Checkbox as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { Label as
|
|
6
|
-
const
|
|
2
|
+
import { forwardRef as g, useId as v } from "react";
|
|
3
|
+
import { Checkbox as C } from "../../../vendor/shadcn/checkbox.js";
|
|
4
|
+
import { cn as m } from "../../../lib/utils.js";
|
|
5
|
+
import { Label as j } from "../label/label.js";
|
|
6
|
+
const k = g(
|
|
7
7
|
({
|
|
8
8
|
label: n,
|
|
9
9
|
description: c,
|
|
@@ -15,7 +15,7 @@ const v = g(
|
|
|
15
15
|
info: l,
|
|
16
16
|
...p
|
|
17
17
|
}, h) => {
|
|
18
|
-
const u =
|
|
18
|
+
const u = v(), o = i || t || u, d = (r) => {
|
|
19
19
|
if (!a) return;
|
|
20
20
|
a({
|
|
21
21
|
target: {
|
|
@@ -35,8 +35,8 @@ const v = g(
|
|
|
35
35
|
stopPropagation: () => {
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
|
-
},
|
|
39
|
-
|
|
38
|
+
}, x = /* @__PURE__ */ e.jsx(
|
|
39
|
+
C,
|
|
40
40
|
{
|
|
41
41
|
ref: h,
|
|
42
42
|
id: o,
|
|
@@ -47,15 +47,15 @@ const v = g(
|
|
|
47
47
|
className: "size-3.5 cursor-pointer"
|
|
48
48
|
}
|
|
49
49
|
);
|
|
50
|
-
return n ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-start gap-2", children: [
|
|
51
|
-
|
|
50
|
+
return n ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-start gap-2 rtl:flex-row-reverse", children: [
|
|
51
|
+
x,
|
|
52
52
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1.5", children: [
|
|
53
53
|
/* @__PURE__ */ e.jsx(
|
|
54
|
-
|
|
54
|
+
j,
|
|
55
55
|
{
|
|
56
56
|
htmlFor: o,
|
|
57
57
|
info: l,
|
|
58
|
-
className:
|
|
58
|
+
className: m(
|
|
59
59
|
"text-sm leading-none cursor-pointer",
|
|
60
60
|
s && "text-muted-foreground",
|
|
61
61
|
f
|
|
@@ -66,7 +66,7 @@ const v = g(
|
|
|
66
66
|
c && /* @__PURE__ */ e.jsx(
|
|
67
67
|
"p",
|
|
68
68
|
{
|
|
69
|
-
className:
|
|
69
|
+
className: m(
|
|
70
70
|
"text-sm text-muted-foreground",
|
|
71
71
|
s && "opacity-50"
|
|
72
72
|
),
|
|
@@ -74,10 +74,10 @@ const v = g(
|
|
|
74
74
|
}
|
|
75
75
|
)
|
|
76
76
|
] })
|
|
77
|
-
] }) :
|
|
77
|
+
] }) : x;
|
|
78
78
|
}
|
|
79
79
|
);
|
|
80
|
-
|
|
80
|
+
k.displayName = "Checkbox";
|
|
81
81
|
export {
|
|
82
|
-
|
|
82
|
+
k as Checkbox
|
|
83
83
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ComponentProps, ReactNode } from 'react';
|
|
2
2
|
import { RadioGroup } from '../../../vendor/shadcn/radio-group';
|
|
3
|
+
import { FilterLanguage, FilterTranslations } from './filter-translations';
|
|
3
4
|
export declare const FilterDateRangeValue: {
|
|
4
5
|
readonly CUSTOM: "CUSTOM";
|
|
5
6
|
readonly TODAY: "TODAY";
|
|
@@ -16,6 +17,21 @@ interface FilterDateRangeOptionProps extends ComponentProps<"label"> {
|
|
|
16
17
|
value: string;
|
|
17
18
|
}
|
|
18
19
|
declare const FilterDateRangeOption: import('react').ForwardRefExoticComponent<Omit<FilterDateRangeOptionProps, "ref"> & import('react').RefAttributes<HTMLLabelElement>>;
|
|
20
|
+
/**
|
|
21
|
+
* Labels for date range filter options - allows i18n/translation support
|
|
22
|
+
* @deprecated Use `lang` prop or `translations` prop instead
|
|
23
|
+
*/
|
|
24
|
+
interface FilterDateRangeLabels {
|
|
25
|
+
custom?: string;
|
|
26
|
+
today?: string;
|
|
27
|
+
last3Days?: string;
|
|
28
|
+
last7Days?: string;
|
|
29
|
+
last30Days?: string;
|
|
30
|
+
thisMonth?: string;
|
|
31
|
+
allTime?: string;
|
|
32
|
+
startDate?: string;
|
|
33
|
+
endDate?: string;
|
|
34
|
+
}
|
|
19
35
|
interface FilterDateRangeProps extends ComponentProps<typeof RadioGroup> {
|
|
20
36
|
showCustomFields?: boolean;
|
|
21
37
|
onCustomFieldsChange?: (show: boolean) => void;
|
|
@@ -35,6 +51,20 @@ interface FilterDateRangeProps extends ComponentProps<typeof RadioGroup> {
|
|
|
35
51
|
* Announcement text to display at the top of the filter (e.g., timezone info)
|
|
36
52
|
*/
|
|
37
53
|
announcement?: ReactNode;
|
|
54
|
+
/**
|
|
55
|
+
* Labels for date preset options - enables i18n/translation support.
|
|
56
|
+
* @deprecated Use `lang` prop or `translations` prop instead
|
|
57
|
+
*/
|
|
58
|
+
labels?: FilterDateRangeLabels;
|
|
59
|
+
/**
|
|
60
|
+
* Language code for translations
|
|
61
|
+
* @default "en"
|
|
62
|
+
*/
|
|
63
|
+
lang?: FilterLanguage;
|
|
64
|
+
/**
|
|
65
|
+
* Custom translations (overrides lang-based translations)
|
|
66
|
+
*/
|
|
67
|
+
translations?: FilterTranslations;
|
|
38
68
|
}
|
|
39
69
|
declare const FilterDateRange: import('react').ForwardRefExoticComponent<Omit<FilterDateRangeProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
40
|
-
export { FilterDateRange, FilterDateRangeOption, type FilterDateRangeProps, type FilterDateRangeOptionProps, };
|
|
70
|
+
export { FilterDateRange, FilterDateRangeOption, type FilterDateRangeProps, type FilterDateRangeOptionProps, type FilterDateRangeLabels, };
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { j as e } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { RadioGroup as
|
|
4
|
-
import { cn as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
2
|
+
import { forwardRef as L, useMemo as u } from "react";
|
|
3
|
+
import { RadioGroup as U, RadioGroupItem as k } from "../../../vendor/shadcn/radio-group.js";
|
|
4
|
+
import { cn as O } from "../../../lib/utils.js";
|
|
5
|
+
import { getFilterTranslations as E, getDayNames as G, getMonthAbbreviations as V } from "./filter-translations.js";
|
|
6
|
+
import { Alert as q } from "../alert/alert.js";
|
|
7
|
+
import { DatePicker as A } from "../date-picker/date-picker.js";
|
|
8
|
+
import { TimePicker as w } from "../time-picker/time-picker.js";
|
|
9
|
+
const c = {
|
|
9
10
|
CUSTOM: "CUSTOM",
|
|
10
11
|
TODAY: "TODAY",
|
|
11
12
|
LAST_3_DAYS: "LAST_3_DAYS",
|
|
@@ -13,71 +14,45 @@ const n = {
|
|
|
13
14
|
LAST_30_DAYS: "LAST_30_DAYS",
|
|
14
15
|
THIS_MONTH: "THIS_MONTH",
|
|
15
16
|
ALL_TIME: "ALL_TIME"
|
|
16
|
-
},
|
|
17
|
-
const
|
|
18
|
-
return `${[
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"May",
|
|
24
|
-
"Jun",
|
|
25
|
-
"Jul",
|
|
26
|
-
"Aug",
|
|
27
|
-
"Sep",
|
|
28
|
-
"Oct",
|
|
29
|
-
"Nov",
|
|
30
|
-
"Dec"
|
|
31
|
-
][s.getMonth()]} ${t}`;
|
|
32
|
-
}, F = (s) => {
|
|
33
|
-
const a = [
|
|
34
|
-
"Jan",
|
|
35
|
-
"Feb",
|
|
36
|
-
"Mar",
|
|
37
|
-
"Apr",
|
|
38
|
-
"May",
|
|
39
|
-
"Jun",
|
|
40
|
-
"Jul",
|
|
41
|
-
"Aug",
|
|
42
|
-
"Sep",
|
|
43
|
-
"Oct",
|
|
44
|
-
"Nov",
|
|
45
|
-
"Dec"
|
|
46
|
-
][s.getMonth()], o = s.getFullYear();
|
|
47
|
-
return `${a} ${o}`;
|
|
48
|
-
}, I = (s) => ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"][s.getDay()], J = () => {
|
|
17
|
+
}, D = (l, t) => {
|
|
18
|
+
const s = l.getDate();
|
|
19
|
+
return `${t[l.getMonth()]} ${s}`;
|
|
20
|
+
}, z = (l, t) => {
|
|
21
|
+
const s = t[l.getMonth()], i = l.getFullYear();
|
|
22
|
+
return `${s} ${i}`;
|
|
23
|
+
}, B = (l, t) => t[l.getDay()], J = (l, t) => {
|
|
49
24
|
const s = /* @__PURE__ */ new Date();
|
|
50
25
|
s.setHours(0, 0, 0, 0);
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
const
|
|
26
|
+
const i = `${B(s, l)}, ${D(s, t)}`, x = new Date(s);
|
|
27
|
+
x.setDate(x.getDate() - 2);
|
|
28
|
+
const f = `${D(x, t)} - ${D(s, t)}`, o = new Date(s);
|
|
29
|
+
o.setDate(o.getDate() - 6);
|
|
30
|
+
const p = `${D(o, t)} - ${D(s, t)}`, m = new Date(s);
|
|
31
|
+
m.setDate(m.getDate() - 29);
|
|
32
|
+
const y = `${D(m, t)} - ${D(s, t)}`, j = z(s, t);
|
|
58
33
|
return {
|
|
59
|
-
today:
|
|
60
|
-
last3Days:
|
|
61
|
-
last7Days:
|
|
62
|
-
last30Days:
|
|
63
|
-
thisMonth:
|
|
34
|
+
today: i,
|
|
35
|
+
last3Days: f,
|
|
36
|
+
last7Days: p,
|
|
37
|
+
last30Days: y,
|
|
38
|
+
thisMonth: j
|
|
64
39
|
};
|
|
65
|
-
},
|
|
66
|
-
({ label:
|
|
67
|
-
const
|
|
40
|
+
}, d = L(
|
|
41
|
+
({ label: l, description: t, value: s, className: i, ...x }, f) => {
|
|
42
|
+
const o = `date-range-${s}`;
|
|
68
43
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-start gap-4 w-full py-1", children: [
|
|
69
44
|
/* @__PURE__ */ e.jsxs(
|
|
70
45
|
"label",
|
|
71
46
|
{
|
|
72
|
-
ref:
|
|
73
|
-
className:
|
|
74
|
-
"flex-1 flex items-start gap-3 cursor-pointer",
|
|
75
|
-
|
|
47
|
+
ref: f,
|
|
48
|
+
className: O(
|
|
49
|
+
"flex-1 flex items-start gap-3 cursor-pointer rtl:flex-row-reverse",
|
|
50
|
+
i
|
|
76
51
|
),
|
|
77
|
-
...
|
|
52
|
+
...x,
|
|
78
53
|
children: [
|
|
79
|
-
/* @__PURE__ */ e.jsx(
|
|
80
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-1.5 items-start justify-center pb-0 pt-px px-0", children: /* @__PURE__ */ e.jsx("span", { className: "text-sm font-medium leading-none text-foreground", children:
|
|
54
|
+
/* @__PURE__ */ e.jsx(k, { id: o, value: s, className: "mt-px" }),
|
|
55
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-1.5 items-start justify-center pb-0 pt-px px-0", children: /* @__PURE__ */ e.jsx("span", { className: "text-sm font-medium leading-none text-foreground", children: l }) })
|
|
81
56
|
]
|
|
82
57
|
}
|
|
83
58
|
),
|
|
@@ -85,82 +60,97 @@ const n = {
|
|
|
85
60
|
] });
|
|
86
61
|
}
|
|
87
62
|
);
|
|
88
|
-
|
|
89
|
-
const
|
|
63
|
+
d.displayName = "FilterDateRangeOption";
|
|
64
|
+
const K = L(
|
|
90
65
|
({
|
|
91
|
-
showCustomFields:
|
|
66
|
+
showCustomFields: l = !1,
|
|
92
67
|
onCustomFieldsChange: t,
|
|
93
|
-
startDate:
|
|
94
|
-
endDate:
|
|
95
|
-
startTime:
|
|
96
|
-
endTime:
|
|
97
|
-
onStartDateChange:
|
|
98
|
-
onEndDateChange:
|
|
99
|
-
onStartTimeChange:
|
|
100
|
-
onEndTimeChange:
|
|
101
|
-
mode:
|
|
102
|
-
singleDayLabel:
|
|
103
|
-
showAllTime:
|
|
104
|
-
className:
|
|
105
|
-
value:
|
|
106
|
-
onValueChange:
|
|
107
|
-
announcement:
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
68
|
+
startDate: s,
|
|
69
|
+
endDate: i,
|
|
70
|
+
startTime: x = "",
|
|
71
|
+
endTime: f = "",
|
|
72
|
+
onStartDateChange: o,
|
|
73
|
+
onEndDateChange: p,
|
|
74
|
+
onStartTimeChange: m,
|
|
75
|
+
onEndTimeChange: y,
|
|
76
|
+
mode: j = "range",
|
|
77
|
+
singleDayLabel: Y,
|
|
78
|
+
showAllTime: $ = !1,
|
|
79
|
+
className: H,
|
|
80
|
+
value: R,
|
|
81
|
+
onValueChange: C,
|
|
82
|
+
announcement: h,
|
|
83
|
+
labels: n,
|
|
84
|
+
lang: v,
|
|
85
|
+
translations: T,
|
|
86
|
+
...F
|
|
87
|
+
}, I) => {
|
|
88
|
+
const a = u(() => {
|
|
89
|
+
const r = E(v);
|
|
90
|
+
return T ? { ...r, ...T } : r;
|
|
91
|
+
}, [v, T]), S = u(() => G(a), [a]), _ = u(() => V(a), [a]), g = u(
|
|
92
|
+
() => J(S, _),
|
|
93
|
+
[S, _]
|
|
94
|
+
), b = (r) => {
|
|
95
|
+
C?.(r), t?.(r === c.CUSTOM);
|
|
96
|
+
}, P = (r) => {
|
|
97
|
+
if (r) {
|
|
98
|
+
const N = new Date(r);
|
|
99
|
+
N.setHours(0, 0, 0, 0);
|
|
100
|
+
const M = new Date(r);
|
|
101
|
+
M.setHours(23, 59, 59, 999), o?.(N), p?.(M);
|
|
118
102
|
} else
|
|
119
|
-
|
|
103
|
+
o?.(void 0), p?.(void 0);
|
|
120
104
|
};
|
|
121
105
|
return /* @__PURE__ */ e.jsxs(
|
|
122
106
|
"div",
|
|
123
107
|
{
|
|
124
|
-
ref:
|
|
125
|
-
className:
|
|
108
|
+
ref: I,
|
|
109
|
+
className: O("flex flex-col gap-4 w-full", H),
|
|
126
110
|
children: [
|
|
127
|
-
|
|
111
|
+
h && (typeof h == "string" ? /* @__PURE__ */ e.jsx(q, { icon: "Info", description: h }) : h),
|
|
128
112
|
/* @__PURE__ */ e.jsxs(
|
|
129
|
-
|
|
113
|
+
U,
|
|
130
114
|
{
|
|
131
|
-
value:
|
|
132
|
-
onValueChange:
|
|
115
|
+
value: R,
|
|
116
|
+
onValueChange: b,
|
|
133
117
|
className: "gap-2",
|
|
134
|
-
...
|
|
118
|
+
...F,
|
|
135
119
|
children: [
|
|
136
|
-
/* @__PURE__ */ e.jsx(
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
120
|
+
/* @__PURE__ */ e.jsx(
|
|
121
|
+
d,
|
|
122
|
+
{
|
|
123
|
+
label: n?.custom ?? a.custom,
|
|
124
|
+
value: c.CUSTOM
|
|
125
|
+
}
|
|
126
|
+
),
|
|
127
|
+
l && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4 ps-7 mb-2", children: [
|
|
128
|
+
j === "single" ? /* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-3", children: /* @__PURE__ */ e.jsx(
|
|
129
|
+
A,
|
|
140
130
|
{
|
|
141
|
-
date:
|
|
142
|
-
onChange:
|
|
143
|
-
placeholder:
|
|
131
|
+
date: s,
|
|
132
|
+
onChange: P,
|
|
133
|
+
placeholder: Y ?? a.selectDate,
|
|
144
134
|
className: "h-9",
|
|
145
135
|
iconPosition: "none"
|
|
146
136
|
}
|
|
147
137
|
) }) : /* @__PURE__ */ e.jsxs("div", { className: "flex gap-4 items-start w-full", children: [
|
|
148
138
|
/* @__PURE__ */ e.jsx("div", { className: "flex-1 flex flex-col gap-3", children: /* @__PURE__ */ e.jsx(
|
|
149
|
-
|
|
139
|
+
A,
|
|
150
140
|
{
|
|
151
|
-
date:
|
|
152
|
-
onChange:
|
|
153
|
-
placeholder:
|
|
141
|
+
date: s,
|
|
142
|
+
onChange: o,
|
|
143
|
+
placeholder: n?.startDate ?? a.startDate,
|
|
154
144
|
className: "h-9",
|
|
155
145
|
iconPosition: "none"
|
|
156
146
|
}
|
|
157
147
|
) }),
|
|
158
148
|
/* @__PURE__ */ e.jsx("div", { className: "flex-1 flex flex-col gap-3", children: /* @__PURE__ */ e.jsx(
|
|
159
|
-
|
|
149
|
+
A,
|
|
160
150
|
{
|
|
161
|
-
date:
|
|
162
|
-
onChange:
|
|
163
|
-
placeholder:
|
|
151
|
+
date: i,
|
|
152
|
+
onChange: p,
|
|
153
|
+
placeholder: n?.endDate ?? a.endDate,
|
|
164
154
|
className: "h-9",
|
|
165
155
|
iconPosition: "none"
|
|
166
156
|
}
|
|
@@ -168,20 +158,20 @@ const P = N(
|
|
|
168
158
|
] }),
|
|
169
159
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-4 items-start w-full", children: [
|
|
170
160
|
/* @__PURE__ */ e.jsx("div", { className: "flex-1 flex flex-col gap-3", children: /* @__PURE__ */ e.jsx(
|
|
171
|
-
|
|
161
|
+
w,
|
|
172
162
|
{
|
|
173
|
-
value:
|
|
174
|
-
onChange:
|
|
163
|
+
value: x,
|
|
164
|
+
onChange: m,
|
|
175
165
|
mode: "dropdown",
|
|
176
166
|
use24Hour: !0,
|
|
177
167
|
width: "100%"
|
|
178
168
|
}
|
|
179
169
|
) }),
|
|
180
170
|
/* @__PURE__ */ e.jsx("div", { className: "flex-1 flex flex-col gap-3", children: /* @__PURE__ */ e.jsx(
|
|
181
|
-
|
|
171
|
+
w,
|
|
182
172
|
{
|
|
183
|
-
value:
|
|
184
|
-
onChange:
|
|
173
|
+
value: f,
|
|
174
|
+
onChange: y,
|
|
185
175
|
mode: "dropdown",
|
|
186
176
|
use24Hour: !0,
|
|
187
177
|
width: "100%"
|
|
@@ -191,46 +181,52 @@ const P = N(
|
|
|
191
181
|
] }),
|
|
192
182
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
193
183
|
/* @__PURE__ */ e.jsx(
|
|
194
|
-
|
|
184
|
+
d,
|
|
195
185
|
{
|
|
196
|
-
label:
|
|
197
|
-
value:
|
|
198
|
-
description:
|
|
186
|
+
label: n?.today ?? a.today,
|
|
187
|
+
value: c.TODAY,
|
|
188
|
+
description: g.today
|
|
199
189
|
}
|
|
200
190
|
),
|
|
201
191
|
/* @__PURE__ */ e.jsx(
|
|
202
|
-
|
|
192
|
+
d,
|
|
203
193
|
{
|
|
204
|
-
label:
|
|
205
|
-
value:
|
|
206
|
-
description:
|
|
194
|
+
label: n?.last3Days ?? a.last3Days,
|
|
195
|
+
value: c.LAST_3_DAYS,
|
|
196
|
+
description: g.last3Days
|
|
207
197
|
}
|
|
208
198
|
),
|
|
209
199
|
/* @__PURE__ */ e.jsx(
|
|
210
|
-
|
|
200
|
+
d,
|
|
211
201
|
{
|
|
212
|
-
label:
|
|
213
|
-
value:
|
|
214
|
-
description:
|
|
202
|
+
label: n?.last7Days ?? a.last7Days,
|
|
203
|
+
value: c.LAST_7_DAYS,
|
|
204
|
+
description: g.last7Days
|
|
215
205
|
}
|
|
216
206
|
),
|
|
217
207
|
/* @__PURE__ */ e.jsx(
|
|
218
|
-
|
|
208
|
+
d,
|
|
219
209
|
{
|
|
220
|
-
label:
|
|
221
|
-
value:
|
|
222
|
-
description:
|
|
210
|
+
label: n?.last30Days ?? a.last30Days,
|
|
211
|
+
value: c.LAST_30_DAYS,
|
|
212
|
+
description: g.last30Days
|
|
223
213
|
}
|
|
224
214
|
),
|
|
225
215
|
/* @__PURE__ */ e.jsx(
|
|
226
|
-
|
|
216
|
+
d,
|
|
227
217
|
{
|
|
228
|
-
label:
|
|
229
|
-
value:
|
|
230
|
-
description:
|
|
218
|
+
label: n?.thisMonth ?? a.thisMonth,
|
|
219
|
+
value: c.THIS_MONTH,
|
|
220
|
+
description: g.thisMonth
|
|
231
221
|
}
|
|
232
222
|
),
|
|
233
|
-
|
|
223
|
+
$ && /* @__PURE__ */ e.jsx(
|
|
224
|
+
d,
|
|
225
|
+
{
|
|
226
|
+
label: n?.allTime ?? a.allTime,
|
|
227
|
+
value: c.ALL_TIME
|
|
228
|
+
}
|
|
229
|
+
)
|
|
234
230
|
] })
|
|
235
231
|
]
|
|
236
232
|
}
|
|
@@ -240,9 +236,9 @@ const P = N(
|
|
|
240
236
|
);
|
|
241
237
|
}
|
|
242
238
|
);
|
|
243
|
-
|
|
239
|
+
K.displayName = "FilterDateRange";
|
|
244
240
|
export {
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
241
|
+
K as FilterDateRange,
|
|
242
|
+
d as FilterDateRangeOption,
|
|
243
|
+
c as FilterDateRangeValue
|
|
248
244
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FilterLanguage, FilterTranslations } from './filter-translations';
|
|
1
2
|
/**
|
|
2
3
|
* Props for FilterMultiInput component
|
|
3
4
|
*/
|
|
@@ -49,6 +50,15 @@ export interface FilterMultiInputProps {
|
|
|
49
50
|
* @default false
|
|
50
51
|
*/
|
|
51
52
|
allowDuplicates?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Language code for translations
|
|
55
|
+
* @default "en"
|
|
56
|
+
*/
|
|
57
|
+
lang?: FilterLanguage;
|
|
58
|
+
/**
|
|
59
|
+
* Custom translations (overrides lang-based translations)
|
|
60
|
+
*/
|
|
61
|
+
translations?: FilterTranslations;
|
|
52
62
|
}
|
|
53
63
|
/**
|
|
54
64
|
* Filter section component for entering multiple values via an input field.
|
|
@@ -62,6 +72,7 @@ export interface FilterMultiInputProps {
|
|
|
62
72
|
* onChange={setSelectedBins}
|
|
63
73
|
* placeholder="Enter BIN(s) separated by comma"
|
|
64
74
|
* numericOnly
|
|
75
|
+
* lang="es"
|
|
65
76
|
* />
|
|
66
77
|
* ```
|
|
67
78
|
*/
|
|
@@ -1,50 +1,56 @@
|
|
|
1
1
|
import { j as e } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { Separator as
|
|
5
|
-
import {
|
|
6
|
-
|
|
2
|
+
import { forwardRef as h, useMemo as N } from "react";
|
|
3
|
+
import { cn as y } from "../../../lib/utils.js";
|
|
4
|
+
import { Separator as g } from "../../../vendor/shadcn/separator.js";
|
|
5
|
+
import { getFilterTranslations as v } from "./filter-translations.js";
|
|
6
|
+
import { MultiValuesField as w } from "../multi-values-field/multi-values-field.js";
|
|
7
|
+
const A = h(
|
|
7
8
|
({
|
|
8
|
-
title:
|
|
9
|
-
value:
|
|
10
|
-
onChange:
|
|
11
|
-
placeholder:
|
|
12
|
-
description:
|
|
13
|
-
error:
|
|
14
|
-
numericOnly:
|
|
15
|
-
maxItems:
|
|
16
|
-
disabled:
|
|
17
|
-
className:
|
|
18
|
-
allowDuplicates:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
9
|
+
title: a,
|
|
10
|
+
value: s,
|
|
11
|
+
onChange: o,
|
|
12
|
+
placeholder: m,
|
|
13
|
+
description: n,
|
|
14
|
+
error: f,
|
|
15
|
+
numericOnly: d = !1,
|
|
16
|
+
maxItems: c,
|
|
17
|
+
disabled: p = !1,
|
|
18
|
+
className: u,
|
|
19
|
+
allowDuplicates: x = !1,
|
|
20
|
+
lang: i,
|
|
21
|
+
translations: r
|
|
22
|
+
}, j) => {
|
|
23
|
+
const l = N(() => {
|
|
24
|
+
const t = v(i);
|
|
25
|
+
return r ? { ...t, ...r } : t;
|
|
26
|
+
}, [i, r]), b = d ? (t) => /^\d+$/.test(t) ? !0 : l.onlyNumericAllowed : void 0;
|
|
27
|
+
return /* @__PURE__ */ e.jsxs("div", { ref: j, className: y("flex flex-col h-full", u), children: [
|
|
28
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-between mb-1", children: /* @__PURE__ */ e.jsx("span", { className: "text-sm font-normal text-foreground", children: a }) }),
|
|
29
|
+
/* @__PURE__ */ e.jsx(g, { className: "w-full mb-6" }),
|
|
24
30
|
/* @__PURE__ */ e.jsx(
|
|
25
|
-
|
|
31
|
+
w,
|
|
26
32
|
{
|
|
27
|
-
value:
|
|
28
|
-
onChange:
|
|
29
|
-
placeholder:
|
|
30
|
-
description:
|
|
31
|
-
error:
|
|
32
|
-
disabled:
|
|
33
|
-
maxItems:
|
|
34
|
-
allowDuplicates:
|
|
35
|
-
validate:
|
|
33
|
+
value: s,
|
|
34
|
+
onChange: o,
|
|
35
|
+
placeholder: m ?? l.typeAndPressEnter,
|
|
36
|
+
description: n,
|
|
37
|
+
error: f,
|
|
38
|
+
disabled: p,
|
|
39
|
+
maxItems: c,
|
|
40
|
+
allowDuplicates: x,
|
|
41
|
+
validate: b,
|
|
36
42
|
triggerKeys: ["Enter", "Tab", "Comma"],
|
|
37
|
-
deleteAll:
|
|
38
|
-
label:
|
|
43
|
+
deleteAll: s.length > 0 ? {
|
|
44
|
+
label: l.clearAll,
|
|
39
45
|
length: 1,
|
|
40
|
-
onClick: () =>
|
|
46
|
+
onClick: () => o([])
|
|
41
47
|
} : void 0
|
|
42
48
|
}
|
|
43
49
|
)
|
|
44
50
|
] });
|
|
45
51
|
}
|
|
46
52
|
);
|
|
47
|
-
|
|
53
|
+
A.displayName = "FilterMultiInput";
|
|
48
54
|
export {
|
|
49
|
-
|
|
55
|
+
A as FilterMultiInput
|
|
50
56
|
};
|