@mercurjs/dashboard-shared 2.2.0-canary.34 → 2.2.0-canary.35
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/index.d.ts +6 -1
- package/dist/index.js +266 -197
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -21974,9 +21974,77 @@ function getHasUneditableRows(metadata) {
|
|
|
21974
21974
|
);
|
|
21975
21975
|
}
|
|
21976
21976
|
|
|
21977
|
+
// src/components/icons/list-badge.tsx
|
|
21978
|
+
import * as React8 from "react";
|
|
21979
|
+
import { jsx as jsx65, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
21980
|
+
var ListBadge = React8.forwardRef(
|
|
21981
|
+
({ color = "currentColor", ...props }, ref) => {
|
|
21982
|
+
return /* @__PURE__ */ jsxs43(
|
|
21983
|
+
"svg",
|
|
21984
|
+
{
|
|
21985
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
21986
|
+
width: 15,
|
|
21987
|
+
height: 15,
|
|
21988
|
+
viewBox: "0 0 15 15",
|
|
21989
|
+
fill: "none",
|
|
21990
|
+
ref,
|
|
21991
|
+
...props,
|
|
21992
|
+
children: [
|
|
21993
|
+
/* @__PURE__ */ jsx65("circle", { cx: 7.5, cy: 7.5, r: 7.5, fill: "#2563EB" }),
|
|
21994
|
+
/* @__PURE__ */ jsx65("circle", { cx: 7.5, cy: 7.5, r: 7.5, fill: "url(#list_badge_a)", fillOpacity: 0.2 }),
|
|
21995
|
+
/* @__PURE__ */ jsx65(
|
|
21996
|
+
"circle",
|
|
21997
|
+
{
|
|
21998
|
+
cx: 7.5,
|
|
21999
|
+
cy: 7.5,
|
|
22000
|
+
r: 7.25,
|
|
22001
|
+
stroke: color,
|
|
22002
|
+
strokeOpacity: 0.24,
|
|
22003
|
+
strokeWidth: 0.5
|
|
22004
|
+
}
|
|
22005
|
+
),
|
|
22006
|
+
/* @__PURE__ */ jsx65(
|
|
22007
|
+
"path",
|
|
22008
|
+
{
|
|
22009
|
+
d: "M10.23 4.25H4.77C4.48281 4.25 4.25 4.48281 4.25 4.77V6.59C4.25 6.87719 4.48281 7.11 4.77 7.11H10.23C10.5172 7.11 10.75 6.87719 10.75 6.59V4.77C10.75 4.48281 10.5172 4.25 10.23 4.25Z",
|
|
22010
|
+
fill: "#fff"
|
|
22011
|
+
}
|
|
22012
|
+
),
|
|
22013
|
+
/* @__PURE__ */ jsx65(
|
|
22014
|
+
"path",
|
|
22015
|
+
{
|
|
22016
|
+
d: "M4.25 8.93H10.75M4.25 10.75H10.75M4.77 4.25H10.23C10.5172 4.25 10.75 4.48281 10.75 4.77V6.59C10.75 6.87719 10.5172 7.11 10.23 7.11H4.77C4.48281 7.11 4.25 6.87719 4.25 6.59V4.77C4.25 4.48281 4.48281 4.25 4.77 4.25Z",
|
|
22017
|
+
stroke: "#fff",
|
|
22018
|
+
strokeWidth: 0.8,
|
|
22019
|
+
strokeLinecap: "round",
|
|
22020
|
+
strokeLinejoin: "round"
|
|
22021
|
+
}
|
|
22022
|
+
),
|
|
22023
|
+
/* @__PURE__ */ jsx65("defs", { children: /* @__PURE__ */ jsxs43(
|
|
22024
|
+
"linearGradient",
|
|
22025
|
+
{
|
|
22026
|
+
id: "list_badge_a",
|
|
22027
|
+
x1: 7.5,
|
|
22028
|
+
x2: 7.5,
|
|
22029
|
+
y1: 0,
|
|
22030
|
+
y2: 15,
|
|
22031
|
+
gradientUnits: "userSpaceOnUse",
|
|
22032
|
+
children: [
|
|
22033
|
+
/* @__PURE__ */ jsx65("stop", { stopColor: "#fff" }),
|
|
22034
|
+
/* @__PURE__ */ jsx65("stop", { offset: 1, stopColor: "#fff", stopOpacity: 0 })
|
|
22035
|
+
]
|
|
22036
|
+
}
|
|
22037
|
+
) })
|
|
22038
|
+
]
|
|
22039
|
+
}
|
|
22040
|
+
);
|
|
22041
|
+
}
|
|
22042
|
+
);
|
|
22043
|
+
ListBadge.displayName = "ListBadge";
|
|
22044
|
+
|
|
21977
22045
|
// src/components/layout/pages/single-column-page/single-column-page.tsx
|
|
21978
22046
|
import { Outlet } from "react-router-dom";
|
|
21979
|
-
import { jsx as
|
|
22047
|
+
import { jsx as jsx66, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
21980
22048
|
var SingleColumnPage = ({
|
|
21981
22049
|
children,
|
|
21982
22050
|
/**
|
|
@@ -22012,11 +22080,11 @@ var SingleColumnPage = ({
|
|
|
22012
22080
|
}
|
|
22013
22081
|
showMetadata = false;
|
|
22014
22082
|
}
|
|
22015
|
-
return /* @__PURE__ */
|
|
22083
|
+
return /* @__PURE__ */ jsxs44("div", { className: "flex flex-col gap-y-3", children: [
|
|
22016
22084
|
children,
|
|
22017
|
-
showMetadata && /* @__PURE__ */
|
|
22018
|
-
showJSON && /* @__PURE__ */
|
|
22019
|
-
hasOutlet && /* @__PURE__ */
|
|
22085
|
+
showMetadata && /* @__PURE__ */ jsx66(MetadataSection, { data }),
|
|
22086
|
+
showJSON && /* @__PURE__ */ jsx66(JsonViewSection, { data }),
|
|
22087
|
+
hasOutlet && /* @__PURE__ */ jsx66(Outlet, {})
|
|
22020
22088
|
] });
|
|
22021
22089
|
};
|
|
22022
22090
|
|
|
@@ -22024,7 +22092,7 @@ var SingleColumnPage = ({
|
|
|
22024
22092
|
import { clx as clx35 } from "@medusajs/ui";
|
|
22025
22093
|
import { Children as Children2 } from "react";
|
|
22026
22094
|
import { Outlet as Outlet2 } from "react-router-dom";
|
|
22027
|
-
import { jsx as
|
|
22095
|
+
import { jsx as jsx67, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
22028
22096
|
var Root5 = ({
|
|
22029
22097
|
children,
|
|
22030
22098
|
/**
|
|
@@ -22066,24 +22134,24 @@ var Root5 = ({
|
|
|
22066
22134
|
}
|
|
22067
22135
|
const [main, sidebar] = childrenArray;
|
|
22068
22136
|
const showExtraData = showJSON || showMetadata;
|
|
22069
|
-
return /* @__PURE__ */
|
|
22070
|
-
/* @__PURE__ */
|
|
22071
|
-
/* @__PURE__ */
|
|
22137
|
+
return /* @__PURE__ */ jsxs45("div", { className: "flex w-full flex-col gap-y-3", children: [
|
|
22138
|
+
/* @__PURE__ */ jsxs45("div", { className: "flex w-full flex-col items-start gap-x-4 gap-y-3 xl:grid xl:grid-cols-[minmax(0,_1fr)_440px]", children: [
|
|
22139
|
+
/* @__PURE__ */ jsxs45("div", { className: "flex w-full min-w-0 flex-col gap-y-3", children: [
|
|
22072
22140
|
main,
|
|
22073
|
-
showExtraData && /* @__PURE__ */
|
|
22074
|
-
showMetadata && /* @__PURE__ */
|
|
22075
|
-
showJSON && /* @__PURE__ */
|
|
22141
|
+
showExtraData && /* @__PURE__ */ jsxs45("div", { className: "hidden flex-col gap-y-3 xl:flex", children: [
|
|
22142
|
+
showMetadata && /* @__PURE__ */ jsx67(MetadataSection, { data }),
|
|
22143
|
+
showJSON && /* @__PURE__ */ jsx67(JsonViewSection, { data })
|
|
22076
22144
|
] })
|
|
22077
22145
|
] }),
|
|
22078
|
-
/* @__PURE__ */
|
|
22146
|
+
/* @__PURE__ */ jsxs45("div", { className: "flex w-full flex-col gap-y-3 xl:mt-0", children: [
|
|
22079
22147
|
sidebar,
|
|
22080
|
-
showExtraData && /* @__PURE__ */
|
|
22081
|
-
showMetadata && /* @__PURE__ */
|
|
22082
|
-
showJSON && /* @__PURE__ */
|
|
22148
|
+
showExtraData && /* @__PURE__ */ jsxs45("div", { className: "flex flex-col gap-y-3 xl:hidden", children: [
|
|
22149
|
+
showMetadata && /* @__PURE__ */ jsx67(MetadataSection, { data }),
|
|
22150
|
+
showJSON && /* @__PURE__ */ jsx67(JsonViewSection, { data })
|
|
22083
22151
|
] })
|
|
22084
22152
|
] })
|
|
22085
22153
|
] }),
|
|
22086
|
-
hasOutlet && /* @__PURE__ */
|
|
22154
|
+
hasOutlet && /* @__PURE__ */ jsx67(Outlet2, {})
|
|
22087
22155
|
] });
|
|
22088
22156
|
};
|
|
22089
22157
|
var Main = ({
|
|
@@ -22091,14 +22159,14 @@ var Main = ({
|
|
|
22091
22159
|
className,
|
|
22092
22160
|
...props
|
|
22093
22161
|
}) => {
|
|
22094
|
-
return /* @__PURE__ */
|
|
22162
|
+
return /* @__PURE__ */ jsx67("div", { className: clx35("flex w-full flex-col gap-y-3", className), ...props, children });
|
|
22095
22163
|
};
|
|
22096
22164
|
var Sidebar = ({
|
|
22097
22165
|
children,
|
|
22098
22166
|
className,
|
|
22099
22167
|
...props
|
|
22100
22168
|
}) => {
|
|
22101
|
-
return /* @__PURE__ */
|
|
22169
|
+
return /* @__PURE__ */ jsx67(
|
|
22102
22170
|
"div",
|
|
22103
22171
|
{
|
|
22104
22172
|
className: clx35(
|
|
@@ -22189,7 +22257,7 @@ var useTabManagement = ({
|
|
|
22189
22257
|
};
|
|
22190
22258
|
|
|
22191
22259
|
// src/components/tabbed-form/tabbed-form.tsx
|
|
22192
|
-
import { jsx as
|
|
22260
|
+
import { jsx as jsx68, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
22193
22261
|
var TabbedFormContext = createContext7(null);
|
|
22194
22262
|
var useTabbedForm = () => {
|
|
22195
22263
|
const form = useContext7(TabbedFormContext);
|
|
@@ -22259,7 +22327,7 @@ function Root6({
|
|
|
22259
22327
|
const meta = resolveTabMeta(el);
|
|
22260
22328
|
return meta && visibleTabs.some((vt) => vt.id === meta.id);
|
|
22261
22329
|
});
|
|
22262
|
-
return /* @__PURE__ */
|
|
22330
|
+
return /* @__PURE__ */ jsx68(TabbedFormContext.Provider, { value: form, children: /* @__PURE__ */ jsx68(RouteFocusModal.Form, { form, children: /* @__PURE__ */ jsxs46(
|
|
22263
22331
|
KeyboundForm,
|
|
22264
22332
|
{
|
|
22265
22333
|
onKeyDown: (e) => {
|
|
@@ -22282,14 +22350,14 @@ function Root6({
|
|
|
22282
22350
|
onSubmit,
|
|
22283
22351
|
className: "flex h-full flex-col",
|
|
22284
22352
|
children: [
|
|
22285
|
-
/* @__PURE__ */
|
|
22353
|
+
/* @__PURE__ */ jsxs46(
|
|
22286
22354
|
ProgressTabs,
|
|
22287
22355
|
{
|
|
22288
22356
|
value: activeTabId,
|
|
22289
22357
|
onValueChange: onTabChange,
|
|
22290
22358
|
className: "flex h-full flex-col overflow-hidden",
|
|
22291
22359
|
children: [
|
|
22292
|
-
/* @__PURE__ */
|
|
22360
|
+
/* @__PURE__ */ jsx68(RouteFocusModal.Header, { children: /* @__PURE__ */ jsx68("div", { className: "-my-2 w-full border-l", children: /* @__PURE__ */ jsx68(ProgressTabs.List, { className: "justify-start-start flex w-full items-center", children: visibleTabs.map((tab) => /* @__PURE__ */ jsx68(
|
|
22293
22361
|
ProgressTabs.Trigger,
|
|
22294
22362
|
{
|
|
22295
22363
|
status: tabState[tab.id] ?? "not-started",
|
|
@@ -22299,9 +22367,9 @@ function Root6({
|
|
|
22299
22367
|
},
|
|
22300
22368
|
tab.id
|
|
22301
22369
|
)) }) }) }),
|
|
22302
|
-
/* @__PURE__ */
|
|
22370
|
+
/* @__PURE__ */ jsx68(RouteFocusModal.Body, { className: "size-full overflow-hidden", children: visibleElements.map((element) => {
|
|
22303
22371
|
const meta = resolveTabMeta(element);
|
|
22304
|
-
return /* @__PURE__ */
|
|
22372
|
+
return /* @__PURE__ */ jsx68(
|
|
22305
22373
|
ProgressTabs.Content,
|
|
22306
22374
|
{
|
|
22307
22375
|
className: "size-full overflow-y-auto",
|
|
@@ -22314,7 +22382,7 @@ function Root6({
|
|
|
22314
22382
|
]
|
|
22315
22383
|
}
|
|
22316
22384
|
),
|
|
22317
|
-
/* @__PURE__ */
|
|
22385
|
+
/* @__PURE__ */ jsx68(RouteFocusModal.Footer, { children: footer ? footer({ isLastTab, onNext, isLoading }) : /* @__PURE__ */ jsx68(
|
|
22318
22386
|
DefaultFooter,
|
|
22319
22387
|
{
|
|
22320
22388
|
isLastTab,
|
|
@@ -22332,9 +22400,9 @@ var DefaultFooter = ({
|
|
|
22332
22400
|
isLoading
|
|
22333
22401
|
}) => {
|
|
22334
22402
|
const { t: t2 } = useTranslation25();
|
|
22335
|
-
return /* @__PURE__ */
|
|
22336
|
-
/* @__PURE__ */
|
|
22337
|
-
isLastTab ? /* @__PURE__ */
|
|
22403
|
+
return /* @__PURE__ */ jsxs46("div", { className: "flex items-center justify-end gap-x-2", children: [
|
|
22404
|
+
/* @__PURE__ */ jsx68(RouteFocusModal.Close, { asChild: true, children: /* @__PURE__ */ jsx68(Button9, { variant: "secondary", size: "small", children: t2("actions.cancel") }) }),
|
|
22405
|
+
isLastTab ? /* @__PURE__ */ jsx68(
|
|
22338
22406
|
Button9,
|
|
22339
22407
|
{
|
|
22340
22408
|
type: "submit",
|
|
@@ -22344,7 +22412,7 @@ var DefaultFooter = ({
|
|
|
22344
22412
|
children: t2("actions.save")
|
|
22345
22413
|
},
|
|
22346
22414
|
"submit-button"
|
|
22347
|
-
) : /* @__PURE__ */
|
|
22415
|
+
) : /* @__PURE__ */ jsx68(
|
|
22348
22416
|
Button9,
|
|
22349
22417
|
{
|
|
22350
22418
|
type: "button",
|
|
@@ -22360,7 +22428,7 @@ var DefaultFooter = ({
|
|
|
22360
22428
|
var Tab = ({
|
|
22361
22429
|
children
|
|
22362
22430
|
}) => {
|
|
22363
|
-
return /* @__PURE__ */
|
|
22431
|
+
return /* @__PURE__ */ jsx68("div", { className: "flex flex-col items-center p-16", children: /* @__PURE__ */ jsx68("div", { className: "flex w-full max-w-[720px] flex-col gap-y-8", children }) });
|
|
22364
22432
|
};
|
|
22365
22433
|
var TabbedForm = Object.assign(Root6, { Tab, useForm: useTabbedForm });
|
|
22366
22434
|
|
|
@@ -22469,7 +22537,7 @@ import { XMarkMini as XMarkMini3 } from "@medusajs/icons";
|
|
|
22469
22537
|
import { Text as Text14, clx as clx36 } from "@medusajs/ui";
|
|
22470
22538
|
import { Popover as RadixPopover2 } from "radix-ui";
|
|
22471
22539
|
import { useTranslation as useTranslation26 } from "react-i18next";
|
|
22472
|
-
import { jsx as
|
|
22540
|
+
import { jsx as jsx69, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
22473
22541
|
var FilterChip = ({
|
|
22474
22542
|
hadPreviousValue,
|
|
22475
22543
|
label,
|
|
@@ -22483,9 +22551,9 @@ var FilterChip = ({
|
|
|
22483
22551
|
e.stopPropagation();
|
|
22484
22552
|
onRemove();
|
|
22485
22553
|
};
|
|
22486
|
-
return /* @__PURE__ */
|
|
22487
|
-
!hadPreviousValue && /* @__PURE__ */
|
|
22488
|
-
/* @__PURE__ */
|
|
22554
|
+
return /* @__PURE__ */ jsxs47("div", { className: "bg-ui-bg-field transition-fg shadow-borders-base text-ui-fg-subtle flex cursor-default select-none items-stretch overflow-hidden rounded-md", children: [
|
|
22555
|
+
!hadPreviousValue && /* @__PURE__ */ jsx69(RadixPopover2.Anchor, {}),
|
|
22556
|
+
/* @__PURE__ */ jsx69(
|
|
22489
22557
|
"div",
|
|
22490
22558
|
{
|
|
22491
22559
|
className: clx36(
|
|
@@ -22494,11 +22562,11 @@ var FilterChip = ({
|
|
|
22494
22562
|
"border-r": !!(value || hadPreviousValue)
|
|
22495
22563
|
}
|
|
22496
22564
|
),
|
|
22497
|
-
children: /* @__PURE__ */
|
|
22565
|
+
children: /* @__PURE__ */ jsx69(Text14, { size: "small", weight: "plus", leading: "compact", children: label })
|
|
22498
22566
|
}
|
|
22499
22567
|
),
|
|
22500
|
-
/* @__PURE__ */
|
|
22501
|
-
hasOperator && !!(value || hadPreviousValue) && /* @__PURE__ */
|
|
22568
|
+
/* @__PURE__ */ jsxs47("div", { className: "flex w-full items-center overflow-hidden", children: [
|
|
22569
|
+
hasOperator && !!(value || hadPreviousValue) && /* @__PURE__ */ jsx69("div", { className: "border-r p-1 px-2", children: /* @__PURE__ */ jsx69(
|
|
22502
22570
|
Text14,
|
|
22503
22571
|
{
|
|
22504
22572
|
size: "small",
|
|
@@ -22508,7 +22576,7 @@ var FilterChip = ({
|
|
|
22508
22576
|
children: t2("general.is")
|
|
22509
22577
|
}
|
|
22510
22578
|
) }),
|
|
22511
|
-
!!(value || hadPreviousValue) && /* @__PURE__ */
|
|
22579
|
+
!!(value || hadPreviousValue) && /* @__PURE__ */ jsx69(
|
|
22512
22580
|
RadixPopover2.Trigger,
|
|
22513
22581
|
{
|
|
22514
22582
|
asChild: true,
|
|
@@ -22519,7 +22587,7 @@ var FilterChip = ({
|
|
|
22519
22587
|
"data-[state=open]:bg-ui-bg-field-hover": !readonly
|
|
22520
22588
|
}
|
|
22521
22589
|
),
|
|
22522
|
-
children: /* @__PURE__ */
|
|
22590
|
+
children: /* @__PURE__ */ jsx69(
|
|
22523
22591
|
Text14,
|
|
22524
22592
|
{
|
|
22525
22593
|
size: "small",
|
|
@@ -22532,7 +22600,7 @@ var FilterChip = ({
|
|
|
22532
22600
|
}
|
|
22533
22601
|
)
|
|
22534
22602
|
] }),
|
|
22535
|
-
!readonly && !!(value || hadPreviousValue) && /* @__PURE__ */
|
|
22603
|
+
!readonly && !!(value || hadPreviousValue) && /* @__PURE__ */ jsx69(
|
|
22536
22604
|
"button",
|
|
22537
22605
|
{
|
|
22538
22606
|
onClick: handleRemove,
|
|
@@ -22541,7 +22609,7 @@ var FilterChip = ({
|
|
|
22541
22609
|
"hover:bg-ui-bg-subtle-hover",
|
|
22542
22610
|
"active:bg-ui-bg-subtle-pressed active:text-ui-fg-base"
|
|
22543
22611
|
),
|
|
22544
|
-
children: /* @__PURE__ */
|
|
22612
|
+
children: /* @__PURE__ */ jsx69(XMarkMini3, {})
|
|
22545
22613
|
}
|
|
22546
22614
|
)
|
|
22547
22615
|
] });
|
|
@@ -22549,7 +22617,7 @@ var FilterChip = ({
|
|
|
22549
22617
|
var filter_chip_default = FilterChip;
|
|
22550
22618
|
|
|
22551
22619
|
// src/components/table/data-table/data-table-filter/date-filter.tsx
|
|
22552
|
-
import { jsx as
|
|
22620
|
+
import { jsx as jsx70, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
22553
22621
|
var DateFilter = ({
|
|
22554
22622
|
filter,
|
|
22555
22623
|
prefix,
|
|
@@ -22623,8 +22691,8 @@ var DateFilter = ({
|
|
|
22623
22691
|
}, 200);
|
|
22624
22692
|
}
|
|
22625
22693
|
};
|
|
22626
|
-
return /* @__PURE__ */
|
|
22627
|
-
/* @__PURE__ */
|
|
22694
|
+
return /* @__PURE__ */ jsxs48(RadixPopover3.Root, { modal: true, open, onOpenChange: handleOpenChange, children: [
|
|
22695
|
+
/* @__PURE__ */ jsx70(
|
|
22628
22696
|
filter_chip_default,
|
|
22629
22697
|
{
|
|
22630
22698
|
hadPreviousValue: !!previousValue,
|
|
@@ -22634,7 +22702,7 @@ var DateFilter = ({
|
|
|
22634
22702
|
readonly
|
|
22635
22703
|
}
|
|
22636
22704
|
),
|
|
22637
|
-
!readonly && /* @__PURE__ */
|
|
22705
|
+
!readonly && /* @__PURE__ */ jsx70(RadixPopover3.Portal, { children: /* @__PURE__ */ jsxs48(
|
|
22638
22706
|
RadixPopover3.Content,
|
|
22639
22707
|
{
|
|
22640
22708
|
"data-name": "date_filter_content",
|
|
@@ -22652,10 +22720,10 @@ var DateFilter = ({
|
|
|
22652
22720
|
}
|
|
22653
22721
|
},
|
|
22654
22722
|
children: [
|
|
22655
|
-
/* @__PURE__ */
|
|
22723
|
+
/* @__PURE__ */ jsxs48("ul", { className: "w-full p-1", children: [
|
|
22656
22724
|
presets.map((preset) => {
|
|
22657
22725
|
const isSelected = selectedParams.get().includes(JSON.stringify(preset.value));
|
|
22658
|
-
return /* @__PURE__ */
|
|
22726
|
+
return /* @__PURE__ */ jsx70("li", { children: /* @__PURE__ */ jsxs48(
|
|
22659
22727
|
"button",
|
|
22660
22728
|
{
|
|
22661
22729
|
className: "bg-ui-bg-base hover:bg-ui-bg-base-hover focus-visible:bg-ui-bg-base-pressed text-ui-fg-base data-[disabled]:text-ui-fg-disabled txt-compact-small relative flex w-full cursor-pointer select-none items-center rounded-md px-2 py-1.5 outline-none transition-colors data-[disabled]:pointer-events-none",
|
|
@@ -22664,7 +22732,7 @@ var DateFilter = ({
|
|
|
22664
22732
|
handleSelectPreset(preset.value);
|
|
22665
22733
|
},
|
|
22666
22734
|
children: [
|
|
22667
|
-
/* @__PURE__ */
|
|
22735
|
+
/* @__PURE__ */ jsx70(
|
|
22668
22736
|
"div",
|
|
22669
22737
|
{
|
|
22670
22738
|
className: clx37(
|
|
@@ -22673,7 +22741,7 @@ var DateFilter = ({
|
|
|
22673
22741
|
"[&_svg]:invisible": !isSelected
|
|
22674
22742
|
}
|
|
22675
22743
|
),
|
|
22676
|
-
children: /* @__PURE__ */
|
|
22744
|
+
children: /* @__PURE__ */ jsx70(EllipseMiniSolid, {})
|
|
22677
22745
|
}
|
|
22678
22746
|
),
|
|
22679
22747
|
preset.label
|
|
@@ -22681,14 +22749,14 @@ var DateFilter = ({
|
|
|
22681
22749
|
}
|
|
22682
22750
|
) }, preset.label);
|
|
22683
22751
|
}),
|
|
22684
|
-
/* @__PURE__ */
|
|
22752
|
+
/* @__PURE__ */ jsx70("li", { children: /* @__PURE__ */ jsxs48(
|
|
22685
22753
|
"button",
|
|
22686
22754
|
{
|
|
22687
22755
|
className: "bg-ui-bg-base hover:bg-ui-bg-base-hover focus-visible:bg-ui-bg-base-pressed text-ui-fg-base data-[disabled]:text-ui-fg-disabled txt-compact-small relative flex w-full cursor-pointer select-none items-center rounded-md px-2 py-1.5 outline-none transition-colors data-[disabled]:pointer-events-none",
|
|
22688
22756
|
type: "button",
|
|
22689
22757
|
onClick: handleSelectCustom,
|
|
22690
22758
|
children: [
|
|
22691
|
-
/* @__PURE__ */
|
|
22759
|
+
/* @__PURE__ */ jsx70(
|
|
22692
22760
|
"div",
|
|
22693
22761
|
{
|
|
22694
22762
|
className: clx37(
|
|
@@ -22697,7 +22765,7 @@ var DateFilter = ({
|
|
|
22697
22765
|
"[&_svg]:invisible": !showCustom
|
|
22698
22766
|
}
|
|
22699
22767
|
),
|
|
22700
|
-
children: /* @__PURE__ */
|
|
22768
|
+
children: /* @__PURE__ */ jsx70(EllipseMiniSolid, {})
|
|
22701
22769
|
}
|
|
22702
22770
|
),
|
|
22703
22771
|
t("filters.date.custom")
|
|
@@ -22705,10 +22773,10 @@ var DateFilter = ({
|
|
|
22705
22773
|
}
|
|
22706
22774
|
) })
|
|
22707
22775
|
] }),
|
|
22708
|
-
showCustom && /* @__PURE__ */
|
|
22709
|
-
/* @__PURE__ */
|
|
22710
|
-
/* @__PURE__ */
|
|
22711
|
-
/* @__PURE__ */
|
|
22776
|
+
showCustom && /* @__PURE__ */ jsxs48("div", { className: "border-t px-1 pb-3 pt-1", children: [
|
|
22777
|
+
/* @__PURE__ */ jsxs48("div", { children: [
|
|
22778
|
+
/* @__PURE__ */ jsx70("div", { className: "px-2 py-1", children: /* @__PURE__ */ jsx70(Text15, { size: "xsmall", leading: "compact", weight: "plus", children: t("filters.date.from") }) }),
|
|
22779
|
+
/* @__PURE__ */ jsx70("div", { className: "px-2 py-1", children: /* @__PURE__ */ jsx70(
|
|
22712
22780
|
DatePicker,
|
|
22713
22781
|
{
|
|
22714
22782
|
modal: true,
|
|
@@ -22718,9 +22786,9 @@ var DateFilter = ({
|
|
|
22718
22786
|
}
|
|
22719
22787
|
) })
|
|
22720
22788
|
] }),
|
|
22721
|
-
/* @__PURE__ */
|
|
22722
|
-
/* @__PURE__ */
|
|
22723
|
-
/* @__PURE__ */
|
|
22789
|
+
/* @__PURE__ */ jsxs48("div", { children: [
|
|
22790
|
+
/* @__PURE__ */ jsx70("div", { className: "px-2 py-1", children: /* @__PURE__ */ jsx70(Text15, { size: "xsmall", leading: "compact", weight: "plus", children: t("filters.date.to") }) }),
|
|
22791
|
+
/* @__PURE__ */ jsx70("div", { className: "px-2 py-1", children: /* @__PURE__ */ jsx70(
|
|
22724
22792
|
DatePicker,
|
|
22725
22793
|
{
|
|
22726
22794
|
modal: true,
|
|
@@ -22814,7 +22882,7 @@ import {
|
|
|
22814
22882
|
} from "radix-ui";
|
|
22815
22883
|
import { useCallback as useCallback21, useEffect as useEffect19, useState as useState27 } from "react";
|
|
22816
22884
|
import { useTranslation as useTranslation28 } from "react-i18next";
|
|
22817
|
-
import { jsx as
|
|
22885
|
+
import { jsx as jsx71, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
22818
22886
|
var NumberFilter = ({
|
|
22819
22887
|
filter,
|
|
22820
22888
|
prefix,
|
|
@@ -22911,8 +22979,8 @@ var NumberFilter = ({
|
|
|
22911
22979
|
const EQ_KEY = key;
|
|
22912
22980
|
const displayValue = parseDisplayValue(currentValue, t2);
|
|
22913
22981
|
const previousDisplayValue = parseDisplayValue(previousValue, t2);
|
|
22914
|
-
return /* @__PURE__ */
|
|
22915
|
-
/* @__PURE__ */
|
|
22982
|
+
return /* @__PURE__ */ jsxs49(RadixPopover4.Root, { modal: true, open, onOpenChange: handleOpenChange, children: [
|
|
22983
|
+
/* @__PURE__ */ jsx71(
|
|
22916
22984
|
filter_chip_default,
|
|
22917
22985
|
{
|
|
22918
22986
|
hasOperator: true,
|
|
@@ -22923,7 +22991,7 @@ var NumberFilter = ({
|
|
|
22923
22991
|
readonly
|
|
22924
22992
|
}
|
|
22925
22993
|
),
|
|
22926
|
-
!readonly && /* @__PURE__ */
|
|
22994
|
+
!readonly && /* @__PURE__ */ jsx71(RadixPopover4.Portal, { children: /* @__PURE__ */ jsxs49(
|
|
22927
22995
|
RadixPopover4.Content,
|
|
22928
22996
|
{
|
|
22929
22997
|
"data-name": "number_filter_content",
|
|
@@ -22941,30 +23009,30 @@ var NumberFilter = ({
|
|
|
22941
23009
|
}
|
|
22942
23010
|
},
|
|
22943
23011
|
children: [
|
|
22944
|
-
/* @__PURE__ */
|
|
23012
|
+
/* @__PURE__ */ jsx71("div", { className: "p-1", children: /* @__PURE__ */ jsx71(
|
|
22945
23013
|
RadixRadioGroup.Root,
|
|
22946
23014
|
{
|
|
22947
23015
|
value: operator,
|
|
22948
23016
|
onValueChange: (val) => setOperator(val),
|
|
22949
23017
|
className: "flex flex-col items-start",
|
|
22950
23018
|
orientation: "vertical",
|
|
22951
|
-
children: operators.map((o) => /* @__PURE__ */
|
|
23019
|
+
children: operators.map((o) => /* @__PURE__ */ jsxs49(
|
|
22952
23020
|
RadixRadioGroup.Item,
|
|
22953
23021
|
{
|
|
22954
23022
|
value: o.operator,
|
|
22955
23023
|
className: "txt-compact-small hover:bg-ui-bg-base-hover focus-visible:bg-ui-bg-base-hover active:bg-ui-bg-base-pressed transition-fg grid w-full grid-cols-[20px_1fr] gap-2 rounded-[4px] px-2 py-1.5 text-left outline-none",
|
|
22956
23024
|
children: [
|
|
22957
|
-
/* @__PURE__ */
|
|
22958
|
-
/* @__PURE__ */
|
|
23025
|
+
/* @__PURE__ */ jsx71("div", { className: "size-5", children: /* @__PURE__ */ jsx71(RadixRadioGroup.Indicator, { children: /* @__PURE__ */ jsx71(EllipseMiniSolid2, {}) }) }),
|
|
23026
|
+
/* @__PURE__ */ jsx71("span", { className: "w-full", children: o.label })
|
|
22959
23027
|
]
|
|
22960
23028
|
},
|
|
22961
23029
|
o.operator
|
|
22962
23030
|
))
|
|
22963
23031
|
}
|
|
22964
23032
|
) }),
|
|
22965
|
-
/* @__PURE__ */
|
|
22966
|
-
/* @__PURE__ */
|
|
22967
|
-
/* @__PURE__ */
|
|
23033
|
+
/* @__PURE__ */ jsx71("div", { children: operator === "range" ? /* @__PURE__ */ jsxs49("div", { className: "px-1 pb-3 pt-1", children: [
|
|
23034
|
+
/* @__PURE__ */ jsx71("div", { className: "px-2 py-1.5", children: /* @__PURE__ */ jsx71(Label3, { size: "xsmall", weight: "plus", htmlFor: GT_KEY, children: t2("filters.compare.greaterThan") }) }),
|
|
23035
|
+
/* @__PURE__ */ jsx71("div", { className: "px-2 py-0.5", children: /* @__PURE__ */ jsx71(
|
|
22968
23036
|
Input5,
|
|
22969
23037
|
{
|
|
22970
23038
|
name: GT_KEY,
|
|
@@ -22974,8 +23042,8 @@ var NumberFilter = ({
|
|
|
22974
23042
|
onChange: (e) => debouncedOnChange(e, "gt")
|
|
22975
23043
|
}
|
|
22976
23044
|
) }),
|
|
22977
|
-
/* @__PURE__ */
|
|
22978
|
-
/* @__PURE__ */
|
|
23045
|
+
/* @__PURE__ */ jsx71("div", { className: "px-2 py-1.5", children: /* @__PURE__ */ jsx71(Label3, { size: "xsmall", weight: "plus", htmlFor: LT_KEY, children: t2("filters.compare.lessThan") }) }),
|
|
23046
|
+
/* @__PURE__ */ jsx71("div", { className: "px-2 py-0.5", children: /* @__PURE__ */ jsx71(
|
|
22979
23047
|
Input5,
|
|
22980
23048
|
{
|
|
22981
23049
|
name: LT_KEY,
|
|
@@ -22985,9 +23053,9 @@ var NumberFilter = ({
|
|
|
22985
23053
|
onChange: (e) => debouncedOnChange(e, "lt")
|
|
22986
23054
|
}
|
|
22987
23055
|
) })
|
|
22988
|
-
] }, "range") : /* @__PURE__ */
|
|
22989
|
-
/* @__PURE__ */
|
|
22990
|
-
/* @__PURE__ */
|
|
23056
|
+
] }, "range") : /* @__PURE__ */ jsxs49("div", { className: "px-1 pb-3 pt-1", children: [
|
|
23057
|
+
/* @__PURE__ */ jsx71("div", { className: "px-2 py-1.5", children: /* @__PURE__ */ jsx71(Label3, { size: "xsmall", weight: "plus", htmlFor: EQ_KEY, children: label }) }),
|
|
23058
|
+
/* @__PURE__ */ jsx71("div", { className: "px-2 py-0.5", children: /* @__PURE__ */ jsx71(
|
|
22991
23059
|
Input5,
|
|
22992
23060
|
{
|
|
22993
23061
|
name: EQ_KEY,
|
|
@@ -23057,7 +23125,7 @@ import { Command } from "cmdk";
|
|
|
23057
23125
|
import { Popover as RadixPopover5 } from "radix-ui";
|
|
23058
23126
|
import { useState as useState28 } from "react";
|
|
23059
23127
|
import { useTranslation as useTranslation29 } from "react-i18next";
|
|
23060
|
-
import { jsx as
|
|
23128
|
+
import { jsx as jsx72, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
23061
23129
|
var SelectFilter = ({
|
|
23062
23130
|
filter,
|
|
23063
23131
|
prefix,
|
|
@@ -23110,8 +23178,8 @@ var SelectFilter = ({
|
|
|
23110
23178
|
};
|
|
23111
23179
|
const normalizedValues = labelValues ? Array.isArray(labelValues) ? labelValues : [labelValues] : null;
|
|
23112
23180
|
const normalizedPrev = previousValue ? Array.isArray(previousValue) ? previousValue : [previousValue] : null;
|
|
23113
|
-
return /* @__PURE__ */
|
|
23114
|
-
/* @__PURE__ */
|
|
23181
|
+
return /* @__PURE__ */ jsxs50(RadixPopover5.Root, { modal: true, open, onOpenChange: handleOpenChange, children: [
|
|
23182
|
+
/* @__PURE__ */ jsx72(
|
|
23115
23183
|
filter_chip_default,
|
|
23116
23184
|
{
|
|
23117
23185
|
hasOperator: true,
|
|
@@ -23122,7 +23190,7 @@ var SelectFilter = ({
|
|
|
23122
23190
|
onRemove: handleRemove
|
|
23123
23191
|
}
|
|
23124
23192
|
),
|
|
23125
|
-
!readonly && /* @__PURE__ */
|
|
23193
|
+
!readonly && /* @__PURE__ */ jsx72(RadixPopover5.Portal, { children: /* @__PURE__ */ jsx72(
|
|
23126
23194
|
RadixPopover5.Content,
|
|
23127
23195
|
{
|
|
23128
23196
|
hideWhenDetached: true,
|
|
@@ -23140,9 +23208,9 @@ var SelectFilter = ({
|
|
|
23140
23208
|
}
|
|
23141
23209
|
}
|
|
23142
23210
|
},
|
|
23143
|
-
children: /* @__PURE__ */
|
|
23144
|
-
searchable && /* @__PURE__ */
|
|
23145
|
-
/* @__PURE__ */
|
|
23211
|
+
children: /* @__PURE__ */ jsxs50(Command, { className: "h-full", children: [
|
|
23212
|
+
searchable && /* @__PURE__ */ jsx72("div", { className: "border-b p-1", children: /* @__PURE__ */ jsxs50("div", { className: "grid grid-cols-[1fr_20px] gap-x-2 rounded-md px-2 py-1", children: [
|
|
23213
|
+
/* @__PURE__ */ jsx72(
|
|
23146
23214
|
Command.Input,
|
|
23147
23215
|
{
|
|
23148
23216
|
ref: setSearchRef,
|
|
@@ -23152,7 +23220,7 @@ var SelectFilter = ({
|
|
|
23152
23220
|
placeholder: "Search"
|
|
23153
23221
|
}
|
|
23154
23222
|
),
|
|
23155
|
-
/* @__PURE__ */
|
|
23223
|
+
/* @__PURE__ */ jsx72("div", { className: "flex h-5 w-5 items-center justify-center", children: /* @__PURE__ */ jsx72(
|
|
23156
23224
|
"button",
|
|
23157
23225
|
{
|
|
23158
23226
|
disabled: !search,
|
|
@@ -23163,14 +23231,14 @@ var SelectFilter = ({
|
|
|
23163
23231
|
invisible: !search
|
|
23164
23232
|
}
|
|
23165
23233
|
),
|
|
23166
|
-
children: /* @__PURE__ */
|
|
23234
|
+
children: /* @__PURE__ */ jsx72(XMarkMini4, {})
|
|
23167
23235
|
}
|
|
23168
23236
|
) })
|
|
23169
23237
|
] }) }),
|
|
23170
|
-
/* @__PURE__ */
|
|
23171
|
-
/* @__PURE__ */
|
|
23238
|
+
/* @__PURE__ */ jsx72(Command.Empty, { className: "txt-compact-small flex items-center justify-center p-1", children: /* @__PURE__ */ jsx72("span", { className: "w-full px-2 py-1 text-center", children: t2("general.noResultsTitle") }) }),
|
|
23239
|
+
/* @__PURE__ */ jsx72(Command.List, { className: "h-full max-h-[163px] min-h-[0] overflow-auto p-1 outline-none", children: options.map((option) => {
|
|
23172
23240
|
const isSelected = selectedParams.get().includes(String(option.value));
|
|
23173
|
-
return /* @__PURE__ */
|
|
23241
|
+
return /* @__PURE__ */ jsxs50(
|
|
23174
23242
|
Command.Item,
|
|
23175
23243
|
{
|
|
23176
23244
|
className: "bg-ui-bg-base hover:bg-ui-bg-base-hover aria-selected:bg-ui-bg-base-pressed focus-visible:bg-ui-bg-base-pressed text-ui-fg-base data-[disabled]:text-ui-fg-disabled txt-compact-small relative flex cursor-pointer select-none items-center gap-x-2 rounded-md px-2 py-1.5 outline-none transition-colors data-[disabled]:pointer-events-none",
|
|
@@ -23179,7 +23247,7 @@ var SelectFilter = ({
|
|
|
23179
23247
|
handleSelect(option.value);
|
|
23180
23248
|
},
|
|
23181
23249
|
children: [
|
|
23182
|
-
/* @__PURE__ */
|
|
23250
|
+
/* @__PURE__ */ jsx72(
|
|
23183
23251
|
"div",
|
|
23184
23252
|
{
|
|
23185
23253
|
className: clx39(
|
|
@@ -23188,7 +23256,7 @@ var SelectFilter = ({
|
|
|
23188
23256
|
"[&_svg]:invisible": !isSelected
|
|
23189
23257
|
}
|
|
23190
23258
|
),
|
|
23191
|
-
children: multiple ? /* @__PURE__ */
|
|
23259
|
+
children: multiple ? /* @__PURE__ */ jsx72(CheckMini, {}) : /* @__PURE__ */ jsx72(EllipseMiniSolid3, {})
|
|
23192
23260
|
}
|
|
23193
23261
|
),
|
|
23194
23262
|
option.label
|
|
@@ -23208,7 +23276,7 @@ import { Input as Input6, Label as Label4, clx as clx40 } from "@medusajs/ui";
|
|
|
23208
23276
|
import debounce3 from "lodash.debounce";
|
|
23209
23277
|
import { Popover as RadixPopover6 } from "radix-ui";
|
|
23210
23278
|
import { useCallback as useCallback22, useEffect as useEffect20, useState as useState29 } from "react";
|
|
23211
|
-
import { jsx as
|
|
23279
|
+
import { jsx as jsx73, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
23212
23280
|
var StringFilter = ({
|
|
23213
23281
|
filter,
|
|
23214
23282
|
prefix,
|
|
@@ -23256,8 +23324,8 @@ var StringFilter = ({
|
|
|
23256
23324
|
selectedParams.delete();
|
|
23257
23325
|
removeFilter(key);
|
|
23258
23326
|
};
|
|
23259
|
-
return /* @__PURE__ */
|
|
23260
|
-
/* @__PURE__ */
|
|
23327
|
+
return /* @__PURE__ */ jsxs51(RadixPopover6.Root, { modal: true, open, onOpenChange: handleOpenChange, children: [
|
|
23328
|
+
/* @__PURE__ */ jsx73(
|
|
23261
23329
|
filter_chip_default,
|
|
23262
23330
|
{
|
|
23263
23331
|
hasOperator: true,
|
|
@@ -23268,7 +23336,7 @@ var StringFilter = ({
|
|
|
23268
23336
|
readonly
|
|
23269
23337
|
}
|
|
23270
23338
|
),
|
|
23271
|
-
!readonly && /* @__PURE__ */
|
|
23339
|
+
!readonly && /* @__PURE__ */ jsx73(RadixPopover6.Portal, { children: /* @__PURE__ */ jsx73(
|
|
23272
23340
|
RadixPopover6.Content,
|
|
23273
23341
|
{
|
|
23274
23342
|
hideWhenDetached: true,
|
|
@@ -23286,9 +23354,9 @@ var StringFilter = ({
|
|
|
23286
23354
|
}
|
|
23287
23355
|
}
|
|
23288
23356
|
},
|
|
23289
|
-
children: /* @__PURE__ */
|
|
23290
|
-
/* @__PURE__ */
|
|
23291
|
-
/* @__PURE__ */
|
|
23357
|
+
children: /* @__PURE__ */ jsxs51("div", { className: "px-1 pb-3 pt-1", children: [
|
|
23358
|
+
/* @__PURE__ */ jsx73("div", { className: "px-2 py-1.5", children: /* @__PURE__ */ jsx73(Label4, { size: "xsmall", weight: "plus", htmlFor: key, children: label }) }),
|
|
23359
|
+
/* @__PURE__ */ jsx73("div", { className: "px-2 py-0.5", children: /* @__PURE__ */ jsx73(
|
|
23292
23360
|
Input6,
|
|
23293
23361
|
{
|
|
23294
23362
|
name: key,
|
|
@@ -23304,7 +23372,7 @@ var StringFilter = ({
|
|
|
23304
23372
|
};
|
|
23305
23373
|
|
|
23306
23374
|
// src/components/table/data-table/data-table-filter/data-table-filter.tsx
|
|
23307
|
-
import { jsx as
|
|
23375
|
+
import { jsx as jsx74, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
23308
23376
|
var DataTableFilter2 = ({
|
|
23309
23377
|
filters,
|
|
23310
23378
|
readonly,
|
|
@@ -23358,7 +23426,7 @@ var DataTableFilter2 = ({
|
|
|
23358
23426
|
const removeAllFilters = useCallback23(() => {
|
|
23359
23427
|
setActiveFilters([]);
|
|
23360
23428
|
}, []);
|
|
23361
|
-
return /* @__PURE__ */
|
|
23429
|
+
return /* @__PURE__ */ jsx74(
|
|
23362
23430
|
DataTableFilterContext.Provider,
|
|
23363
23431
|
{
|
|
23364
23432
|
value: useMemo16(
|
|
@@ -23368,11 +23436,11 @@ var DataTableFilter2 = ({
|
|
|
23368
23436
|
}),
|
|
23369
23437
|
[removeAllFilters, removeFilter]
|
|
23370
23438
|
),
|
|
23371
|
-
children: /* @__PURE__ */
|
|
23439
|
+
children: /* @__PURE__ */ jsxs52("div", { className: "max-w-2/3 flex flex-wrap items-center gap-2", children: [
|
|
23372
23440
|
activeFilters.map((filter) => {
|
|
23373
23441
|
switch (filter.type) {
|
|
23374
23442
|
case "select":
|
|
23375
|
-
return /* @__PURE__ */
|
|
23443
|
+
return /* @__PURE__ */ jsx74(
|
|
23376
23444
|
SelectFilter,
|
|
23377
23445
|
{
|
|
23378
23446
|
filter,
|
|
@@ -23386,7 +23454,7 @@ var DataTableFilter2 = ({
|
|
|
23386
23454
|
filter.key
|
|
23387
23455
|
);
|
|
23388
23456
|
case "date":
|
|
23389
|
-
return /* @__PURE__ */
|
|
23457
|
+
return /* @__PURE__ */ jsx74(
|
|
23390
23458
|
DateFilter,
|
|
23391
23459
|
{
|
|
23392
23460
|
filter,
|
|
@@ -23397,7 +23465,7 @@ var DataTableFilter2 = ({
|
|
|
23397
23465
|
filter.key
|
|
23398
23466
|
);
|
|
23399
23467
|
case "string":
|
|
23400
|
-
return /* @__PURE__ */
|
|
23468
|
+
return /* @__PURE__ */ jsx74(
|
|
23401
23469
|
StringFilter,
|
|
23402
23470
|
{
|
|
23403
23471
|
filter,
|
|
@@ -23408,7 +23476,7 @@ var DataTableFilter2 = ({
|
|
|
23408
23476
|
filter.key
|
|
23409
23477
|
);
|
|
23410
23478
|
case "number":
|
|
23411
|
-
return /* @__PURE__ */
|
|
23479
|
+
return /* @__PURE__ */ jsx74(
|
|
23412
23480
|
NumberFilter,
|
|
23413
23481
|
{
|
|
23414
23482
|
filter,
|
|
@@ -23422,9 +23490,9 @@ var DataTableFilter2 = ({
|
|
|
23422
23490
|
break;
|
|
23423
23491
|
}
|
|
23424
23492
|
}),
|
|
23425
|
-
!readonly && availableFilters.length > 0 && /* @__PURE__ */
|
|
23426
|
-
/* @__PURE__ */
|
|
23427
|
-
/* @__PURE__ */
|
|
23493
|
+
!readonly && availableFilters.length > 0 && /* @__PURE__ */ jsxs52(RadixPopover7.Root, { modal: true, open, onOpenChange: setOpen, children: [
|
|
23494
|
+
/* @__PURE__ */ jsx74(RadixPopover7.Trigger, { asChild: true, id: "filters_menu_trigger", children: /* @__PURE__ */ jsx74(Button10, { size: "small", variant: "secondary", children: t2("filters.addFilter") }) }),
|
|
23495
|
+
/* @__PURE__ */ jsx74(RadixPopover7.Portal, { children: /* @__PURE__ */ jsx74(
|
|
23428
23496
|
RadixPopover7.Content,
|
|
23429
23497
|
{
|
|
23430
23498
|
className: clx41(
|
|
@@ -23445,7 +23513,7 @@ var DataTableFilter2 = ({
|
|
|
23445
23513
|
children: availableFilters.map((filter) => {
|
|
23446
23514
|
return (
|
|
23447
23515
|
// oxlint-disable-next-line jsx-a11y/click-events-have-key-events
|
|
23448
|
-
/* @__PURE__ */
|
|
23516
|
+
/* @__PURE__ */ jsx74(
|
|
23449
23517
|
"div",
|
|
23450
23518
|
{
|
|
23451
23519
|
tabIndex: 0,
|
|
@@ -23463,7 +23531,7 @@ var DataTableFilter2 = ({
|
|
|
23463
23531
|
}
|
|
23464
23532
|
) })
|
|
23465
23533
|
] }),
|
|
23466
|
-
!readonly && activeFilters.length > 0 && /* @__PURE__ */
|
|
23534
|
+
!readonly && activeFilters.length > 0 && /* @__PURE__ */ jsx74(ClearAllFilters, { filters, prefix })
|
|
23467
23535
|
] })
|
|
23468
23536
|
}
|
|
23469
23537
|
);
|
|
@@ -23481,7 +23549,7 @@ var ClearAllFilters = ({ filters, prefix }) => {
|
|
|
23481
23549
|
});
|
|
23482
23550
|
removeAllFilters();
|
|
23483
23551
|
};
|
|
23484
|
-
return /* @__PURE__ */
|
|
23552
|
+
return /* @__PURE__ */ jsx74(
|
|
23485
23553
|
"button",
|
|
23486
23554
|
{
|
|
23487
23555
|
type: "button",
|
|
@@ -23527,7 +23595,7 @@ import { DropdownMenu as DropdownMenu6, IconButton as IconButton10 } from "@medu
|
|
|
23527
23595
|
import { useState as useState31 } from "react";
|
|
23528
23596
|
import { useTranslation as useTranslation31 } from "react-i18next";
|
|
23529
23597
|
import { useSearchParams as useSearchParams8 } from "react-router-dom";
|
|
23530
|
-
import { jsx as
|
|
23598
|
+
import { jsx as jsx75, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
23531
23599
|
var initState2 = (params, prefix) => {
|
|
23532
23600
|
const param = prefix ? `${prefix}_order` : "order";
|
|
23533
23601
|
const sortParam = params.get(param);
|
|
@@ -23586,17 +23654,17 @@ var DataTableOrderBy = ({
|
|
|
23586
23654
|
return prev;
|
|
23587
23655
|
});
|
|
23588
23656
|
};
|
|
23589
|
-
return /* @__PURE__ */
|
|
23590
|
-
/* @__PURE__ */
|
|
23591
|
-
/* @__PURE__ */
|
|
23592
|
-
/* @__PURE__ */
|
|
23657
|
+
return /* @__PURE__ */ jsxs53(DropdownMenu6, { dir: direction, children: [
|
|
23658
|
+
/* @__PURE__ */ jsx75(DropdownMenu6.Trigger, { asChild: true, children: /* @__PURE__ */ jsx75(IconButton10, { size: "small", children: /* @__PURE__ */ jsx75(DescendingSorting, {}) }) }),
|
|
23659
|
+
/* @__PURE__ */ jsxs53(DropdownMenu6.Content, { className: "z-[1]", align: "end", children: [
|
|
23660
|
+
/* @__PURE__ */ jsx75(
|
|
23593
23661
|
DropdownMenu6.RadioGroup,
|
|
23594
23662
|
{
|
|
23595
23663
|
value: state.key,
|
|
23596
23664
|
onValueChange: handleKeyChange,
|
|
23597
23665
|
children: keys.map((key) => {
|
|
23598
23666
|
const stringKey = String(key.key);
|
|
23599
|
-
return /* @__PURE__ */
|
|
23667
|
+
return /* @__PURE__ */ jsx75(
|
|
23600
23668
|
DropdownMenu6.RadioItem,
|
|
23601
23669
|
{
|
|
23602
23670
|
value: stringKey,
|
|
@@ -23608,14 +23676,14 @@ var DataTableOrderBy = ({
|
|
|
23608
23676
|
})
|
|
23609
23677
|
}
|
|
23610
23678
|
),
|
|
23611
|
-
/* @__PURE__ */
|
|
23612
|
-
/* @__PURE__ */
|
|
23679
|
+
/* @__PURE__ */ jsx75(DropdownMenu6.Separator, {}),
|
|
23680
|
+
/* @__PURE__ */ jsxs53(
|
|
23613
23681
|
DropdownMenu6.RadioGroup,
|
|
23614
23682
|
{
|
|
23615
23683
|
value: state.dir,
|
|
23616
23684
|
onValueChange: handleDirChange,
|
|
23617
23685
|
children: [
|
|
23618
|
-
/* @__PURE__ */
|
|
23686
|
+
/* @__PURE__ */ jsxs53(
|
|
23619
23687
|
DropdownMenu6.RadioItem,
|
|
23620
23688
|
{
|
|
23621
23689
|
className: "flex items-center justify-between",
|
|
@@ -23623,11 +23691,11 @@ var DataTableOrderBy = ({
|
|
|
23623
23691
|
onSelect: (event) => event.preventDefault(),
|
|
23624
23692
|
children: [
|
|
23625
23693
|
t2("general.ascending"),
|
|
23626
|
-
/* @__PURE__ */
|
|
23694
|
+
/* @__PURE__ */ jsx75(DropdownMenu6.Label, { children: "1 - 30" })
|
|
23627
23695
|
]
|
|
23628
23696
|
}
|
|
23629
23697
|
),
|
|
23630
|
-
/* @__PURE__ */
|
|
23698
|
+
/* @__PURE__ */ jsxs53(
|
|
23631
23699
|
DropdownMenu6.RadioItem,
|
|
23632
23700
|
{
|
|
23633
23701
|
className: "flex items-center justify-between",
|
|
@@ -23635,7 +23703,7 @@ var DataTableOrderBy = ({
|
|
|
23635
23703
|
onSelect: (event) => event.preventDefault(),
|
|
23636
23704
|
children: [
|
|
23637
23705
|
t2("general.descending"),
|
|
23638
|
-
/* @__PURE__ */
|
|
23706
|
+
/* @__PURE__ */ jsx75(DropdownMenu6.Label, { children: "30 - 1" })
|
|
23639
23707
|
]
|
|
23640
23708
|
}
|
|
23641
23709
|
)
|
|
@@ -23651,7 +23719,7 @@ import { Input as Input7 } from "@medusajs/ui";
|
|
|
23651
23719
|
import { useCallback as useCallback24, useEffect as useEffect22 } from "react";
|
|
23652
23720
|
import { useTranslation as useTranslation32 } from "react-i18next";
|
|
23653
23721
|
import debounce4 from "lodash.debounce";
|
|
23654
|
-
import { jsx as
|
|
23722
|
+
import { jsx as jsx76 } from "react/jsx-runtime";
|
|
23655
23723
|
var DataTableSearch = ({
|
|
23656
23724
|
placeholder,
|
|
23657
23725
|
prefix,
|
|
@@ -23681,7 +23749,7 @@ var DataTableSearch = ({
|
|
|
23681
23749
|
debouncedOnChange.cancel();
|
|
23682
23750
|
};
|
|
23683
23751
|
}, [debouncedOnChange]);
|
|
23684
|
-
return /* @__PURE__ */
|
|
23752
|
+
return /* @__PURE__ */ jsx76(
|
|
23685
23753
|
Input7,
|
|
23686
23754
|
{
|
|
23687
23755
|
autoComplete: "off",
|
|
@@ -23696,24 +23764,24 @@ var DataTableSearch = ({
|
|
|
23696
23764
|
};
|
|
23697
23765
|
|
|
23698
23766
|
// src/components/table/data-table/data-table-query/data-table-query.tsx
|
|
23699
|
-
import { jsx as
|
|
23767
|
+
import { jsx as jsx77, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
23700
23768
|
var DataTableQuery = ({
|
|
23701
23769
|
search,
|
|
23702
23770
|
orderBy,
|
|
23703
23771
|
filters,
|
|
23704
23772
|
prefix
|
|
23705
23773
|
}) => {
|
|
23706
|
-
return (search || orderBy || filters || prefix) && /* @__PURE__ */
|
|
23707
|
-
/* @__PURE__ */
|
|
23708
|
-
/* @__PURE__ */
|
|
23709
|
-
search && /* @__PURE__ */
|
|
23774
|
+
return (search || orderBy || filters || prefix) && /* @__PURE__ */ jsxs54("div", { className: "flex items-start justify-between gap-x-4 px-6 py-4", children: [
|
|
23775
|
+
/* @__PURE__ */ jsx77("div", { className: "w-full max-w-[60%]", children: filters && filters.length > 0 && /* @__PURE__ */ jsx77(DataTableFilter2, { filters, prefix }) }),
|
|
23776
|
+
/* @__PURE__ */ jsxs54("div", { className: "flex shrink-0 items-center gap-x-2", children: [
|
|
23777
|
+
search && /* @__PURE__ */ jsx77(
|
|
23710
23778
|
DataTableSearch,
|
|
23711
23779
|
{
|
|
23712
23780
|
prefix,
|
|
23713
23781
|
autofocus: search === "autofocus"
|
|
23714
23782
|
}
|
|
23715
23783
|
),
|
|
23716
|
-
orderBy && /* @__PURE__ */
|
|
23784
|
+
orderBy && /* @__PURE__ */ jsx77(DataTableOrderBy, { keys: orderBy, prefix })
|
|
23717
23785
|
] })
|
|
23718
23786
|
] });
|
|
23719
23787
|
};
|
|
@@ -23731,7 +23799,7 @@ import {
|
|
|
23731
23799
|
} from "react";
|
|
23732
23800
|
import { useTranslation as useTranslation33 } from "react-i18next";
|
|
23733
23801
|
import { Link as Link8 } from "react-router-dom";
|
|
23734
|
-
import { jsx as
|
|
23802
|
+
import { jsx as jsx78, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
23735
23803
|
var DataTableRoot = ({
|
|
23736
23804
|
table,
|
|
23737
23805
|
columns,
|
|
@@ -23769,14 +23837,14 @@ var DataTableRoot = ({
|
|
|
23769
23837
|
useEffect23(() => {
|
|
23770
23838
|
scrollableRef.current?.scroll({ top: 0, left: 0 });
|
|
23771
23839
|
}, [pageIndex]);
|
|
23772
|
-
return /* @__PURE__ */
|
|
23840
|
+
return /* @__PURE__ */ jsxs55(
|
|
23773
23841
|
"div",
|
|
23774
23842
|
{
|
|
23775
23843
|
className: clx42("flex w-full flex-col overflow-hidden", {
|
|
23776
23844
|
"flex flex-1 flex-col": layout === "fill"
|
|
23777
23845
|
}),
|
|
23778
23846
|
children: [
|
|
23779
|
-
/* @__PURE__ */
|
|
23847
|
+
/* @__PURE__ */ jsx78(
|
|
23780
23848
|
"div",
|
|
23781
23849
|
{
|
|
23782
23850
|
ref: scrollableRef,
|
|
@@ -23785,9 +23853,9 @@ var DataTableRoot = ({
|
|
|
23785
23853
|
"min-h-0 flex-grow overflow-auto": layout === "fill",
|
|
23786
23854
|
"overflow-x-auto": layout === "fit"
|
|
23787
23855
|
}),
|
|
23788
|
-
children: !noResults ? /* @__PURE__ */
|
|
23789
|
-
!noHeader && /* @__PURE__ */
|
|
23790
|
-
return /* @__PURE__ */
|
|
23856
|
+
children: !noResults ? /* @__PURE__ */ jsxs55(Table, { className: "relative w-full", children: [
|
|
23857
|
+
!noHeader && /* @__PURE__ */ jsx78(Table.Header, { className: "border-t-0", children: table.getHeaderGroups().map((headerGroup) => {
|
|
23858
|
+
return /* @__PURE__ */ jsx78(
|
|
23791
23859
|
Table.Row,
|
|
23792
23860
|
{
|
|
23793
23861
|
className: clx42({
|
|
@@ -23803,7 +23871,7 @@ var DataTableRoot = ({
|
|
|
23803
23871
|
);
|
|
23804
23872
|
const isFirstHeader = firstHeader !== -1 ? header.id === headerGroup.headers[firstHeader].id : index === 0;
|
|
23805
23873
|
const isStickyHeader = isSelectHeader || isFirstHeader;
|
|
23806
|
-
return /* @__PURE__ */
|
|
23874
|
+
return /* @__PURE__ */ jsx78(
|
|
23807
23875
|
Table.HeaderCell,
|
|
23808
23876
|
{
|
|
23809
23877
|
"data-table-header-id": header.id,
|
|
@@ -23827,12 +23895,12 @@ var DataTableRoot = ({
|
|
|
23827
23895
|
headerGroup.id
|
|
23828
23896
|
);
|
|
23829
23897
|
}) }),
|
|
23830
|
-
/* @__PURE__ */
|
|
23898
|
+
/* @__PURE__ */ jsx78(Table.Body, { className: "border-b-0", children: table.getRowModel().rows.map((row) => {
|
|
23831
23899
|
const to = navigateTo ? navigateTo(row) : void 0;
|
|
23832
23900
|
const isRowDisabled = hasSelect && !row.getCanSelect();
|
|
23833
23901
|
const isOdd = row.depth % 2 !== 0;
|
|
23834
23902
|
const cells = row.getVisibleCells();
|
|
23835
|
-
return /* @__PURE__ */
|
|
23903
|
+
return /* @__PURE__ */ jsx78(
|
|
23836
23904
|
Table.Row,
|
|
23837
23905
|
{
|
|
23838
23906
|
"data-selected": row.getIsSelected(),
|
|
@@ -23862,7 +23930,7 @@ var DataTableRoot = ({
|
|
|
23862
23930
|
);
|
|
23863
23931
|
const isTabableLink = isFirstCell && !!to;
|
|
23864
23932
|
const shouldRenderAsLink = !!to && !isSelectCell;
|
|
23865
|
-
return /* @__PURE__ */
|
|
23933
|
+
return /* @__PURE__ */ jsx78(
|
|
23866
23934
|
Table.Cell,
|
|
23867
23935
|
{
|
|
23868
23936
|
className: clx42({
|
|
@@ -23876,14 +23944,14 @@ var DataTableRoot = ({
|
|
|
23876
23944
|
style: {
|
|
23877
23945
|
paddingLeft: depthOffset ? `${depthOffset}px` : void 0
|
|
23878
23946
|
},
|
|
23879
|
-
children: shouldRenderAsLink ? /* @__PURE__ */
|
|
23947
|
+
children: shouldRenderAsLink ? /* @__PURE__ */ jsx78(
|
|
23880
23948
|
Link8,
|
|
23881
23949
|
{
|
|
23882
23950
|
to,
|
|
23883
23951
|
className: "size-full outline-none",
|
|
23884
23952
|
"data-row-link": true,
|
|
23885
23953
|
tabIndex: isTabableLink ? 0 : -1,
|
|
23886
|
-
children: /* @__PURE__ */
|
|
23954
|
+
children: /* @__PURE__ */ jsx78(
|
|
23887
23955
|
"div",
|
|
23888
23956
|
{
|
|
23889
23957
|
className: clx42(
|
|
@@ -23905,10 +23973,10 @@ var DataTableRoot = ({
|
|
|
23905
23973
|
row.id
|
|
23906
23974
|
);
|
|
23907
23975
|
}) })
|
|
23908
|
-
] }) : /* @__PURE__ */
|
|
23976
|
+
] }) : /* @__PURE__ */ jsx78("div", { className: clx42({ "border-b": layout === "fit" }), children: /* @__PURE__ */ jsx78(NoResults, {}) })
|
|
23909
23977
|
}
|
|
23910
23978
|
),
|
|
23911
|
-
pagination && /* @__PURE__ */
|
|
23979
|
+
pagination && /* @__PURE__ */ jsx78("div", { className: clx42({ "border-t": layout === "fill" }), children: /* @__PURE__ */ jsx78(
|
|
23912
23980
|
Pagination,
|
|
23913
23981
|
{
|
|
23914
23982
|
canNextPage: table.getCanNextPage(),
|
|
@@ -23921,14 +23989,14 @@ var DataTableRoot = ({
|
|
|
23921
23989
|
pageSize
|
|
23922
23990
|
}
|
|
23923
23991
|
) }),
|
|
23924
|
-
hasCommandBar && /* @__PURE__ */
|
|
23925
|
-
/* @__PURE__ */
|
|
23992
|
+
hasCommandBar && /* @__PURE__ */ jsx78(CommandBar, { open: !!Object.keys(rowSelection).length, children: /* @__PURE__ */ jsxs55(CommandBar.Bar, { children: [
|
|
23993
|
+
/* @__PURE__ */ jsx78(CommandBar.Value, { children: t2("general.countSelected", {
|
|
23926
23994
|
count: Object.keys(rowSelection).length
|
|
23927
23995
|
}) }),
|
|
23928
|
-
/* @__PURE__ */
|
|
23996
|
+
/* @__PURE__ */ jsx78(CommandBar.Seperator, {}),
|
|
23929
23997
|
commands?.map((command, index) => {
|
|
23930
|
-
return /* @__PURE__ */
|
|
23931
|
-
/* @__PURE__ */
|
|
23998
|
+
return /* @__PURE__ */ jsxs55(Fragment5, { children: [
|
|
23999
|
+
/* @__PURE__ */ jsx78(
|
|
23932
24000
|
CommandBar.Command,
|
|
23933
24001
|
{
|
|
23934
24002
|
label: command.label,
|
|
@@ -23936,7 +24004,7 @@ var DataTableRoot = ({
|
|
|
23936
24004
|
action: () => handleAction(command.action)
|
|
23937
24005
|
}
|
|
23938
24006
|
),
|
|
23939
|
-
index < commands.length - 1 && /* @__PURE__ */
|
|
24007
|
+
index < commands.length - 1 && /* @__PURE__ */ jsx78(CommandBar.Seperator, {})
|
|
23940
24008
|
] }, index);
|
|
23941
24009
|
})
|
|
23942
24010
|
] }) })
|
|
@@ -23953,7 +24021,7 @@ var Pagination = (props) => {
|
|
|
23953
24021
|
prev: t2("general.prev"),
|
|
23954
24022
|
next: t2("general.next")
|
|
23955
24023
|
};
|
|
23956
|
-
return /* @__PURE__ */
|
|
24024
|
+
return /* @__PURE__ */ jsx78(
|
|
23957
24025
|
Table.Pagination,
|
|
23958
24026
|
{
|
|
23959
24027
|
className: "flex-shrink-0",
|
|
@@ -23964,7 +24032,7 @@ var Pagination = (props) => {
|
|
|
23964
24032
|
};
|
|
23965
24033
|
|
|
23966
24034
|
// src/components/table/data-table/data-table.tsx
|
|
23967
|
-
import { jsx as
|
|
24035
|
+
import { jsx as jsx79, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
23968
24036
|
var MemoizedDataTableQuery = memo(DataTableQuery);
|
|
23969
24037
|
var _DataTable = ({
|
|
23970
24038
|
table,
|
|
@@ -23985,7 +24053,7 @@ var _DataTable = ({
|
|
|
23985
24053
|
noRecords: noRecordsProps = {}
|
|
23986
24054
|
}) => {
|
|
23987
24055
|
if (isLoading) {
|
|
23988
|
-
return /* @__PURE__ */
|
|
24056
|
+
return /* @__PURE__ */ jsx79(
|
|
23989
24057
|
TableSkeleton,
|
|
23990
24058
|
{
|
|
23991
24059
|
layout,
|
|
@@ -24001,7 +24069,7 @@ var _DataTable = ({
|
|
|
24001
24069
|
const noResults = !isLoading && count === 0 && !noQuery;
|
|
24002
24070
|
const noRecords = !isLoading && count === 0 && noQuery;
|
|
24003
24071
|
if (noRecords) {
|
|
24004
|
-
return /* @__PURE__ */
|
|
24072
|
+
return /* @__PURE__ */ jsx79(
|
|
24005
24073
|
NoRecords,
|
|
24006
24074
|
{
|
|
24007
24075
|
className: clx43({
|
|
@@ -24011,14 +24079,14 @@ var _DataTable = ({
|
|
|
24011
24079
|
}
|
|
24012
24080
|
);
|
|
24013
24081
|
}
|
|
24014
|
-
return /* @__PURE__ */
|
|
24082
|
+
return /* @__PURE__ */ jsxs56(
|
|
24015
24083
|
"div",
|
|
24016
24084
|
{
|
|
24017
24085
|
className: clx43("divide-y", {
|
|
24018
24086
|
"flex h-full flex-col overflow-hidden": layout === "fill"
|
|
24019
24087
|
}),
|
|
24020
24088
|
children: [
|
|
24021
|
-
/* @__PURE__ */
|
|
24089
|
+
/* @__PURE__ */ jsx79(
|
|
24022
24090
|
MemoizedDataTableQuery,
|
|
24023
24091
|
{
|
|
24024
24092
|
search,
|
|
@@ -24027,7 +24095,7 @@ var _DataTable = ({
|
|
|
24027
24095
|
prefix
|
|
24028
24096
|
}
|
|
24029
24097
|
),
|
|
24030
|
-
/* @__PURE__ */
|
|
24098
|
+
/* @__PURE__ */ jsx79(
|
|
24031
24099
|
DataTableRoot,
|
|
24032
24100
|
{
|
|
24033
24101
|
table,
|
|
@@ -24048,12 +24116,12 @@ var _DataTable = ({
|
|
|
24048
24116
|
|
|
24049
24117
|
// src/components/table/table-cells/common/code-cell/code-cell.tsx
|
|
24050
24118
|
import { Badge as Badge6 } from "@medusajs/ui";
|
|
24051
|
-
import { jsx as
|
|
24119
|
+
import { jsx as jsx80 } from "react/jsx-runtime";
|
|
24052
24120
|
var CodeCell = ({ code }) => {
|
|
24053
|
-
return /* @__PURE__ */
|
|
24121
|
+
return /* @__PURE__ */ jsx80("div", { className: "flex h-full w-full items-center gap-x-3 overflow-hidden", children: /* @__PURE__ */ jsx80(Badge6, { size: "2xsmall", className: "truncate", children: code }) });
|
|
24054
24122
|
};
|
|
24055
24123
|
var CodeHeader = ({ text }) => {
|
|
24056
|
-
return /* @__PURE__ */
|
|
24124
|
+
return /* @__PURE__ */ jsx80("div", { className: " flex h-full w-full items-center ", children: /* @__PURE__ */ jsx80("span", { children: text }) });
|
|
24057
24125
|
};
|
|
24058
24126
|
|
|
24059
24127
|
// src/components/table/table-cells/common/created-at-cell/created-at-cell.tsx
|
|
@@ -24061,73 +24129,73 @@ import { Tooltip as Tooltip9 } from "@medusajs/ui";
|
|
|
24061
24129
|
import { useTranslation as useTranslation34 } from "react-i18next";
|
|
24062
24130
|
|
|
24063
24131
|
// src/components/table/table-cells/common/placeholder-cell/placeholder-cell.tsx
|
|
24064
|
-
import { jsx as
|
|
24132
|
+
import { jsx as jsx81 } from "react/jsx-runtime";
|
|
24065
24133
|
var PlaceholderCell = () => {
|
|
24066
|
-
return /* @__PURE__ */
|
|
24134
|
+
return /* @__PURE__ */ jsx81("div", { className: "flex h-full w-full items-center", children: /* @__PURE__ */ jsx81("span", { className: "text-ui-fg-muted", children: "-" }) });
|
|
24067
24135
|
};
|
|
24068
24136
|
|
|
24069
24137
|
// src/components/table/table-cells/common/created-at-cell/created-at-cell.tsx
|
|
24070
|
-
import { jsx as
|
|
24138
|
+
import { jsx as jsx82 } from "react/jsx-runtime";
|
|
24071
24139
|
var CreatedAtCell = ({ date }) => {
|
|
24072
24140
|
const { getFullDate } = useDate();
|
|
24073
24141
|
if (!date) {
|
|
24074
|
-
return /* @__PURE__ */
|
|
24142
|
+
return /* @__PURE__ */ jsx82(PlaceholderCell, {});
|
|
24075
24143
|
}
|
|
24076
|
-
return /* @__PURE__ */
|
|
24144
|
+
return /* @__PURE__ */ jsx82("div", { className: "flex h-full w-full items-center overflow-hidden", children: /* @__PURE__ */ jsx82(
|
|
24077
24145
|
Tooltip9,
|
|
24078
24146
|
{
|
|
24079
24147
|
className: "z-10",
|
|
24080
|
-
content: /* @__PURE__ */
|
|
24148
|
+
content: /* @__PURE__ */ jsx82("span", { className: "text-pretty", children: `${getFullDate({
|
|
24081
24149
|
date,
|
|
24082
24150
|
includeTime: true
|
|
24083
24151
|
})}` }),
|
|
24084
|
-
children: /* @__PURE__ */
|
|
24152
|
+
children: /* @__PURE__ */ jsx82("span", { className: "truncate", children: getFullDate({ date, includeTime: true }) })
|
|
24085
24153
|
}
|
|
24086
24154
|
) });
|
|
24087
24155
|
};
|
|
24088
24156
|
var CreatedAtHeader = () => {
|
|
24089
24157
|
const { t: t2 } = useTranslation34();
|
|
24090
|
-
return /* @__PURE__ */
|
|
24158
|
+
return /* @__PURE__ */ jsx82("div", { className: "flex h-full w-full items-center", children: /* @__PURE__ */ jsx82("span", { className: "truncate", children: t2("fields.createdAt") }) });
|
|
24091
24159
|
};
|
|
24092
24160
|
|
|
24093
24161
|
// src/components/table/table-cells/common/date-cell/date-cell.tsx
|
|
24094
24162
|
import { Tooltip as Tooltip10 } from "@medusajs/ui";
|
|
24095
24163
|
import { useTranslation as useTranslation35 } from "react-i18next";
|
|
24096
|
-
import { jsx as
|
|
24164
|
+
import { jsx as jsx83 } from "react/jsx-runtime";
|
|
24097
24165
|
var DateCell = ({ date }) => {
|
|
24098
24166
|
const { getFullDate } = useDate();
|
|
24099
24167
|
if (!date) {
|
|
24100
|
-
return /* @__PURE__ */
|
|
24168
|
+
return /* @__PURE__ */ jsx83(PlaceholderCell, {});
|
|
24101
24169
|
}
|
|
24102
|
-
return /* @__PURE__ */
|
|
24170
|
+
return /* @__PURE__ */ jsx83("div", { className: "flex h-full w-full items-center overflow-hidden", children: /* @__PURE__ */ jsx83(
|
|
24103
24171
|
Tooltip10,
|
|
24104
24172
|
{
|
|
24105
24173
|
className: "z-10",
|
|
24106
|
-
content: /* @__PURE__ */
|
|
24174
|
+
content: /* @__PURE__ */ jsx83("span", { className: "text-pretty", children: `${getFullDate({
|
|
24107
24175
|
date,
|
|
24108
24176
|
includeTime: true
|
|
24109
24177
|
})}` }),
|
|
24110
|
-
children: /* @__PURE__ */
|
|
24178
|
+
children: /* @__PURE__ */ jsx83("span", { className: "truncate", children: getFullDate({ date, includeTime: false }) })
|
|
24111
24179
|
}
|
|
24112
24180
|
) });
|
|
24113
24181
|
};
|
|
24114
24182
|
var DateHeader = () => {
|
|
24115
24183
|
const { t: t2 } = useTranslation35();
|
|
24116
|
-
return /* @__PURE__ */
|
|
24184
|
+
return /* @__PURE__ */ jsx83("div", { className: "flex h-full w-full items-center", children: /* @__PURE__ */ jsx83("span", { className: "truncate", children: t2("fields.date") }) });
|
|
24117
24185
|
};
|
|
24118
24186
|
|
|
24119
24187
|
// src/components/table/table-cells/common/email-cell/email-cell.tsx
|
|
24120
24188
|
import { useTranslation as useTranslation36 } from "react-i18next";
|
|
24121
|
-
import { jsx as
|
|
24189
|
+
import { jsx as jsx84 } from "react/jsx-runtime";
|
|
24122
24190
|
var EmailCell = ({ email }) => {
|
|
24123
24191
|
if (!email) {
|
|
24124
|
-
return /* @__PURE__ */
|
|
24192
|
+
return /* @__PURE__ */ jsx84(PlaceholderCell, {});
|
|
24125
24193
|
}
|
|
24126
|
-
return /* @__PURE__ */
|
|
24194
|
+
return /* @__PURE__ */ jsx84("div", { className: "flex h-full w-full items-center overflow-hidden", children: /* @__PURE__ */ jsx84("span", { className: "truncate", children: email }) });
|
|
24127
24195
|
};
|
|
24128
24196
|
var EmailHeader = () => {
|
|
24129
24197
|
const { t: t2 } = useTranslation36();
|
|
24130
|
-
return /* @__PURE__ */
|
|
24198
|
+
return /* @__PURE__ */ jsx84("div", { className: "flex h-full w-full items-center", children: /* @__PURE__ */ jsx84("span", { className: "truncate", children: t2("fields.email") }) });
|
|
24131
24199
|
};
|
|
24132
24200
|
|
|
24133
24201
|
// src/components/table/table-cells/common/money-amount-cell/money-amount-cell.tsx
|
|
@@ -24165,7 +24233,7 @@ var isAmountLessThenRoundingError = (amount, currencyCode) => {
|
|
|
24165
24233
|
};
|
|
24166
24234
|
|
|
24167
24235
|
// src/components/table/table-cells/common/money-amount-cell/money-amount-cell.tsx
|
|
24168
|
-
import { jsx as
|
|
24236
|
+
import { jsx as jsx85 } from "react/jsx-runtime";
|
|
24169
24237
|
var MoneyAmountCell = ({
|
|
24170
24238
|
currencyCode,
|
|
24171
24239
|
amount,
|
|
@@ -24173,10 +24241,10 @@ var MoneyAmountCell = ({
|
|
|
24173
24241
|
className
|
|
24174
24242
|
}) => {
|
|
24175
24243
|
if (typeof amount === "undefined" || amount === null) {
|
|
24176
|
-
return /* @__PURE__ */
|
|
24244
|
+
return /* @__PURE__ */ jsx85(PlaceholderCell, {});
|
|
24177
24245
|
}
|
|
24178
24246
|
const formatted = getStylizedAmount(amount, currencyCode);
|
|
24179
|
-
return /* @__PURE__ */
|
|
24247
|
+
return /* @__PURE__ */ jsx85(
|
|
24180
24248
|
"div",
|
|
24181
24249
|
{
|
|
24182
24250
|
className: clx44(
|
|
@@ -24187,37 +24255,37 @@ var MoneyAmountCell = ({
|
|
|
24187
24255
|
},
|
|
24188
24256
|
className
|
|
24189
24257
|
),
|
|
24190
|
-
children: /* @__PURE__ */
|
|
24258
|
+
children: /* @__PURE__ */ jsx85("span", { className: "truncate", children: formatted })
|
|
24191
24259
|
}
|
|
24192
24260
|
);
|
|
24193
24261
|
};
|
|
24194
24262
|
|
|
24195
24263
|
// src/components/table/table-cells/common/name-cell/name-cell.tsx
|
|
24196
24264
|
import { useTranslation as useTranslation37 } from "react-i18next";
|
|
24197
|
-
import { jsx as
|
|
24265
|
+
import { jsx as jsx86 } from "react/jsx-runtime";
|
|
24198
24266
|
var NameCell = ({ firstName, lastName }) => {
|
|
24199
24267
|
if (!firstName && !lastName) {
|
|
24200
|
-
return /* @__PURE__ */
|
|
24268
|
+
return /* @__PURE__ */ jsx86(PlaceholderCell, {});
|
|
24201
24269
|
}
|
|
24202
24270
|
const name = [firstName, lastName].filter(Boolean).join(" ");
|
|
24203
|
-
return /* @__PURE__ */
|
|
24271
|
+
return /* @__PURE__ */ jsx86("div", { className: "flex h-full w-full items-center overflow-hidden", children: /* @__PURE__ */ jsx86("span", { className: "truncate", children: name }) });
|
|
24204
24272
|
};
|
|
24205
24273
|
var NameHeader = () => {
|
|
24206
24274
|
const { t: t2 } = useTranslation37();
|
|
24207
|
-
return /* @__PURE__ */
|
|
24275
|
+
return /* @__PURE__ */ jsx86("div", { className: "flex h-full w-full items-center", children: /* @__PURE__ */ jsx86("span", { className: "truncate", children: t2("fields.name") }) });
|
|
24208
24276
|
};
|
|
24209
24277
|
|
|
24210
24278
|
// src/components/table/table-cells/common/status-cell/status-cell.tsx
|
|
24211
24279
|
import { clx as clx45 } from "@medusajs/ui";
|
|
24212
|
-
import { jsx as
|
|
24280
|
+
import { jsx as jsx87, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
24213
24281
|
var StatusCell = ({ color, children }) => {
|
|
24214
|
-
return /* @__PURE__ */
|
|
24215
|
-
/* @__PURE__ */
|
|
24282
|
+
return /* @__PURE__ */ jsxs57("div", { className: "txt-compact-small text-ui-fg-subtle flex h-full w-full items-center gap-x-2 overflow-hidden", children: [
|
|
24283
|
+
/* @__PURE__ */ jsx87(
|
|
24216
24284
|
"div",
|
|
24217
24285
|
{
|
|
24218
24286
|
role: "presentation",
|
|
24219
24287
|
className: "flex h-5 w-2 items-center justify-center",
|
|
24220
|
-
children: /* @__PURE__ */
|
|
24288
|
+
children: /* @__PURE__ */ jsx87(
|
|
24221
24289
|
"div",
|
|
24222
24290
|
{
|
|
24223
24291
|
className: clx45(
|
|
@@ -24235,19 +24303,19 @@ var StatusCell = ({ color, children }) => {
|
|
|
24235
24303
|
)
|
|
24236
24304
|
}
|
|
24237
24305
|
),
|
|
24238
|
-
/* @__PURE__ */
|
|
24306
|
+
/* @__PURE__ */ jsx87("span", { className: "truncate", children })
|
|
24239
24307
|
] });
|
|
24240
24308
|
};
|
|
24241
24309
|
|
|
24242
24310
|
// src/components/table/table-cells/common/text-cell/text-cell.tsx
|
|
24243
24311
|
import { clx as clx46 } from "@medusajs/ui";
|
|
24244
|
-
import { jsx as
|
|
24312
|
+
import { jsx as jsx88 } from "react/jsx-runtime";
|
|
24245
24313
|
var TextCell = ({ text, align = "left", maxWidth = 220 }) => {
|
|
24246
24314
|
if (!text) {
|
|
24247
|
-
return /* @__PURE__ */
|
|
24315
|
+
return /* @__PURE__ */ jsx88(PlaceholderCell, {});
|
|
24248
24316
|
}
|
|
24249
24317
|
const stringLength = text.toString().length;
|
|
24250
|
-
return /* @__PURE__ */
|
|
24318
|
+
return /* @__PURE__ */ jsx88(ConditionalTooltip, { content: text, showTooltip: stringLength > 20, children: /* @__PURE__ */ jsx88(
|
|
24251
24319
|
"div",
|
|
24252
24320
|
{
|
|
24253
24321
|
className: clx46("flex h-full w-full items-center gap-x-3 overflow-hidden", {
|
|
@@ -24258,16 +24326,16 @@ var TextCell = ({ text, align = "left", maxWidth = 220 }) => {
|
|
|
24258
24326
|
style: {
|
|
24259
24327
|
maxWidth
|
|
24260
24328
|
},
|
|
24261
|
-
children: /* @__PURE__ */
|
|
24329
|
+
children: /* @__PURE__ */ jsx88("span", { className: "truncate", children: text })
|
|
24262
24330
|
}
|
|
24263
24331
|
) });
|
|
24264
24332
|
};
|
|
24265
24333
|
var TextHeader = ({ text, align = "left" }) => {
|
|
24266
|
-
return /* @__PURE__ */
|
|
24334
|
+
return /* @__PURE__ */ jsx88("div", { className: clx46("flex h-full w-full items-center", {
|
|
24267
24335
|
"justify-start text-start": align === "left",
|
|
24268
24336
|
"justify-center text-center": align === "center",
|
|
24269
24337
|
"justify-end text-end": align === "right"
|
|
24270
|
-
}), children: /* @__PURE__ */
|
|
24338
|
+
}), children: /* @__PURE__ */ jsx88("span", { className: "truncate", children: text }) });
|
|
24271
24339
|
};
|
|
24272
24340
|
|
|
24273
24341
|
// src/hooks/use-data-table.tsx
|
|
@@ -24394,6 +24462,7 @@ export {
|
|
|
24394
24462
|
JsonViewSection,
|
|
24395
24463
|
JsonViewSectionSkeleton,
|
|
24396
24464
|
LinkButton,
|
|
24465
|
+
ListBadge,
|
|
24397
24466
|
ListSummary,
|
|
24398
24467
|
Listicle,
|
|
24399
24468
|
MetadataForm,
|