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,23 +1,23 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { getListMultiSelectFilterOptions as v, getListSingleSelectFilterOptions as D, getDateTimeFilterOptions as
|
|
3
|
-
import { defaultDataTableI18n as
|
|
4
|
-
function
|
|
5
|
-
const
|
|
6
|
-
switch (
|
|
2
|
+
import { getListMultiSelectFilterOptions as v, getListSingleSelectFilterOptions as D, getDateTimeFilterOptions as b, getDateFilterOptions as A, getBooleanFilterOptions as F, getNumberFilterOptions as k, getStringFilterOptions as x } from "./data-table-constants.js";
|
|
3
|
+
import { defaultDataTableI18n as d } from "./data-table-i18n.js";
|
|
4
|
+
function C(e, a = "string") {
|
|
5
|
+
const t = (s) => {
|
|
6
|
+
switch (s) {
|
|
7
7
|
case "string":
|
|
8
|
-
return
|
|
8
|
+
return x(d)?.[0]?.value ?? "like";
|
|
9
9
|
case "number":
|
|
10
|
-
return
|
|
10
|
+
return k(d)?.[0]?.value ?? "eq";
|
|
11
11
|
case "boolean":
|
|
12
|
-
return
|
|
12
|
+
return F(d)?.[0]?.value ?? "eq";
|
|
13
13
|
case "date":
|
|
14
|
-
return
|
|
14
|
+
return A(d)?.[0]?.value ?? "eq";
|
|
15
15
|
case "datetime":
|
|
16
|
-
return
|
|
16
|
+
return b(d)?.[0]?.value ?? "date_time_before";
|
|
17
17
|
case "list_single_select":
|
|
18
|
-
return D(
|
|
18
|
+
return D(d)?.[0]?.value ?? "array_overlap";
|
|
19
19
|
case "list_multi_select":
|
|
20
|
-
return v(
|
|
20
|
+
return v(d)?.[0]?.value ?? "array_overlap";
|
|
21
21
|
default:
|
|
22
22
|
return "eq";
|
|
23
23
|
}
|
|
@@ -27,14 +27,14 @@ function L(e, s = "string") {
|
|
|
27
27
|
columnId: e?.id || "",
|
|
28
28
|
columnLabel: e?.column.columnDef.meta?.headerLabel || (typeof e?.column.columnDef.header == "string" ? e.column.columnDef.header : "") || e?.id || "",
|
|
29
29
|
columnAccessorKey: (e?.column.columnDef && "accessorKey" in e.column.columnDef && typeof e.column.columnDef.accessorKey == "string" ? e.column.columnDef.accessorKey : e?.id) || "",
|
|
30
|
-
columnType: e?.column.columnDef.meta?.type ||
|
|
31
|
-
operator:
|
|
30
|
+
columnType: e?.column.columnDef.meta?.type || a,
|
|
31
|
+
operator: t(
|
|
32
32
|
e?.column.columnDef.meta?.type
|
|
33
33
|
),
|
|
34
34
|
listOptions: e?.column.columnDef.meta?.listOptions
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function L() {
|
|
38
38
|
const e = () => crypto.randomUUID();
|
|
39
39
|
return {
|
|
40
40
|
id: e(),
|
|
@@ -56,61 +56,61 @@ function O() {
|
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
function I(e,
|
|
60
|
-
const
|
|
59
|
+
function I(e, a) {
|
|
60
|
+
const t = e.filter((n) => n.operator === "eq_null" || n.operator === "n_eq_null" || n.operator === "checked" || n.operator === "unchecked" ? !0 : n.value === void 0 || n.value === "" ? !1 : n.columnType === "list_multi_select" ? (Array.isArray(n.value) ? n.value.filter((i) => i !== void 0) : [n.value].filter((i) => i !== void 0)).length > 0 : !0), o = a ? ((n) => {
|
|
61
61
|
const p = (i) => {
|
|
62
|
-
const
|
|
63
|
-
[
|
|
64
|
-
operator:
|
|
65
|
-
value:
|
|
62
|
+
const g = i.conditions.filter((u) => !u.columnId || !u.operator ? !1 : u.operator === "eq_null" || u.operator === "n_eq_null" || u.operator === "checked" || u.operator === "unchecked" ? !0 : u.value === void 0 ? !1 : u.columnType === "list_multi_select" ? (Array.isArray(u.value) ? u.value.filter((_) => _ !== void 0) : [u.value].filter((_) => _ !== void 0)).length > 0 : !0).map((u) => ({
|
|
63
|
+
[u.columnAccessorKey]: {
|
|
64
|
+
operator: u.operator,
|
|
65
|
+
value: u.operator === "eq_null" || u.operator === "n_eq_null" || u.operator === "checked" || u.operator === "unchecked" ? !0 : u.columnType === "list_single_select" ? Array.isArray(u.value) ? u.value.filter((f) => f !== void 0) : [u.value].filter((f) => f !== void 0) : u.value
|
|
66
66
|
}
|
|
67
|
-
})),
|
|
68
|
-
...
|
|
69
|
-
...
|
|
67
|
+
})), y = i.groups?.map(p).filter(Boolean) || [], m = [
|
|
68
|
+
...g,
|
|
69
|
+
...y
|
|
70
70
|
];
|
|
71
|
-
return
|
|
71
|
+
return m.length === 0 ? null : m.length === 1 ? m[0] : i.logicalOperator === "AND" ? { _and: m } : { _or: m };
|
|
72
72
|
};
|
|
73
73
|
return p(n.rootGroup);
|
|
74
|
-
})(
|
|
74
|
+
})(a) : null, c = t.map(
|
|
75
75
|
(n) => ({
|
|
76
76
|
[n.columnAccessorKey]: {
|
|
77
77
|
operator: n.operator,
|
|
78
78
|
value: n.operator === "eq_null" || n.operator === "n_eq_null" || n.operator === "checked" || n.operator === "unchecked" ? !0 : n.columnType === "list_single_select" ? Array.isArray(n.value) ? n.value.filter((p) => p !== void 0) : [n.value].filter((p) => p !== void 0) : n.value ?? ""
|
|
79
79
|
}
|
|
80
80
|
})
|
|
81
|
-
),
|
|
82
|
-
...
|
|
81
|
+
), r = [
|
|
82
|
+
...o ? [o] : [],
|
|
83
83
|
...c
|
|
84
84
|
];
|
|
85
|
-
return
|
|
85
|
+
return r.length > 0 ? r.length === 1 ? r[0] : { _and: r } : {};
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function O(e, a) {
|
|
88
88
|
const {
|
|
89
|
-
rowHeight:
|
|
90
|
-
headerHeight:
|
|
91
|
-
containerHeight:
|
|
89
|
+
rowHeight: t = 1,
|
|
90
|
+
headerHeight: s = 1,
|
|
91
|
+
containerHeight: o = 1,
|
|
92
92
|
onPageChange: c,
|
|
93
|
-
setPagination:
|
|
94
|
-
} =
|
|
95
|
-
(l -
|
|
93
|
+
setPagination: r
|
|
94
|
+
} = a, l = e?.offsetHeight || o, n = Math.floor(
|
|
95
|
+
(l - s) / t
|
|
96
96
|
), p = n > 1 ? n : 1;
|
|
97
|
-
|
|
97
|
+
r((i) => {
|
|
98
98
|
if (i.pageSize !== p) {
|
|
99
99
|
if (c) {
|
|
100
|
-
const
|
|
100
|
+
const g = Math.max(
|
|
101
101
|
0,
|
|
102
102
|
Math.ceil(i.pageSize * (i.pageIndex + 1) / p) - 1
|
|
103
|
-
),
|
|
104
|
-
c(
|
|
103
|
+
), y = Math.min(i.pageIndex, g);
|
|
104
|
+
c(y, p);
|
|
105
105
|
}
|
|
106
106
|
return { ...i, pageSize: p };
|
|
107
107
|
}
|
|
108
108
|
return i;
|
|
109
109
|
});
|
|
110
110
|
}
|
|
111
|
-
function
|
|
111
|
+
function T(e, a, t) {
|
|
112
112
|
if (e == null)
|
|
113
|
-
switch (
|
|
113
|
+
switch (a) {
|
|
114
114
|
case "eq_null":
|
|
115
115
|
return !0;
|
|
116
116
|
case "n_eq_null":
|
|
@@ -118,42 +118,42 @@ function q(e, s, r) {
|
|
|
118
118
|
default:
|
|
119
119
|
return !1;
|
|
120
120
|
}
|
|
121
|
-
const
|
|
122
|
-
switch (
|
|
121
|
+
const s = (r) => r == null || typeof r == "string" ? r : String(r), o = s(e), c = s(t);
|
|
122
|
+
switch (a) {
|
|
123
123
|
case "eq":
|
|
124
|
-
return
|
|
124
|
+
return o === c;
|
|
125
125
|
case "ne":
|
|
126
|
-
return
|
|
126
|
+
return o !== c;
|
|
127
127
|
case "lt":
|
|
128
|
-
return typeof e == "number" && typeof
|
|
128
|
+
return typeof e == "number" && typeof t == "number" ? e < t : o < c;
|
|
129
129
|
case "le":
|
|
130
|
-
return typeof e == "number" && typeof
|
|
130
|
+
return typeof e == "number" && typeof t == "number" ? e <= t : o <= c;
|
|
131
131
|
case "gt":
|
|
132
|
-
return typeof e == "number" && typeof
|
|
132
|
+
return typeof e == "number" && typeof t == "number" ? e > t : o > c;
|
|
133
133
|
case "ge":
|
|
134
|
-
return typeof e == "number" && typeof
|
|
134
|
+
return typeof e == "number" && typeof t == "number" ? e >= t : o >= c;
|
|
135
135
|
case "like":
|
|
136
|
-
return
|
|
136
|
+
return o?.toLowerCase().includes(c?.toLowerCase());
|
|
137
137
|
case "n_like":
|
|
138
|
-
return !
|
|
138
|
+
return !o?.toLowerCase().includes(c?.toLowerCase());
|
|
139
139
|
case "starts_with":
|
|
140
|
-
return
|
|
140
|
+
return o?.toLowerCase().startsWith(c?.toLowerCase());
|
|
141
141
|
case "ends_with":
|
|
142
|
-
return
|
|
142
|
+
return o?.toLowerCase().endsWith(c?.toLowerCase());
|
|
143
143
|
case "eq_null":
|
|
144
144
|
return e == null || e === "";
|
|
145
145
|
case "n_eq_null":
|
|
146
146
|
return e != null && e !== "";
|
|
147
147
|
case "array_overlap":
|
|
148
|
-
return Array.isArray(e) && Array.isArray(
|
|
149
|
-
(
|
|
150
|
-
(l) =>
|
|
148
|
+
return Array.isArray(e) && Array.isArray(t) ? t.length === 0 ? !0 : e.length === 0 ? !1 : t.some(
|
|
149
|
+
(r) => e.some(
|
|
150
|
+
(l) => s(l) === s(r)
|
|
151
151
|
)
|
|
152
152
|
) : !1;
|
|
153
153
|
case "n_array_overlap":
|
|
154
|
-
return Array.isArray(e) && Array.isArray(
|
|
155
|
-
(
|
|
156
|
-
(l) =>
|
|
154
|
+
return Array.isArray(e) && Array.isArray(t) ? t.length === 0 || e.length === 0 ? !0 : !t.some(
|
|
155
|
+
(r) => e.some(
|
|
156
|
+
(l) => s(l) === s(r)
|
|
157
157
|
)
|
|
158
158
|
) : !0;
|
|
159
159
|
case "checked":
|
|
@@ -162,67 +162,67 @@ function q(e, s, r) {
|
|
|
162
162
|
return e === !1;
|
|
163
163
|
case "date_before":
|
|
164
164
|
try {
|
|
165
|
-
const
|
|
166
|
-
return
|
|
165
|
+
const r = new Date(e), l = new Date(t);
|
|
166
|
+
return r.setHours(0, 0, 0, 0), l.setHours(0, 0, 0, 0), r < l;
|
|
167
167
|
} catch {
|
|
168
168
|
return !1;
|
|
169
169
|
}
|
|
170
170
|
case "date_after":
|
|
171
171
|
try {
|
|
172
|
-
const
|
|
173
|
-
return
|
|
172
|
+
const r = new Date(e), l = new Date(t);
|
|
173
|
+
return r.setHours(0, 0, 0, 0), l.setHours(0, 0, 0, 0), r > l;
|
|
174
174
|
} catch {
|
|
175
175
|
return !1;
|
|
176
176
|
}
|
|
177
177
|
case "date_time_before":
|
|
178
178
|
try {
|
|
179
|
-
const
|
|
180
|
-
return
|
|
179
|
+
const r = new Date(e), l = new Date(t);
|
|
180
|
+
return r < l;
|
|
181
181
|
} catch {
|
|
182
182
|
return !1;
|
|
183
183
|
}
|
|
184
184
|
case "date_time_after":
|
|
185
185
|
try {
|
|
186
|
-
const
|
|
187
|
-
return
|
|
186
|
+
const r = new Date(e), l = new Date(t);
|
|
187
|
+
return r > l;
|
|
188
188
|
} catch {
|
|
189
189
|
return !1;
|
|
190
190
|
}
|
|
191
191
|
default:
|
|
192
|
-
return console.warn(`Unknown filter operator: ${
|
|
192
|
+
return console.warn(`Unknown filter operator: ${a}`), !0;
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
|
-
function h(e,
|
|
196
|
-
if (!
|
|
195
|
+
function h(e, a) {
|
|
196
|
+
if (!a || Object.keys(a).length === 0)
|
|
197
197
|
return !0;
|
|
198
|
-
if ("_and" in
|
|
199
|
-
return
|
|
200
|
-
(
|
|
198
|
+
if ("_and" in a && Array.isArray(a._and))
|
|
199
|
+
return a._and.every(
|
|
200
|
+
(t) => h(e, t)
|
|
201
201
|
);
|
|
202
|
-
if ("_or" in
|
|
203
|
-
return
|
|
204
|
-
(
|
|
202
|
+
if ("_or" in a && Array.isArray(a._or))
|
|
203
|
+
return a._or.some(
|
|
204
|
+
(t) => h(e, t)
|
|
205
205
|
);
|
|
206
|
-
for (const [
|
|
207
|
-
if (!
|
|
208
|
-
const
|
|
209
|
-
if (!
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
206
|
+
for (const [t, s] of Object.entries(a))
|
|
207
|
+
if (!t.startsWith("_") && typeof s == "object" && s !== null && "operator" in s) {
|
|
208
|
+
const o = e.getValue(t);
|
|
209
|
+
if (!T(
|
|
210
|
+
o,
|
|
211
|
+
s.operator,
|
|
212
|
+
s.value
|
|
213
213
|
)) return !1;
|
|
214
214
|
}
|
|
215
215
|
return !0;
|
|
216
216
|
}
|
|
217
|
-
function
|
|
218
|
-
let
|
|
219
|
-
return function(...
|
|
220
|
-
clearTimeout(
|
|
221
|
-
e(...
|
|
222
|
-
},
|
|
217
|
+
function z(e, a) {
|
|
218
|
+
let t;
|
|
219
|
+
return function(...s) {
|
|
220
|
+
clearTimeout(t), t = setTimeout(() => {
|
|
221
|
+
e(...s);
|
|
222
|
+
}, a);
|
|
223
223
|
};
|
|
224
224
|
}
|
|
225
|
-
function
|
|
225
|
+
function H(e) {
|
|
226
226
|
switch (e) {
|
|
227
227
|
case "string":
|
|
228
228
|
return "CaseUpper";
|
|
@@ -244,13 +244,28 @@ function M(e) {
|
|
|
244
244
|
return "FileQuestionMark";
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
|
+
function K(e, a, t, s) {
|
|
248
|
+
const o = a[e];
|
|
249
|
+
if (!o || !t || o.side !== t) return;
|
|
250
|
+
const c = o.side === "left" ? `${o.offset}px` : void 0, r = o.side === "right" ? `${o.offset}px` : void 0;
|
|
251
|
+
return {
|
|
252
|
+
position: "sticky",
|
|
253
|
+
left: c,
|
|
254
|
+
right: r,
|
|
255
|
+
zIndex: s ? 49 : 48,
|
|
256
|
+
background: "var(--d-background)",
|
|
257
|
+
// Use separate shadow for pinned columns to avoid conflicts
|
|
258
|
+
boxShadow: t === "left" ? `inset -1px ${s ? "0" : "-1px"} 0 var(--d-border), 2px 0 4px -2px rgba(0,0,0,0.1)` : `inset 1px ${s ? "0" : "-1px"} 0 var(--d-border), -2px 0 4px -2px rgba(0,0,0,0.1)`
|
|
259
|
+
};
|
|
260
|
+
}
|
|
247
261
|
export {
|
|
248
|
-
|
|
262
|
+
T as applyClientSideFilter,
|
|
249
263
|
h as applySearchFilterToRow,
|
|
250
264
|
I as buildSearchFilter,
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
265
|
+
C as createBadgeFilterFromHeader,
|
|
266
|
+
L as createDefaultAdvancedFilter,
|
|
267
|
+
z as debounce,
|
|
268
|
+
H as getIconFromColumnType,
|
|
269
|
+
K as getPinnedStyle,
|
|
270
|
+
O as updatePageSizeFromContainer
|
|
256
271
|
};
|
|
@@ -19,14 +19,16 @@ function s(e, t) {
|
|
|
19
19
|
sortable: e.sortable ?? !1,
|
|
20
20
|
filterable: e.filterable ?? !1,
|
|
21
21
|
searchable: e.searchable ?? !1,
|
|
22
|
-
pinned: e.pinned
|
|
22
|
+
pinned: e.pinned,
|
|
23
|
+
cellClassName: e.cellClassName,
|
|
24
|
+
headerClassName: e.headerClassName
|
|
23
25
|
}
|
|
24
26
|
};
|
|
25
27
|
}
|
|
26
|
-
function
|
|
28
|
+
function h(e) {
|
|
27
29
|
return s(e, "string");
|
|
28
30
|
}
|
|
29
|
-
function
|
|
31
|
+
function y(e) {
|
|
30
32
|
return s(e, "number");
|
|
31
33
|
}
|
|
32
34
|
function _(e) {
|
|
@@ -39,7 +41,10 @@ function q(e) {
|
|
|
39
41
|
return s(e, "datetime");
|
|
40
42
|
}
|
|
41
43
|
function F(e) {
|
|
42
|
-
const t = Array.isArray(e.options) ? typeof e.options[0] == "string" ? e.options.map((a) => ({ value: a, label: a })) : e.options : [], r = s(
|
|
44
|
+
const t = Array.isArray(e.options) ? typeof e.options[0] == "string" ? e.options.map((a) => ({ value: a, label: a })) : e.options : [], r = s(
|
|
45
|
+
e,
|
|
46
|
+
"list_single_select"
|
|
47
|
+
);
|
|
43
48
|
return {
|
|
44
49
|
...r,
|
|
45
50
|
meta: {
|
|
@@ -50,7 +55,10 @@ function F(e) {
|
|
|
50
55
|
};
|
|
51
56
|
}
|
|
52
57
|
function K(e) {
|
|
53
|
-
const t = Array.isArray(e.options) ? typeof e.options[0] == "string" ? e.options.map((a) => ({ value: a, label: a })) : e.options : [], r = s(
|
|
58
|
+
const t = Array.isArray(e.options) ? typeof e.options[0] == "string" ? e.options.map((a) => ({ value: a, label: a })) : e.options : [], r = s(
|
|
59
|
+
e,
|
|
60
|
+
"list_multi_select"
|
|
61
|
+
);
|
|
54
62
|
return {
|
|
55
63
|
...r,
|
|
56
64
|
meta: {
|
|
@@ -175,7 +183,7 @@ function D(e, t, r, a, l) {
|
|
|
175
183
|
value: l
|
|
176
184
|
});
|
|
177
185
|
}
|
|
178
|
-
function
|
|
186
|
+
function N(e, t, r, a, l, n, i) {
|
|
179
187
|
return u({
|
|
180
188
|
columnId: e,
|
|
181
189
|
columnAccessorKey: t,
|
|
@@ -192,7 +200,7 @@ function p(e) {
|
|
|
192
200
|
sort_order: e.map((t) => t.order)
|
|
193
201
|
};
|
|
194
202
|
}
|
|
195
|
-
function
|
|
203
|
+
function V(e) {
|
|
196
204
|
return {
|
|
197
205
|
...e.filters && {
|
|
198
206
|
filters: {
|
|
@@ -228,6 +236,7 @@ function $(e, t, r) {
|
|
|
228
236
|
return {
|
|
229
237
|
...a,
|
|
230
238
|
meta: {
|
|
239
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
231
240
|
...a.meta,
|
|
232
241
|
listOptions: n
|
|
233
242
|
}
|
|
@@ -242,16 +251,17 @@ function M(e, t) {
|
|
|
242
251
|
return l ? {
|
|
243
252
|
...r,
|
|
244
253
|
meta: {
|
|
254
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
245
255
|
...r.meta,
|
|
246
256
|
pinned: l
|
|
247
257
|
}
|
|
248
258
|
} : r;
|
|
249
259
|
});
|
|
250
260
|
}
|
|
251
|
-
function
|
|
261
|
+
function f(e) {
|
|
252
262
|
return e.map((t) => t.accessorKey || t.id).filter(Boolean);
|
|
253
263
|
}
|
|
254
|
-
function
|
|
264
|
+
function w(e, t) {
|
|
255
265
|
return {
|
|
256
266
|
string: [
|
|
257
267
|
"like",
|
|
@@ -294,17 +304,17 @@ export {
|
|
|
294
304
|
v as createDisplayColumn,
|
|
295
305
|
u as createFilterBadge,
|
|
296
306
|
O as createFilterBadges,
|
|
297
|
-
|
|
298
|
-
|
|
307
|
+
V as createInitialState,
|
|
308
|
+
N as createListFilter,
|
|
299
309
|
K as createMultiSelectColumn,
|
|
300
|
-
|
|
310
|
+
y as createNumberColumn,
|
|
301
311
|
I as createNumberFilter,
|
|
302
312
|
F as createSingleSelectColumn,
|
|
303
313
|
p as createSorting,
|
|
304
|
-
|
|
314
|
+
h as createStringColumn,
|
|
305
315
|
T as createStringFilter,
|
|
306
|
-
|
|
307
|
-
|
|
316
|
+
f as getColumnIds,
|
|
317
|
+
w as isValidOperatorForType,
|
|
308
318
|
M as pinColumns,
|
|
309
319
|
b as toSelectOptions,
|
|
310
320
|
k as toSelectOptionsFromObjects,
|
|
@@ -25,8 +25,8 @@ function h({
|
|
|
25
25
|
e.text.base,
|
|
26
26
|
e.text.placeholder,
|
|
27
27
|
e.interaction.disabled,
|
|
28
|
-
"flex min-h-16 w-full
|
|
29
|
-
"
|
|
28
|
+
"flex min-h-16 w-full max-w-full min-w-0 px-3 py-2 shadow-xs transition-[color,box-shadow] outline-none md:text-sm",
|
|
29
|
+
"overflow-x-hidden break-words whitespace-pre-wrap",
|
|
30
30
|
// Focus states
|
|
31
31
|
"focus-visible:ring-d-ring/50 focus-visible:border-d-ring focus-visible:ring-[3px]",
|
|
32
32
|
e.input.invalid,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as t, jsxs as h } from "react/jsx-runtime";
|
|
3
|
-
import { cn as r } from "../../lib/utils.js";
|
|
4
3
|
import { useControllableState as p } from "../../node_modules/@radix-ui/react-use-controllable-state/dist/index.js";
|
|
5
4
|
import { useState as b, useEffect as g } from "react";
|
|
5
|
+
import { cn as r } from "../../lib/utils.js";
|
|
6
6
|
import v from "../../node_modules/lucide-react/dist/esm/icons/monitor.js";
|
|
7
7
|
import x from "../../node_modules/lucide-react/dist/esm/icons/sun.js";
|
|
8
8
|
import y from "../../node_modules/lucide-react/dist/esm/icons/moon.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as i } from "react/jsx-runtime";
|
|
3
|
-
import * as d from "react";
|
|
4
3
|
import { Root as u, Item as m } from "../../node_modules/@radix-ui/react-toggle-group/dist/index.js";
|
|
5
|
-
import
|
|
4
|
+
import * as d from "react";
|
|
6
5
|
import { toggleVariants as g } from "./toggle.js";
|
|
6
|
+
import { cn as s } from "../../lib/utils.js";
|
|
7
7
|
const l = d.createContext({
|
|
8
8
|
size: "default",
|
|
9
9
|
variant: "default"
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as e, jsxs as v } from "react/jsx-runtime";
|
|
3
|
+
import { useState as h, useRef as b, useCallback as j, useEffect as N } from "react";
|
|
4
|
+
import { cn as c } from "../../lib/utils.js";
|
|
5
|
+
import { Icon as B } from "./icon.js";
|
|
6
|
+
import { Popover as L, PopoverTrigger as W, PopoverContent as K } from "./popover.js";
|
|
7
|
+
import { Typo as T } from "./typo.js";
|
|
8
|
+
function H({
|
|
9
|
+
children: o,
|
|
10
|
+
text: a,
|
|
11
|
+
title: w,
|
|
12
|
+
popoverContent: f,
|
|
13
|
+
className: k = "",
|
|
14
|
+
wrapperClassName: x = "",
|
|
15
|
+
popoverClassName: z = "",
|
|
16
|
+
showButton: O = !0,
|
|
17
|
+
emptyFallback: R = "-"
|
|
18
|
+
}) {
|
|
19
|
+
const [p, C] = h(!1), [l, m] = h(!1), [P, E] = h(""), i = b(null), s = b(null), d = o !== void 0, t = a || P || (typeof o == "string" ? o : ""), D = d || typeof a == "string" && a.trim().length > 0, r = d || !!a || !!f || p, u = j(() => {
|
|
20
|
+
if (i.current) {
|
|
21
|
+
const { scrollWidth: n, clientWidth: I } = i.current, g = i.current.textContent?.trim() ?? "";
|
|
22
|
+
E(
|
|
23
|
+
(y) => y === g ? y : g
|
|
24
|
+
), C(n > I);
|
|
25
|
+
}
|
|
26
|
+
}, []);
|
|
27
|
+
return N(() => {
|
|
28
|
+
u(), i.current && typeof ResizeObserver < "u" && (s.current = new ResizeObserver(u), s.current.observe(i.current));
|
|
29
|
+
const n = () => u();
|
|
30
|
+
return window.addEventListener("resize", n), () => {
|
|
31
|
+
s.current && (s.current.disconnect(), s.current = null), window.removeEventListener("resize", n);
|
|
32
|
+
};
|
|
33
|
+
}, [t, u]), N(() => {
|
|
34
|
+
!r && l && m(!1);
|
|
35
|
+
}, [r, l]), !D && !t ? /* @__PURE__ */ e("div", { className: c(x, "text-muted-foreground"), children: R }) : /* @__PURE__ */ v(L, { open: l, onOpenChange: m, children: [
|
|
36
|
+
/* @__PURE__ */ e(W, { asChild: !0, children: /* @__PURE__ */ v(
|
|
37
|
+
"button",
|
|
38
|
+
{
|
|
39
|
+
type: "button",
|
|
40
|
+
className: c(
|
|
41
|
+
"group flex max-w-60 min-w-0 items-center gap-2 text-left",
|
|
42
|
+
r && "cursor-pointer",
|
|
43
|
+
x
|
|
44
|
+
),
|
|
45
|
+
disabled: !r,
|
|
46
|
+
"aria-label": r && t ? `Click to view full content: ${t}` : t || void 0,
|
|
47
|
+
onKeyDown: (n) => {
|
|
48
|
+
(n.key === "Enter" || n.key === " ") && r && (n.preventDefault(), m(!l));
|
|
49
|
+
},
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ e("div", { className: "flex min-w-0 flex-1", children: /* @__PURE__ */ e(
|
|
52
|
+
"div",
|
|
53
|
+
{
|
|
54
|
+
ref: i,
|
|
55
|
+
className: c(
|
|
56
|
+
"truncate whitespace-nowrap",
|
|
57
|
+
r && "group-hover:underline",
|
|
58
|
+
k
|
|
59
|
+
),
|
|
60
|
+
title: p ? t : void 0,
|
|
61
|
+
children: d ? o : t
|
|
62
|
+
}
|
|
63
|
+
) }),
|
|
64
|
+
p && O && /* @__PURE__ */ e(
|
|
65
|
+
"span",
|
|
66
|
+
{
|
|
67
|
+
className: c(
|
|
68
|
+
"text-d-muted-foreground flex shrink-0 items-center opacity-50 transition-opacity group-hover:opacity-100"
|
|
69
|
+
),
|
|
70
|
+
"aria-hidden": "true",
|
|
71
|
+
children: /* @__PURE__ */ e(B, { name: "Eye", size: "sm" })
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
) }),
|
|
77
|
+
/* @__PURE__ */ v(
|
|
78
|
+
K,
|
|
79
|
+
{
|
|
80
|
+
side: "top",
|
|
81
|
+
align: "start",
|
|
82
|
+
className: c("w-96", z),
|
|
83
|
+
children: [
|
|
84
|
+
w && /* @__PURE__ */ e("div", { className: "w-full", children: /* @__PURE__ */ e(T, { variant: "caption", className: "w-full font-bold", children: w }) }),
|
|
85
|
+
/* @__PURE__ */ e("div", { className: "w-full", children: f || (d && !t ? /* @__PURE__ */ e("div", { className: "w-full min-w-0", children: o }) : /* @__PURE__ */ e(
|
|
86
|
+
T,
|
|
87
|
+
{
|
|
88
|
+
variant: "caption",
|
|
89
|
+
className: "w-full break-words whitespace-pre-wrap",
|
|
90
|
+
children: t
|
|
91
|
+
}
|
|
92
|
+
)) })
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
)
|
|
96
|
+
] });
|
|
97
|
+
}
|
|
98
|
+
export {
|
|
99
|
+
H as TruncatedCell
|
|
100
|
+
};
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as l, jsxs as s } from "react/jsx-runtime";
|
|
3
|
-
import { useMemo as n } from "react";
|
|
4
3
|
import c from "../../../_virtual/dayjs.min.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { hexContrast as
|
|
8
|
-
import { TooltipProvider as
|
|
9
|
-
import { Typo as
|
|
4
|
+
import { l as n } from "../../../_virtual/lodash.js";
|
|
5
|
+
import { useMemo as m } from "react";
|
|
6
|
+
import { hexContrast as b, hexToRgba as u, cn as v } from "../../../lib/utils.js";
|
|
7
|
+
import { TooltipProvider as g, Tooltip as T, TooltipTrigger as N, TooltipContent as y } from "../tooltip.js";
|
|
8
|
+
import { Typo as C } from "../typo.js";
|
|
9
|
+
import { useCalendar as k } from "./calendar-context.js";
|
|
10
10
|
const H = ({ appointment: e }) => {
|
|
11
|
-
const { setSelectedAppointmentId: h } =
|
|
11
|
+
const { setSelectedAppointmentId: h } = k(), f = m(() => {
|
|
12
12
|
if (e.color)
|
|
13
13
|
return {
|
|
14
14
|
backgroundColor: u(e.color, 0.75),
|
|
15
15
|
borderColor: u(e.color, 1),
|
|
16
|
-
color:
|
|
16
|
+
color: b(e.color),
|
|
17
17
|
backdropFilter: "blur(5px)"
|
|
18
18
|
};
|
|
19
|
-
}, [e.color]), o = e.endTime || c(`2000-01-01 ${e.startTime}`).add(1, "hour").format("HH:mm"), x =
|
|
19
|
+
}, [e.color]), o = e.endTime || c(`2000-01-01 ${e.startTime}`).add(1, "hour").format("HH:mm"), x = m(() => {
|
|
20
20
|
const r = c(`2000-01-01 ${e.startTime}`), a = c(`2000-01-01 ${o}`).diff(r, "minute"), i = Math.floor(a / 60), d = a % 60;
|
|
21
21
|
return i === 0 ? `${d}m` : d === 0 ? `${i}h` : `${i}h ${d}m`;
|
|
22
22
|
}, [e.startTime, o]);
|
|
23
|
-
return /* @__PURE__ */ l(
|
|
24
|
-
/* @__PURE__ */ l(
|
|
23
|
+
return /* @__PURE__ */ l(g, { delayDuration: 300, children: /* @__PURE__ */ s(T, { children: [
|
|
24
|
+
/* @__PURE__ */ l(N, { asChild: !0, children: /* @__PURE__ */ s(
|
|
25
25
|
"div",
|
|
26
26
|
{
|
|
27
27
|
onClick: (r) => {
|
|
28
28
|
r.preventDefault(), r.stopPropagation(), h(e.id);
|
|
29
29
|
},
|
|
30
30
|
style: f,
|
|
31
|
-
className:
|
|
31
|
+
className: v(
|
|
32
32
|
"border-d-border flex h-full cursor-pointer flex-col justify-start rounded-r-md border border-l-4 p-2 shadow-md transition-all duration-200 ease-in-out hover:scale-105",
|
|
33
33
|
e.className
|
|
34
34
|
),
|
|
@@ -55,8 +55,8 @@ const H = ({ appointment: e }) => {
|
|
|
55
55
|
]
|
|
56
56
|
}
|
|
57
57
|
) }),
|
|
58
|
-
/* @__PURE__ */ s(
|
|
59
|
-
e?.title && /* @__PURE__ */ s(
|
|
58
|
+
/* @__PURE__ */ s(y, { side: "right", variant: "card", children: [
|
|
59
|
+
e?.title && /* @__PURE__ */ s(C, { children: [
|
|
60
60
|
e?.title,
|
|
61
61
|
" (",
|
|
62
62
|
x,
|
|
@@ -77,10 +77,10 @@ const H = ({ appointment: e }) => {
|
|
|
77
77
|
className: "flex items-start justify-between gap-4 py-1 text-right",
|
|
78
78
|
children: [
|
|
79
79
|
/* @__PURE__ */ s("span", { className: "font-medium", children: [
|
|
80
|
-
|
|
80
|
+
n.upperFirst(r.key),
|
|
81
81
|
":"
|
|
82
82
|
] }),
|
|
83
|
-
/* @__PURE__ */ l("span", { className: "text-d-accent-foreground max-w-[200px]", children: typeof r.value == "string" ?
|
|
83
|
+
/* @__PURE__ */ l("span", { className: "text-d-accent-foreground max-w-[200px]", children: typeof r.value == "string" ? n.upperFirst(r.value) : r.value })
|
|
84
84
|
]
|
|
85
85
|
},
|
|
86
86
|
t
|