laif-ds 0.2.74 → 0.2.76
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/CHANGELOG.md +446 -0
- package/dist/agent-docs/adoption-report.json +615 -0
- package/dist/agent-docs/components/Accordion.md +46 -16
- package/dist/agent-docs/components/Alert.md +90 -95
- package/dist/agent-docs/components/AlertDialog.md +132 -126
- package/dist/agent-docs/components/AppEditor.md +90 -90
- package/dist/agent-docs/components/AppRadioGroup.md +18 -18
- package/dist/agent-docs/components/AppSidebar.md +129 -122
- package/dist/agent-docs/components/AppStepper.md +81 -77
- package/dist/agent-docs/components/AspectRatio.md +70 -62
- package/dist/agent-docs/components/AudioVisualizer.md +5 -5
- package/dist/agent-docs/components/Avatar.md +112 -113
- package/dist/agent-docs/components/Badge.md +123 -118
- package/dist/agent-docs/components/Breadcrumb.md +8 -1
- package/dist/agent-docs/components/Button.md +131 -129
- package/dist/agent-docs/components/Card.md +172 -147
- package/dist/agent-docs/components/Carousel.md +148 -129
- package/dist/agent-docs/components/Chat.md +121 -109
- package/dist/agent-docs/components/ChatMessage.md +72 -61
- package/dist/agent-docs/components/Checkbox.md +150 -135
- package/dist/agent-docs/components/CircularProgress.md +53 -49
- package/dist/agent-docs/components/CodeHighlighter.md +4 -4
- package/dist/agent-docs/components/Collapsible.md +114 -95
- package/dist/agent-docs/components/Command.md +141 -142
- package/dist/agent-docs/components/Confirmer.md +182 -175
- package/dist/agent-docs/components/ContextMenu.md +196 -191
- package/dist/agent-docs/components/DataCrossTable.md +114 -94
- package/dist/agent-docs/components/DataTable.md +32 -24
- package/dist/agent-docs/components/Dialog.md +130 -125
- package/dist/agent-docs/components/Drawer.md +141 -127
- package/dist/agent-docs/components/FilePreviewer.md +138 -139
- package/dist/agent-docs/components/FileUploader.md +149 -129
- package/dist/agent-docs/components/Form.md +3 -1
- package/dist/agent-docs/components/FormComposer.md +163 -137
- package/dist/agent-docs/components/GanttChart.md +125 -122
- package/dist/agent-docs/components/HoverCard.md +1 -1
- package/dist/agent-docs/components/Icon.md +98 -99
- package/dist/agent-docs/components/Input.md +173 -138
- package/dist/agent-docs/components/InputOtp.md +6 -1
- package/dist/agent-docs/components/InputSelector.md +94 -97
- package/dist/agent-docs/components/InterruptPrompt.md +4 -4
- package/dist/agent-docs/components/MarkdownRenderer.md +5 -2
- package/dist/agent-docs/components/Menubar.md +60 -57
- package/dist/agent-docs/components/MessageInput.md +134 -131
- package/dist/agent-docs/components/MessageList.md +110 -96
- package/dist/agent-docs/components/MultipleSelector.md +147 -146
- package/dist/agent-docs/components/NavigationMenu.md +6 -2
- package/dist/agent-docs/components/Popover.md +112 -103
- package/dist/agent-docs/components/PromptSuggestions.md +5 -5
- package/dist/agent-docs/components/RadioGroup.md +97 -90
- package/dist/agent-docs/components/Resizable.md +4 -1
- package/dist/agent-docs/components/ResizePrompt.md +12 -13
- package/dist/agent-docs/components/ScrollArea.md +6 -2
- package/dist/agent-docs/components/SecurePdfViewer.md +10 -6
- package/dist/agent-docs/components/Select.md +131 -132
- package/dist/agent-docs/components/Sheet.md +8 -1
- package/dist/agent-docs/components/ShikiHighlighter.md +5 -5
- package/dist/agent-docs/components/Sidebar.md +94 -85
- package/dist/agent-docs/components/Slider.md +62 -58
- package/dist/agent-docs/components/Sonner.md +1 -0
- package/dist/agent-docs/components/Spinner.md +14 -14
- package/dist/agent-docs/components/Stepper.md +93 -67
- package/dist/agent-docs/components/Switch.md +41 -42
- package/dist/agent-docs/components/TableSkeleton.md +8 -8
- package/dist/agent-docs/components/Tabs.md +106 -86
- package/dist/agent-docs/components/TextArea.md +51 -52
- package/dist/agent-docs/components/ThemeSwitcher.md +72 -69
- package/dist/agent-docs/components/Toaster.md +1 -0
- package/dist/agent-docs/components/Tooltip.md +102 -91
- package/dist/agent-docs/components/Typo.md +68 -65
- package/dist/agent-docs/components/WeeklyCalendar.md +63 -64
- package/dist/agent-docs/components-list.md +1 -0
- package/dist/agent-docs/manifest.json +5981 -0
- package/dist/agent-docs/truncated-cell.md +342 -0
- package/dist/components/editor/editor-hooks/use-update-toolbar.js +6 -6
- package/dist/components/editor/plugins/actions/counter-character-plugin.js +6 -6
- package/dist/components/editor/plugins/toolbar/font-format-toolbar-plugin.js +18 -18
- package/dist/components/editor/plugins/toolbar/history-toolbar-plugin.js +10 -10
- package/dist/components/editor/plugins/toolbar/toolbar-plugin.js +9 -9
- package/dist/components/ui/app-checkbox.js +1 -1
- package/dist/components/ui/app-dialog.js +70 -64
- package/dist/components/ui/app-editor.js +51 -51
- package/dist/components/ui/app-form.js +81 -81
- package/dist/components/ui/app-multiple-select-dropdown.js +36 -36
- package/dist/components/ui/app-select.js +109 -104
- package/dist/components/ui/app-sidebar.js +41 -41
- package/dist/components/ui/app-stepper.js +1 -1
- package/dist/components/ui/app-time-picker.js +18 -18
- package/dist/components/ui/app-tooltip.js +1 -1
- package/dist/components/ui/async-select.js +5 -5
- package/dist/components/ui/audio-visualizer.js +61 -58
- package/dist/components/ui/card.js +1 -1
- package/dist/components/ui/carousel.js +2 -2
- package/dist/components/ui/chart.js +1 -1
- package/dist/components/ui/chat-message.js +8 -8
- package/dist/components/ui/chat.js +86 -88
- package/dist/components/ui/command.js +2 -2
- package/dist/components/ui/copy-button.js +4 -4
- package/dist/components/ui/date-picker.js +20 -20
- package/dist/components/ui/file-preview/index.js +13 -13
- package/dist/components/ui/file-previewer.js +12 -11
- package/dist/components/ui/file-uploader.js +86 -78
- package/dist/components/ui/form.js +2 -2
- package/dist/components/ui/gantt/components/Chart/Bars/Bars.js +56 -56
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarItem/BarItem.js +12 -12
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarsItems/BarItems.js +1 -1
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarsRow.js +4 -4
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/RepeteadBars/RepeteadBars.js +2 -2
- package/dist/components/ui/gantt/components/Chart/Chart.js +23 -23
- package/dist/components/ui/gantt/components/Chart/Scale/Scale.js +1 -1
- package/dist/components/ui/gantt/components/Chart/Tree/Tree.js +34 -34
- package/dist/components/ui/gantt/components/Controls/Controls.js +5 -5
- package/dist/components/ui/gantt/components/Gantt/Gantt.js +4 -4
- package/dist/components/ui/gantt/hooks/useGanttCalculate.js +25 -18
- package/dist/components/ui/input-selector.js +1 -1
- package/dist/components/ui/input.js +23 -23
- package/dist/components/ui/kanban.js +8 -9
- package/dist/components/ui/markdown-renderer.js +41 -35
- package/dist/components/ui/message-input.js +45 -44
- package/dist/components/ui/multiple-selector.js +91 -82
- package/dist/components/ui/secure-pdf-viewer.js +19 -7
- package/dist/components/ui/sidebar.js +1 -1
- package/dist/components/ui/slider.js +1 -1
- package/dist/components/ui/spinner.js +4 -4
- package/dist/components/ui/stepper.js +157 -138
- package/dist/components/ui/tables/data-cross-table/data-cross-table-buttons.js +29 -29
- package/dist/components/ui/tables/data-cross-table/data-cross-table.js +258 -246
- package/dist/components/ui/tables/data-table/components/data-table-advanced-filter.js +4 -1
- package/dist/components/ui/tables/data-table/components/data-table-body.js +211 -367
- package/dist/components/ui/tables/data-table/components/data-table-filter-inputs.js +114 -112
- package/dist/components/ui/tables/data-table/components/data-table-filters.js +116 -96
- package/dist/components/ui/tables/data-table/components/data-table-header.js +211 -0
- package/dist/components/ui/tables/data-table/components/data-table-searchbar.js +8 -8
- package/dist/components/ui/tables/data-table/components/data-table-skeleton-rows.js +33 -0
- package/dist/components/ui/tables/data-table/data-table.js +258 -250
- package/dist/components/ui/tables/data-table/data-table.service.js +112 -97
- package/dist/components/ui/tables/data-table/data-table.utils.js +25 -15
- package/dist/components/ui/textarea.js +2 -2
- package/dist/components/ui/theme-switcher.js +1 -1
- package/dist/components/ui/toggle-group.js +2 -2
- package/dist/components/ui/truncated-cell.js +100 -0
- package/dist/components/ui/weekly-calendar/appointment-card.js +16 -16
- package/dist/components/ui/weekly-calendar/calendar-context.js +6 -6
- package/dist/components/ui/weekly-calendar/calendar-header.js +12 -12
- package/dist/components/ui/weekly-calendar/day-column.js +16 -16
- package/dist/components/ui/weekly-calendar/time-column.js +4 -4
- package/dist/components/ui/weekly-calendar/weekly-calendar.js +4 -4
- package/dist/hooks/use-audio-recording.js +1 -1
- package/dist/hooks/use-auto-scroll.js +18 -18
- package/dist/hooks/use-autosize-textarea.js +12 -13
- package/dist/index.d.ts +100 -45
- package/dist/index.js +362 -360
- package/dist/lib/utils.js +6 -6
- package/dist/styles.v3.css +1 -1
- package/package.json +14 -4
|
@@ -1,80 +1,90 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as p, Fragment as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { Badge as
|
|
5
|
-
import { Button as
|
|
6
|
-
import { Icon as
|
|
7
|
-
import { Input as
|
|
8
|
-
import { Popover as
|
|
9
|
-
import { getIconFromColumnType as
|
|
10
|
-
import { DataTableAdvancedFilterComponent as
|
|
11
|
-
import { DataTableStringFilter as
|
|
12
|
-
function
|
|
2
|
+
import { jsxs as p, Fragment as E, jsx as o } from "react/jsx-runtime";
|
|
3
|
+
import { useState as M, useEffect as G } from "react";
|
|
4
|
+
import { Badge as S } from "../../../badge.js";
|
|
5
|
+
import { Button as P } from "../../../button.js";
|
|
6
|
+
import { Icon as D } from "../../../icon.js";
|
|
7
|
+
import { Input as R } from "../../../input.js";
|
|
8
|
+
import { Popover as _, PopoverTrigger as w, PopoverContent as C } from "../../../popover.js";
|
|
9
|
+
import { getIconFromColumnType as z } from "../data-table.service.js";
|
|
10
|
+
import { DataTableAdvancedFilterComponent as J } from "./data-table-advanced-filter.js";
|
|
11
|
+
import { DataTableStringFilter as K, DataTableNumberFilter as Q, DataTableBooleanFilter as U, DataTableDateFilter as V, DataTableDateTimeFilter as W, DataTableListSingleSelectFilter as X, DataTableListMultiSelectFilter as Y } from "./data-table-simple-filters.js";
|
|
12
|
+
function ae({
|
|
13
13
|
advancedFilterBadge: m,
|
|
14
|
-
setAdvancedFilterBadge:
|
|
14
|
+
setAdvancedFilterBadge: f,
|
|
15
15
|
filterableColumns: h,
|
|
16
|
-
sortedFilterBadges:
|
|
16
|
+
sortedFilterBadges: I,
|
|
17
17
|
setFilterBadges: d,
|
|
18
|
-
filterSearch:
|
|
19
|
-
setFilterSearch:
|
|
20
|
-
filteredColumns:
|
|
21
|
-
handleAddFilter:
|
|
18
|
+
filterSearch: j,
|
|
19
|
+
setFilterSearch: k,
|
|
20
|
+
filteredColumns: A,
|
|
21
|
+
handleAddFilter: q,
|
|
22
22
|
handleAddAdvancedFilter: F,
|
|
23
|
+
pendingOpenFilterId: O,
|
|
24
|
+
onPendingOpenFilterHandled: N,
|
|
23
25
|
i18n: s
|
|
24
26
|
}) {
|
|
25
|
-
const [
|
|
26
|
-
return
|
|
27
|
+
const [x, T] = M(/* @__PURE__ */ new Set()), L = x.has("add");
|
|
28
|
+
return G(() => {
|
|
29
|
+
O && (T(/* @__PURE__ */ new Set([O])), N());
|
|
30
|
+
}, [O, N]), G(() => {
|
|
27
31
|
if (d((e) => {
|
|
28
|
-
let
|
|
29
|
-
const
|
|
32
|
+
let a = !1;
|
|
33
|
+
const i = e.map((r) => {
|
|
30
34
|
if (r.columnType !== "list_single_select" && r.columnType !== "list_multi_select")
|
|
31
35
|
return r;
|
|
32
|
-
const n =
|
|
36
|
+
const n = (
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
38
|
+
h.find((t) => t.id === r.columnId)?.column.columnDef.meta?.listOptions || []
|
|
39
|
+
), g = new Set(n.map((t) => String(t.value)));
|
|
33
40
|
if (r.columnType === "list_single_select") {
|
|
34
41
|
const t = r.value;
|
|
35
|
-
return t !== void 0 && !g.has(String(t)) ? (
|
|
42
|
+
return t !== void 0 && !g.has(String(t)) ? (a = !0, { ...r, value: void 0, listOptions: n }) : r.listOptions !== n ? { ...r, listOptions: n } : r;
|
|
36
43
|
} else {
|
|
37
|
-
const t = Array.isArray(r.value) ? r.value : [], v = t.filter((
|
|
38
|
-
return v.length !== t.length ? (
|
|
44
|
+
const t = Array.isArray(r.value) ? r.value : [], v = t.filter((u) => g.has(String(u)));
|
|
45
|
+
return v.length !== t.length ? (a = !0, {
|
|
39
46
|
...r,
|
|
40
47
|
value: v.length > 0 ? v : void 0,
|
|
41
48
|
listOptions: n
|
|
42
49
|
}) : r.listOptions !== n ? { ...r, listOptions: n } : r;
|
|
43
50
|
}
|
|
44
51
|
});
|
|
45
|
-
return
|
|
52
|
+
return a ? i : e;
|
|
46
53
|
}), m) {
|
|
47
54
|
const e = (l) => {
|
|
48
55
|
let n = !1;
|
|
49
56
|
return { conditions: l.map((t) => {
|
|
50
57
|
if (t.columnType !== "list_single_select" && t.columnType !== "list_multi_select")
|
|
51
58
|
return t;
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
59
|
+
const u = (
|
|
60
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
61
|
+
h.find(
|
|
62
|
+
(c) => c.id === t.columnId
|
|
63
|
+
)?.column.columnDef.meta?.listOptions || []
|
|
64
|
+
), b = new Set(u.map((c) => String(c.value)));
|
|
55
65
|
if (t.columnType === "list_single_select") {
|
|
56
|
-
const
|
|
57
|
-
return
|
|
66
|
+
const c = t.value;
|
|
67
|
+
return c !== void 0 && !b.has(String(c)) ? (n = !0, {
|
|
58
68
|
...t,
|
|
59
69
|
value: void 0,
|
|
60
|
-
listOptions:
|
|
61
|
-
}) : t.listOptions !==
|
|
70
|
+
listOptions: u
|
|
71
|
+
}) : t.listOptions !== u ? { ...t, listOptions: u } : t;
|
|
62
72
|
} else {
|
|
63
|
-
const
|
|
64
|
-
return
|
|
73
|
+
const c = Array.isArray(t.value) ? t.value : [], y = c.filter(($) => b.has(String($)));
|
|
74
|
+
return y.length !== c.length ? (n = !0, {
|
|
65
75
|
...t,
|
|
66
|
-
value:
|
|
67
|
-
listOptions:
|
|
68
|
-
}) : t.listOptions !==
|
|
76
|
+
value: y.length > 0 ? y : void 0,
|
|
77
|
+
listOptions: u
|
|
78
|
+
}) : t.listOptions !== u ? { ...t, listOptions: u } : t;
|
|
69
79
|
}
|
|
70
80
|
}), changed: n };
|
|
71
|
-
},
|
|
81
|
+
}, a = (l) => {
|
|
72
82
|
let n = !1;
|
|
73
83
|
const { conditions: g, changed: t } = e(l.conditions);
|
|
74
84
|
t && (n = !0);
|
|
75
|
-
const v = l.groups?.map((
|
|
76
|
-
const { group:
|
|
77
|
-
return
|
|
85
|
+
const v = l.groups?.map((u) => {
|
|
86
|
+
const { group: b, changed: c } = a(u);
|
|
87
|
+
return c && (n = !0), b;
|
|
78
88
|
});
|
|
79
89
|
return {
|
|
80
90
|
group: {
|
|
@@ -84,70 +94,71 @@ function se({
|
|
|
84
94
|
},
|
|
85
95
|
changed: n
|
|
86
96
|
};
|
|
87
|
-
}, { group:
|
|
97
|
+
}, { group: i, changed: r } = a(
|
|
88
98
|
m.rootGroup
|
|
89
99
|
);
|
|
90
|
-
r &&
|
|
100
|
+
r && f({
|
|
91
101
|
...m,
|
|
92
|
-
rootGroup:
|
|
102
|
+
rootGroup: i
|
|
93
103
|
});
|
|
94
104
|
}
|
|
95
105
|
}, [
|
|
96
106
|
h,
|
|
97
107
|
d,
|
|
98
108
|
m,
|
|
99
|
-
|
|
100
|
-
]), /* @__PURE__ */ p(
|
|
101
|
-
m && /* @__PURE__ */ p(
|
|
102
|
-
/* @__PURE__ */ o(
|
|
103
|
-
|
|
109
|
+
f
|
|
110
|
+
]), /* @__PURE__ */ p(E, { children: [
|
|
111
|
+
m && /* @__PURE__ */ p(_, { children: [
|
|
112
|
+
/* @__PURE__ */ o(w, { asChild: !0, children: /* @__PURE__ */ p(
|
|
113
|
+
S,
|
|
104
114
|
{
|
|
105
115
|
className: "hover:border-d-border cursor-pointer hover:border",
|
|
106
116
|
variant: "default",
|
|
107
117
|
children: [
|
|
108
|
-
/* @__PURE__ */ o(
|
|
118
|
+
/* @__PURE__ */ o(D, { name: "ListFilter" }),
|
|
109
119
|
s.filters.advancedFilter
|
|
110
120
|
]
|
|
111
121
|
}
|
|
112
122
|
) }),
|
|
113
|
-
/* @__PURE__ */ o(
|
|
114
|
-
|
|
123
|
+
/* @__PURE__ */ o(C, { className: "w-[800px]", align: "start", children: /* @__PURE__ */ o(
|
|
124
|
+
J,
|
|
115
125
|
{
|
|
116
126
|
columns: h,
|
|
117
127
|
onFilterChange: (e) => {
|
|
118
|
-
|
|
128
|
+
f(e || void 0);
|
|
119
129
|
},
|
|
120
130
|
initialFilter: m,
|
|
121
131
|
i18n: s
|
|
122
132
|
}
|
|
123
133
|
) })
|
|
124
134
|
] }),
|
|
125
|
-
|
|
126
|
-
const
|
|
135
|
+
I.map((e) => {
|
|
136
|
+
const a = x.has(e.id);
|
|
127
137
|
return /* @__PURE__ */ p(
|
|
128
|
-
|
|
138
|
+
_,
|
|
129
139
|
{
|
|
130
|
-
|
|
131
|
-
|
|
140
|
+
open: a,
|
|
141
|
+
onOpenChange: (i) => {
|
|
142
|
+
T((r) => {
|
|
132
143
|
const l = new Set(r);
|
|
133
|
-
return
|
|
144
|
+
return i ? l.add(e.id) : l.delete(e.id), l;
|
|
134
145
|
});
|
|
135
146
|
},
|
|
136
147
|
children: [
|
|
137
|
-
/* @__PURE__ */ o(
|
|
138
|
-
|
|
148
|
+
/* @__PURE__ */ o(w, { asChild: !0, children: /* @__PURE__ */ p(
|
|
149
|
+
S,
|
|
139
150
|
{
|
|
140
151
|
variant: (e.value === void 0 || e.value === "") && !(e.operator === "eq_null" || e.operator === "n_eq_null" || e.operator === "checked" || e.operator === "unchecked") ? "ghost" : "default",
|
|
141
|
-
className: `hover:border-d-border flex cursor-pointer items-center gap-1 hover:border ${
|
|
152
|
+
className: `hover:border-d-border flex cursor-pointer items-center gap-1 hover:border ${a && "border-d-foreground border"}`,
|
|
142
153
|
children: [
|
|
143
|
-
/* @__PURE__ */ o(
|
|
154
|
+
/* @__PURE__ */ o(D, { name: "Filter" }),
|
|
144
155
|
e.columnLabel || s.filters.value
|
|
145
156
|
]
|
|
146
157
|
}
|
|
147
158
|
) }),
|
|
148
|
-
/* @__PURE__ */ p(
|
|
159
|
+
/* @__PURE__ */ p(C, { align: "start", children: [
|
|
149
160
|
e.columnType === "string" && /* @__PURE__ */ o(
|
|
150
|
-
|
|
161
|
+
K,
|
|
151
162
|
{
|
|
152
163
|
filter: e,
|
|
153
164
|
setFilterBadges: d,
|
|
@@ -155,7 +166,7 @@ function se({
|
|
|
155
166
|
}
|
|
156
167
|
),
|
|
157
168
|
e.columnType === "number" && /* @__PURE__ */ o(
|
|
158
|
-
|
|
169
|
+
Q,
|
|
159
170
|
{
|
|
160
171
|
filter: e,
|
|
161
172
|
setFilterBadges: d,
|
|
@@ -163,7 +174,7 @@ function se({
|
|
|
163
174
|
}
|
|
164
175
|
),
|
|
165
176
|
e.columnType === "boolean" && /* @__PURE__ */ o(
|
|
166
|
-
|
|
177
|
+
U,
|
|
167
178
|
{
|
|
168
179
|
filter: e,
|
|
169
180
|
setFilterBadges: d,
|
|
@@ -171,7 +182,7 @@ function se({
|
|
|
171
182
|
}
|
|
172
183
|
),
|
|
173
184
|
e.columnType === "date" && /* @__PURE__ */ o(
|
|
174
|
-
|
|
185
|
+
V,
|
|
175
186
|
{
|
|
176
187
|
filter: e,
|
|
177
188
|
setFilterBadges: d,
|
|
@@ -179,7 +190,7 @@ function se({
|
|
|
179
190
|
}
|
|
180
191
|
),
|
|
181
192
|
e.columnType === "datetime" && /* @__PURE__ */ o(
|
|
182
|
-
|
|
193
|
+
W,
|
|
183
194
|
{
|
|
184
195
|
filter: e,
|
|
185
196
|
setFilterBadges: d,
|
|
@@ -187,11 +198,14 @@ function se({
|
|
|
187
198
|
}
|
|
188
199
|
),
|
|
189
200
|
e.columnType === "list_single_select" && (() => {
|
|
190
|
-
const r =
|
|
191
|
-
|
|
192
|
-
|
|
201
|
+
const r = (
|
|
202
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
203
|
+
h.find(
|
|
204
|
+
(l) => l.id === e.columnId
|
|
205
|
+
)?.column.columnDef.meta?.listOptions || e.listOptions || []
|
|
206
|
+
);
|
|
193
207
|
return /* @__PURE__ */ o(
|
|
194
|
-
|
|
208
|
+
X,
|
|
195
209
|
{
|
|
196
210
|
filter: { ...e, listOptions: r },
|
|
197
211
|
setFilterBadges: d,
|
|
@@ -200,11 +214,14 @@ function se({
|
|
|
200
214
|
);
|
|
201
215
|
})(),
|
|
202
216
|
e.columnType === "list_multi_select" && (() => {
|
|
203
|
-
const r =
|
|
204
|
-
|
|
205
|
-
|
|
217
|
+
const r = (
|
|
218
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
219
|
+
h.find(
|
|
220
|
+
(l) => l.id === e.columnId
|
|
221
|
+
)?.column.columnDef.meta?.listOptions || e.listOptions || []
|
|
222
|
+
);
|
|
206
223
|
return /* @__PURE__ */ o(
|
|
207
|
-
|
|
224
|
+
Y,
|
|
208
225
|
{
|
|
209
226
|
filter: { ...e, listOptions: r },
|
|
210
227
|
setFilterBadges: d,
|
|
@@ -220,52 +237,55 @@ function se({
|
|
|
220
237
|
);
|
|
221
238
|
}),
|
|
222
239
|
h?.length > 0 && /* @__PURE__ */ p(
|
|
223
|
-
|
|
240
|
+
_,
|
|
224
241
|
{
|
|
242
|
+
open: L,
|
|
225
243
|
onOpenChange: (e) => {
|
|
226
|
-
|
|
227
|
-
const
|
|
228
|
-
return e ?
|
|
244
|
+
T((a) => {
|
|
245
|
+
const i = new Set(a);
|
|
246
|
+
return e ? i.add("add") : i.delete("add"), i;
|
|
229
247
|
});
|
|
230
248
|
},
|
|
231
249
|
children: [
|
|
232
|
-
/* @__PURE__ */ o(
|
|
233
|
-
|
|
250
|
+
/* @__PURE__ */ o(w, { asChild: !0, children: /* @__PURE__ */ p(
|
|
251
|
+
S,
|
|
234
252
|
{
|
|
235
253
|
variant: "ghost",
|
|
236
|
-
className: `hover:border-d-border flex cursor-pointer items-center gap-1 hover:border ${
|
|
254
|
+
className: `hover:border-d-border flex cursor-pointer items-center gap-1 hover:border ${L && "border-d-foreground border"}`,
|
|
237
255
|
children: [
|
|
238
|
-
/* @__PURE__ */ o(
|
|
256
|
+
/* @__PURE__ */ o(D, { name: "FunnelPlus" }),
|
|
239
257
|
s.filters.addFilter
|
|
240
258
|
]
|
|
241
259
|
}
|
|
242
260
|
) }),
|
|
243
|
-
/* @__PURE__ */ p(
|
|
261
|
+
/* @__PURE__ */ p(C, { className: "p-2", align: "start", children: [
|
|
244
262
|
/* @__PURE__ */ o(
|
|
245
|
-
|
|
263
|
+
R,
|
|
246
264
|
{
|
|
247
265
|
className: "mb-1",
|
|
248
266
|
placeholder: s.filters.searchFilters,
|
|
249
267
|
iconLeft: "Search",
|
|
250
|
-
onChange: (e) =>
|
|
251
|
-
value:
|
|
268
|
+
onChange: (e) => k(e.target.value),
|
|
269
|
+
value: j
|
|
252
270
|
}
|
|
253
271
|
),
|
|
254
|
-
/* @__PURE__ */ o("div", { className: "max-h-[400px] overflow-y-auto", children:
|
|
255
|
-
|
|
272
|
+
/* @__PURE__ */ o("div", { className: "max-h-[400px] overflow-y-auto", children: A.map((e) => /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o(
|
|
273
|
+
P,
|
|
256
274
|
{
|
|
257
275
|
variant: "ghost",
|
|
258
276
|
className: "w-full justify-start",
|
|
259
|
-
iconLeft:
|
|
277
|
+
iconLeft: z(
|
|
260
278
|
e.column.columnDef.meta?.type
|
|
261
279
|
),
|
|
262
|
-
onClick: () =>
|
|
280
|
+
onClick: () => {
|
|
281
|
+
q(e);
|
|
282
|
+
},
|
|
263
283
|
children: e.column.columnDef.meta?.headerLabel || (typeof e.column.columnDef.header == "string" ? e.column.columnDef.header : "") || e.column.id
|
|
264
284
|
}
|
|
265
285
|
) }, e.id)) }),
|
|
266
286
|
/* @__PURE__ */ o("div", { className: "border-d-border mb-1 w-full border-b" }),
|
|
267
287
|
/* @__PURE__ */ o(
|
|
268
|
-
|
|
288
|
+
P,
|
|
269
289
|
{
|
|
270
290
|
variant: "ghost",
|
|
271
291
|
className: "w-full justify-start",
|
|
@@ -282,5 +302,5 @@ function se({
|
|
|
282
302
|
] });
|
|
283
303
|
}
|
|
284
304
|
export {
|
|
285
|
-
|
|
305
|
+
ae as DataTableFilters
|
|
286
306
|
};
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
import { flexRender as w } from "../../../../../node_modules/@tanstack/react-table/build/lib/index.js";
|
|
4
|
+
import S from "react";
|
|
5
|
+
import { cn as l } from "../../../../../lib/utils.js";
|
|
6
|
+
import { Button as i } from "../../../button.js";
|
|
7
|
+
import { Icon as m } from "../../../icon.js";
|
|
8
|
+
import { Popover as D, PopoverTrigger as y, PopoverContent as N } from "../../../popover.js";
|
|
9
|
+
import { TableHeader as I, TableRow as h, TableHead as C } from "../../../table.js";
|
|
10
|
+
import { getPinnedStyle as z } from "../data-table.service.js";
|
|
11
|
+
function F({
|
|
12
|
+
table: r,
|
|
13
|
+
headerRefs: g,
|
|
14
|
+
pinnedOffsets: d,
|
|
15
|
+
maxSortedColumns: c,
|
|
16
|
+
i18n: s,
|
|
17
|
+
searchbarGlobalFilter: f,
|
|
18
|
+
isColumnFiltered: p,
|
|
19
|
+
onAddFilter: v
|
|
20
|
+
}) {
|
|
21
|
+
const [x, u] = S.useState({});
|
|
22
|
+
return /* @__PURE__ */ t(I, { children: r.getHeaderGroups().map((a) => /* @__PURE__ */ t(h, { children: a.headers.map((e) => /* @__PURE__ */ t(
|
|
23
|
+
C,
|
|
24
|
+
{
|
|
25
|
+
ref: (o) => {
|
|
26
|
+
g.current[e.column.id] = o;
|
|
27
|
+
},
|
|
28
|
+
className: l(
|
|
29
|
+
"bg-d-background sticky top-0 h-8 px-0",
|
|
30
|
+
e.column.columnDef.meta?.pinned ? "z-[49]" : "z-10",
|
|
31
|
+
e.column.columnDef.meta?.headerClassName
|
|
32
|
+
),
|
|
33
|
+
style: z(
|
|
34
|
+
e.column.id,
|
|
35
|
+
d,
|
|
36
|
+
e.column.columnDef.meta?.pinned,
|
|
37
|
+
!0
|
|
38
|
+
),
|
|
39
|
+
children: e.isPlaceholder ? null : /* @__PURE__ */ n(
|
|
40
|
+
D,
|
|
41
|
+
{
|
|
42
|
+
open: !!x[e.id],
|
|
43
|
+
onOpenChange: (o) => {
|
|
44
|
+
u((b) => ({
|
|
45
|
+
...b,
|
|
46
|
+
[e.id]: o
|
|
47
|
+
}));
|
|
48
|
+
},
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ t(
|
|
51
|
+
y,
|
|
52
|
+
{
|
|
53
|
+
asChild: !0,
|
|
54
|
+
onClick: (o) => {
|
|
55
|
+
e.column.columnDef.meta?.sortable || e.column.columnDef.meta?.filterable || (o.preventDefault(), o.stopPropagation());
|
|
56
|
+
},
|
|
57
|
+
children: /* @__PURE__ */ n(
|
|
58
|
+
"div",
|
|
59
|
+
{
|
|
60
|
+
className: l(
|
|
61
|
+
"flex h-full items-center justify-between gap-2 px-2",
|
|
62
|
+
e.column.columnDef.meta?.sortable || e.column.columnDef.meta?.filterable ? "hover:bg-d-secondary-foreground/10 cursor-pointer" : "cursor-not-allowed"
|
|
63
|
+
),
|
|
64
|
+
children: [
|
|
65
|
+
w(
|
|
66
|
+
e.column.columnDef.header,
|
|
67
|
+
e.getContext()
|
|
68
|
+
),
|
|
69
|
+
/* @__PURE__ */ n("div", { className: "flex flex-row items-center gap-1", children: [
|
|
70
|
+
e.column.columnDef.meta?.searchable && /* @__PURE__ */ t(
|
|
71
|
+
m,
|
|
72
|
+
{
|
|
73
|
+
name: "Search",
|
|
74
|
+
className: l(
|
|
75
|
+
"text-d-foreground/30 max-h-3.5 max-w-3.5",
|
|
76
|
+
!!f && "text-d-primary"
|
|
77
|
+
)
|
|
78
|
+
}
|
|
79
|
+
),
|
|
80
|
+
e.column.columnDef.meta?.filterable && /* @__PURE__ */ t(
|
|
81
|
+
m,
|
|
82
|
+
{
|
|
83
|
+
name: "Filter",
|
|
84
|
+
className: l(
|
|
85
|
+
"text-d-foreground/30 max-h-3.5 max-w-3.5",
|
|
86
|
+
p(e.column.id) && "text-d-primary"
|
|
87
|
+
)
|
|
88
|
+
}
|
|
89
|
+
),
|
|
90
|
+
e.column.columnDef.meta?.sortable && /* @__PURE__ */ n("div", { className: "flex flex-col py-1", children: [
|
|
91
|
+
/* @__PURE__ */ t(
|
|
92
|
+
i,
|
|
93
|
+
{
|
|
94
|
+
iconLeft: "ChevronUp",
|
|
95
|
+
size: "icon",
|
|
96
|
+
className: l(
|
|
97
|
+
"hover:bg-d-foreground/10 max-h-4 max-w-6",
|
|
98
|
+
e.column.getIsSorted() === "asc" && "hover:text-d-destructive hover:bg-d-destructive/20"
|
|
99
|
+
),
|
|
100
|
+
variant: e.column.getIsSorted() === "asc" ? "ghost-accent" : "ghost",
|
|
101
|
+
onClick: (o) => {
|
|
102
|
+
e.column.getIsSorted() === "asc" ? e.column.clearSorting() : e.column.toggleSorting(!1, !0), o.stopPropagation(), o.preventDefault();
|
|
103
|
+
},
|
|
104
|
+
disabled: r.getState().sorting.length >= c && !e.column.getIsSorted()
|
|
105
|
+
}
|
|
106
|
+
),
|
|
107
|
+
/* @__PURE__ */ t(
|
|
108
|
+
i,
|
|
109
|
+
{
|
|
110
|
+
iconLeft: "ChevronDown",
|
|
111
|
+
size: "icon",
|
|
112
|
+
className: l(
|
|
113
|
+
"hover:bg-d-foreground/10 max-h-4 max-w-6",
|
|
114
|
+
e.column.getIsSorted() === "desc" && "hover:text-d-destructive hover:bg-d-destructive/20"
|
|
115
|
+
),
|
|
116
|
+
variant: e.column.getIsSorted() === "desc" ? "ghost-accent" : "ghost",
|
|
117
|
+
onClick: (o) => {
|
|
118
|
+
e.column.getIsSorted() === "desc" ? e.column.clearSorting() : e.column.toggleSorting(!0, !0), o.stopPropagation(), o.preventDefault();
|
|
119
|
+
},
|
|
120
|
+
disabled: r.getState().sorting.length >= c && !e.column.getIsSorted()
|
|
121
|
+
}
|
|
122
|
+
)
|
|
123
|
+
] })
|
|
124
|
+
] })
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
)
|
|
128
|
+
}
|
|
129
|
+
),
|
|
130
|
+
/* @__PURE__ */ t(N, { className: "w-40 p-0", children: /* @__PURE__ */ n("div", { className: "flex flex-col text-sm", children: [
|
|
131
|
+
e.column.columnDef.meta?.sortable && /* @__PURE__ */ n(
|
|
132
|
+
"div",
|
|
133
|
+
{
|
|
134
|
+
className: l(
|
|
135
|
+
"group hover:bg-d-secondary-foreground/5 relative flex cursor-pointer items-center justify-between rounded px-2 py-1.5",
|
|
136
|
+
e.column.getIsSorted() && "bg-d-secondary-foreground/5",
|
|
137
|
+
r.getState().sorting.length >= c && !e.column.getIsSorted() && "pointer-events-none cursor-not-allowed opacity-60"
|
|
138
|
+
),
|
|
139
|
+
"aria-disabled": r.getState().sorting.length >= c && !e.column.getIsSorted(),
|
|
140
|
+
children: [
|
|
141
|
+
/* @__PURE__ */ t("span", { className: "text-md", children: s.sorting.sort }),
|
|
142
|
+
/* @__PURE__ */ t(m, { name: "ChevronRight", size: "xs" }),
|
|
143
|
+
/* @__PURE__ */ n("div", { className: "bg-d-background border-d-border absolute top-0 left-full ml-0 hidden w-48 flex-col rounded-md border p-1 shadow-md group-hover:flex", children: [
|
|
144
|
+
/* @__PURE__ */ t(
|
|
145
|
+
i,
|
|
146
|
+
{
|
|
147
|
+
className: "justify-start",
|
|
148
|
+
variant: "ghost",
|
|
149
|
+
size: "sm",
|
|
150
|
+
iconLeft: e.column.columnDef.meta?.type === "number" ? "ArrowDown01" : e.column.columnDef.meta?.type === "string" ? "ArrowDownAz" : "ArrowDownNarrowWide",
|
|
151
|
+
onClick: () => {
|
|
152
|
+
!e.column.getIsSorted() && r.getState().sorting.length >= c || e.column.toggleSorting(!1, !0);
|
|
153
|
+
},
|
|
154
|
+
children: s.sorting.ascending
|
|
155
|
+
}
|
|
156
|
+
),
|
|
157
|
+
/* @__PURE__ */ t(
|
|
158
|
+
i,
|
|
159
|
+
{
|
|
160
|
+
className: "justify-start",
|
|
161
|
+
variant: "ghost",
|
|
162
|
+
size: "sm",
|
|
163
|
+
iconLeft: e.column.columnDef.meta?.type === "number" ? "ArrowUp01" : e.column.columnDef.meta?.type === "string" ? "ArrowUpAz" : "ArrowUpNarrowWide",
|
|
164
|
+
onClick: () => {
|
|
165
|
+
!e.column.getIsSorted() && r.getState().sorting.length >= c || e.column.toggleSorting(!0, !0);
|
|
166
|
+
},
|
|
167
|
+
children: s.sorting.descending
|
|
168
|
+
}
|
|
169
|
+
),
|
|
170
|
+
e.column.getIsSorted() && /* @__PURE__ */ t(
|
|
171
|
+
i,
|
|
172
|
+
{
|
|
173
|
+
className: "text-d-destructive/80 hover:text-d-destructive justify-start",
|
|
174
|
+
variant: "ghost",
|
|
175
|
+
size: "sm",
|
|
176
|
+
iconLeft: "CircleX",
|
|
177
|
+
onClick: () => e.column.clearSorting(),
|
|
178
|
+
children: s.sorting.clearSort
|
|
179
|
+
}
|
|
180
|
+
)
|
|
181
|
+
] })
|
|
182
|
+
]
|
|
183
|
+
}
|
|
184
|
+
),
|
|
185
|
+
e.column.columnDef.meta?.filterable && /* @__PURE__ */ n(
|
|
186
|
+
"div",
|
|
187
|
+
{
|
|
188
|
+
className: "hover:bg-d-secondary-foreground/5 relative flex cursor-pointer items-center justify-between rounded px-2 py-1.5",
|
|
189
|
+
onClick: () => {
|
|
190
|
+
v(e), u((o) => ({
|
|
191
|
+
...o,
|
|
192
|
+
[e.id]: !1
|
|
193
|
+
}));
|
|
194
|
+
},
|
|
195
|
+
children: [
|
|
196
|
+
/* @__PURE__ */ t("span", { className: "text-md", children: s.filters.filter }),
|
|
197
|
+
/* @__PURE__ */ t(m, { name: "Filter", size: "xs" })
|
|
198
|
+
]
|
|
199
|
+
}
|
|
200
|
+
)
|
|
201
|
+
] }) })
|
|
202
|
+
]
|
|
203
|
+
}
|
|
204
|
+
)
|
|
205
|
+
},
|
|
206
|
+
e.id
|
|
207
|
+
)) }, a.id)) });
|
|
208
|
+
}
|
|
209
|
+
export {
|
|
210
|
+
F as DataTableHeaderComponent
|
|
211
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as a, jsxs as l } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { useState as g, useRef as p, useEffect as x } from "react";
|
|
4
|
+
import { Button as v } from "../../../button.js";
|
|
4
5
|
import { cn as z } from "../../../../../lib/utils.js";
|
|
5
|
-
import { useState as p, useRef as x, useEffect as v } from "react";
|
|
6
6
|
import { Tooltip as D, TooltipTrigger as E, TooltipContent as L } from "../../../tooltip.js";
|
|
7
7
|
function K({
|
|
8
8
|
searchableColumnsHeaders: b = [],
|
|
@@ -14,12 +14,12 @@ function K({
|
|
|
14
14
|
id: S,
|
|
15
15
|
"data-testid": C
|
|
16
16
|
}) {
|
|
17
|
-
const [s, c] =
|
|
17
|
+
const [s, c] = g(t || ""), [f, o] = g(
|
|
18
18
|
!!(t && t.length > 0)
|
|
19
|
-
), B = "search_input_" + Math.random().toString(36).substring(2, 9), N = S ?? B, d =
|
|
20
|
-
|
|
19
|
+
), B = "search_input_" + Math.random().toString(36).substring(2, 9), N = S ?? B, d = p(null), n = p(null);
|
|
20
|
+
x(() => {
|
|
21
21
|
t && t.length > 0 ? (c(t), o(!0)) : (t === "" || t === void 0) && (c(""), o(!1));
|
|
22
|
-
}, [t]),
|
|
22
|
+
}, [t]), x(() => (u && (n.current && clearTimeout(n.current), n.current = setTimeout(() => {
|
|
23
23
|
u(s);
|
|
24
24
|
}, h)), () => {
|
|
25
25
|
n.current && clearTimeout(n.current);
|
|
@@ -43,7 +43,7 @@ function K({
|
|
|
43
43
|
return /* @__PURE__ */ a("div", { className: z("relative", T), children: /* @__PURE__ */ l("div", { className: "flex items-center", children: [
|
|
44
44
|
/* @__PURE__ */ l(D, { children: [
|
|
45
45
|
/* @__PURE__ */ a(E, { asChild: !0, children: /* @__PURE__ */ a(
|
|
46
|
-
|
|
46
|
+
v,
|
|
47
47
|
{
|
|
48
48
|
className: "h-6 w-6",
|
|
49
49
|
iconLeft: "Search",
|
|
@@ -98,7 +98,7 @@ function K({
|
|
|
98
98
|
}
|
|
99
99
|
),
|
|
100
100
|
s !== "" && /* @__PURE__ */ a(
|
|
101
|
-
|
|
101
|
+
v,
|
|
102
102
|
{
|
|
103
103
|
className: "text-muted-foreground hover:text-foreground hover:text-d-destructive absolute top-1 right-0 size-6",
|
|
104
104
|
iconLeft: "X",
|