@middag-io/react 0.33.0 → 0.35.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/README.md +28 -8
- package/dist-lib/base/shell/AuthShell.js +39 -0
- package/dist-lib/base/shell/BasicShell.js +207 -0
- package/dist-lib/base/shell/ImmersiveShell.js +55 -0
- package/dist-lib/base/shell/partials/InspectorContext.js +60 -0
- package/dist-lib/base/shell/partials/InspectorPanel.js +22 -0
- package/dist-lib/base/shell/partials/NavErrorBoundary.js +66 -0
- package/dist-lib/base/shell/partials/OverlayScreen.js +36 -0
- package/dist-lib/base/shell/partials/PageActionButton.js +4 -0
- package/dist-lib/base/theme/appearance.js +39 -0
- package/dist-lib/base/theme/host-layout-detector.js +39 -0
- package/dist-lib/base/theme/host-theme-detector.js +131 -0
- package/dist-lib/base/theme/sidebar-safelist.txt +20 -0
- package/dist-lib/base/theme/tailwind-theme.css +136 -0
- package/dist-lib/base/theme/theme-bridge.css +164 -0
- package/dist-lib/base/theme/theme-context.js +103 -0
- package/dist-lib/base/theme/themes/classic.css +174 -0
- package/dist-lib/base/theme/tokens.css +290 -0
- package/dist-lib/base/theme/useHostTheme.js +34 -0
- package/dist-lib/base/utils/clipboard.js +16 -0
- package/dist-lib/base/utils/conditions.js +13 -0
- package/dist-lib/base/utils/icon-registry.js +16 -0
- package/dist-lib/base/utils/icons.js +11 -0
- package/dist-lib/base/utils/interpolate.js +6 -0
- package/dist-lib/base/utils/register-default-icons.js +9 -0
- package/dist-lib/base/utils/storage.js +30 -0
- package/dist-lib/base/utils/time.js +59 -0
- package/dist-lib/chunks/subpath-BD_PKGUX.js +146 -0
- package/dist-lib/chunks/subpath-DLFO_UGQ.js +604 -0
- package/dist-lib/components/reui/accordion.js +43 -0
- package/dist-lib/components/reui/alert-dialog.js +101 -0
- package/dist-lib/components/reui/alert.js +55 -0
- package/dist-lib/components/reui/aspect-ratio.js +11 -0
- package/dist-lib/components/reui/autocomplete.js +170 -0
- package/dist-lib/components/reui/avatar.js +51 -0
- package/dist-lib/components/reui/badge.js +64 -0
- package/dist-lib/components/reui/breadcrumb.js +69 -0
- package/dist-lib/components/reui/button-group.js +38 -0
- package/dist-lib/components/reui/button.js +47 -0
- package/dist-lib/components/reui/calendar.js +89 -0
- package/dist-lib/components/reui/card.js +55 -0
- package/dist-lib/components/reui/carousel.js +110 -0
- package/dist-lib/components/reui/chart.js +130 -0
- package/dist-lib/components/reui/checkbox.js +20 -0
- package/dist-lib/components/reui/collapsible.js +23 -0
- package/dist-lib/components/reui/combobox.js +166 -0
- package/dist-lib/components/reui/command.js +85 -0
- package/dist-lib/components/reui/context-menu.js +121 -0
- package/dist-lib/components/reui/data-grid/data-grid-column-filter.js +108 -0
- package/dist-lib/components/reui/data-grid/data-grid-column-header.js +217 -0
- package/dist-lib/components/reui/data-grid/data-grid-column-visibility.js +25 -0
- package/dist-lib/components/reui/data-grid/data-grid-pagination.js +132 -0
- package/dist-lib/components/reui/data-grid/data-grid-scroll-area.js +183 -0
- package/dist-lib/components/reui/data-grid/data-grid-table-dnd-rows.js +125 -0
- package/dist-lib/components/reui/data-grid/data-grid-table-dnd.js +130 -0
- package/dist-lib/components/reui/data-grid/data-grid-table-virtual.js +156 -0
- package/dist-lib/components/reui/data-grid/data-grid-table.js +546 -0
- package/dist-lib/components/reui/data-grid/data-grid.js +113 -0
- package/dist-lib/components/reui/data-grid-pagination.js +131 -0
- package/dist-lib/components/reui/date-selector.js +642 -0
- package/dist-lib/components/reui/dialog.js +94 -0
- package/dist-lib/components/reui/drawer.js +77 -0
- package/dist-lib/components/reui/dropdown-menu.js +123 -0
- package/dist-lib/components/reui/empty.js +59 -0
- package/dist-lib/components/reui/field.js +115 -0
- package/dist-lib/components/reui/filters.js +873 -0
- package/dist-lib/components/reui/frame.js +97 -0
- package/dist-lib/components/reui/hover-card.js +31 -0
- package/dist-lib/components/reui/icon-placeholder.js +14 -0
- package/dist-lib/components/reui/index.js +18 -0
- package/dist-lib/components/reui/input-group.js +78 -0
- package/dist-lib/components/reui/input-otp.js +44 -0
- package/dist-lib/components/reui/input.js +14 -0
- package/dist-lib/components/reui/item.js +116 -0
- package/dist-lib/components/reui/kanban.js +316 -0
- package/dist-lib/components/reui/kbd.js +19 -0
- package/dist-lib/components/reui/label.js +14 -0
- package/dist-lib/components/reui/menubar.js +132 -0
- package/dist-lib/components/reui/native-select.js +37 -0
- package/dist-lib/components/reui/navigation-menu.js +80 -0
- package/dist-lib/components/reui/number-field.js +126 -0
- package/dist-lib/components/reui/pagination.js +78 -0
- package/dist-lib/components/reui/phone-input.js +124 -0
- package/dist-lib/components/reui/popover.js +55 -0
- package/dist-lib/components/reui/progress.js +20 -0
- package/dist-lib/components/reui/radio-group.js +27 -0
- package/dist-lib/components/reui/rating.js +81 -0
- package/dist-lib/components/reui/resizable.js +31 -0
- package/dist-lib/components/reui/scroll-area.js +36 -0
- package/dist-lib/components/reui/scrollspy.js +104 -0
- package/dist-lib/components/reui/select.js +97 -0
- package/dist-lib/components/reui/separator.js +17 -0
- package/dist-lib/components/reui/sheet.js +81 -0
- package/dist-lib/components/reui/sidebar.js +350 -0
- package/dist-lib/components/reui/skeleton.js +12 -0
- package/dist-lib/components/reui/slider.js +35 -0
- package/dist-lib/components/reui/sonner.js +28 -0
- package/dist-lib/components/reui/sortable.js +172 -0
- package/dist-lib/components/reui/spinner.js +14 -0
- package/dist-lib/components/reui/stepper.js +193 -0
- package/dist-lib/components/reui/svgs/claudeAiIcon.js +13 -0
- package/dist-lib/components/reui/svgs/gemini.js +257 -0
- package/dist-lib/components/reui/svgs/openai.js +10 -0
- package/dist-lib/components/reui/svgs/openaiDark.js +13 -0
- package/dist-lib/components/reui/switch.js +19 -0
- package/dist-lib/components/reui/table.js +66 -0
- package/dist-lib/components/reui/tabs.js +47 -0
- package/dist-lib/components/reui/textarea.js +13 -0
- package/dist-lib/components/reui/timeline.js +84 -0
- package/dist-lib/components/reui/toggle-group.js +48 -0
- package/dist-lib/components/reui/toggle.js +36 -0
- package/dist-lib/components/reui/tooltip.js +35 -0
- package/dist-lib/components/reui/tree.js +102 -0
- package/dist-lib/i18n/I18nProvider.js +23 -0
- package/dist-lib/i18n/host-resolver.js +10 -0
- package/dist-lib/i18n/instance.js +2 -0
- package/dist-lib/i18n/locales/en/ui.json +266 -0
- package/dist-lib/i18n/locales/en/validators.json +13 -0
- package/dist-lib/i18n/locales/pt-BR/ui.json +266 -0
- package/dist-lib/i18n/locales/pt-BR/validators.json +13 -0
- package/dist-lib/i18n/register-strings.js +7 -0
- package/dist-lib/i18n/render-label.js +13 -0
- package/dist-lib/i18n/resolve-field-error.js +10 -0
- package/dist-lib/i18n/useHostString.js +31 -0
- package/dist-lib/i18n/useTranslation.js +48 -0
- package/dist-lib/lib/actions/resolve-action-target.js +48 -0
- package/dist-lib/lib/hooks/use-copy-to-clipboard.js +18 -0
- package/dist-lib/lib/hooks/use-file-upload.js +171 -0
- package/dist-lib/lib/hooks/use-mobile.js +18 -0
- package/dist-lib/lib/portal-container.js +7 -0
- package/dist-lib/lib/utils.js +8 -0
- package/dist-lib/middag-react.css +1 -1
- package/package.json +41 -8
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../lib/utils.js";
|
|
3
|
+
import { Button as t } from "./button.js";
|
|
4
|
+
import { useDataGrid as n } from "./data-grid/data-grid.js";
|
|
5
|
+
import { Select as r, SelectContent as i, SelectItem as a, SelectTrigger as o, SelectValue as s } from "./select.js";
|
|
6
|
+
import { Skeleton as c } from "./skeleton.js";
|
|
7
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
8
|
+
import { HugeiconsIcon as f } from "@hugeicons/react";
|
|
9
|
+
import { ArrowLeft01Icon as p, ArrowRight01Icon as m } from "@hugeicons/core-free-icons";
|
|
10
|
+
//#region src/components/reui/data-grid-pagination.tsx
|
|
11
|
+
function h(h) {
|
|
12
|
+
let { table: g, recordCount: _, isLoading: v } = n(), y = {
|
|
13
|
+
sizes: [
|
|
14
|
+
5,
|
|
15
|
+
10,
|
|
16
|
+
25,
|
|
17
|
+
50,
|
|
18
|
+
100
|
|
19
|
+
],
|
|
20
|
+
sizesLabel: "Show",
|
|
21
|
+
sizesDescription: "per page",
|
|
22
|
+
sizesSkeleton: /* @__PURE__ */ u(c, { className: "h-8 w-44" }),
|
|
23
|
+
moreLimit: 5,
|
|
24
|
+
more: !1,
|
|
25
|
+
info: "{from} - {to} of {count}",
|
|
26
|
+
infoSkeleton: /* @__PURE__ */ u(c, { className: "h-8 w-60" }),
|
|
27
|
+
rowsPerPageLabel: "Rows per page",
|
|
28
|
+
previousPageLabel: "Go to previous page",
|
|
29
|
+
nextPageLabel: "Go to next page",
|
|
30
|
+
ellipsisText: "...",
|
|
31
|
+
...h
|
|
32
|
+
}, b = "size-7 p-0 text-sm", x = b + " rtl:transform rtl:rotate-180", S = g.getState().pagination.pageIndex, C = g.getState().pagination.pageSize, w = S * C + 1, T = Math.min((S + 1) * C, _), E = g.getPageCount(), D = y?.info ? y.info.replace("{from}", w.toString()).replace("{to}", T.toString()).replace("{count}", _.toString()) : `${w} - ${T} of ${_}`, O = y?.moreLimit || 5, k = Math.floor(S / O) * O, A = Math.min(k + O, E), j = () => {
|
|
33
|
+
let n = [];
|
|
34
|
+
for (let r = k; r < A; r++) n.push(/* @__PURE__ */ u(t, {
|
|
35
|
+
size: "icon-sm",
|
|
36
|
+
variant: "ghost",
|
|
37
|
+
className: e(b, "text-muted-foreground", { "bg-accent text-accent-foreground": S === r }),
|
|
38
|
+
onClick: () => {
|
|
39
|
+
S !== r && g.setPageIndex(r);
|
|
40
|
+
},
|
|
41
|
+
children: r + 1
|
|
42
|
+
}, r));
|
|
43
|
+
return n;
|
|
44
|
+
}, M = () => k > 0 ? /* @__PURE__ */ u(t, {
|
|
45
|
+
size: "icon-sm",
|
|
46
|
+
className: b,
|
|
47
|
+
variant: "ghost",
|
|
48
|
+
onClick: () => g.setPageIndex(k - 1),
|
|
49
|
+
children: y.ellipsisText
|
|
50
|
+
}) : null, N = () => A < E ? /* @__PURE__ */ u(t, {
|
|
51
|
+
className: b,
|
|
52
|
+
variant: "ghost",
|
|
53
|
+
size: "icon-sm",
|
|
54
|
+
onClick: () => g.setPageIndex(A),
|
|
55
|
+
children: y.ellipsisText
|
|
56
|
+
}) : null;
|
|
57
|
+
return /* @__PURE__ */ d("div", {
|
|
58
|
+
"data-slot": "data-grid-pagination",
|
|
59
|
+
className: e("flex grow flex-col flex-wrap items-center justify-between gap-2.5 py-2.5 sm:flex-row sm:py-0", y?.className),
|
|
60
|
+
children: [/* @__PURE__ */ u("div", {
|
|
61
|
+
className: "order-2 flex flex-wrap items-center space-x-2.5 pb-2.5 sm:order-1 sm:pb-0",
|
|
62
|
+
children: v ? y?.sizesSkeleton : /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", {
|
|
63
|
+
className: "text-muted-foreground text-sm",
|
|
64
|
+
children: y.rowsPerPageLabel
|
|
65
|
+
}), /* @__PURE__ */ d(r, {
|
|
66
|
+
value: `${C}`,
|
|
67
|
+
onValueChange: (e) => {
|
|
68
|
+
let t = Number(e);
|
|
69
|
+
g.setPageSize(t);
|
|
70
|
+
},
|
|
71
|
+
children: [/* @__PURE__ */ u(o, {
|
|
72
|
+
className: "w-14",
|
|
73
|
+
size: "sm",
|
|
74
|
+
children: /* @__PURE__ */ u(s, {})
|
|
75
|
+
}), /* @__PURE__ */ u(i, {
|
|
76
|
+
side: "top",
|
|
77
|
+
className: "min-w-18",
|
|
78
|
+
children: y?.sizes?.map((e) => /* @__PURE__ */ u(a, {
|
|
79
|
+
value: `${e}`,
|
|
80
|
+
children: e
|
|
81
|
+
}, e))
|
|
82
|
+
})]
|
|
83
|
+
})] })
|
|
84
|
+
}), /* @__PURE__ */ u("div", {
|
|
85
|
+
className: "order-1 flex flex-col items-center justify-center gap-2.5 pt-2.5 sm:order-2 sm:flex-row sm:justify-end sm:pt-0",
|
|
86
|
+
children: v ? y?.infoSkeleton : /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", {
|
|
87
|
+
className: "text-muted-foreground order-2 text-sm text-nowrap sm:order-1",
|
|
88
|
+
children: D
|
|
89
|
+
}), E > 1 && /* @__PURE__ */ d("div", {
|
|
90
|
+
className: "order-1 flex items-center space-x-1 sm:order-2",
|
|
91
|
+
children: [
|
|
92
|
+
/* @__PURE__ */ d(t, {
|
|
93
|
+
size: "icon-sm",
|
|
94
|
+
variant: "ghost",
|
|
95
|
+
className: x,
|
|
96
|
+
onClick: () => g.previousPage(),
|
|
97
|
+
disabled: !g.getCanPreviousPage(),
|
|
98
|
+
children: [/* @__PURE__ */ u("span", {
|
|
99
|
+
className: "sr-only",
|
|
100
|
+
children: y.previousPageLabel
|
|
101
|
+
}), /* @__PURE__ */ u(f, {
|
|
102
|
+
icon: p,
|
|
103
|
+
strokeWidth: 2,
|
|
104
|
+
className: "size-4"
|
|
105
|
+
})]
|
|
106
|
+
}),
|
|
107
|
+
M(),
|
|
108
|
+
j(),
|
|
109
|
+
N(),
|
|
110
|
+
/* @__PURE__ */ d(t, {
|
|
111
|
+
size: "icon-sm",
|
|
112
|
+
variant: "ghost",
|
|
113
|
+
className: x,
|
|
114
|
+
onClick: () => g.nextPage(),
|
|
115
|
+
disabled: !g.getCanNextPage(),
|
|
116
|
+
children: [/* @__PURE__ */ u("span", {
|
|
117
|
+
className: "sr-only",
|
|
118
|
+
children: y.nextPageLabel
|
|
119
|
+
}), /* @__PURE__ */ u(f, {
|
|
120
|
+
icon: m,
|
|
121
|
+
strokeWidth: 2,
|
|
122
|
+
className: "size-4"
|
|
123
|
+
})]
|
|
124
|
+
})
|
|
125
|
+
]
|
|
126
|
+
})] })
|
|
127
|
+
})]
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
//#endregion
|
|
131
|
+
export { h as DataGridPagination };
|