@orderly.network/ui 2.10.2 → 3.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +100 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +114 -52
- package/dist/index.d.ts +114 -52
- package/dist/index.js +536 -504
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +254 -296
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +4 -3
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var React71 = require('react');
|
|
4
4
|
var tailwindVariants = require('tailwind-variants');
|
|
5
5
|
var reactSlot = require('@radix-ui/react-slot');
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -16,7 +16,7 @@ var CheckboxPrimitive = require('@radix-ui/react-checkbox');
|
|
|
16
16
|
var SwitchPrimitives = require('@radix-ui/react-switch');
|
|
17
17
|
var reactTable = require('@tanstack/react-table');
|
|
18
18
|
var locale = require('date-fns/locale');
|
|
19
|
-
var
|
|
19
|
+
var pluginCore = require('@orderly.network/plugin-core');
|
|
20
20
|
var reactDayPicker = require('react-day-picker');
|
|
21
21
|
var DialogPrimitive = require('@radix-ui/react-dialog');
|
|
22
22
|
var TabsPrimitive = require('@radix-ui/react-tabs');
|
|
@@ -49,7 +49,7 @@ function _interopNamespace(e) {
|
|
|
49
49
|
return Object.freeze(n);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
var
|
|
52
|
+
var React71__namespace = /*#__PURE__*/_interopNamespace(React71);
|
|
53
53
|
var AvatarPrimitive__namespace = /*#__PURE__*/_interopNamespace(AvatarPrimitive);
|
|
54
54
|
var makeBlockie__default = /*#__PURE__*/_interopDefault(makeBlockie);
|
|
55
55
|
var SelectPrimitive__namespace = /*#__PURE__*/_interopNamespace(SelectPrimitive);
|
|
@@ -557,7 +557,7 @@ var boxVariants = tv({
|
|
|
557
557
|
__size: false
|
|
558
558
|
}
|
|
559
559
|
});
|
|
560
|
-
var Box =
|
|
560
|
+
var Box = React71__namespace.default.forwardRef((props, forwardedRef) => {
|
|
561
561
|
const {
|
|
562
562
|
asChild = false,
|
|
563
563
|
as: TAG = "div",
|
|
@@ -692,7 +692,7 @@ var flexVariant = tv(
|
|
|
692
692
|
responsiveVariants: true
|
|
693
693
|
}
|
|
694
694
|
);
|
|
695
|
-
var Flex =
|
|
695
|
+
var Flex = React71.forwardRef((props, ref) => {
|
|
696
696
|
const {
|
|
697
697
|
className,
|
|
698
698
|
display,
|
|
@@ -791,7 +791,7 @@ var Spinner = (props) => {
|
|
|
791
791
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "oui-sr-only", children: "Loading..." })
|
|
792
792
|
] });
|
|
793
793
|
};
|
|
794
|
-
var BaseButton =
|
|
794
|
+
var BaseButton = React71__namespace.default.forwardRef(
|
|
795
795
|
(props, forwardedRef) => {
|
|
796
796
|
const {
|
|
797
797
|
asChild = false,
|
|
@@ -806,14 +806,14 @@ var BaseButton = React70__namespace.default.forwardRef(
|
|
|
806
806
|
} = props;
|
|
807
807
|
const Comp = asChild ? reactSlot.Slot : "button";
|
|
808
808
|
const isDisabled = typeof disabled !== "undefined" ? disabled : loading;
|
|
809
|
-
const iconElement =
|
|
810
|
-
return icon ?
|
|
809
|
+
const iconElement = React71.useMemo(() => {
|
|
810
|
+
return icon ? React71__namespace.default.cloneElement(icon, {
|
|
811
811
|
size: size === "xs" ? 12 : size === "sm" ? 12 : size === "md" ? 14 : size === "lg" ? 16 : size === "xl" ? 18 : 12,
|
|
812
812
|
className: "oui-text-inherit",
|
|
813
813
|
opacity: loading ? 0 : 1
|
|
814
814
|
}) : null;
|
|
815
815
|
}, [size, icon]);
|
|
816
|
-
const content =
|
|
816
|
+
const content = React71.useMemo(() => {
|
|
817
817
|
if (!leading && !trailing && !iconElement) return children;
|
|
818
818
|
return /* @__PURE__ */ jsxRuntime.jsxs(Flex, { as: "span", itemAlign: "center", className: "oui-space-x-1", children: [
|
|
819
819
|
leading,
|
|
@@ -822,7 +822,7 @@ var BaseButton = React70__namespace.default.forwardRef(
|
|
|
822
822
|
trailing
|
|
823
823
|
] });
|
|
824
824
|
}, [children, leading, trailing, iconElement]);
|
|
825
|
-
const spinnerSize =
|
|
825
|
+
const spinnerSize = React71.useMemo(() => {
|
|
826
826
|
switch (size) {
|
|
827
827
|
case "xl":
|
|
828
828
|
return "md";
|
|
@@ -1057,7 +1057,7 @@ var buttonVariants = tailwindVariants.tv(
|
|
|
1057
1057
|
responsiveVariants: ["md", "lg"]
|
|
1058
1058
|
}
|
|
1059
1059
|
);
|
|
1060
|
-
var Button =
|
|
1060
|
+
var Button = React71__namespace.default.forwardRef(
|
|
1061
1061
|
({
|
|
1062
1062
|
className,
|
|
1063
1063
|
variant,
|
|
@@ -1090,9 +1090,9 @@ var Button = React70__namespace.default.forwardRef(
|
|
|
1090
1090
|
}
|
|
1091
1091
|
);
|
|
1092
1092
|
Button.displayName = "Button";
|
|
1093
|
-
var ThrottledButton =
|
|
1094
|
-
const lastCall =
|
|
1095
|
-
const throttle =
|
|
1093
|
+
var ThrottledButton = React71__namespace.default.forwardRef(({ onClick, throttleDuration = 700, ...props }, ref) => {
|
|
1094
|
+
const lastCall = React71.useRef(0);
|
|
1095
|
+
const throttle = React71.useCallback(
|
|
1096
1096
|
(delay, fn) => {
|
|
1097
1097
|
return function(...args) {
|
|
1098
1098
|
const now = Date.now();
|
|
@@ -1107,6 +1107,89 @@ var ThrottledButton = React70__namespace.default.forwardRef(({ onClick, throttle
|
|
|
1107
1107
|
const debouncedClick = throttle(throttleDuration, onClick);
|
|
1108
1108
|
return /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: debouncedClick, ref, ...props });
|
|
1109
1109
|
});
|
|
1110
|
+
var iconButtonVariants = tailwindVariants.tv({
|
|
1111
|
+
base: [
|
|
1112
|
+
"oui-button",
|
|
1113
|
+
"oui-inline-flex",
|
|
1114
|
+
"oui-items-center",
|
|
1115
|
+
"oui-justify-center",
|
|
1116
|
+
"oui-transition-colors",
|
|
1117
|
+
"disabled:oui-cursor-not-allowed",
|
|
1118
|
+
"disabled:oui-opacity-36"
|
|
1119
|
+
],
|
|
1120
|
+
variants: {
|
|
1121
|
+
color: {
|
|
1122
|
+
primary: [
|
|
1123
|
+
"oui-text-primary-darken",
|
|
1124
|
+
"hover:oui-text-primary-darken/80",
|
|
1125
|
+
"active:oui-text-primary-darken/70"
|
|
1126
|
+
],
|
|
1127
|
+
secondary: [
|
|
1128
|
+
"oui-text-base-contrast-54",
|
|
1129
|
+
"hover:oui-text-base-contrast-80",
|
|
1130
|
+
"active:oui-text-base-contrast-70"
|
|
1131
|
+
],
|
|
1132
|
+
success: [
|
|
1133
|
+
"oui-text-success",
|
|
1134
|
+
"hover:oui-text-success/80",
|
|
1135
|
+
"active:oui-text-success/70"
|
|
1136
|
+
],
|
|
1137
|
+
buy: [
|
|
1138
|
+
"oui-text-success",
|
|
1139
|
+
"hover:oui-text-success/80",
|
|
1140
|
+
"active:oui-text-success/70"
|
|
1141
|
+
],
|
|
1142
|
+
danger: [
|
|
1143
|
+
"oui-text-danger",
|
|
1144
|
+
"hover:oui-text-danger/80",
|
|
1145
|
+
"active:oui-text-danger/70"
|
|
1146
|
+
],
|
|
1147
|
+
sell: [
|
|
1148
|
+
"oui-text-danger",
|
|
1149
|
+
"hover:oui-text-danger/80",
|
|
1150
|
+
"active:oui-text-danger/70"
|
|
1151
|
+
],
|
|
1152
|
+
warning: [
|
|
1153
|
+
"oui-text-warning-darken",
|
|
1154
|
+
"hover:oui-text-warning-darken/80",
|
|
1155
|
+
"active:oui-text-warning-darken/70"
|
|
1156
|
+
],
|
|
1157
|
+
gray: [
|
|
1158
|
+
"oui-text-base",
|
|
1159
|
+
"hover:oui-text-base/80",
|
|
1160
|
+
"active:oui-text-base/70"
|
|
1161
|
+
],
|
|
1162
|
+
light: [
|
|
1163
|
+
"oui-text-white",
|
|
1164
|
+
"hover:oui-text-white/80",
|
|
1165
|
+
"active:oui-text-white/70"
|
|
1166
|
+
]
|
|
1167
|
+
}
|
|
1168
|
+
},
|
|
1169
|
+
defaultVariants: {
|
|
1170
|
+
color: "secondary"
|
|
1171
|
+
}
|
|
1172
|
+
});
|
|
1173
|
+
var IconButton = React71__namespace.default.forwardRef(
|
|
1174
|
+
({ className, color, angle, style, children, ...props }, ref) => {
|
|
1175
|
+
const angleStyle = parseAngleProps({ angle });
|
|
1176
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1177
|
+
BaseButton,
|
|
1178
|
+
{
|
|
1179
|
+
className: iconButtonVariants({
|
|
1180
|
+
color,
|
|
1181
|
+
className
|
|
1182
|
+
}),
|
|
1183
|
+
size: "md",
|
|
1184
|
+
ref,
|
|
1185
|
+
style: { ...style, ...angleStyle },
|
|
1186
|
+
...props,
|
|
1187
|
+
children
|
|
1188
|
+
}
|
|
1189
|
+
);
|
|
1190
|
+
}
|
|
1191
|
+
);
|
|
1192
|
+
IconButton.displayName = "IconButton";
|
|
1110
1193
|
var gridVariants = tv({
|
|
1111
1194
|
extend: gapVariants,
|
|
1112
1195
|
base: ["oui-grid"],
|
|
@@ -1177,7 +1260,7 @@ var gridVariants = tv({
|
|
|
1177
1260
|
// autoFlow: "row",
|
|
1178
1261
|
}
|
|
1179
1262
|
});
|
|
1180
|
-
var Grid =
|
|
1263
|
+
var Grid = React71__namespace.default.forwardRef((props, ref) => {
|
|
1181
1264
|
const { className, cols, rows, gap, gapX, gapY, autoFlow, ...rest } = props;
|
|
1182
1265
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1183
1266
|
Box,
|
|
@@ -1227,8 +1310,8 @@ var gridSpanVariants = tv({
|
|
|
1227
1310
|
});
|
|
1228
1311
|
var Span = (props) => {
|
|
1229
1312
|
const { colSpan, rowSpan, className, ...rest } = props;
|
|
1230
|
-
const ref =
|
|
1231
|
-
|
|
1313
|
+
const ref = React71.useRef(null);
|
|
1314
|
+
React71.useEffect(() => {
|
|
1232
1315
|
if (ref.current) {
|
|
1233
1316
|
const parent = ref.current.parentElement;
|
|
1234
1317
|
if (!parent || !parent.classList.contains("oui-grid")) ;
|
|
@@ -1271,7 +1354,7 @@ var iconVariants = tailwindVariants.tv({
|
|
|
1271
1354
|
color: "black"
|
|
1272
1355
|
}
|
|
1273
1356
|
});
|
|
1274
|
-
var BaseIcon =
|
|
1357
|
+
var BaseIcon = React71__namespace.default.forwardRef(
|
|
1275
1358
|
(props, ref) => {
|
|
1276
1359
|
const {
|
|
1277
1360
|
size = 24,
|
|
@@ -1333,7 +1416,7 @@ var avatarVariants = tv({
|
|
|
1333
1416
|
size: "sm"
|
|
1334
1417
|
}
|
|
1335
1418
|
});
|
|
1336
|
-
var AvatarBase =
|
|
1419
|
+
var AvatarBase = React71__namespace.forwardRef(({ className, size, ...props }, ref) => {
|
|
1337
1420
|
const { root } = avatarVariants({ size });
|
|
1338
1421
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1339
1422
|
AvatarPrimitive__namespace.Root,
|
|
@@ -1345,7 +1428,7 @@ var AvatarBase = React70__namespace.forwardRef(({ className, size, ...props }, r
|
|
|
1345
1428
|
);
|
|
1346
1429
|
});
|
|
1347
1430
|
AvatarBase.displayName = AvatarPrimitive__namespace.Root.displayName;
|
|
1348
|
-
var AvatarImage =
|
|
1431
|
+
var AvatarImage = React71__namespace.forwardRef(({ className, ...props }, ref) => {
|
|
1349
1432
|
const { image } = avatarVariants();
|
|
1350
1433
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1351
1434
|
AvatarPrimitive__namespace.Image,
|
|
@@ -1357,12 +1440,12 @@ var AvatarImage = React70__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
1357
1440
|
);
|
|
1358
1441
|
});
|
|
1359
1442
|
AvatarImage.displayName = AvatarPrimitive__namespace.Image.displayName;
|
|
1360
|
-
var AvatarFallback =
|
|
1443
|
+
var AvatarFallback = React71__namespace.forwardRef(({ className, ...props }, ref) => {
|
|
1361
1444
|
const { fallback } = avatarVariants({ className });
|
|
1362
1445
|
return /* @__PURE__ */ jsxRuntime.jsx(AvatarPrimitive__namespace.Fallback, { ref, className: fallback(), ...props });
|
|
1363
1446
|
});
|
|
1364
1447
|
AvatarFallback.displayName = AvatarPrimitive__namespace.Fallback.displayName;
|
|
1365
|
-
var Avatar =
|
|
1448
|
+
var Avatar = React71__namespace.forwardRef((props, ref) => {
|
|
1366
1449
|
const { size, src, fallback, delayMs, alt, onLoadingStatusChange, ...rest } = props;
|
|
1367
1450
|
return /* @__PURE__ */ jsxRuntime.jsxs(AvatarBase, { ...rest, ref, size, children: [
|
|
1368
1451
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1376,13 +1459,13 @@ var Avatar = React70__namespace.forwardRef((props, ref) => {
|
|
|
1376
1459
|
typeof fallback !== "undefined" && /* @__PURE__ */ jsxRuntime.jsx(AvatarFallback, { delayMs, children: fallback })
|
|
1377
1460
|
] });
|
|
1378
1461
|
});
|
|
1379
|
-
var EVMAvatar =
|
|
1462
|
+
var EVMAvatar = React71__namespace.forwardRef((props, ref) => {
|
|
1380
1463
|
const { address, ...rest } = props;
|
|
1381
|
-
const src =
|
|
1464
|
+
const src = React71.useMemo(() => makeBlockie__default.default(address), [props.address]);
|
|
1382
1465
|
return /* @__PURE__ */ jsxRuntime.jsx(Avatar, { ...rest, src });
|
|
1383
1466
|
});
|
|
1384
1467
|
var ChainIcon = (props) => {
|
|
1385
|
-
const url =
|
|
1468
|
+
const url = React71.useMemo(() => {
|
|
1386
1469
|
return `https://oss.orderly.network/static/network_logo/${props.chainId}.png`;
|
|
1387
1470
|
}, [props.chainId]);
|
|
1388
1471
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1396,7 +1479,7 @@ var ChainIcon = (props) => {
|
|
|
1396
1479
|
);
|
|
1397
1480
|
};
|
|
1398
1481
|
var TokenIcon = (props) => {
|
|
1399
|
-
const url =
|
|
1482
|
+
const url = React71.useMemo(() => {
|
|
1400
1483
|
if (props.url) {
|
|
1401
1484
|
return props.url;
|
|
1402
1485
|
}
|
|
@@ -1419,7 +1502,7 @@ var TokenIcon = (props) => {
|
|
|
1419
1502
|
};
|
|
1420
1503
|
var CombineIcon = (props) => {
|
|
1421
1504
|
const { secondary } = props;
|
|
1422
|
-
const subElement =
|
|
1505
|
+
const subElement = React71.useMemo(() => {
|
|
1423
1506
|
const className = "oui-bg-base-6 oui-absolute oui-bottom-0 oui-right-0 oui-outline oui-outline-2 oui-outline-base-1 oui-z-10";
|
|
1424
1507
|
if (secondary.component) {
|
|
1425
1508
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: tailwindVariants.cnBase(className, secondary?.className), children: secondary.component });
|
|
@@ -1446,7 +1529,7 @@ var CombineIcon = (props) => {
|
|
|
1446
1529
|
subElement
|
|
1447
1530
|
] });
|
|
1448
1531
|
};
|
|
1449
|
-
var CloseIcon =
|
|
1532
|
+
var CloseIcon = React71__namespace.default.forwardRef(
|
|
1450
1533
|
(props, ref) => {
|
|
1451
1534
|
const { opacity = 0.54, ...rest } = props;
|
|
1452
1535
|
return /* @__PURE__ */ jsxRuntime.jsx(BaseIcon, { ref, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1460,7 +1543,7 @@ var CloseIcon = React70__namespace.default.forwardRef(
|
|
|
1460
1543
|
}
|
|
1461
1544
|
);
|
|
1462
1545
|
CloseIcon.displayName = "CloseIcon";
|
|
1463
|
-
var BaseIconWithPath =
|
|
1546
|
+
var BaseIconWithPath = React71__namespace.default.forwardRef((props, ref) => {
|
|
1464
1547
|
const { opacity = 0.54, d, ...rest } = props;
|
|
1465
1548
|
return /* @__PURE__ */ jsxRuntime.jsx(BaseIcon, { ref, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1466
1549
|
"path",
|
|
@@ -1473,7 +1556,7 @@ var BaseIconWithPath = React70__namespace.default.forwardRef((props, ref) => {
|
|
|
1473
1556
|
}
|
|
1474
1557
|
) });
|
|
1475
1558
|
});
|
|
1476
|
-
var CheckIcon =
|
|
1559
|
+
var CheckIcon = React71__namespace.default.forwardRef(
|
|
1477
1560
|
(props, ref) => {
|
|
1478
1561
|
const { opacity = 0.54, ...rest } = props;
|
|
1479
1562
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1487,7 +1570,7 @@ var CheckIcon = React70__namespace.default.forwardRef(
|
|
|
1487
1570
|
}
|
|
1488
1571
|
);
|
|
1489
1572
|
CheckIcon.displayName = "CheckIcon";
|
|
1490
|
-
var ChevronDownIcon =
|
|
1573
|
+
var ChevronDownIcon = React71__namespace.default.forwardRef(
|
|
1491
1574
|
(props, ref) => {
|
|
1492
1575
|
const { opacity = 0.54, ...rest } = props;
|
|
1493
1576
|
return /* @__PURE__ */ jsxRuntime.jsx(BaseIcon, { ref, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1501,7 +1584,7 @@ var ChevronDownIcon = React70__namespace.default.forwardRef(
|
|
|
1501
1584
|
}
|
|
1502
1585
|
);
|
|
1503
1586
|
ChevronDownIcon.displayName = "ChevronDownIcon";
|
|
1504
|
-
var ChevronUpIcon =
|
|
1587
|
+
var ChevronUpIcon = React71__namespace.default.forwardRef(
|
|
1505
1588
|
(props, ref) => {
|
|
1506
1589
|
const { opacity = 0.54, ...rest } = props;
|
|
1507
1590
|
return /* @__PURE__ */ jsxRuntime.jsx(BaseIcon, { ref, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1515,7 +1598,7 @@ var ChevronUpIcon = React70__namespace.default.forwardRef(
|
|
|
1515
1598
|
}
|
|
1516
1599
|
);
|
|
1517
1600
|
ChevronUpIcon.displayName = "ChevronUpIcon";
|
|
1518
|
-
var CaretUpIcon =
|
|
1601
|
+
var CaretUpIcon = React71__namespace.default.forwardRef(
|
|
1519
1602
|
(props, ref) => {
|
|
1520
1603
|
const { opacity = 0.54, ...rest } = props;
|
|
1521
1604
|
return /* @__PURE__ */ jsxRuntime.jsx(BaseIcon, { ref, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1529,7 +1612,7 @@ var CaretUpIcon = React70__namespace.default.forwardRef(
|
|
|
1529
1612
|
}
|
|
1530
1613
|
);
|
|
1531
1614
|
CaretUpIcon.displayName = "CaretUpIcon";
|
|
1532
|
-
var CaretDownIcon =
|
|
1615
|
+
var CaretDownIcon = React71__namespace.default.forwardRef(
|
|
1533
1616
|
(props, ref) => {
|
|
1534
1617
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1535
1618
|
BaseIconWithPath,
|
|
@@ -1542,7 +1625,7 @@ var CaretDownIcon = React70__namespace.default.forwardRef(
|
|
|
1542
1625
|
}
|
|
1543
1626
|
);
|
|
1544
1627
|
CaretDownIcon.displayName = "CaretDownIcon";
|
|
1545
|
-
var CaretLeftIcon =
|
|
1628
|
+
var CaretLeftIcon = React71__namespace.default.forwardRef(
|
|
1546
1629
|
(props, ref) => {
|
|
1547
1630
|
const { opacity = 0.54, ...rest } = props;
|
|
1548
1631
|
return /* @__PURE__ */ jsxRuntime.jsx(BaseIcon, { ref, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1556,7 +1639,7 @@ var CaretLeftIcon = React70__namespace.default.forwardRef(
|
|
|
1556
1639
|
}
|
|
1557
1640
|
);
|
|
1558
1641
|
CaretLeftIcon.displayName = "CaretLeftIcon";
|
|
1559
|
-
var CaretRightIcon =
|
|
1642
|
+
var CaretRightIcon = React71__namespace.default.forwardRef(
|
|
1560
1643
|
(props, ref) => {
|
|
1561
1644
|
const { opacity = 0.54, ...rest } = props;
|
|
1562
1645
|
return /* @__PURE__ */ jsxRuntime.jsx(BaseIcon, { ref, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1570,7 +1653,7 @@ var CaretRightIcon = React70__namespace.default.forwardRef(
|
|
|
1570
1653
|
}
|
|
1571
1654
|
);
|
|
1572
1655
|
CaretRightIcon.displayName = "CaretRightIcon";
|
|
1573
|
-
var ChevronLeftIcon =
|
|
1656
|
+
var ChevronLeftIcon = React71__namespace.default.forwardRef(
|
|
1574
1657
|
(props, ref) => {
|
|
1575
1658
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1576
1659
|
BaseIconWithPath,
|
|
@@ -1583,7 +1666,7 @@ var ChevronLeftIcon = React70__namespace.default.forwardRef(
|
|
|
1583
1666
|
}
|
|
1584
1667
|
);
|
|
1585
1668
|
ChevronLeftIcon.displayName = "ChevronLeftIcon";
|
|
1586
|
-
var ChevronRightIcon =
|
|
1669
|
+
var ChevronRightIcon = React71__namespace.default.forwardRef(
|
|
1587
1670
|
(props, ref) => {
|
|
1588
1671
|
const { opacity = 0.54, ...rest } = props;
|
|
1589
1672
|
return /* @__PURE__ */ jsxRuntime.jsx(BaseIcon, { ref, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1597,7 +1680,7 @@ var ChevronRightIcon = React70__namespace.default.forwardRef(
|
|
|
1597
1680
|
}
|
|
1598
1681
|
);
|
|
1599
1682
|
ChevronRightIcon.displayName = "ChevronRightIcon";
|
|
1600
|
-
var CalendarMinusIcon =
|
|
1683
|
+
var CalendarMinusIcon = React71__namespace.default.forwardRef(
|
|
1601
1684
|
(props, ref) => {
|
|
1602
1685
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1603
1686
|
BaseIconWithPath,
|
|
@@ -1610,7 +1693,7 @@ var CalendarMinusIcon = React70__namespace.default.forwardRef(
|
|
|
1610
1693
|
}
|
|
1611
1694
|
);
|
|
1612
1695
|
CalendarMinusIcon.displayName = "CalendarMinusIcon";
|
|
1613
|
-
var SettingIcon =
|
|
1696
|
+
var SettingIcon = React71__namespace.default.forwardRef(
|
|
1614
1697
|
(props, ref) => {
|
|
1615
1698
|
const { opacity = 0.54, ...rest } = props;
|
|
1616
1699
|
return /* @__PURE__ */ jsxRuntime.jsx(BaseIcon, { ref, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1624,7 +1707,7 @@ var SettingIcon = React70__namespace.default.forwardRef(
|
|
|
1624
1707
|
}
|
|
1625
1708
|
);
|
|
1626
1709
|
SettingIcon.displayName = "SettingIcon";
|
|
1627
|
-
var CloseSquareFillIcon =
|
|
1710
|
+
var CloseSquareFillIcon = React71__namespace.default.forwardRef((props, ref) => {
|
|
1628
1711
|
const { opacity = 0.54, ...rest } = props;
|
|
1629
1712
|
return /* @__PURE__ */ jsxRuntime.jsx(BaseIcon, { ref, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1630
1713
|
"path",
|
|
@@ -1636,7 +1719,7 @@ var CloseSquareFillIcon = React70__namespace.default.forwardRef((props, ref) =>
|
|
|
1636
1719
|
) });
|
|
1637
1720
|
});
|
|
1638
1721
|
CloseSquareFillIcon.displayName = "CloseSquareFillIcon";
|
|
1639
|
-
var CloseCircleFillIcon =
|
|
1722
|
+
var CloseCircleFillIcon = React71__namespace.default.forwardRef((props, ref) => {
|
|
1640
1723
|
const { opacity = 0.54, ...rest } = props;
|
|
1641
1724
|
return /* @__PURE__ */ jsxRuntime.jsx(BaseIcon, { ref, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1642
1725
|
"path",
|
|
@@ -1648,7 +1731,7 @@ var CloseCircleFillIcon = React70__namespace.default.forwardRef((props, ref) =>
|
|
|
1648
1731
|
) });
|
|
1649
1732
|
});
|
|
1650
1733
|
CloseCircleFillIcon.displayName = "CloseCircleFillIcon";
|
|
1651
|
-
var CheckedCircleFillIcon =
|
|
1734
|
+
var CheckedCircleFillIcon = React71__namespace.default.forwardRef((props, ref) => {
|
|
1652
1735
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1653
1736
|
BaseIconWithPath,
|
|
1654
1737
|
{
|
|
@@ -1659,7 +1742,7 @@ var CheckedCircleFillIcon = React70__namespace.default.forwardRef((props, ref) =
|
|
|
1659
1742
|
);
|
|
1660
1743
|
});
|
|
1661
1744
|
CheckedCircleFillIcon.displayName = "CheckedCircleFillIcon";
|
|
1662
|
-
var CheckedSquareFillIcon =
|
|
1745
|
+
var CheckedSquareFillIcon = React71__namespace.default.forwardRef((props, ref) => {
|
|
1663
1746
|
const { opacity = 0.54, ...rest } = props;
|
|
1664
1747
|
return /* @__PURE__ */ jsxRuntime.jsx(BaseIcon, { ref, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1665
1748
|
"path",
|
|
@@ -1673,7 +1756,7 @@ var CheckedSquareFillIcon = React70__namespace.default.forwardRef((props, ref) =
|
|
|
1673
1756
|
) });
|
|
1674
1757
|
});
|
|
1675
1758
|
CheckedSquareFillIcon.displayName = "CheckSquareFillIcon";
|
|
1676
|
-
var CheckSquareEmptyIcon =
|
|
1759
|
+
var CheckSquareEmptyIcon = React71__namespace.default.forwardRef(
|
|
1677
1760
|
(props, ref) => {
|
|
1678
1761
|
const { opacity = 0.54, ...rest } = props;
|
|
1679
1762
|
return /* @__PURE__ */ jsxRuntime.jsx(BaseIcon, { ref, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1689,7 +1772,7 @@ var CheckSquareEmptyIcon = React70__namespace.default.forwardRef(
|
|
|
1689
1772
|
}
|
|
1690
1773
|
);
|
|
1691
1774
|
CheckSquareEmptyIcon.displayName = "CheckSquareEmptyIcon";
|
|
1692
|
-
var PlusIcon =
|
|
1775
|
+
var PlusIcon = React71__namespace.default.forwardRef(
|
|
1693
1776
|
(props, ref) => {
|
|
1694
1777
|
const { opacity = 0.54, ...rest } = props;
|
|
1695
1778
|
return /* @__PURE__ */ jsxRuntime.jsx(BaseIcon, { ref, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1703,7 +1786,7 @@ var PlusIcon = React70__namespace.default.forwardRef(
|
|
|
1703
1786
|
}
|
|
1704
1787
|
);
|
|
1705
1788
|
PlusIcon.displayName = "PlusIcon";
|
|
1706
|
-
var ReduceIcon =
|
|
1789
|
+
var ReduceIcon = React71__namespace.default.forwardRef(
|
|
1707
1790
|
(props, ref) => {
|
|
1708
1791
|
const { opacity = 0.54, ...rest } = props;
|
|
1709
1792
|
return /* @__PURE__ */ jsxRuntime.jsx(BaseIcon, { ref, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1721,7 +1804,7 @@ var ReduceIcon = React70__namespace.default.forwardRef(
|
|
|
1721
1804
|
}
|
|
1722
1805
|
);
|
|
1723
1806
|
ReduceIcon.displayName = "ReduceIcon";
|
|
1724
|
-
var CircleOutlinedIcon =
|
|
1807
|
+
var CircleOutlinedIcon = React71__namespace.default.forwardRef((props, ref) => {
|
|
1725
1808
|
const { opacity = 0.54, ...rest } = props;
|
|
1726
1809
|
return /* @__PURE__ */ jsxRuntime.jsx(BaseIcon, { ref, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1727
1810
|
"path",
|
|
@@ -1733,7 +1816,7 @@ var CircleOutlinedIcon = React70__namespace.default.forwardRef((props, ref) => {
|
|
|
1733
1816
|
) });
|
|
1734
1817
|
});
|
|
1735
1818
|
CircleOutlinedIcon.displayName = "CircleOutlinedIcon";
|
|
1736
|
-
var SquareOutlinedIcon =
|
|
1819
|
+
var SquareOutlinedIcon = React71__namespace.default.forwardRef((props, ref) => {
|
|
1737
1820
|
const { opacity = 0.54, ...rest } = props;
|
|
1738
1821
|
return /* @__PURE__ */ jsxRuntime.jsx(BaseIcon, { ref, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1739
1822
|
"path",
|
|
@@ -1745,7 +1828,7 @@ var SquareOutlinedIcon = React70__namespace.default.forwardRef((props, ref) => {
|
|
|
1745
1828
|
) });
|
|
1746
1829
|
});
|
|
1747
1830
|
SquareOutlinedIcon.displayName = "SquareOutlinedIcon";
|
|
1748
|
-
var ExclamationFillIcon =
|
|
1831
|
+
var ExclamationFillIcon = React71__namespace.default.forwardRef((props, ref) => {
|
|
1749
1832
|
const { ...rest } = props;
|
|
1750
1833
|
return /* @__PURE__ */ jsxRuntime.jsx(BaseIcon, { ref, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1751
1834
|
"path",
|
|
@@ -1756,7 +1839,7 @@ var ExclamationFillIcon = React70__namespace.default.forwardRef((props, ref) =>
|
|
|
1756
1839
|
) });
|
|
1757
1840
|
});
|
|
1758
1841
|
ExclamationFillIcon.displayName = "ExclamationFillIcon";
|
|
1759
|
-
var QuestionFillIcon =
|
|
1842
|
+
var QuestionFillIcon = React71__namespace.default.forwardRef(
|
|
1760
1843
|
(props, ref) => {
|
|
1761
1844
|
const { opacity = 0.54, ...rest } = props;
|
|
1762
1845
|
return /* @__PURE__ */ jsxRuntime.jsx(BaseIcon, { ref, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1770,7 +1853,7 @@ var QuestionFillIcon = React70__namespace.default.forwardRef(
|
|
|
1770
1853
|
}
|
|
1771
1854
|
);
|
|
1772
1855
|
QuestionFillIcon.displayName = "ExclamationFillIcon";
|
|
1773
|
-
var ArrowLeftRightIcon =
|
|
1856
|
+
var ArrowLeftRightIcon = React71__namespace.default.forwardRef((props, ref) => {
|
|
1774
1857
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1775
1858
|
BaseIconWithPath,
|
|
1776
1859
|
{
|
|
@@ -1781,7 +1864,7 @@ var ArrowLeftRightIcon = React70__namespace.default.forwardRef((props, ref) => {
|
|
|
1781
1864
|
);
|
|
1782
1865
|
});
|
|
1783
1866
|
ArrowLeftRightIcon.displayName = "ArrowLeftRightIcon";
|
|
1784
|
-
var ArrowDownUpIcon =
|
|
1867
|
+
var ArrowDownUpIcon = React71__namespace.default.forwardRef(
|
|
1785
1868
|
(props, ref) => {
|
|
1786
1869
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1787
1870
|
BaseIconWithPath,
|
|
@@ -1794,7 +1877,7 @@ var ArrowDownUpIcon = React70__namespace.default.forwardRef(
|
|
|
1794
1877
|
}
|
|
1795
1878
|
);
|
|
1796
1879
|
ArrowDownUpIcon.displayName = "ArrowDownUpIconIcon";
|
|
1797
|
-
var ArrowUpSquareFillIcon =
|
|
1880
|
+
var ArrowUpSquareFillIcon = React71__namespace.default.forwardRef((props, ref) => {
|
|
1798
1881
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1799
1882
|
BaseIconWithPath,
|
|
1800
1883
|
{
|
|
@@ -1805,7 +1888,7 @@ var ArrowUpSquareFillIcon = React70__namespace.default.forwardRef((props, ref) =
|
|
|
1805
1888
|
);
|
|
1806
1889
|
});
|
|
1807
1890
|
ArrowUpSquareFillIcon.displayName = "ArrowUpSquareFillIconIcon";
|
|
1808
|
-
var ArrowDownSquareFillIcon =
|
|
1891
|
+
var ArrowDownSquareFillIcon = React71__namespace.default.forwardRef((props, ref) => {
|
|
1809
1892
|
const { opacity = 0.54, ...rest } = props;
|
|
1810
1893
|
return /* @__PURE__ */ jsxRuntime.jsx(BaseIcon, { ref, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1811
1894
|
"path",
|
|
@@ -1817,7 +1900,7 @@ var ArrowDownSquareFillIcon = React70__namespace.default.forwardRef((props, ref)
|
|
|
1817
1900
|
) });
|
|
1818
1901
|
});
|
|
1819
1902
|
ArrowDownSquareFillIcon.displayName = "ArrowDownSquareFillIconIcon";
|
|
1820
|
-
var ArrowLeftRightSquareFill =
|
|
1903
|
+
var ArrowLeftRightSquareFill = React71__namespace.default.forwardRef((props, ref) => {
|
|
1821
1904
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1822
1905
|
"svg",
|
|
1823
1906
|
{
|
|
@@ -1843,7 +1926,7 @@ var ArrowLeftRightSquareFill = React70__namespace.default.forwardRef((props, ref
|
|
|
1843
1926
|
if (process.env.NODE_ENV !== "production") {
|
|
1844
1927
|
ArrowLeftRightSquareFill.displayName = "ArrowLeftRightSquareFill";
|
|
1845
1928
|
}
|
|
1846
|
-
var ArrowRightUpSquareFillIcon =
|
|
1929
|
+
var ArrowRightUpSquareFillIcon = React71__namespace.default.forwardRef((props, ref) => {
|
|
1847
1930
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1848
1931
|
BaseIconWithPath,
|
|
1849
1932
|
{
|
|
@@ -2012,7 +2095,7 @@ var BattleSolidInactiveIcon = (props) => {
|
|
|
2012
2095
|
}
|
|
2013
2096
|
) });
|
|
2014
2097
|
};
|
|
2015
|
-
var FeeTierIcon =
|
|
2098
|
+
var FeeTierIcon = React71__namespace.default.forwardRef(
|
|
2016
2099
|
(props, ref) => {
|
|
2017
2100
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2018
2101
|
BaseIconWithPath,
|
|
@@ -2078,7 +2161,7 @@ var EarnInactiveIcon = (props) => {
|
|
|
2078
2161
|
)
|
|
2079
2162
|
] }) });
|
|
2080
2163
|
};
|
|
2081
|
-
var EditIcon =
|
|
2164
|
+
var EditIcon = React71__namespace.default.forwardRef(
|
|
2082
2165
|
(props, ref) => {
|
|
2083
2166
|
const { opacity = 0.54, ...rest } = props;
|
|
2084
2167
|
return /* @__PURE__ */ jsxRuntime.jsx(BaseIcon, { ref, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2092,7 +2175,7 @@ var EditIcon = React70__namespace.default.forwardRef(
|
|
|
2092
2175
|
}
|
|
2093
2176
|
);
|
|
2094
2177
|
EditIcon.displayName = "EditIcon";
|
|
2095
|
-
var EyeIcon =
|
|
2178
|
+
var EyeIcon = React71__namespace.default.forwardRef(
|
|
2096
2179
|
(props, ref) => {
|
|
2097
2180
|
const { opacity = 0.54, ...rest } = props;
|
|
2098
2181
|
return /* @__PURE__ */ jsxRuntime.jsx(BaseIcon, { ref, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2106,7 +2189,7 @@ var EyeIcon = React70__namespace.default.forwardRef(
|
|
|
2106
2189
|
}
|
|
2107
2190
|
);
|
|
2108
2191
|
EyeIcon.displayName = "EyeIcon";
|
|
2109
|
-
var ShareIcon =
|
|
2192
|
+
var ShareIcon = React71__namespace.default.forwardRef(
|
|
2110
2193
|
(props, ref) => {
|
|
2111
2194
|
const { opacity = 0.54, ...rest } = props;
|
|
2112
2195
|
return /* @__PURE__ */ jsxRuntime.jsx(BaseIcon, { ref, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2120,7 +2203,7 @@ var ShareIcon = React70__namespace.default.forwardRef(
|
|
|
2120
2203
|
}
|
|
2121
2204
|
);
|
|
2122
2205
|
ShareIcon.displayName = "ShareIcon";
|
|
2123
|
-
var EyeCloseIcon =
|
|
2206
|
+
var EyeCloseIcon = React71__namespace.default.forwardRef(
|
|
2124
2207
|
(props, ref) => {
|
|
2125
2208
|
const { opacity = 0.54, ...rest } = props;
|
|
2126
2209
|
return /* @__PURE__ */ jsxRuntime.jsx(BaseIcon, { ref, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2134,7 +2217,7 @@ var EyeCloseIcon = React70__namespace.default.forwardRef(
|
|
|
2134
2217
|
}
|
|
2135
2218
|
);
|
|
2136
2219
|
EyeCloseIcon.displayName = "EyeCloseIcon";
|
|
2137
|
-
var RefreshIcon =
|
|
2220
|
+
var RefreshIcon = React71__namespace.default.forwardRef(
|
|
2138
2221
|
(props, ref) => {
|
|
2139
2222
|
const { opacity = 0.54, ...rest } = props;
|
|
2140
2223
|
return /* @__PURE__ */ jsxRuntime.jsx(BaseIcon, { ref, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2306,7 +2389,7 @@ var EsOrderlyIcon = (props) => {
|
|
|
2306
2389
|
}
|
|
2307
2390
|
);
|
|
2308
2391
|
};
|
|
2309
|
-
var InfoCircleIcon =
|
|
2392
|
+
var InfoCircleIcon = React71__namespace.default.forwardRef(
|
|
2310
2393
|
(props, ref) => {
|
|
2311
2394
|
const { className, opacity = 0.36, ...rest } = props;
|
|
2312
2395
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2333,14 +2416,14 @@ var InfoCircleIcon = React70__namespace.default.forwardRef(
|
|
|
2333
2416
|
}
|
|
2334
2417
|
);
|
|
2335
2418
|
var WalletIcon = (props) => {
|
|
2336
|
-
const url =
|
|
2419
|
+
const url = React71.useMemo(() => {
|
|
2337
2420
|
const split = props.name?.split(" ");
|
|
2338
2421
|
const formatWalletName = split?.[0]?.toLowerCase();
|
|
2339
2422
|
return `https://oss.orderly.network/static/wallet_icon/${formatWalletName}.png`;
|
|
2340
2423
|
}, [props.name]);
|
|
2341
2424
|
return /* @__PURE__ */ jsxRuntime.jsx(Avatar, { size: props.size, src: url, alt: `${props.name}` });
|
|
2342
2425
|
};
|
|
2343
|
-
var CalendarIcon =
|
|
2426
|
+
var CalendarIcon = React71__namespace.default.forwardRef(
|
|
2344
2427
|
(props, ref) => {
|
|
2345
2428
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2346
2429
|
BaseIconWithPath,
|
|
@@ -2353,7 +2436,7 @@ var CalendarIcon = React70__namespace.default.forwardRef(
|
|
|
2353
2436
|
}
|
|
2354
2437
|
);
|
|
2355
2438
|
CalendarIcon.displayName = "CaretLeftIcon";
|
|
2356
|
-
var CopyIcon =
|
|
2439
|
+
var CopyIcon = React71__namespace.default.forwardRef(
|
|
2357
2440
|
(props, ref) => {
|
|
2358
2441
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2359
2442
|
BaseIconWithPath,
|
|
@@ -2366,7 +2449,7 @@ var CopyIcon = React70__namespace.default.forwardRef(
|
|
|
2366
2449
|
}
|
|
2367
2450
|
);
|
|
2368
2451
|
CopyIcon.displayName = "CopyIcon";
|
|
2369
|
-
var ServerFillIcon =
|
|
2452
|
+
var ServerFillIcon = React71__namespace.default.forwardRef(
|
|
2370
2453
|
(props, ref) => {
|
|
2371
2454
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2372
2455
|
BaseIconWithPath,
|
|
@@ -2379,7 +2462,7 @@ var ServerFillIcon = React70__namespace.default.forwardRef(
|
|
|
2379
2462
|
}
|
|
2380
2463
|
);
|
|
2381
2464
|
ServerFillIcon.displayName = "ServerFillIcon";
|
|
2382
|
-
var SortingAscIcon =
|
|
2465
|
+
var SortingAscIcon = React71__namespace.default.forwardRef(
|
|
2383
2466
|
(props, ref) => {
|
|
2384
2467
|
const { opacity = 0.54, ...rest } = props;
|
|
2385
2468
|
return /* @__PURE__ */ jsxRuntime.jsxs(BaseIcon, { ref, ...rest, children: [
|
|
@@ -2403,7 +2486,7 @@ var SortingAscIcon = React70__namespace.default.forwardRef(
|
|
|
2403
2486
|
}
|
|
2404
2487
|
);
|
|
2405
2488
|
SortingAscIcon.displayName = "SortingAscIcon";
|
|
2406
|
-
var SortingDescIcon =
|
|
2489
|
+
var SortingDescIcon = React71__namespace.default.forwardRef(
|
|
2407
2490
|
(props, ref) => {
|
|
2408
2491
|
const { opacity = 0.54, ...rest } = props;
|
|
2409
2492
|
return /* @__PURE__ */ jsxRuntime.jsxs(BaseIcon, { ref, ...rest, children: [
|
|
@@ -2427,7 +2510,7 @@ var SortingDescIcon = React70__namespace.default.forwardRef(
|
|
|
2427
2510
|
}
|
|
2428
2511
|
);
|
|
2429
2512
|
SortingDescIcon.displayName = "SortingDescIcon";
|
|
2430
|
-
var ArrowUpShortIcon =
|
|
2513
|
+
var ArrowUpShortIcon = React71__namespace.default.forwardRef(
|
|
2431
2514
|
(props, ref) => {
|
|
2432
2515
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2433
2516
|
BaseIconWithPath,
|
|
@@ -2439,7 +2522,7 @@ var ArrowUpShortIcon = React70__namespace.default.forwardRef(
|
|
|
2439
2522
|
);
|
|
2440
2523
|
}
|
|
2441
2524
|
);
|
|
2442
|
-
var ArrowDownShortIcon =
|
|
2525
|
+
var ArrowDownShortIcon = React71__namespace.default.forwardRef(
|
|
2443
2526
|
(props, ref) => {
|
|
2444
2527
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2445
2528
|
BaseIconWithPath,
|
|
@@ -2451,7 +2534,7 @@ var ArrowDownShortIcon = React70__namespace.default.forwardRef(
|
|
|
2451
2534
|
);
|
|
2452
2535
|
}
|
|
2453
2536
|
);
|
|
2454
|
-
var ArrowLeftShortIcon =
|
|
2537
|
+
var ArrowLeftShortIcon = React71__namespace.default.forwardRef(
|
|
2455
2538
|
(props, ref) => {
|
|
2456
2539
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2457
2540
|
BaseIconWithPath,
|
|
@@ -2463,7 +2546,7 @@ var ArrowLeftShortIcon = React70__namespace.default.forwardRef(
|
|
|
2463
2546
|
);
|
|
2464
2547
|
}
|
|
2465
2548
|
);
|
|
2466
|
-
var ArrowRightShortIcon =
|
|
2549
|
+
var ArrowRightShortIcon = React71__namespace.default.forwardRef(
|
|
2467
2550
|
(props, ref) => {
|
|
2468
2551
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2469
2552
|
BaseIconWithPath,
|
|
@@ -2479,7 +2562,7 @@ ArrowUpShortIcon.displayName = "ArrowUpShortIcon";
|
|
|
2479
2562
|
ArrowDownShortIcon.displayName = "ArrowDownShortIcon";
|
|
2480
2563
|
ArrowLeftShortIcon.displayName = "ArrowLeftShortIcon";
|
|
2481
2564
|
ArrowRightShortIcon.displayName = "ArrowRightShortIcon";
|
|
2482
|
-
var SortingIcon =
|
|
2565
|
+
var SortingIcon = React71__namespace.default.forwardRef(
|
|
2483
2566
|
(props, ref) => {
|
|
2484
2567
|
const { opacity = 0.54, ...rest } = props;
|
|
2485
2568
|
return /* @__PURE__ */ jsxRuntime.jsx(BaseIcon, { ref, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3509,7 +3592,7 @@ var StarChildChatInactiveIcon = (props) => {
|
|
|
3509
3592
|
)
|
|
3510
3593
|
] });
|
|
3511
3594
|
};
|
|
3512
|
-
var CloseRoundFillIcon =
|
|
3595
|
+
var CloseRoundFillIcon = React71__namespace.default.forwardRef((props, ref) => {
|
|
3513
3596
|
const { opacity = 0.54, ...rest } = props;
|
|
3514
3597
|
return /* @__PURE__ */ jsxRuntime.jsx(BaseIcon, { ref, ...rest, viewBox: "0 0 28 28", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3515
3598
|
"path",
|
|
@@ -3792,7 +3875,7 @@ function EmptyStateIcon() {
|
|
|
3792
3875
|
);
|
|
3793
3876
|
}
|
|
3794
3877
|
var emptyData_default = EmptyStateIcon;
|
|
3795
|
-
var VectorIcon =
|
|
3878
|
+
var VectorIcon = React71__namespace.default.forwardRef(
|
|
3796
3879
|
(props, ref) => {
|
|
3797
3880
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3798
3881
|
"svg",
|
|
@@ -3886,7 +3969,7 @@ var PersonIcon = () => {
|
|
|
3886
3969
|
}
|
|
3887
3970
|
);
|
|
3888
3971
|
};
|
|
3889
|
-
var SettingFillIcon =
|
|
3972
|
+
var SettingFillIcon = React71__namespace.default.forwardRef(
|
|
3890
3973
|
(props, ref) => {
|
|
3891
3974
|
const { opacity = 0.54, ...rest } = props;
|
|
3892
3975
|
return /* @__PURE__ */ jsxRuntime.jsx(BaseIcon, { ref, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3921,7 +4004,7 @@ var TradingLeftNavIcon = (props) => {
|
|
|
3921
4004
|
}
|
|
3922
4005
|
);
|
|
3923
4006
|
};
|
|
3924
|
-
var VaultsIcon =
|
|
4007
|
+
var VaultsIcon = React71__namespace.default.forwardRef(
|
|
3925
4008
|
(props, ref) => {
|
|
3926
4009
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3927
4010
|
"svg",
|
|
@@ -3946,7 +4029,7 @@ var VaultsIcon = React70__namespace.default.forwardRef(
|
|
|
3946
4029
|
if (process.env.NODE_ENV !== "production") {
|
|
3947
4030
|
VaultsIcon.displayName = "VaultsIcon";
|
|
3948
4031
|
}
|
|
3949
|
-
var LeftNavVaultsIcon =
|
|
4032
|
+
var LeftNavVaultsIcon = React71.forwardRef(
|
|
3950
4033
|
(props, ref) => {
|
|
3951
4034
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3952
4035
|
"svg",
|
|
@@ -3986,7 +4069,7 @@ var LeftNavVaultsIcon = React70.forwardRef(
|
|
|
3986
4069
|
);
|
|
3987
4070
|
}
|
|
3988
4071
|
);
|
|
3989
|
-
var NewsFillIcon =
|
|
4072
|
+
var NewsFillIcon = React71__namespace.default.forwardRef(
|
|
3990
4073
|
(props, ref) => {
|
|
3991
4074
|
const { opacity = 1, ...rest } = props;
|
|
3992
4075
|
return /* @__PURE__ */ jsxRuntime.jsx(BaseIcon, { ref, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4000,7 +4083,7 @@ var NewsFillIcon = React70__namespace.default.forwardRef(
|
|
|
4000
4083
|
}
|
|
4001
4084
|
);
|
|
4002
4085
|
NewsFillIcon.displayName = "NewsFillIcon";
|
|
4003
|
-
var BellIcon =
|
|
4086
|
+
var BellIcon = React71__namespace.default.forwardRef(
|
|
4004
4087
|
(props, ref) => {
|
|
4005
4088
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4006
4089
|
BaseIconWithPath,
|
|
@@ -4074,7 +4157,7 @@ var ReferralSolidIcon = (props) => {
|
|
|
4074
4157
|
}
|
|
4075
4158
|
) });
|
|
4076
4159
|
};
|
|
4077
|
-
var AddCircleIcon =
|
|
4160
|
+
var AddCircleIcon = React71__namespace.default.forwardRef(
|
|
4078
4161
|
(props, ref) => {
|
|
4079
4162
|
const { className, opacity = 0.54, ...rest } = props;
|
|
4080
4163
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -4110,7 +4193,7 @@ var AddCircleIcon = React70__namespace.default.forwardRef(
|
|
|
4110
4193
|
}
|
|
4111
4194
|
);
|
|
4112
4195
|
AddCircleIcon.displayName = "AddCircleIcon";
|
|
4113
|
-
var WarningIcon =
|
|
4196
|
+
var WarningIcon = React71__namespace.default.forwardRef(
|
|
4114
4197
|
(props, ref) => {
|
|
4115
4198
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4116
4199
|
"svg",
|
|
@@ -4127,7 +4210,7 @@ var WarningIcon = React70__namespace.default.forwardRef(
|
|
|
4127
4210
|
);
|
|
4128
4211
|
}
|
|
4129
4212
|
);
|
|
4130
|
-
var RwaIcon =
|
|
4213
|
+
var RwaIcon = React71__namespace.default.forwardRef(
|
|
4131
4214
|
(props, ref) => {
|
|
4132
4215
|
const { opacity = 1, ...rest } = props;
|
|
4133
4216
|
return /* @__PURE__ */ jsxRuntime.jsx(BaseIcon, { ref, ...rest, viewBox: "0 0 12 12", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4198,7 +4281,7 @@ var textVariants = tv({
|
|
|
4198
4281
|
}
|
|
4199
4282
|
}
|
|
4200
4283
|
});
|
|
4201
|
-
var Text =
|
|
4284
|
+
var Text = React71__namespace.default.forwardRef((props, forwardedRef) => {
|
|
4202
4285
|
const {
|
|
4203
4286
|
children,
|
|
4204
4287
|
className,
|
|
@@ -4287,7 +4370,7 @@ var isTextRule = (rule) => {
|
|
|
4287
4370
|
};
|
|
4288
4371
|
var DEFAULT_SYMBOL_FORMAT = "base-quote";
|
|
4289
4372
|
var DEFAULT_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
|
|
4290
|
-
var FormattedText =
|
|
4373
|
+
var FormattedText = React71__namespace.default.forwardRef(
|
|
4291
4374
|
(props, ref) => {
|
|
4292
4375
|
const {
|
|
4293
4376
|
rule,
|
|
@@ -4312,13 +4395,13 @@ var FormattedText = React70__namespace.default.forwardRef(
|
|
|
4312
4395
|
isIcon,
|
|
4313
4396
|
...rest
|
|
4314
4397
|
} = props;
|
|
4315
|
-
const prefixElement =
|
|
4398
|
+
const prefixElement = React71.useMemo(() => {
|
|
4316
4399
|
if (rule === "symbol" && showIcon) {
|
|
4317
4400
|
return /* @__PURE__ */ jsxRuntime.jsx(TokenIcon, { symbol: children, size: iconSize });
|
|
4318
4401
|
}
|
|
4319
4402
|
return prefix;
|
|
4320
4403
|
}, [prefix, showIcon, rule, iconSize, children]);
|
|
4321
|
-
const suffix =
|
|
4404
|
+
const suffix = React71.useMemo(() => {
|
|
4322
4405
|
if (typeof props.suffix !== "undefined") {
|
|
4323
4406
|
return props.suffix;
|
|
4324
4407
|
}
|
|
@@ -4337,7 +4420,7 @@ var FormattedText = React70__namespace.default.forwardRef(
|
|
|
4337
4420
|
);
|
|
4338
4421
|
}
|
|
4339
4422
|
}, [props.suffix, copyable, children]);
|
|
4340
|
-
const content =
|
|
4423
|
+
const content = React71.useMemo(() => {
|
|
4341
4424
|
if (typeof children === "undefined") {
|
|
4342
4425
|
return "--";
|
|
4343
4426
|
}
|
|
@@ -4367,9 +4450,12 @@ var FormattedText = React70__namespace.default.forwardRef(
|
|
|
4367
4450
|
const quote = arr[2];
|
|
4368
4451
|
return (formatString ?? DEFAULT_SYMBOL_FORMAT).replace("type", type).replace("base", base).replace("quote", quote);
|
|
4369
4452
|
}
|
|
4453
|
+
if (capitalize && typeof children === "string") {
|
|
4454
|
+
return children.charAt(0).toUpperCase() + children.slice(1);
|
|
4455
|
+
}
|
|
4370
4456
|
return children;
|
|
4371
|
-
}, [children, rule, formatString, range, symbolElement]);
|
|
4372
|
-
const contentWithFix =
|
|
4457
|
+
}, [children, rule, formatString, range, symbolElement, capitalize]);
|
|
4458
|
+
const contentWithFix = React71.useMemo(() => {
|
|
4373
4459
|
if (typeof suffix === "undefined" && typeof prefixElement === "undefined") {
|
|
4374
4460
|
return content;
|
|
4375
4461
|
}
|
|
@@ -4399,7 +4485,7 @@ var gradientTextVariants = tv({
|
|
|
4399
4485
|
}
|
|
4400
4486
|
}
|
|
4401
4487
|
});
|
|
4402
|
-
var GradientText =
|
|
4488
|
+
var GradientText = React71__namespace.default.forwardRef((props, ref) => {
|
|
4403
4489
|
const { color, className, angle, ...rest } = props;
|
|
4404
4490
|
const style = parseAngleProps({ angle });
|
|
4405
4491
|
return (
|
|
@@ -4442,7 +4528,7 @@ var Numeral = (props) => {
|
|
|
4442
4528
|
...rest
|
|
4443
4529
|
} = props;
|
|
4444
4530
|
const num = Number(props.children);
|
|
4445
|
-
const child =
|
|
4531
|
+
const child = React71.useMemo(() => {
|
|
4446
4532
|
if (props.children === "-") return props.children;
|
|
4447
4533
|
if (isNaN(num)) return placeholder ?? "--";
|
|
4448
4534
|
if (typeof visible !== "undefined" && !visible) return masking ?? "*****";
|
|
@@ -4462,7 +4548,7 @@ var Numeral = (props) => {
|
|
|
4462
4548
|
});
|
|
4463
4549
|
}, [num, visible, tick, dp]);
|
|
4464
4550
|
const defaultColor = rest.color || "inherit";
|
|
4465
|
-
const colorName =
|
|
4551
|
+
const colorName = React71.useMemo(() => {
|
|
4466
4552
|
if (!coloring) return defaultColor;
|
|
4467
4553
|
if (typeof visible !== "undefined" && !visible) return defaultColor;
|
|
4468
4554
|
if (Number.isNaN(num)) {
|
|
@@ -4472,7 +4558,7 @@ var Numeral = (props) => {
|
|
|
4472
4558
|
if (num < 0) return "lose";
|
|
4473
4559
|
return "profit";
|
|
4474
4560
|
}, [coloring, num, rest.color, props.visible]);
|
|
4475
|
-
const identifier =
|
|
4561
|
+
const identifier = React71.useMemo(() => {
|
|
4476
4562
|
if (!showIdentifier || Number.isNaN(num) || num === 0) return null;
|
|
4477
4563
|
if (typeof visible !== "undefined" && !visible) return null;
|
|
4478
4564
|
if (num < 0) {
|
|
@@ -4482,7 +4568,7 @@ var Numeral = (props) => {
|
|
|
4482
4568
|
if (identifiers?.profit) return identifiers.profit;
|
|
4483
4569
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { children: "+" });
|
|
4484
4570
|
}, [num, props.visible, showIdentifier]);
|
|
4485
|
-
const childWithUnit =
|
|
4571
|
+
const childWithUnit = React71.useMemo(() => {
|
|
4486
4572
|
if (typeof suffix === "undefined" && typeof prefix === "undefined" && typeof unit === "undefined" && typeof currency === "undefined" && !showIdentifier) {
|
|
4487
4573
|
return child;
|
|
4488
4574
|
}
|
|
@@ -4567,7 +4653,7 @@ var statisticVariants = tv({
|
|
|
4567
4653
|
// color: "default",
|
|
4568
4654
|
}
|
|
4569
4655
|
});
|
|
4570
|
-
var StatisticLabel =
|
|
4656
|
+
var StatisticLabel = React71__namespace.default.forwardRef(
|
|
4571
4657
|
(props, ref) => {
|
|
4572
4658
|
const { label: labelClassName } = statisticVariants({});
|
|
4573
4659
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4583,10 +4669,10 @@ var StatisticLabel = React70__namespace.default.forwardRef(
|
|
|
4583
4669
|
}
|
|
4584
4670
|
);
|
|
4585
4671
|
StatisticLabel.displayName = "StatisticLabel";
|
|
4586
|
-
var Statistic =
|
|
4672
|
+
var Statistic = React71__namespace.default.forwardRef((props, ref) => {
|
|
4587
4673
|
const { label, valueProps, align, className, classNames, children, ...rest } = props;
|
|
4588
4674
|
const { root, value: valueClassName } = statisticVariants({ align });
|
|
4589
|
-
const value =
|
|
4675
|
+
const value = React71.useMemo(() => {
|
|
4590
4676
|
if (typeof children === "string" || typeof children === "number") {
|
|
4591
4677
|
const { className: valueClass, as, ...restValueProps } = valueProps ?? {};
|
|
4592
4678
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4630,7 +4716,7 @@ Text2.pnl = NumTypePnl;
|
|
|
4630
4716
|
Text2.notional = NumTypeNotional;
|
|
4631
4717
|
Text2.assetValue = NumTypeAssetValue;
|
|
4632
4718
|
Text2.collateral = NumTypeCollateral;
|
|
4633
|
-
var BaseInput =
|
|
4719
|
+
var BaseInput = React71.forwardRef(
|
|
4634
4720
|
(props, ref) => {
|
|
4635
4721
|
const {
|
|
4636
4722
|
clearable,
|
|
@@ -4647,14 +4733,14 @@ var BaseInput = React70.forwardRef(
|
|
|
4647
4733
|
value,
|
|
4648
4734
|
...inputProps
|
|
4649
4735
|
} = props;
|
|
4650
|
-
const [cursor, setCursor] =
|
|
4651
|
-
const innerInputRef =
|
|
4652
|
-
const prevInputValue =
|
|
4653
|
-
const isFocused =
|
|
4654
|
-
const innerFormatters =
|
|
4736
|
+
const [cursor, setCursor] = React71.useState(null);
|
|
4737
|
+
const innerInputRef = React71.useRef(null);
|
|
4738
|
+
const prevInputValue = React71.useRef(null);
|
|
4739
|
+
const isFocused = React71.useRef(false);
|
|
4740
|
+
const innerFormatters = React71.useMemo(() => {
|
|
4655
4741
|
return formatters ?? [];
|
|
4656
4742
|
}, [formatters]);
|
|
4657
|
-
|
|
4743
|
+
React71.useEffect(() => {
|
|
4658
4744
|
if (!ref) return;
|
|
4659
4745
|
if (typeof ref === "function") {
|
|
4660
4746
|
ref(innerInputRef.current);
|
|
@@ -4662,7 +4748,7 @@ var BaseInput = React70.forwardRef(
|
|
|
4662
4748
|
ref.current = innerInputRef.current;
|
|
4663
4749
|
}
|
|
4664
4750
|
}, [innerInputRef, ref]);
|
|
4665
|
-
const formatToRender =
|
|
4751
|
+
const formatToRender = React71.useCallback(
|
|
4666
4752
|
(value2) => {
|
|
4667
4753
|
if (!Array.isArray(innerFormatters) || innerFormatters.length === 0)
|
|
4668
4754
|
return value2;
|
|
@@ -4678,7 +4764,7 @@ var BaseInput = React70.forwardRef(
|
|
|
4678
4764
|
},
|
|
4679
4765
|
[innerFormatters]
|
|
4680
4766
|
);
|
|
4681
|
-
const formatToChange =
|
|
4767
|
+
const formatToChange = React71.useCallback(
|
|
4682
4768
|
(value2, originValue) => {
|
|
4683
4769
|
if (!Array.isArray(innerFormatters) || innerFormatters.length === 0)
|
|
4684
4770
|
return value2;
|
|
@@ -4695,11 +4781,11 @@ var BaseInput = React70.forwardRef(
|
|
|
4695
4781
|
},
|
|
4696
4782
|
[innerFormatters]
|
|
4697
4783
|
);
|
|
4698
|
-
const formattedValue =
|
|
4784
|
+
const formattedValue = React71.useMemo(() => {
|
|
4699
4785
|
if (typeof value === "undefined" || value === null) return "";
|
|
4700
4786
|
return formatToRender(value);
|
|
4701
4787
|
}, [value, formatToRender]);
|
|
4702
|
-
|
|
4788
|
+
React71.useEffect(() => {
|
|
4703
4789
|
if (document.activeElement !== innerInputRef.current) return;
|
|
4704
4790
|
const nextValueLen = `${formattedValue}`.length;
|
|
4705
4791
|
const prevValueLen = prevInputValue.current?.length || 0;
|
|
@@ -4924,7 +5010,7 @@ var inputVariants = tv(
|
|
|
4924
5010
|
responsiveVariants: ["md", "lg"]
|
|
4925
5011
|
}
|
|
4926
5012
|
);
|
|
4927
|
-
var Input =
|
|
5013
|
+
var Input = React71__namespace.default.forwardRef((props, ref) => {
|
|
4928
5014
|
const {
|
|
4929
5015
|
size,
|
|
4930
5016
|
disabled,
|
|
@@ -4951,7 +5037,7 @@ var Input = React70__namespace.default.forwardRef((props, ref) => {
|
|
|
4951
5037
|
pl: typeof prefix === "undefined" || pl,
|
|
4952
5038
|
pr: typeof suffix === "undefined" || pr
|
|
4953
5039
|
});
|
|
4954
|
-
const cid =
|
|
5040
|
+
const cid = React71.useId();
|
|
4955
5041
|
const suffixElement = typeof onClear !== "undefined" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4956
5042
|
ClearButton,
|
|
4957
5043
|
{
|
|
@@ -5003,7 +5089,7 @@ var Input = React70__namespace.default.forwardRef((props, ref) => {
|
|
|
5003
5089
|
)
|
|
5004
5090
|
] });
|
|
5005
5091
|
});
|
|
5006
|
-
var ClearButton =
|
|
5092
|
+
var ClearButton = React71__namespace.default.forwardRef((props, ref) => {
|
|
5007
5093
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5008
5094
|
"button",
|
|
5009
5095
|
{
|
|
@@ -5059,7 +5145,7 @@ var popoverVariants = tv({
|
|
|
5059
5145
|
var PopoverRoot = PopoverPrimitive__namespace.Root;
|
|
5060
5146
|
var PopoverTrigger = PopoverPrimitive__namespace.Trigger;
|
|
5061
5147
|
var PopoverAnchor = PopoverPrimitive__namespace.Anchor;
|
|
5062
|
-
var PopoverContent =
|
|
5148
|
+
var PopoverContent = React71__namespace.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5063
5149
|
PopoverPrimitive__namespace.Content,
|
|
5064
5150
|
{
|
|
5065
5151
|
ref,
|
|
@@ -5110,7 +5196,7 @@ var scrollAreaVariants = tv({
|
|
|
5110
5196
|
}
|
|
5111
5197
|
}
|
|
5112
5198
|
});
|
|
5113
|
-
var ScrollArea =
|
|
5199
|
+
var ScrollArea = React71__namespace.default.forwardRef((oriProps, ref) => {
|
|
5114
5200
|
const {
|
|
5115
5201
|
className,
|
|
5116
5202
|
classNames,
|
|
@@ -5140,7 +5226,7 @@ var ScrollArea = React70__namespace.default.forwardRef((oriProps, ref) => {
|
|
|
5140
5226
|
);
|
|
5141
5227
|
});
|
|
5142
5228
|
ScrollArea.displayName = ScrollAreaPrimitive__namespace.Root.displayName;
|
|
5143
|
-
var ScrollBar =
|
|
5229
|
+
var ScrollBar = React71__namespace.default.forwardRef((oriProps, ref) => {
|
|
5144
5230
|
const { className, orientation = "vertical", ...props } = oriProps;
|
|
5145
5231
|
const { bar, tumb } = scrollAreaVariants({ className, orientation });
|
|
5146
5232
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -5313,7 +5399,7 @@ var selectVariants = tv(
|
|
|
5313
5399
|
var SelectRoot = SelectPrimitive__namespace.Root;
|
|
5314
5400
|
var SelectGroup = SelectPrimitive__namespace.Group;
|
|
5315
5401
|
var SelectValue = SelectPrimitive__namespace.Value;
|
|
5316
|
-
var SelectTrigger =
|
|
5402
|
+
var SelectTrigger = React71__namespace.forwardRef(
|
|
5317
5403
|
({
|
|
5318
5404
|
className,
|
|
5319
5405
|
children,
|
|
@@ -5367,7 +5453,7 @@ var SelectTrigger = React70__namespace.forwardRef(
|
|
|
5367
5453
|
}
|
|
5368
5454
|
);
|
|
5369
5455
|
SelectTrigger.displayName = SelectPrimitive__namespace.Trigger.displayName;
|
|
5370
|
-
var SelectScrollUpButton =
|
|
5456
|
+
var SelectScrollUpButton = React71__namespace.forwardRef(({ className, ...props }, ref) => {
|
|
5371
5457
|
const { scrollUpButton } = selectVariants();
|
|
5372
5458
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5373
5459
|
SelectPrimitive__namespace.ScrollUpButton,
|
|
@@ -5380,7 +5466,7 @@ var SelectScrollUpButton = React70__namespace.forwardRef(({ className, ...props
|
|
|
5380
5466
|
);
|
|
5381
5467
|
});
|
|
5382
5468
|
SelectScrollUpButton.displayName = SelectPrimitive__namespace.ScrollUpButton.displayName;
|
|
5383
|
-
var SelectScrollDownButton =
|
|
5469
|
+
var SelectScrollDownButton = React71__namespace.forwardRef(({ className, ...props }, ref) => {
|
|
5384
5470
|
const { scrollDownButton } = selectVariants();
|
|
5385
5471
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5386
5472
|
SelectPrimitive__namespace.ScrollDownButton,
|
|
@@ -5393,7 +5479,7 @@ var SelectScrollDownButton = React70__namespace.forwardRef(({ className, ...prop
|
|
|
5393
5479
|
);
|
|
5394
5480
|
});
|
|
5395
5481
|
SelectScrollDownButton.displayName = SelectPrimitive__namespace.ScrollDownButton.displayName;
|
|
5396
|
-
var SelectContent =
|
|
5482
|
+
var SelectContent = React71__namespace.forwardRef(({ className, children, position = "popper", ...props }, ref) => {
|
|
5397
5483
|
const { content, viewport } = selectVariants({ position, className });
|
|
5398
5484
|
return /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5399
5485
|
SelectPrimitive__namespace.Content,
|
|
@@ -5407,7 +5493,7 @@ var SelectContent = React70__namespace.forwardRef(({ className, children, positi
|
|
|
5407
5493
|
) });
|
|
5408
5494
|
});
|
|
5409
5495
|
SelectContent.displayName = SelectPrimitive__namespace.Content.displayName;
|
|
5410
|
-
var SelectLabel =
|
|
5496
|
+
var SelectLabel = React71__namespace.forwardRef(({ className, ...props }, ref) => {
|
|
5411
5497
|
const { label } = selectVariants();
|
|
5412
5498
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5413
5499
|
SelectPrimitive__namespace.Label,
|
|
@@ -5419,12 +5505,12 @@ var SelectLabel = React70__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
5419
5505
|
);
|
|
5420
5506
|
});
|
|
5421
5507
|
SelectLabel.displayName = SelectPrimitive__namespace.Label.displayName;
|
|
5422
|
-
var SelectItem =
|
|
5508
|
+
var SelectItem = React71__namespace.forwardRef(({ className, children, size, ...props }, ref) => {
|
|
5423
5509
|
const { item } = selectVariants({ size });
|
|
5424
5510
|
return /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Item, { ref, className: item({ className }), ...props, children: /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ItemText, { children }) });
|
|
5425
5511
|
});
|
|
5426
5512
|
SelectItem.displayName = SelectPrimitive__namespace.Item.displayName;
|
|
5427
|
-
var SelectSeparator =
|
|
5513
|
+
var SelectSeparator = React71__namespace.forwardRef(({ className, ...props }, ref) => {
|
|
5428
5514
|
const { separator } = selectVariants();
|
|
5429
5515
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5430
5516
|
SelectPrimitive__namespace.Separator,
|
|
@@ -5438,17 +5524,17 @@ var SelectSeparator = React70__namespace.forwardRef(({ className, ...props }, re
|
|
|
5438
5524
|
SelectSeparator.displayName = SelectPrimitive__namespace.Separator.displayName;
|
|
5439
5525
|
var CombineSelect = (props) => {
|
|
5440
5526
|
const { options, variant, valueFormatter, ...rest } = props;
|
|
5441
|
-
const [keyword, setKeyword] =
|
|
5442
|
-
const [value, setValue] =
|
|
5527
|
+
const [keyword, setKeyword] = React71.useState("");
|
|
5528
|
+
const [value, setValue] = React71.useState(props.value ?? "");
|
|
5443
5529
|
const { trigger } = selectVariants({
|
|
5444
5530
|
size: props.size,
|
|
5445
5531
|
variant
|
|
5446
5532
|
});
|
|
5447
|
-
const [selectedIndex, setSelectedIndex] =
|
|
5533
|
+
const [selectedIndex, setSelectedIndex] = React71.useState(
|
|
5448
5534
|
() => typeof props.value === "undefined" ? -1 : options.findIndex((option) => option.value === props.value)
|
|
5449
5535
|
);
|
|
5450
|
-
const [focused, setFocused] =
|
|
5451
|
-
const inputRef =
|
|
5536
|
+
const [focused, setFocused] = React71.useState(false);
|
|
5537
|
+
const inputRef = React71.useRef(null);
|
|
5452
5538
|
const onFocus = () => {
|
|
5453
5539
|
setFocused(true);
|
|
5454
5540
|
};
|
|
@@ -5618,7 +5704,7 @@ var SelectWithOptions = (props) => {
|
|
|
5618
5704
|
...rest
|
|
5619
5705
|
} = props;
|
|
5620
5706
|
return /* @__PURE__ */ jsxRuntime.jsx(Select, { ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(SelectGroup, { children: options.map((option, index) => {
|
|
5621
|
-
return
|
|
5707
|
+
return React71__namespace.default.cloneElement(optionRenderer(option, currentValue), {
|
|
5622
5708
|
size: props.size,
|
|
5623
5709
|
key: index,
|
|
5624
5710
|
index
|
|
@@ -5628,7 +5714,7 @@ var SelectWithOptions = (props) => {
|
|
|
5628
5714
|
var TokenSelect = (props) => {
|
|
5629
5715
|
const { tokens, showIcon = true, iconSize, showCaret, ...rest } = props;
|
|
5630
5716
|
const { icon } = selectVariants();
|
|
5631
|
-
const options =
|
|
5717
|
+
const options = React71.useMemo(() => {
|
|
5632
5718
|
return tokens.map((token) => {
|
|
5633
5719
|
return {
|
|
5634
5720
|
...token,
|
|
@@ -5706,16 +5792,16 @@ var Select2 = Select;
|
|
|
5706
5792
|
Select2.options = SelectWithOptions;
|
|
5707
5793
|
Select2.combine = CombineSelect;
|
|
5708
5794
|
Select2.tokens = TokenSelect;
|
|
5709
|
-
var QuantityInput =
|
|
5795
|
+
var QuantityInput = React71.forwardRef(
|
|
5710
5796
|
(props, ref) => {
|
|
5711
5797
|
const { tokens, ...rest } = props;
|
|
5712
|
-
const [token, setToken] =
|
|
5713
|
-
const tokenOptions =
|
|
5798
|
+
const [token, setToken] = React71.useState(tokens[0]);
|
|
5799
|
+
const tokenOptions = React71.useMemo(() => {
|
|
5714
5800
|
return props.tokens.map((token2) => ({
|
|
5715
5801
|
name: token2
|
|
5716
5802
|
}));
|
|
5717
5803
|
}, [props.tokens]);
|
|
5718
|
-
const inputRef =
|
|
5804
|
+
const inputRef = React71.useRef(null);
|
|
5719
5805
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5720
5806
|
Input,
|
|
5721
5807
|
{
|
|
@@ -5781,7 +5867,7 @@ var tooltipVariants = tv({
|
|
|
5781
5867
|
"data-[side=top]:oui-slide-in-from-bottom-2"
|
|
5782
5868
|
]
|
|
5783
5869
|
});
|
|
5784
|
-
var TooltipContent =
|
|
5870
|
+
var TooltipContent = React71__namespace.forwardRef(({ className, sideOffset = 4, ...props }, ref) => {
|
|
5785
5871
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5786
5872
|
TooltipPrimitive__namespace.Content,
|
|
5787
5873
|
{
|
|
@@ -5812,7 +5898,7 @@ var TooltipArrow = (props) => {
|
|
|
5812
5898
|
}
|
|
5813
5899
|
);
|
|
5814
5900
|
};
|
|
5815
|
-
var Tooltip =
|
|
5901
|
+
var Tooltip = React71__namespace.forwardRef((originalProps, ref) => {
|
|
5816
5902
|
const {
|
|
5817
5903
|
children,
|
|
5818
5904
|
content,
|
|
@@ -5844,10 +5930,10 @@ var Tooltip = React70__namespace.forwardRef((originalProps, ref) => {
|
|
|
5844
5930
|
);
|
|
5845
5931
|
});
|
|
5846
5932
|
Tooltip.displayName = "Tooltip";
|
|
5847
|
-
var InputWithTooltip =
|
|
5933
|
+
var InputWithTooltip = React71.forwardRef((props, ref) => {
|
|
5848
5934
|
const { tooltip, tooltipProps, triggerClassName, ...inputProps } = props;
|
|
5849
|
-
const [open, setOpen] =
|
|
5850
|
-
|
|
5935
|
+
const [open, setOpen] = React71.useState(false);
|
|
5936
|
+
React71.useEffect(() => {
|
|
5851
5937
|
if (typeof tooltip !== "undefined" && tooltip !== "" && tooltip !== null) {
|
|
5852
5938
|
setOpen(true);
|
|
5853
5939
|
} else {
|
|
@@ -6044,7 +6130,7 @@ var inputHelpTextVariants = tailwindVariants.tv({
|
|
|
6044
6130
|
}
|
|
6045
6131
|
}
|
|
6046
6132
|
});
|
|
6047
|
-
var InputHelpText =
|
|
6133
|
+
var InputHelpText = React71__namespace.default.forwardRef(
|
|
6048
6134
|
(props, ref) => {
|
|
6049
6135
|
const { className, asChild, color, ...rest } = props;
|
|
6050
6136
|
const Comp = asChild ? reactSlot.Slot : "div";
|
|
@@ -6082,7 +6168,7 @@ var textFieldVariants = tv({
|
|
|
6082
6168
|
direction: "column"
|
|
6083
6169
|
}
|
|
6084
6170
|
});
|
|
6085
|
-
var TextField =
|
|
6171
|
+
var TextField = React71__namespace.default.forwardRef((props, ref) => {
|
|
6086
6172
|
const { label, helpText, direction, className, ...inputProps } = props;
|
|
6087
6173
|
const { root, label: labelClassName } = textFieldVariants({ direction });
|
|
6088
6174
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: root({ className, direction }), children: [
|
|
@@ -6100,7 +6186,7 @@ var TextField = React70__namespace.default.forwardRef((props, ref) => {
|
|
|
6100
6186
|
] });
|
|
6101
6187
|
});
|
|
6102
6188
|
TextField.displayName = "TextField";
|
|
6103
|
-
var InputLabel =
|
|
6189
|
+
var InputLabel = React71__namespace.default.forwardRef(
|
|
6104
6190
|
(props, ref) => {
|
|
6105
6191
|
const { asChild = false, className, ...rest } = props;
|
|
6106
6192
|
const Comp = asChild ? reactSlot.Slot : "label";
|
|
@@ -6152,7 +6238,7 @@ var checkboxVariants = tailwindVariants.tv({
|
|
|
6152
6238
|
// style: "checkBox",
|
|
6153
6239
|
}
|
|
6154
6240
|
});
|
|
6155
|
-
var Checkbox =
|
|
6241
|
+
var Checkbox = React71__namespace.forwardRef(({ className, color = "white", variant = "checkBox", ...props }, ref) => {
|
|
6156
6242
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6157
6243
|
CheckboxPrimitive__namespace.Root,
|
|
6158
6244
|
{
|
|
@@ -6282,7 +6368,7 @@ var switchVariants = tailwindVariants.tv({
|
|
|
6282
6368
|
color: "primary"
|
|
6283
6369
|
}
|
|
6284
6370
|
});
|
|
6285
|
-
var Switch =
|
|
6371
|
+
var Switch = React71__namespace.default.forwardRef(({ className, color, ...props }, ref) => {
|
|
6286
6372
|
const { root, thumb } = switchVariants({
|
|
6287
6373
|
className,
|
|
6288
6374
|
color
|
|
@@ -6403,7 +6489,7 @@ function Badge({ className, variant, color, size, ...props }) {
|
|
|
6403
6489
|
}
|
|
6404
6490
|
);
|
|
6405
6491
|
}
|
|
6406
|
-
var Logo =
|
|
6492
|
+
var Logo = React71__namespace.default.forwardRef(({ src, alt, href }, ref) => {
|
|
6407
6493
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "logo oui-px-3", ref, children: /* @__PURE__ */ jsxRuntime.jsx("a", { href: href ?? "/", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6408
6494
|
"img",
|
|
6409
6495
|
{
|
|
@@ -6416,8 +6502,8 @@ var Logo = React70__namespace.default.forwardRef(({ src, alt, href }, ref) => {
|
|
|
6416
6502
|
Logo.displayName = "LogoElement";
|
|
6417
6503
|
function useInit(params) {
|
|
6418
6504
|
const { dataSource, loading, ignoreLoadingCheck } = params;
|
|
6419
|
-
const [initialized, setInitialized] =
|
|
6420
|
-
|
|
6505
|
+
const [initialized, setInitialized] = React71.useState(false);
|
|
6506
|
+
React71.useEffect(() => {
|
|
6421
6507
|
if (initialized) return;
|
|
6422
6508
|
if (ignoreLoadingCheck || loading || Array.isArray(dataSource)) {
|
|
6423
6509
|
setInitialized(true);
|
|
@@ -6426,10 +6512,10 @@ function useInit(params) {
|
|
|
6426
6512
|
return initialized;
|
|
6427
6513
|
}
|
|
6428
6514
|
function useScroll(deps) {
|
|
6429
|
-
const scrollRef =
|
|
6430
|
-
const [showLeftShadow, setShowLeftShadow] =
|
|
6431
|
-
const [showRightShadow, setShowRightShadow] =
|
|
6432
|
-
|
|
6515
|
+
const scrollRef = React71.useRef(null);
|
|
6516
|
+
const [showLeftShadow, setShowLeftShadow] = React71.useState(false);
|
|
6517
|
+
const [showRightShadow, setShowRightShadow] = React71.useState(false);
|
|
6518
|
+
React71.useEffect(() => {
|
|
6433
6519
|
if (!scrollRef.current) {
|
|
6434
6520
|
return;
|
|
6435
6521
|
}
|
|
@@ -6438,7 +6524,7 @@ function useScroll(deps) {
|
|
|
6438
6524
|
setShowRightShadow(!isScrolledToRight(scrollRef.current));
|
|
6439
6525
|
});
|
|
6440
6526
|
}, [scrollRef]);
|
|
6441
|
-
|
|
6527
|
+
React71.useEffect(() => {
|
|
6442
6528
|
if (!scrollRef.current) {
|
|
6443
6529
|
return;
|
|
6444
6530
|
}
|
|
@@ -6460,14 +6546,14 @@ function hasHorizontalScroll(element) {
|
|
|
6460
6546
|
}
|
|
6461
6547
|
function useShowHeader(params) {
|
|
6462
6548
|
const { dataSource, loading } = params;
|
|
6463
|
-
const initShowHeader =
|
|
6464
|
-
const showHeader =
|
|
6549
|
+
const initShowHeader = React71.useRef(false);
|
|
6550
|
+
const showHeader = React71.useMemo(() => {
|
|
6465
6551
|
if (loading && !dataSource?.length) {
|
|
6466
6552
|
return initShowHeader.current;
|
|
6467
6553
|
}
|
|
6468
6554
|
return !!dataSource?.length;
|
|
6469
6555
|
}, [loading, dataSource]);
|
|
6470
|
-
|
|
6556
|
+
React71.useEffect(() => {
|
|
6471
6557
|
if (showHeader) {
|
|
6472
6558
|
initShowHeader.current = true;
|
|
6473
6559
|
}
|
|
@@ -6476,8 +6562,8 @@ function useShowHeader(params) {
|
|
|
6476
6562
|
}
|
|
6477
6563
|
function useShowPagination(params) {
|
|
6478
6564
|
const { loading, dataSource, pagination, rows } = params;
|
|
6479
|
-
const initShowPagination =
|
|
6480
|
-
const showPagination =
|
|
6565
|
+
const initShowPagination = React71.useRef(false);
|
|
6566
|
+
const showPagination = React71.useMemo(() => {
|
|
6481
6567
|
if (loading && !dataSource?.length) {
|
|
6482
6568
|
return initShowPagination.current;
|
|
6483
6569
|
}
|
|
@@ -6486,7 +6572,7 @@ function useShowPagination(params) {
|
|
|
6486
6572
|
}
|
|
6487
6573
|
return false;
|
|
6488
6574
|
}, [loading, pagination, dataSource, rows]);
|
|
6489
|
-
|
|
6575
|
+
React71.useEffect(() => {
|
|
6490
6576
|
if (showPagination) {
|
|
6491
6577
|
initShowPagination.current = true;
|
|
6492
6578
|
}
|
|
@@ -6495,7 +6581,7 @@ function useShowPagination(params) {
|
|
|
6495
6581
|
}
|
|
6496
6582
|
function useSort(props) {
|
|
6497
6583
|
const { onSort, initialSort } = props;
|
|
6498
|
-
const [sorting, setSorting] =
|
|
6584
|
+
const [sorting, setSorting] = React71.useState(
|
|
6499
6585
|
initialSort ? [
|
|
6500
6586
|
{
|
|
6501
6587
|
id: initialSort.sortKey,
|
|
@@ -6503,7 +6589,7 @@ function useSort(props) {
|
|
|
6503
6589
|
}
|
|
6504
6590
|
] : []
|
|
6505
6591
|
);
|
|
6506
|
-
|
|
6592
|
+
React71.useEffect(() => {
|
|
6507
6593
|
const { id, desc } = sorting[0] || {};
|
|
6508
6594
|
onSort?.(id ? { sortKey: id, sort: desc ? "desc" : "asc" } : void 0);
|
|
6509
6595
|
}, [sorting, onSort]);
|
|
@@ -6516,11 +6602,11 @@ function useMediaQuery(query) {
|
|
|
6516
6602
|
}
|
|
6517
6603
|
return false;
|
|
6518
6604
|
};
|
|
6519
|
-
const [matches, setMatches] =
|
|
6605
|
+
const [matches, setMatches] = React71.useState(getMatches(query));
|
|
6520
6606
|
function handleChange() {
|
|
6521
6607
|
setMatches(getMatches(query));
|
|
6522
6608
|
}
|
|
6523
|
-
|
|
6609
|
+
React71.useEffect(() => {
|
|
6524
6610
|
const matchMedia = window?.matchMedia(query);
|
|
6525
6611
|
handleChange();
|
|
6526
6612
|
if (matchMedia?.addListener) {
|
|
@@ -6548,7 +6634,7 @@ function useScreen() {
|
|
|
6548
6634
|
};
|
|
6549
6635
|
}
|
|
6550
6636
|
function useObserverElement(element, callback) {
|
|
6551
|
-
|
|
6637
|
+
React71.useEffect(() => {
|
|
6552
6638
|
if (!element) {
|
|
6553
6639
|
return;
|
|
6554
6640
|
}
|
|
@@ -6564,11 +6650,11 @@ function useObserverElement(element, callback) {
|
|
|
6564
6650
|
}, [element]);
|
|
6565
6651
|
}
|
|
6566
6652
|
function useLongPress(callback, longPressTime = 600) {
|
|
6567
|
-
const timeoutRef =
|
|
6568
|
-
const targetRef =
|
|
6569
|
-
const startPositionRef =
|
|
6570
|
-
const isLongPressTriggeredRef =
|
|
6571
|
-
const clearLongPress =
|
|
6653
|
+
const timeoutRef = React71.useRef(null);
|
|
6654
|
+
const targetRef = React71.useRef(null);
|
|
6655
|
+
const startPositionRef = React71.useRef(null);
|
|
6656
|
+
const isLongPressTriggeredRef = React71.useRef(false);
|
|
6657
|
+
const clearLongPress = React71.useCallback(() => {
|
|
6572
6658
|
if (timeoutRef.current) {
|
|
6573
6659
|
clearTimeout(timeoutRef.current);
|
|
6574
6660
|
timeoutRef.current = null;
|
|
@@ -6577,7 +6663,7 @@ function useLongPress(callback, longPressTime = 600) {
|
|
|
6577
6663
|
startPositionRef.current = null;
|
|
6578
6664
|
isLongPressTriggeredRef.current = false;
|
|
6579
6665
|
}, []);
|
|
6580
|
-
const startLongPress =
|
|
6666
|
+
const startLongPress = React71.useCallback(
|
|
6581
6667
|
(e) => {
|
|
6582
6668
|
clearLongPress();
|
|
6583
6669
|
if ("touches" in e) {
|
|
@@ -6598,17 +6684,17 @@ function useLongPress(callback, longPressTime = 600) {
|
|
|
6598
6684
|
},
|
|
6599
6685
|
[callback, longPressTime, clearLongPress]
|
|
6600
6686
|
);
|
|
6601
|
-
const handleMouseDown =
|
|
6687
|
+
const handleMouseDown = React71.useCallback(
|
|
6602
6688
|
(e) => {
|
|
6603
6689
|
if (e.button !== 0) return;
|
|
6604
6690
|
startLongPress(e);
|
|
6605
6691
|
},
|
|
6606
6692
|
[startLongPress]
|
|
6607
6693
|
);
|
|
6608
|
-
const handleMouseUp =
|
|
6694
|
+
const handleMouseUp = React71.useCallback(() => {
|
|
6609
6695
|
clearLongPress();
|
|
6610
6696
|
}, [clearLongPress]);
|
|
6611
|
-
const handleMouseMove =
|
|
6697
|
+
const handleMouseMove = React71.useCallback(
|
|
6612
6698
|
(e) => {
|
|
6613
6699
|
if (isLongPressTriggeredRef.current) return;
|
|
6614
6700
|
if (startPositionRef.current) {
|
|
@@ -6622,25 +6708,25 @@ function useLongPress(callback, longPressTime = 600) {
|
|
|
6622
6708
|
},
|
|
6623
6709
|
[clearLongPress]
|
|
6624
6710
|
);
|
|
6625
|
-
const handleMouseLeave =
|
|
6711
|
+
const handleMouseLeave = React71.useCallback(() => {
|
|
6626
6712
|
clearLongPress();
|
|
6627
6713
|
}, [clearLongPress]);
|
|
6628
|
-
const handleContextMenu =
|
|
6714
|
+
const handleContextMenu = React71.useCallback((e) => {
|
|
6629
6715
|
if (timeoutRef.current || isLongPressTriggeredRef.current) {
|
|
6630
6716
|
e.preventDefault();
|
|
6631
6717
|
e.stopPropagation();
|
|
6632
6718
|
}
|
|
6633
6719
|
}, []);
|
|
6634
|
-
const handleTouchStart =
|
|
6720
|
+
const handleTouchStart = React71.useCallback(
|
|
6635
6721
|
(e) => {
|
|
6636
6722
|
startLongPress(e);
|
|
6637
6723
|
},
|
|
6638
6724
|
[startLongPress]
|
|
6639
6725
|
);
|
|
6640
|
-
const handleTouchEnd =
|
|
6726
|
+
const handleTouchEnd = React71.useCallback(() => {
|
|
6641
6727
|
clearLongPress();
|
|
6642
6728
|
}, [clearLongPress]);
|
|
6643
|
-
const handleTouchMove =
|
|
6729
|
+
const handleTouchMove = React71.useCallback(
|
|
6644
6730
|
(e) => {
|
|
6645
6731
|
if (timeoutRef.current) {
|
|
6646
6732
|
e.preventDefault();
|
|
@@ -6661,7 +6747,7 @@ function useLongPress(callback, longPressTime = 600) {
|
|
|
6661
6747
|
},
|
|
6662
6748
|
[clearLongPress]
|
|
6663
6749
|
);
|
|
6664
|
-
const handleTouchCancel =
|
|
6750
|
+
const handleTouchCancel = React71.useCallback(() => {
|
|
6665
6751
|
clearLongPress();
|
|
6666
6752
|
}, [clearLongPress]);
|
|
6667
6753
|
return {
|
|
@@ -6677,8 +6763,8 @@ function useLongPress(callback, longPressTime = 600) {
|
|
|
6677
6763
|
};
|
|
6678
6764
|
}
|
|
6679
6765
|
var useThemeAttribute = () => {
|
|
6680
|
-
const [themeAttribute, setThemeAttribute] =
|
|
6681
|
-
|
|
6766
|
+
const [themeAttribute, setThemeAttribute] = React71.useState("");
|
|
6767
|
+
React71.useEffect(() => {
|
|
6682
6768
|
setThemeAttribute(
|
|
6683
6769
|
document.documentElement.getAttribute("data-oui-theme") ?? ""
|
|
6684
6770
|
);
|
|
@@ -6703,9 +6789,9 @@ var useThemeAttribute = () => {
|
|
|
6703
6789
|
|
|
6704
6790
|
// src/table/hooks/useWrap.ts
|
|
6705
6791
|
function useWrap(deps) {
|
|
6706
|
-
const wrapRef =
|
|
6792
|
+
const wrapRef = React71.useRef(null);
|
|
6707
6793
|
const themeAttribute = useThemeAttribute();
|
|
6708
|
-
|
|
6794
|
+
React71.useEffect(() => {
|
|
6709
6795
|
if (!wrapRef.current) return;
|
|
6710
6796
|
const bgColor = window.getComputedStyle(wrapRef.current).backgroundColor;
|
|
6711
6797
|
wrapRef.current.style.setProperty("--oui-table-background-color", bgColor);
|
|
@@ -6798,7 +6884,7 @@ var TableBody = (props) => {
|
|
|
6798
6884
|
children: props.expandRowRender?.(row, row.index)
|
|
6799
6885
|
}
|
|
6800
6886
|
) });
|
|
6801
|
-
const rowView = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6887
|
+
const rowView = /* @__PURE__ */ jsxRuntime.jsxs(React71.Fragment, { children: [
|
|
6802
6888
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6803
6889
|
"tr",
|
|
6804
6890
|
{
|
|
@@ -6859,7 +6945,7 @@ var TableBody = (props) => {
|
|
|
6859
6945
|
expandView
|
|
6860
6946
|
] }, row.id);
|
|
6861
6947
|
if (typeof props.renderRowContainer === "function") {
|
|
6862
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6948
|
+
return /* @__PURE__ */ jsxRuntime.jsx(React71.Fragment, { children: props.renderRowContainer(row.original, row.index, rowView, row) }, row.id);
|
|
6863
6949
|
}
|
|
6864
6950
|
return rowView;
|
|
6865
6951
|
})
|
|
@@ -6941,7 +7027,7 @@ var DescendingIcon = () => {
|
|
|
6941
7027
|
};
|
|
6942
7028
|
function useMultiSort(props) {
|
|
6943
7029
|
const { onSort, currentSorting } = props;
|
|
6944
|
-
const handleFieldSort =
|
|
7030
|
+
const handleFieldSort = React71.useCallback(
|
|
6945
7031
|
(fieldKey) => {
|
|
6946
7032
|
const isCurrentField = currentSorting?.sortKey === fieldKey;
|
|
6947
7033
|
let newOrder;
|
|
@@ -6956,7 +7042,7 @@ function useMultiSort(props) {
|
|
|
6956
7042
|
},
|
|
6957
7043
|
[currentSorting, onSort]
|
|
6958
7044
|
);
|
|
6959
|
-
const getFieldSort =
|
|
7045
|
+
const getFieldSort = React71.useCallback(
|
|
6960
7046
|
(fieldKey) => {
|
|
6961
7047
|
if (currentSorting?.sortKey === fieldKey) {
|
|
6962
7048
|
return { sortKey: fieldKey, sort: currentSorting.sort };
|
|
@@ -7112,9 +7198,9 @@ var SortIndicator2 = ({ isSorted }) => {
|
|
|
7112
7198
|
desc: /* @__PURE__ */ jsxRuntime.jsx(DescendingIcon, {})
|
|
7113
7199
|
}[isSorted] || /* @__PURE__ */ jsxRuntime.jsx(SortingIcon2, {});
|
|
7114
7200
|
};
|
|
7115
|
-
var LocaleContext =
|
|
7201
|
+
var LocaleContext = React71.createContext(void 0);
|
|
7116
7202
|
var LocaleProvider = (props) => {
|
|
7117
|
-
const value =
|
|
7203
|
+
const value = React71.useMemo(
|
|
7118
7204
|
() => ({ ...props.locale, exist: true }),
|
|
7119
7205
|
[props.locale]
|
|
7120
7206
|
);
|
|
@@ -7145,8 +7231,8 @@ var localeValues = {
|
|
|
7145
7231
|
|
|
7146
7232
|
// src/locale/useLocale.ts
|
|
7147
7233
|
var useLocale = (componentName, defaultLocale) => {
|
|
7148
|
-
const fullLocale =
|
|
7149
|
-
const getLocale =
|
|
7234
|
+
const fullLocale = React71.useContext(LocaleContext);
|
|
7235
|
+
const getLocale = React71.useMemo(() => {
|
|
7150
7236
|
const locale = defaultLocale || localeValues[componentName];
|
|
7151
7237
|
const localeFromContext = fullLocale?.[componentName] || {};
|
|
7152
7238
|
return {
|
|
@@ -7154,7 +7240,7 @@ var useLocale = (componentName, defaultLocale) => {
|
|
|
7154
7240
|
...localeFromContext
|
|
7155
7241
|
};
|
|
7156
7242
|
}, [componentName, defaultLocale, fullLocale]);
|
|
7157
|
-
const getLocaleCode =
|
|
7243
|
+
const getLocaleCode = React71.useMemo(() => {
|
|
7158
7244
|
const localeCode = fullLocale?.locale;
|
|
7159
7245
|
const defaultLocaleCode = localeValues.locale;
|
|
7160
7246
|
return localeCode || defaultLocaleCode;
|
|
@@ -7174,7 +7260,7 @@ var Pagination = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
|
7174
7260
|
}
|
|
7175
7261
|
);
|
|
7176
7262
|
Pagination.displayName = "Pagination";
|
|
7177
|
-
var PaginationContent =
|
|
7263
|
+
var PaginationContent = React71__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
7178
7264
|
"ul",
|
|
7179
7265
|
{
|
|
7180
7266
|
ref,
|
|
@@ -7186,7 +7272,7 @@ var PaginationContent = React70__namespace.default.forwardRef(({ className, ...p
|
|
|
7186
7272
|
}
|
|
7187
7273
|
));
|
|
7188
7274
|
PaginationContent.displayName = "PaginationContent";
|
|
7189
|
-
var PaginationItem =
|
|
7275
|
+
var PaginationItem = React71__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("li", { ref, className: tailwindVariants.cnBase("oui-leading-[0px]", className), ...props }));
|
|
7190
7276
|
PaginationItem.displayName = "PaginationItem";
|
|
7191
7277
|
var PaginationLink = ({
|
|
7192
7278
|
className,
|
|
@@ -7318,7 +7404,7 @@ var PaginationItems = (props) => {
|
|
|
7318
7404
|
if (totalPages <= 1) {
|
|
7319
7405
|
return null;
|
|
7320
7406
|
}
|
|
7321
|
-
const pageNumbers =
|
|
7407
|
+
const pageNumbers = React71.useMemo(() => {
|
|
7322
7408
|
if (typeof props.generatePageNumbers === "function") {
|
|
7323
7409
|
return props.generatePageNumbers(currentPage, totalPages);
|
|
7324
7410
|
}
|
|
@@ -7378,139 +7464,26 @@ var TablePagination = (props) => {
|
|
|
7378
7464
|
}
|
|
7379
7465
|
) });
|
|
7380
7466
|
};
|
|
7381
|
-
var
|
|
7382
|
-
|
|
7383
|
-
|
|
7384
|
-
|
|
7385
|
-
if (!globalObject.__ORDERLY_EXTENSION_REGISTRY__) {
|
|
7386
|
-
globalObject.__ORDERLY_EXTENSION_REGISTRY__ = new _OrderlyExtensionRegistry();
|
|
7387
|
-
}
|
|
7388
|
-
return globalObject.__ORDERLY_EXTENSION_REGISTRY__;
|
|
7389
|
-
}
|
|
7390
|
-
extensionMap = /* @__PURE__ */ new Map();
|
|
7391
|
-
// private formatterMap: Map<string, Function> = new Map();
|
|
7392
|
-
register(plugin3) {
|
|
7393
|
-
if (!plugin3.builder) ;
|
|
7394
|
-
for (let index = 0; index < plugin3.positions.length; index++) {
|
|
7395
|
-
if (typeof plugin3.builder !== "function") {
|
|
7396
|
-
const builder = this.extensionMap.get(plugin3.positions[index])?.builder;
|
|
7397
|
-
plugin3.builder = typeof builder === "undefined" ? (
|
|
7398
|
-
// ? DEFAULT_BUILDER
|
|
7399
|
-
void 0
|
|
7400
|
-
) : builder;
|
|
7401
|
-
}
|
|
7402
|
-
const pos = plugin3.positions[index];
|
|
7403
|
-
this.registerToPosition(pos, plugin3);
|
|
7404
|
-
}
|
|
7405
|
-
}
|
|
7406
|
-
registerToPosition(position, plugin3) {
|
|
7407
|
-
if (this.extensionMap.has(position)) {
|
|
7408
|
-
const existingPlugin = this.extensionMap.get(position);
|
|
7409
|
-
if (!existingPlugin?.__isInternal) {
|
|
7410
|
-
if (!existingPlugin?.builder && plugin3.__isInternal) {
|
|
7411
|
-
this.setBuilder(position, plugin3.builder);
|
|
7412
|
-
}
|
|
7413
|
-
return;
|
|
7414
|
-
}
|
|
7415
|
-
if (!plugin3.builder) {
|
|
7416
|
-
plugin3.builder = existingPlugin.builder;
|
|
7417
|
-
}
|
|
7418
|
-
}
|
|
7419
|
-
this.extensionMap.set(position, plugin3);
|
|
7420
|
-
}
|
|
7421
|
-
setBuilder(position, builder) {
|
|
7422
|
-
const plugin3 = this.extensionMap.get(position);
|
|
7423
|
-
if (plugin3) {
|
|
7424
|
-
plugin3.builder = builder;
|
|
7425
|
-
}
|
|
7426
|
-
}
|
|
7427
|
-
unregister(plugin3) {
|
|
7428
|
-
for (let index = 0; index < plugin3.positions.length; index++) {
|
|
7429
|
-
const pos = plugin3.positions[index];
|
|
7430
|
-
this.unregisterFromPosition(pos);
|
|
7431
|
-
}
|
|
7432
|
-
}
|
|
7433
|
-
unregisterFromPosition(position) {
|
|
7434
|
-
this.extensionMap.delete(position);
|
|
7435
|
-
}
|
|
7436
|
-
getPluginsByPosition(position) {
|
|
7437
|
-
return this.extensionMap.get(position);
|
|
7438
|
-
}
|
|
7439
|
-
/**
|
|
7440
|
-
* get the registered formatter by position
|
|
7441
|
-
* @param position
|
|
7442
|
-
*/
|
|
7443
|
-
getFormatterByPosition(position) {
|
|
7444
|
-
return this.extensionMap.get(position);
|
|
7445
|
-
}
|
|
7446
|
-
};
|
|
7447
|
-
|
|
7448
|
-
// src/plugin/install.tsx
|
|
7449
|
-
var installExtension = (options) => {
|
|
7450
|
-
return (component) => {
|
|
7451
|
-
const registry = OrderlyExtensionRegistry.getInstance();
|
|
7452
|
-
registry.register({
|
|
7453
|
-
name: options.name,
|
|
7454
|
-
positions: options.positions,
|
|
7455
|
-
__isInternal: !!options.__isInternal,
|
|
7456
|
-
builder: options.builder,
|
|
7457
|
-
render: component
|
|
7458
|
-
});
|
|
7459
|
-
};
|
|
7460
|
-
};
|
|
7461
|
-
var setExtensionBuilder = (position, builder) => {
|
|
7462
|
-
const registry = OrderlyExtensionRegistry.getInstance();
|
|
7463
|
-
registry.setBuilder(position, builder);
|
|
7464
|
-
};
|
|
7465
|
-
var NotFound = (props) => {
|
|
7466
|
-
const { position } = props;
|
|
7467
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "oui-text-danger", children: [
|
|
7468
|
-
/* @__PURE__ */ jsxRuntime.jsx("strong", { children: `[${position}] ` }),
|
|
7469
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Not found!" })
|
|
7470
|
-
] });
|
|
7471
|
-
};
|
|
7472
|
-
|
|
7473
|
-
// src/plugin/useBuilder.ts
|
|
7474
|
-
var useBuilder = (position, props) => {
|
|
7475
|
-
const registry = OrderlyExtensionRegistry.getInstance();
|
|
7476
|
-
const plugin3 = registry.getPluginsByPosition(position);
|
|
7477
|
-
return () => {
|
|
7478
|
-
return plugin3?.builder?.(props) || props;
|
|
7479
|
-
};
|
|
7480
|
-
};
|
|
7481
|
-
|
|
7482
|
-
// src/plugin/useExtensionBuilder.ts
|
|
7483
|
-
var useExtensionBuilder = (position, props) => {
|
|
7484
|
-
const builder = useBuilder(position, props);
|
|
7485
|
-
return builder();
|
|
7486
|
-
};
|
|
7487
|
-
var ExtensionSlot = (props) => {
|
|
7488
|
-
const { position, scope, defaultWidget: defaultValue, ...rest } = props;
|
|
7489
|
-
const elementProps = useExtensionBuilder(position, rest);
|
|
7490
|
-
const Ele = React70.useMemo(() => {
|
|
7491
|
-
const registry = OrderlyExtensionRegistry.getInstance();
|
|
7492
|
-
const plugin3 = registry.getPluginsByPosition(position);
|
|
7493
|
-
return plugin3?.render ?? defaultValue ?? NotFound;
|
|
7494
|
-
}, []);
|
|
7495
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7496
|
-
reactErrorBoundary.ErrorBoundary,
|
|
7467
|
+
var EmptyDataState = (props) => {
|
|
7468
|
+
const [locale] = useLocale("empty");
|
|
7469
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7470
|
+
Flex,
|
|
7497
7471
|
{
|
|
7498
|
-
|
|
7499
|
-
|
|
7472
|
+
itemAlign: "center",
|
|
7473
|
+
direction: "column",
|
|
7474
|
+
gapY: 4,
|
|
7475
|
+
className: props.className,
|
|
7476
|
+
children: [
|
|
7477
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { children: /* @__PURE__ */ jsxRuntime.jsx(emptyData_default, {}) }),
|
|
7478
|
+
/* @__PURE__ */ jsxRuntime.jsx(Text2, { as: "div", intensity: 36, size: "2xs", children: props.title ?? locale.description })
|
|
7479
|
+
]
|
|
7500
7480
|
}
|
|
7501
7481
|
);
|
|
7502
7482
|
};
|
|
7503
|
-
|
|
7504
|
-
|
|
7505
|
-
|
|
7506
|
-
|
|
7507
|
-
ExtensionPositionEnum2["WithdrawForm"] = "withdrawForm";
|
|
7508
|
-
ExtensionPositionEnum2["AccountMenu"] = "accountMenu";
|
|
7509
|
-
ExtensionPositionEnum2["MobileAccountMenu"] = "mobileAccountMenu";
|
|
7510
|
-
ExtensionPositionEnum2["MainMenus"] = "mainMenus";
|
|
7511
|
-
ExtensionPositionEnum2["EmptyDataIdentifier"] = "emptyDataIdentifier";
|
|
7512
|
-
return ExtensionPositionEnum2;
|
|
7513
|
-
})(ExtensionPositionEnum || {});
|
|
7483
|
+
var InjectableEmptyDataState = pluginCore.injectable(
|
|
7484
|
+
EmptyDataState,
|
|
7485
|
+
"Table.EmptyDataIdentifier"
|
|
7486
|
+
);
|
|
7514
7487
|
var TablePlaceholder = (props) => {
|
|
7515
7488
|
const { visible, loading, emptyView, className } = props;
|
|
7516
7489
|
if (!visible) {
|
|
@@ -7528,7 +7501,7 @@ var TablePlaceholder = (props) => {
|
|
|
7528
7501
|
"oui-flex oui-items-center oui-justify-center",
|
|
7529
7502
|
className
|
|
7530
7503
|
),
|
|
7531
|
-
children: loading ? /* @__PURE__ */ jsxRuntime.jsx(Spinner, {}) : emptyView || /* @__PURE__ */ jsxRuntime.jsx(
|
|
7504
|
+
children: loading ? /* @__PURE__ */ jsxRuntime.jsx(Spinner, {}) : emptyView || /* @__PURE__ */ jsxRuntime.jsx(InjectableEmptyDataState, {})
|
|
7532
7505
|
}
|
|
7533
7506
|
);
|
|
7534
7507
|
};
|
|
@@ -7728,10 +7701,10 @@ function DataTable(props) {
|
|
|
7728
7701
|
onSort,
|
|
7729
7702
|
initialSort
|
|
7730
7703
|
});
|
|
7731
|
-
const hasMultiSortColumns =
|
|
7704
|
+
const hasMultiSortColumns = React71.useMemo(() => {
|
|
7732
7705
|
return columns.some((col) => col.multiSort && !col.multiSort.onSort);
|
|
7733
7706
|
}, [columns]);
|
|
7734
|
-
const effectiveManualSorting =
|
|
7707
|
+
const effectiveManualSorting = React71.useMemo(() => {
|
|
7735
7708
|
if (!hasMultiSortColumns) {
|
|
7736
7709
|
return manualSorting;
|
|
7737
7710
|
}
|
|
@@ -7745,27 +7718,27 @@ function DataTable(props) {
|
|
|
7745
7718
|
}
|
|
7746
7719
|
return false;
|
|
7747
7720
|
}, [hasMultiSortColumns, manualSorting, sorting, columns]);
|
|
7748
|
-
const dataSource =
|
|
7721
|
+
const dataSource = React71.useMemo(() => {
|
|
7749
7722
|
return Transform.dataSource(props.dataSource || [], columns, sorting);
|
|
7750
7723
|
}, [props.dataSource, columns, sorting]);
|
|
7751
|
-
const formatColumns =
|
|
7724
|
+
const formatColumns = React71.useMemo(
|
|
7752
7725
|
() => Transform.columns(columns, sorting, setSorting),
|
|
7753
7726
|
[columns, sorting, setSorting]
|
|
7754
7727
|
);
|
|
7755
|
-
const columnPinning =
|
|
7728
|
+
const columnPinning = React71.useMemo(
|
|
7756
7729
|
() => Transform.columnPinning(columns),
|
|
7757
7730
|
[columns]
|
|
7758
7731
|
);
|
|
7759
|
-
const rowSelection =
|
|
7732
|
+
const rowSelection = React71.useMemo(
|
|
7760
7733
|
() => props.rowSelection || {},
|
|
7761
7734
|
[props.rowSelection]
|
|
7762
7735
|
);
|
|
7763
|
-
const { state: paginationState, config: paginationConfig } =
|
|
7736
|
+
const { state: paginationState, config: paginationConfig } = React71.useMemo(
|
|
7764
7737
|
() => Transform.pagination(pagination),
|
|
7765
7738
|
[pagination]
|
|
7766
7739
|
);
|
|
7767
7740
|
const initialized = useInit({ dataSource, loading, ignoreLoadingCheck });
|
|
7768
|
-
const columnFilters =
|
|
7741
|
+
const columnFilters = React71.useMemo(() => {
|
|
7769
7742
|
return Array.isArray(props.columnFilters) ? props.columnFilters : props.columnFilters ? [props.columnFilters] : [];
|
|
7770
7743
|
}, [props.columnFilters]);
|
|
7771
7744
|
const table = reactTable.useReactTable({
|
|
@@ -7801,7 +7774,7 @@ function DataTable(props) {
|
|
|
7801
7774
|
...paginationConfig
|
|
7802
7775
|
// ...sortConfig,
|
|
7803
7776
|
});
|
|
7804
|
-
|
|
7777
|
+
React71.useEffect(() => {
|
|
7805
7778
|
props.getTableInstance?.(table);
|
|
7806
7779
|
}, [table]);
|
|
7807
7780
|
const wrapRef = useWrap([className, classNames?.root]);
|
|
@@ -7992,15 +7965,15 @@ var DateRangePicker = (props) => {
|
|
|
7992
7965
|
...calendarProps
|
|
7993
7966
|
} = props;
|
|
7994
7967
|
const [locale] = useLocale("picker");
|
|
7995
|
-
const [open, setOpen] =
|
|
7996
|
-
const [dateRange, setDateRange] =
|
|
7968
|
+
const [open, setOpen] = React71.useState(false);
|
|
7969
|
+
const [dateRange, setDateRange] = React71.useState(
|
|
7997
7970
|
value || initialValue || null
|
|
7998
7971
|
);
|
|
7999
|
-
const [isMobileView, setIsMobileView] =
|
|
7972
|
+
const [isMobileView, setIsMobileView] = React71.useState(false);
|
|
8000
7973
|
const update = useDebouncedCallback((width) => {
|
|
8001
7974
|
setIsMobileView(width <= 768);
|
|
8002
7975
|
}, 100);
|
|
8003
|
-
|
|
7976
|
+
React71.useEffect(() => {
|
|
8004
7977
|
const handleResize = () => {
|
|
8005
7978
|
update(window.innerWidth);
|
|
8006
7979
|
};
|
|
@@ -8010,12 +7983,12 @@ var DateRangePicker = (props) => {
|
|
|
8010
7983
|
window.removeEventListener("resize", handleResize);
|
|
8011
7984
|
};
|
|
8012
7985
|
}, []);
|
|
8013
|
-
|
|
7986
|
+
React71.useEffect(() => {
|
|
8014
7987
|
if (value?.from && value?.to && dateRange?.from && dateRange?.to && !areDatesEqual(value, dateRange))
|
|
8015
7988
|
setDateRange(value);
|
|
8016
7989
|
}, [value]);
|
|
8017
7990
|
const { trigger } = selectVariants({ size, className });
|
|
8018
|
-
const formattedValue =
|
|
7991
|
+
const formattedValue = React71.useMemo(() => {
|
|
8019
7992
|
if (!dateRange || !dateRange.from || !dateRange.to) {
|
|
8020
7993
|
return placeholder ?? locale.selectDate;
|
|
8021
7994
|
}
|
|
@@ -8089,8 +8062,8 @@ var DateRangePicker = (props) => {
|
|
|
8089
8062
|
};
|
|
8090
8063
|
DateRangePicker.displayName = "DateRangePicker";
|
|
8091
8064
|
function useDebouncedCallback(callback, delay) {
|
|
8092
|
-
const timeoutRef =
|
|
8093
|
-
const debouncedCallback =
|
|
8065
|
+
const timeoutRef = React71.useRef(null);
|
|
8066
|
+
const debouncedCallback = React71.useCallback(
|
|
8094
8067
|
(args) => {
|
|
8095
8068
|
if (timeoutRef.current) {
|
|
8096
8069
|
clearTimeout(timeoutRef.current);
|
|
@@ -8128,8 +8101,8 @@ var DatePicker = (props) => {
|
|
|
8128
8101
|
} = props;
|
|
8129
8102
|
const [locale] = useLocale("picker");
|
|
8130
8103
|
const { trigger } = selectVariants({ size });
|
|
8131
|
-
const [open, setOpen] =
|
|
8132
|
-
const formattedValue =
|
|
8104
|
+
const [open, setOpen] = React71.useState(false);
|
|
8105
|
+
const formattedValue = React71.useMemo(() => {
|
|
8133
8106
|
if (typeof value === "undefined") {
|
|
8134
8107
|
return placeholder ?? locale.selectDate;
|
|
8135
8108
|
}
|
|
@@ -8196,7 +8169,7 @@ var Sheet = DialogPrimitive__namespace.Root;
|
|
|
8196
8169
|
var SheetTrigger = DialogPrimitive__namespace.Trigger;
|
|
8197
8170
|
var SheetClose = DialogPrimitive__namespace.Close;
|
|
8198
8171
|
var SheetPortal = DialogPrimitive__namespace.Portal;
|
|
8199
|
-
var SheetOverlay =
|
|
8172
|
+
var SheetOverlay = React71__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
8200
8173
|
DialogPrimitive__namespace.Overlay,
|
|
8201
8174
|
{
|
|
8202
8175
|
className: tailwindVariants.cnBase(
|
|
@@ -8222,7 +8195,7 @@ var sheetVariants = tailwindVariants.tv({
|
|
|
8222
8195
|
side: "bottom"
|
|
8223
8196
|
}
|
|
8224
8197
|
});
|
|
8225
|
-
var SheetContent =
|
|
8198
|
+
var SheetContent = React71__namespace.forwardRef(
|
|
8226
8199
|
({
|
|
8227
8200
|
side = "bottom",
|
|
8228
8201
|
closeable = true,
|
|
@@ -8318,7 +8291,7 @@ var SheetFooter = ({
|
|
|
8318
8291
|
}
|
|
8319
8292
|
);
|
|
8320
8293
|
SheetFooter.displayName = "SheetFooter";
|
|
8321
|
-
var SheetTitle =
|
|
8294
|
+
var SheetTitle = React71__namespace.forwardRef(({ className, leading, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8322
8295
|
"div",
|
|
8323
8296
|
{
|
|
8324
8297
|
className: "oui-sheet-header oui-grid oui-grid-cols-[40px_1fr_40px] oui-items-center",
|
|
@@ -8339,7 +8312,7 @@ var SheetTitle = React70__namespace.forwardRef(({ className, leading, ...props }
|
|
|
8339
8312
|
}
|
|
8340
8313
|
));
|
|
8341
8314
|
SheetTitle.displayName = DialogPrimitive__namespace.Title.displayName;
|
|
8342
|
-
var SheetDescription =
|
|
8315
|
+
var SheetDescription = React71__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
8343
8316
|
DialogPrimitive__namespace.Description,
|
|
8344
8317
|
{
|
|
8345
8318
|
ref,
|
|
@@ -8364,8 +8337,8 @@ var getModalId = (modal2) => {
|
|
|
8364
8337
|
return modal2[symModalId];
|
|
8365
8338
|
};
|
|
8366
8339
|
function useModal(modal2, args) {
|
|
8367
|
-
const modals =
|
|
8368
|
-
const modalIdFromContext =
|
|
8340
|
+
const modals = React71.useContext(ModalContext);
|
|
8341
|
+
const modalIdFromContext = React71.useContext(ModalIdContext);
|
|
8369
8342
|
let modalId;
|
|
8370
8343
|
let isComponent = modal2 && typeof modal2 !== "string";
|
|
8371
8344
|
if (!modal2) {
|
|
@@ -8377,19 +8350,19 @@ function useModal(modal2, args) {
|
|
|
8377
8350
|
throw new Error("modalId is required");
|
|
8378
8351
|
}
|
|
8379
8352
|
const id = modalId;
|
|
8380
|
-
|
|
8353
|
+
React71.useEffect(() => {
|
|
8381
8354
|
if (isComponent) {
|
|
8382
8355
|
register(id, modal2, args);
|
|
8383
8356
|
}
|
|
8384
8357
|
}, [isComponent, modalId, modal2, args]);
|
|
8385
8358
|
const modalInfo = modals[id];
|
|
8386
|
-
const show2 =
|
|
8359
|
+
const show2 = React71.useCallback(
|
|
8387
8360
|
(args2) => modalActions.show(id, args2),
|
|
8388
8361
|
[id]
|
|
8389
8362
|
);
|
|
8390
|
-
const hide2 =
|
|
8391
|
-
const remove2 =
|
|
8392
|
-
const onOpenChange =
|
|
8363
|
+
const hide2 = React71.useCallback(() => modalActions.hide(id), [id]);
|
|
8364
|
+
const remove2 = React71.useCallback(() => modalActions.remove(id), [id]);
|
|
8365
|
+
const onOpenChange = React71.useCallback(
|
|
8393
8366
|
(isOpen) => {
|
|
8394
8367
|
if (!isOpen) {
|
|
8395
8368
|
reject("cancel");
|
|
@@ -8398,33 +8371,33 @@ function useModal(modal2, args) {
|
|
|
8398
8371
|
},
|
|
8399
8372
|
[id]
|
|
8400
8373
|
);
|
|
8401
|
-
const setStates2 =
|
|
8374
|
+
const setStates2 = React71.useCallback(
|
|
8402
8375
|
(states) => {
|
|
8403
8376
|
modalActions.setStates(id, states);
|
|
8404
8377
|
},
|
|
8405
8378
|
[id]
|
|
8406
8379
|
);
|
|
8407
|
-
const updateArgs2 =
|
|
8380
|
+
const updateArgs2 = React71.useCallback(
|
|
8408
8381
|
(args2) => {
|
|
8409
8382
|
modalActions.updateArgs(id, args2);
|
|
8410
8383
|
},
|
|
8411
8384
|
[id]
|
|
8412
8385
|
);
|
|
8413
|
-
const resolve =
|
|
8386
|
+
const resolve = React71.useCallback(
|
|
8414
8387
|
(args2) => {
|
|
8415
8388
|
modalCallbacks[id]?.resolve(args2);
|
|
8416
8389
|
delete modalCallbacks[id];
|
|
8417
8390
|
},
|
|
8418
8391
|
[id]
|
|
8419
8392
|
);
|
|
8420
|
-
const reject =
|
|
8393
|
+
const reject = React71.useCallback(
|
|
8421
8394
|
(args2) => {
|
|
8422
8395
|
modalCallbacks[id]?.reject(args2);
|
|
8423
8396
|
delete modalCallbacks[id];
|
|
8424
8397
|
},
|
|
8425
8398
|
[id]
|
|
8426
8399
|
);
|
|
8427
|
-
const resolveHide =
|
|
8400
|
+
const resolveHide = React71.useCallback((args2) => {
|
|
8428
8401
|
hideModalCallbacks[id]?.resolve(args2);
|
|
8429
8402
|
delete hideModalCallbacks[id];
|
|
8430
8403
|
}, []);
|
|
@@ -8458,9 +8431,9 @@ var MODAL_REGISTRY = /* @__PURE__ */ new Map();
|
|
|
8458
8431
|
var create = (Comp) => {
|
|
8459
8432
|
return ({ id, defaultVisible, keepMounted, ...props }) => {
|
|
8460
8433
|
const { args, show: show2 } = useModal(id);
|
|
8461
|
-
const modals =
|
|
8434
|
+
const modals = React71.useContext(ModalContext);
|
|
8462
8435
|
const shouldMount = !!modals[id];
|
|
8463
|
-
|
|
8436
|
+
React71.useEffect(() => {
|
|
8464
8437
|
if (defaultVisible) {
|
|
8465
8438
|
show2();
|
|
8466
8439
|
}
|
|
@@ -8471,11 +8444,11 @@ var create = (Comp) => {
|
|
|
8471
8444
|
}
|
|
8472
8445
|
};
|
|
8473
8446
|
}, [id, show2, defaultVisible]);
|
|
8474
|
-
|
|
8447
|
+
React71.useEffect(() => {
|
|
8475
8448
|
if (keepMounted) modalActions.setStates(id, { keepMounted: true });
|
|
8476
8449
|
}, [id, keepMounted]);
|
|
8477
8450
|
const delayVisible = modals[id]?.delayVisible;
|
|
8478
|
-
|
|
8451
|
+
React71.useEffect(() => {
|
|
8479
8452
|
if (delayVisible) {
|
|
8480
8453
|
show2(args);
|
|
8481
8454
|
}
|
|
@@ -8496,8 +8469,8 @@ var unregister = (id) => {
|
|
|
8496
8469
|
};
|
|
8497
8470
|
var initialState = {};
|
|
8498
8471
|
var ALREADY_MOUNTED = {};
|
|
8499
|
-
var ModalContext =
|
|
8500
|
-
var ModalIdContext =
|
|
8472
|
+
var ModalContext = React71.createContext(initialState);
|
|
8473
|
+
var ModalIdContext = React71.createContext(null);
|
|
8501
8474
|
var modalCallbacks = {};
|
|
8502
8475
|
var hideModalCallbacks = {};
|
|
8503
8476
|
var dispatch = () => {
|
|
@@ -8606,7 +8579,7 @@ var reducer = (state, action) => {
|
|
|
8606
8579
|
}
|
|
8607
8580
|
};
|
|
8608
8581
|
var ModalContainer = () => {
|
|
8609
|
-
const modals =
|
|
8582
|
+
const modals = React71.useContext(ModalContext);
|
|
8610
8583
|
const visibleModalIds = Object.keys(modals).filter((id) => !!modals[id]);
|
|
8611
8584
|
visibleModalIds.forEach((id) => {
|
|
8612
8585
|
if (!MODAL_REGISTRY.has(id) && !ALREADY_MOUNTED[id]) {
|
|
@@ -8625,7 +8598,7 @@ var ModalContainer = () => {
|
|
|
8625
8598
|
}) });
|
|
8626
8599
|
};
|
|
8627
8600
|
var ModalProvider = (props) => {
|
|
8628
|
-
const [state, dispatchOrigin] =
|
|
8601
|
+
const [state, dispatchOrigin] = React71.useReducer(reducer, initialState);
|
|
8629
8602
|
dispatch = dispatchOrigin;
|
|
8630
8603
|
return /* @__PURE__ */ jsxRuntime.jsxs(ModalContext.Provider, { value: state, children: [
|
|
8631
8604
|
props.children,
|
|
@@ -8729,7 +8702,7 @@ var dividerVariants = tv({
|
|
|
8729
8702
|
intensity: 4
|
|
8730
8703
|
}
|
|
8731
8704
|
});
|
|
8732
|
-
var Divider =
|
|
8705
|
+
var Divider = React71__namespace.default.forwardRef((props, ref) => {
|
|
8733
8706
|
const { className, intensity, direction, lineStyle, mx, my, ...rest } = props;
|
|
8734
8707
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8735
8708
|
"div",
|
|
@@ -8937,7 +8910,7 @@ var Dialog = DialogPrimitive__namespace.Root;
|
|
|
8937
8910
|
var DialogTrigger = DialogPrimitive__namespace.Trigger;
|
|
8938
8911
|
var DialogPortal = DialogPrimitive__namespace.Portal;
|
|
8939
8912
|
var DialogClose = DialogPrimitive__namespace.Close;
|
|
8940
|
-
var DialogOverlay =
|
|
8913
|
+
var DialogOverlay = React71__namespace.forwardRef(({ className, ...props }, ref) => {
|
|
8941
8914
|
const { overlay } = dialogVariants();
|
|
8942
8915
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8943
8916
|
DialogPrimitive__namespace.Overlay,
|
|
@@ -8949,7 +8922,7 @@ var DialogOverlay = React70__namespace.forwardRef(({ className, ...props }, ref)
|
|
|
8949
8922
|
);
|
|
8950
8923
|
});
|
|
8951
8924
|
DialogOverlay.displayName = DialogPrimitive__namespace.Overlay.displayName;
|
|
8952
|
-
var DialogContent =
|
|
8925
|
+
var DialogContent = React71__namespace.forwardRef(
|
|
8953
8926
|
({
|
|
8954
8927
|
overlyClassName,
|
|
8955
8928
|
className,
|
|
@@ -9011,7 +8984,7 @@ var DialogFooter = ({
|
|
|
9011
8984
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: footer({ className }), ...props });
|
|
9012
8985
|
};
|
|
9013
8986
|
DialogFooter.displayName = "DialogFooter";
|
|
9014
|
-
var DialogTitle =
|
|
8987
|
+
var DialogTitle = React71__namespace.forwardRef(({ className, ...props }, ref) => {
|
|
9015
8988
|
const { title } = dialogVariants();
|
|
9016
8989
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9017
8990
|
DialogPrimitive__namespace.Title,
|
|
@@ -9023,7 +8996,7 @@ var DialogTitle = React70__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
9023
8996
|
);
|
|
9024
8997
|
});
|
|
9025
8998
|
DialogTitle.displayName = DialogPrimitive__namespace.Title.displayName;
|
|
9026
|
-
var DialogDescription =
|
|
8999
|
+
var DialogDescription = React71__namespace.forwardRef(({ className, ...props }, ref) => {
|
|
9027
9000
|
const { desc } = dialogVariants();
|
|
9028
9001
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9029
9002
|
DialogPrimitive__namespace.Description,
|
|
@@ -9037,10 +9010,10 @@ var DialogDescription = React70__namespace.forwardRef(({ className, ...props },
|
|
|
9037
9010
|
DialogDescription.displayName = DialogPrimitive__namespace.Description.displayName;
|
|
9038
9011
|
var SimpleDialogFooter = (props) => {
|
|
9039
9012
|
const { actions } = props;
|
|
9040
|
-
const [primaryLoading, setPrimaryLoading] =
|
|
9013
|
+
const [primaryLoading, setPrimaryLoading] = React71.useState(
|
|
9041
9014
|
actions?.primary?.loading ?? false
|
|
9042
9015
|
);
|
|
9043
|
-
|
|
9016
|
+
React71.useEffect(() => {
|
|
9044
9017
|
if (actions?.primary?.loading) {
|
|
9045
9018
|
setPrimaryLoading(actions?.primary?.loading);
|
|
9046
9019
|
}
|
|
@@ -9049,7 +9022,7 @@ var SimpleDialogFooter = (props) => {
|
|
|
9049
9022
|
};
|
|
9050
9023
|
}, [actions?.primary?.loading]);
|
|
9051
9024
|
if (!actions) return null;
|
|
9052
|
-
const buttons =
|
|
9025
|
+
const buttons = React71.useMemo(() => {
|
|
9053
9026
|
const buttons2 = [];
|
|
9054
9027
|
if (actions.secondary && typeof actions.secondary.onClick === "function") {
|
|
9055
9028
|
const {
|
|
@@ -9156,7 +9129,7 @@ var AlertDialog = (props) => {
|
|
|
9156
9129
|
classNames
|
|
9157
9130
|
} = props;
|
|
9158
9131
|
const { isMobile } = useScreen();
|
|
9159
|
-
const actions =
|
|
9132
|
+
const actions = React71.useMemo(() => {
|
|
9160
9133
|
if (typeof onOk !== "function" && typeof onCancel !== "function")
|
|
9161
9134
|
return void 0;
|
|
9162
9135
|
const actions2 = {};
|
|
@@ -9209,7 +9182,7 @@ var AlertDialog = (props) => {
|
|
|
9209
9182
|
var CreatedAlertDialog = create((props) => {
|
|
9210
9183
|
const { onOk } = props;
|
|
9211
9184
|
const { visible, hide: hide2, resolve, reject, onOpenChange } = useModal();
|
|
9212
|
-
const onOkHandler =
|
|
9185
|
+
const onOkHandler = React71.useCallback(() => {
|
|
9213
9186
|
return Promise.resolve().then(onOk).then(hide2);
|
|
9214
9187
|
}, [onOk]);
|
|
9215
9188
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -9426,14 +9399,14 @@ function registerSimpleSheet(id, comp, props) {
|
|
|
9426
9399
|
}
|
|
9427
9400
|
var ActionItem = (props) => {
|
|
9428
9401
|
const { action } = props;
|
|
9429
|
-
const onItemClick =
|
|
9402
|
+
const onItemClick = React71.useCallback(() => {
|
|
9430
9403
|
if (typeof action.onClick === "function") {
|
|
9431
9404
|
action.onClick(action);
|
|
9432
9405
|
} else {
|
|
9433
9406
|
props.onClick?.({ ...action, index: props.index });
|
|
9434
9407
|
}
|
|
9435
9408
|
}, [action]);
|
|
9436
|
-
const child =
|
|
9409
|
+
const child = React71.useMemo(() => {
|
|
9437
9410
|
return action.label;
|
|
9438
9411
|
}, [action.label]);
|
|
9439
9412
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -9456,7 +9429,7 @@ var ActionSheetContent = (props) => {
|
|
|
9456
9429
|
if (action.type === "division") {
|
|
9457
9430
|
return /* @__PURE__ */ jsxRuntime.jsx(ActionDivision, {}, index);
|
|
9458
9431
|
}
|
|
9459
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9432
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(React71.Fragment, { children: [
|
|
9460
9433
|
action.value === "cancel" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "oui-h-2 oui-bg-base-10" }),
|
|
9461
9434
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9462
9435
|
ActionItem,
|
|
@@ -9483,7 +9456,7 @@ var ActionSheetContent = (props) => {
|
|
|
9483
9456
|
};
|
|
9484
9457
|
var ActionSheet = (props) => {
|
|
9485
9458
|
const [locale] = useLocale("modal");
|
|
9486
|
-
const items =
|
|
9459
|
+
const items = React71.useMemo(() => {
|
|
9487
9460
|
const items2 = [];
|
|
9488
9461
|
if (Array.isArray(props.actionSheets)) {
|
|
9489
9462
|
for (const action of props.actionSheets) {
|
|
@@ -9563,7 +9536,7 @@ var pickerVariants = tv({
|
|
|
9563
9536
|
color: "base"
|
|
9564
9537
|
}
|
|
9565
9538
|
});
|
|
9566
|
-
var Picker =
|
|
9539
|
+
var Picker = React71.forwardRef(
|
|
9567
9540
|
(originalProps, ref) => {
|
|
9568
9541
|
const {
|
|
9569
9542
|
size,
|
|
@@ -9578,8 +9551,8 @@ var Picker = React70.forwardRef(
|
|
|
9578
9551
|
valueRenderer,
|
|
9579
9552
|
...props
|
|
9580
9553
|
} = originalProps;
|
|
9581
|
-
const [open, setOpen] =
|
|
9582
|
-
const selectedItem =
|
|
9554
|
+
const [open, setOpen] = React71.useState(false);
|
|
9555
|
+
const selectedItem = React71.useMemo(() => {
|
|
9583
9556
|
if (value && !!value.value) {
|
|
9584
9557
|
return value;
|
|
9585
9558
|
}
|
|
@@ -9590,13 +9563,13 @@ var Picker = React70.forwardRef(
|
|
|
9590
9563
|
}
|
|
9591
9564
|
}
|
|
9592
9565
|
}, [value, options]);
|
|
9593
|
-
const text =
|
|
9566
|
+
const text = React71.useMemo(() => {
|
|
9594
9567
|
if (selectedItem) {
|
|
9595
9568
|
return selectedItem.label;
|
|
9596
9569
|
}
|
|
9597
9570
|
return placeholder || label || "";
|
|
9598
9571
|
}, [selectedItem, label, placeholder]);
|
|
9599
|
-
const actions =
|
|
9572
|
+
const actions = React71.useMemo(() => {
|
|
9600
9573
|
return [...options, "---", "Cancel"];
|
|
9601
9574
|
}, [options]);
|
|
9602
9575
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -9727,10 +9700,10 @@ var DataFilter = (props) => {
|
|
|
9727
9700
|
);
|
|
9728
9701
|
};
|
|
9729
9702
|
var usePagination = (initial) => {
|
|
9730
|
-
const dataTotal =
|
|
9731
|
-
const [page, setPage] =
|
|
9732
|
-
const [pageSize, _setPageSize] =
|
|
9733
|
-
const setPageSize =
|
|
9703
|
+
const dataTotal = React71.useRef(0);
|
|
9704
|
+
const [page, setPage] = React71.useState(initial?.page ?? 1);
|
|
9705
|
+
const [pageSize, _setPageSize] = React71.useState(initial?.pageSize ?? 10);
|
|
9706
|
+
const setPageSize = React71.useCallback(
|
|
9734
9707
|
(size) => {
|
|
9735
9708
|
_setPageSize(size);
|
|
9736
9709
|
if (dataTotal.current > 0) {
|
|
@@ -9755,7 +9728,7 @@ var usePagination = (initial) => {
|
|
|
9755
9728
|
pageTotal
|
|
9756
9729
|
};
|
|
9757
9730
|
};
|
|
9758
|
-
const parsePagination =
|
|
9731
|
+
const parsePagination = React71.useCallback(
|
|
9759
9732
|
(meta) => {
|
|
9760
9733
|
return {
|
|
9761
9734
|
...parseMeta(meta),
|
|
@@ -9765,7 +9738,7 @@ var usePagination = (initial) => {
|
|
|
9765
9738
|
},
|
|
9766
9739
|
[page, pageSize]
|
|
9767
9740
|
);
|
|
9768
|
-
const pagination =
|
|
9741
|
+
const pagination = React71.useMemo(
|
|
9769
9742
|
() => ({
|
|
9770
9743
|
page,
|
|
9771
9744
|
pageSize,
|
|
@@ -9774,7 +9747,7 @@ var usePagination = (initial) => {
|
|
|
9774
9747
|
}),
|
|
9775
9748
|
[parsePagination]
|
|
9776
9749
|
);
|
|
9777
|
-
|
|
9750
|
+
React71.useEffect(() => {
|
|
9778
9751
|
if (initial?.resetPageWhenPageSizeChange !== false) {
|
|
9779
9752
|
setPage(1);
|
|
9780
9753
|
}
|
|
@@ -9789,26 +9762,6 @@ var usePagination = (initial) => {
|
|
|
9789
9762
|
parsePagination
|
|
9790
9763
|
};
|
|
9791
9764
|
};
|
|
9792
|
-
var EmptyDataState = (props) => {
|
|
9793
|
-
const [locale] = useLocale("empty");
|
|
9794
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9795
|
-
Flex,
|
|
9796
|
-
{
|
|
9797
|
-
itemAlign: "center",
|
|
9798
|
-
direction: "column",
|
|
9799
|
-
gapY: 4,
|
|
9800
|
-
className: props.className,
|
|
9801
|
-
children: [
|
|
9802
|
-
/* @__PURE__ */ jsxRuntime.jsx(Box, { children: /* @__PURE__ */ jsxRuntime.jsx(emptyData_default, {}) }),
|
|
9803
|
-
/* @__PURE__ */ jsxRuntime.jsx(Text2, { as: "div", intensity: 36, size: "2xs", children: props.title ?? locale.description })
|
|
9804
|
-
]
|
|
9805
|
-
}
|
|
9806
|
-
);
|
|
9807
|
-
};
|
|
9808
|
-
installExtension({
|
|
9809
|
-
name: "emptyDataIdentifier",
|
|
9810
|
-
positions: ["emptyDataIdentifier" /* EmptyDataIdentifier */]
|
|
9811
|
-
})(EmptyDataState);
|
|
9812
9765
|
|
|
9813
9766
|
// src/table/features/index.ts
|
|
9814
9767
|
var features_exports = {};
|
|
@@ -10020,13 +9973,13 @@ var tabsVariants = tv({
|
|
|
10020
9973
|
}
|
|
10021
9974
|
});
|
|
10022
9975
|
var TabsBase = TabsPrimitive__namespace.Root;
|
|
10023
|
-
var TabsList =
|
|
9976
|
+
var TabsList = React71__namespace.forwardRef((originProps, ref) => {
|
|
10024
9977
|
const { className, size, variant, ...props } = originProps;
|
|
10025
9978
|
const { list } = tabsVariants({ size, variant });
|
|
10026
9979
|
return /* @__PURE__ */ jsxRuntime.jsx(TabsPrimitive__namespace.List, { ref, className: list({ className }), ...props });
|
|
10027
9980
|
});
|
|
10028
9981
|
TabsList.displayName = TabsPrimitive__namespace.List.displayName;
|
|
10029
|
-
var TabsTrigger =
|
|
9982
|
+
var TabsTrigger = React71__namespace.forwardRef((originProps, ref) => {
|
|
10030
9983
|
const { className, size, children, icon, variant, ...props } = originProps;
|
|
10031
9984
|
const { trigger, icon: iconClassName } = tabsVariants({ size, variant });
|
|
10032
9985
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -10036,14 +9989,14 @@ var TabsTrigger = React70__namespace.forwardRef((originProps, ref) => {
|
|
|
10036
9989
|
className: trigger({ className }),
|
|
10037
9990
|
...props,
|
|
10038
9991
|
children: [
|
|
10039
|
-
typeof icon !== "undefined" ?
|
|
9992
|
+
typeof icon !== "undefined" ? React71__namespace.cloneElement(icon, { className: iconClassName(), opacity: 1 }) : null,
|
|
10040
9993
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children })
|
|
10041
9994
|
]
|
|
10042
9995
|
}
|
|
10043
9996
|
);
|
|
10044
9997
|
});
|
|
10045
9998
|
TabsTrigger.displayName = TabsPrimitive__namespace.Trigger.displayName;
|
|
10046
|
-
var TabsContent =
|
|
9999
|
+
var TabsContent = React71__namespace.forwardRef((oriProps, ref) => {
|
|
10047
10000
|
const { className, size, children, ...props } = oriProps;
|
|
10048
10001
|
const { content } = tabsVariants({ size });
|
|
10049
10002
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -10057,16 +10010,16 @@ var TabsContent = React70__namespace.forwardRef((oriProps, ref) => {
|
|
|
10057
10010
|
);
|
|
10058
10011
|
});
|
|
10059
10012
|
TabsContent.displayName = TabsPrimitive__namespace.Content.displayName;
|
|
10060
|
-
var OrderlyThemeContext =
|
|
10013
|
+
var OrderlyThemeContext = React71.createContext(
|
|
10061
10014
|
{}
|
|
10062
10015
|
);
|
|
10063
10016
|
var useOrderlyTheme = () => {
|
|
10064
|
-
return
|
|
10017
|
+
return React71.useContext(OrderlyThemeContext);
|
|
10065
10018
|
};
|
|
10066
10019
|
function useDrag(containerRef) {
|
|
10067
|
-
const [isDragging, setIsDragging] =
|
|
10068
|
-
const [startX, setStartX] =
|
|
10069
|
-
const [scrollLeft, setScrollLeft] =
|
|
10020
|
+
const [isDragging, setIsDragging] = React71.useState(false);
|
|
10021
|
+
const [startX, setStartX] = React71.useState(0);
|
|
10022
|
+
const [scrollLeft, setScrollLeft] = React71.useState(0);
|
|
10070
10023
|
const handleMouseDown = (e) => {
|
|
10071
10024
|
if (!containerRef.current) return;
|
|
10072
10025
|
setIsDragging(true);
|
|
@@ -10091,10 +10044,10 @@ function useDrag(containerRef) {
|
|
|
10091
10044
|
};
|
|
10092
10045
|
}
|
|
10093
10046
|
function useScroll2() {
|
|
10094
|
-
const [leadingVisible, setLeadingVisible] =
|
|
10095
|
-
const [tailingVisible, setTailingVisible] =
|
|
10096
|
-
const containerRef =
|
|
10097
|
-
|
|
10047
|
+
const [leadingVisible, setLeadingVisible] = React71.useState(false);
|
|
10048
|
+
const [tailingVisible, setTailingVisible] = React71.useState(false);
|
|
10049
|
+
const containerRef = React71.useRef(null);
|
|
10050
|
+
React71.useEffect(() => {
|
|
10098
10051
|
if (!containerRef.current) return;
|
|
10099
10052
|
const handleScroll = () => {
|
|
10100
10053
|
const container2 = containerRef.current;
|
|
@@ -10119,7 +10072,7 @@ function useScroll2() {
|
|
|
10119
10072
|
intersectionObserver.disconnect();
|
|
10120
10073
|
};
|
|
10121
10074
|
}, []);
|
|
10122
|
-
|
|
10075
|
+
React71.useEffect(() => {
|
|
10123
10076
|
if (!containerRef.current) return;
|
|
10124
10077
|
const intersectionObserver = new IntersectionObserver((entries) => {
|
|
10125
10078
|
entries.forEach((entry) => {
|
|
@@ -10236,7 +10189,7 @@ var ScrollIndicator = (props) => {
|
|
|
10236
10189
|
}
|
|
10237
10190
|
);
|
|
10238
10191
|
};
|
|
10239
|
-
var TabsContext =
|
|
10192
|
+
var TabsContext = React71.createContext({});
|
|
10240
10193
|
var Tabs = (props) => {
|
|
10241
10194
|
const { getComponentTheme } = useOrderlyTheme();
|
|
10242
10195
|
const {
|
|
@@ -10251,20 +10204,20 @@ var Tabs = (props) => {
|
|
|
10251
10204
|
variant: variant ?? "contained"
|
|
10252
10205
|
});
|
|
10253
10206
|
const tabsVariant = tabsOverrides.variant;
|
|
10254
|
-
const [tabList, setTabList] =
|
|
10255
|
-
const registerTab =
|
|
10207
|
+
const [tabList, setTabList] = React71.useState({});
|
|
10208
|
+
const registerTab = React71.useCallback((config) => {
|
|
10256
10209
|
setTabList((prev) => {
|
|
10257
10210
|
return { ...prev, [config.value]: config };
|
|
10258
10211
|
});
|
|
10259
10212
|
}, []);
|
|
10260
|
-
const unregisterTab =
|
|
10213
|
+
const unregisterTab = React71.useCallback((config) => {
|
|
10261
10214
|
setTabList((prev) => {
|
|
10262
10215
|
const newTabList = { ...prev };
|
|
10263
10216
|
delete newTabList[config.value];
|
|
10264
10217
|
return newTabList;
|
|
10265
10218
|
});
|
|
10266
10219
|
}, []);
|
|
10267
|
-
const memoizedValue =
|
|
10220
|
+
const memoizedValue = React71.useMemo(
|
|
10268
10221
|
() => ({ registerTab, unregisterTab }),
|
|
10269
10222
|
[registerTab, unregisterTab]
|
|
10270
10223
|
);
|
|
@@ -10337,8 +10290,8 @@ var Tabs = (props) => {
|
|
|
10337
10290
|
Tabs.displayName = "Tabs";
|
|
10338
10291
|
var TabPanel = (props) => {
|
|
10339
10292
|
const { title, value, icon, style, testid, children, className, classNames } = props;
|
|
10340
|
-
const { registerTab, unregisterTab } =
|
|
10341
|
-
|
|
10293
|
+
const { registerTab, unregisterTab } = React71.useContext(TabsContext);
|
|
10294
|
+
React71.useEffect(() => {
|
|
10342
10295
|
const tabConfig = {
|
|
10343
10296
|
title,
|
|
10344
10297
|
value,
|
|
@@ -10375,7 +10328,7 @@ var cardVariants = tv({
|
|
|
10375
10328
|
intensity: 900
|
|
10376
10329
|
}
|
|
10377
10330
|
});
|
|
10378
|
-
var CardBase =
|
|
10331
|
+
var CardBase = React71__namespace.default.forwardRef(
|
|
10379
10332
|
({ className, intensity, children, ...props }, ref) => {
|
|
10380
10333
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10381
10334
|
"div",
|
|
@@ -10389,7 +10342,7 @@ var CardBase = React70__namespace.default.forwardRef(
|
|
|
10389
10342
|
}
|
|
10390
10343
|
);
|
|
10391
10344
|
CardBase.displayName = "CardBase";
|
|
10392
|
-
var CardHeader =
|
|
10345
|
+
var CardHeader = React71__namespace.default.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
10393
10346
|
"div",
|
|
10394
10347
|
{
|
|
10395
10348
|
ref,
|
|
@@ -10402,7 +10355,7 @@ var CardHeader = React70__namespace.default.forwardRef(({ className, children, .
|
|
|
10402
10355
|
}
|
|
10403
10356
|
));
|
|
10404
10357
|
CardHeader.displayName = "CardHeader";
|
|
10405
|
-
var CardTitle =
|
|
10358
|
+
var CardTitle = React71__namespace.default.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
10406
10359
|
"h3",
|
|
10407
10360
|
{
|
|
10408
10361
|
ref,
|
|
@@ -10415,7 +10368,7 @@ var CardTitle = React70__namespace.default.forwardRef(({ className, children, ..
|
|
|
10415
10368
|
}
|
|
10416
10369
|
));
|
|
10417
10370
|
CardTitle.displayName = "CardTitle";
|
|
10418
|
-
var CardDescription =
|
|
10371
|
+
var CardDescription = React71__namespace.default.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
10419
10372
|
"p",
|
|
10420
10373
|
{
|
|
10421
10374
|
ref,
|
|
@@ -10424,7 +10377,7 @@ var CardDescription = React70__namespace.default.forwardRef(({ className, childr
|
|
|
10424
10377
|
children
|
|
10425
10378
|
}
|
|
10426
10379
|
));
|
|
10427
|
-
var CardContent =
|
|
10380
|
+
var CardContent = React71__namespace.default.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
10428
10381
|
"div",
|
|
10429
10382
|
{
|
|
10430
10383
|
ref,
|
|
@@ -10434,9 +10387,9 @@ var CardContent = React70__namespace.default.forwardRef(({ className, children,
|
|
|
10434
10387
|
}
|
|
10435
10388
|
));
|
|
10436
10389
|
CardContent.displayName = "CardContent";
|
|
10437
|
-
var CardFooter =
|
|
10390
|
+
var CardFooter = React71__namespace.default.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className, ...props, children }));
|
|
10438
10391
|
CardFooter.displayName = "CardFooter";
|
|
10439
|
-
var Card =
|
|
10392
|
+
var Card = React71.forwardRef(
|
|
10440
10393
|
(props, ref) => {
|
|
10441
10394
|
const { title, children, footer, className, classNames, ...rest } = props;
|
|
10442
10395
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardBase, { ...rest, className: tailwindVariants.cnBase(className, classNames?.root), ref, children: [
|
|
@@ -10449,7 +10402,7 @@ var Card = React70.forwardRef(
|
|
|
10449
10402
|
Card.displayName = "Card";
|
|
10450
10403
|
var HoverCardRoot = HoverCardPrimitive__namespace.Root;
|
|
10451
10404
|
var HoverCardTrigger = HoverCardPrimitive__namespace.Trigger;
|
|
10452
|
-
var HoverCardContent =
|
|
10405
|
+
var HoverCardContent = React71__namespace.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
10453
10406
|
HoverCardPrimitive__namespace.Content,
|
|
10454
10407
|
{
|
|
10455
10408
|
ref,
|
|
@@ -10603,7 +10556,7 @@ var sliderVariants = tv({
|
|
|
10603
10556
|
}
|
|
10604
10557
|
}
|
|
10605
10558
|
});
|
|
10606
|
-
var BaseSlider =
|
|
10559
|
+
var BaseSlider = React71__namespace.forwardRef((oriProps, ref) => {
|
|
10607
10560
|
const {
|
|
10608
10561
|
className,
|
|
10609
10562
|
color,
|
|
@@ -10619,8 +10572,8 @@ var BaseSlider = React70__namespace.forwardRef((oriProps, ref) => {
|
|
|
10619
10572
|
const { track, range, thumb, root, trackInner, mark, tips } = sliderVariants({
|
|
10620
10573
|
color
|
|
10621
10574
|
});
|
|
10622
|
-
const [innerValue, setInvalue] =
|
|
10623
|
-
|
|
10575
|
+
const [innerValue, setInvalue] = React71__namespace.useState(__propsValue);
|
|
10576
|
+
React71__namespace.useEffect(() => {
|
|
10624
10577
|
setInvalue((prev) => {
|
|
10625
10578
|
if (!prev) {
|
|
10626
10579
|
return __propsValue;
|
|
@@ -10631,7 +10584,7 @@ var BaseSlider = React70__namespace.forwardRef((oriProps, ref) => {
|
|
|
10631
10584
|
return prev;
|
|
10632
10585
|
});
|
|
10633
10586
|
}, [__propsValue]);
|
|
10634
|
-
const innerMasks =
|
|
10587
|
+
const innerMasks = React71.useMemo(() => {
|
|
10635
10588
|
if (Array.isArray(marks) && marks.length > 0) {
|
|
10636
10589
|
return marks;
|
|
10637
10590
|
}
|
|
@@ -10727,14 +10680,14 @@ var Marks = (props) => {
|
|
|
10727
10680
|
className,
|
|
10728
10681
|
color = "primary"
|
|
10729
10682
|
} = props;
|
|
10730
|
-
const _value =
|
|
10731
|
-
const selIndex =
|
|
10683
|
+
const _value = React71.useMemo(() => value?.[0] ?? 0, [value]);
|
|
10684
|
+
const selIndex = React71.useMemo(() => {
|
|
10732
10685
|
if (typeof props.step === "undefined") {
|
|
10733
10686
|
return void 0;
|
|
10734
10687
|
}
|
|
10735
10688
|
return Math.floor(_value / props.step);
|
|
10736
10689
|
}, [_value, props.step]);
|
|
10737
|
-
const colorCls =
|
|
10690
|
+
const colorCls = React71.useMemo(() => {
|
|
10738
10691
|
switch (color) {
|
|
10739
10692
|
case "primary":
|
|
10740
10693
|
return "oui-border-primary oui-bg-primary";
|
|
@@ -10746,7 +10699,7 @@ var Marks = (props) => {
|
|
|
10746
10699
|
return "oui-border-primary-light oui-bg-primary-light";
|
|
10747
10700
|
}
|
|
10748
10701
|
}, [color]);
|
|
10749
|
-
const textCls =
|
|
10702
|
+
const textCls = React71.useMemo(() => {
|
|
10750
10703
|
switch (color) {
|
|
10751
10704
|
case "primary":
|
|
10752
10705
|
return "oui-text-primary";
|
|
@@ -10768,7 +10721,7 @@ var Marks = (props) => {
|
|
|
10768
10721
|
const __value = isInnerMask ? mark.value : index;
|
|
10769
10722
|
const active = (isInnerMask ? _value >= __value : _value >= mark.value) && _value >= 0 && !props.disabled;
|
|
10770
10723
|
const classNames = active ? colorCls : "";
|
|
10771
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10724
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(React71.Fragment, { children: [
|
|
10772
10725
|
(!isInnerMask ? mark.label : true) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10773
10726
|
"span",
|
|
10774
10727
|
{
|
|
@@ -10798,8 +10751,8 @@ var SliderTip = (props) => {
|
|
|
10798
10751
|
const percent = convertValueToPercentage(value, min, max);
|
|
10799
10752
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { className, style: { lineHeight: "19px" }, children: props.tipFormatter?.(value, min, max, percent) ?? `${percent.toFixed()}%` });
|
|
10800
10753
|
};
|
|
10801
|
-
var SingleSlider =
|
|
10802
|
-
const _value =
|
|
10754
|
+
var SingleSlider = React71__namespace.forwardRef((props, ref) => {
|
|
10755
|
+
const _value = React71.useMemo(() => [props.value], [props.value]);
|
|
10803
10756
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10804
10757
|
BaseSlider,
|
|
10805
10758
|
{
|
|
@@ -10818,7 +10771,7 @@ var SingleSlider = React70__namespace.forwardRef((props, ref) => {
|
|
|
10818
10771
|
SingleSlider.displayName = "SingleSlider";
|
|
10819
10772
|
var Slider = BaseSlider;
|
|
10820
10773
|
Slider.single = SingleSlider;
|
|
10821
|
-
var ToastErrorIcon =
|
|
10774
|
+
var ToastErrorIcon = React71__namespace.default.forwardRef(
|
|
10822
10775
|
(props, ref) => {
|
|
10823
10776
|
const { opacity = 1, viewBox = "0 0 20 20", className, ...rest } = props;
|
|
10824
10777
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -10840,7 +10793,7 @@ var ToastErrorIcon = React70__namespace.default.forwardRef(
|
|
|
10840
10793
|
);
|
|
10841
10794
|
}
|
|
10842
10795
|
);
|
|
10843
|
-
var ToastSuccessIcon =
|
|
10796
|
+
var ToastSuccessIcon = React71__namespace.default.forwardRef(
|
|
10844
10797
|
(props, ref) => {
|
|
10845
10798
|
const { opacity = 1, viewBox = "0 0 20 20", className, ...rest } = props;
|
|
10846
10799
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -10863,7 +10816,7 @@ var ToastSuccessIcon = React70__namespace.default.forwardRef(
|
|
|
10863
10816
|
);
|
|
10864
10817
|
}
|
|
10865
10818
|
);
|
|
10866
|
-
var ToastLoadingIcon =
|
|
10819
|
+
var ToastLoadingIcon = React71__namespace.default.forwardRef(
|
|
10867
10820
|
(props, ref) => {
|
|
10868
10821
|
const { opacity = 1, viewBox = "0 0 20 20", className, ...rest } = props;
|
|
10869
10822
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -11024,10 +10977,10 @@ var ToastTile = (props) => {
|
|
|
11024
10977
|
);
|
|
11025
10978
|
};
|
|
11026
10979
|
function useEndReached(sentinelRef, onEndReached) {
|
|
11027
|
-
const observer =
|
|
11028
|
-
const cb =
|
|
10980
|
+
const observer = React71.useRef();
|
|
10981
|
+
const cb = React71.useRef(onEndReached);
|
|
11029
10982
|
cb.current = onEndReached;
|
|
11030
|
-
|
|
10983
|
+
React71.useEffect(() => {
|
|
11031
10984
|
const options = {
|
|
11032
10985
|
root: null,
|
|
11033
10986
|
rootMargin: "0px",
|
|
@@ -11045,22 +10998,22 @@ function useEndReached(sentinelRef, onEndReached) {
|
|
|
11045
10998
|
observer.current?.disconnect();
|
|
11046
10999
|
};
|
|
11047
11000
|
}, []);
|
|
11048
|
-
|
|
11001
|
+
React71.useEffect(() => {
|
|
11049
11002
|
observer.current?.observe(sentinelRef.current);
|
|
11050
11003
|
}, []);
|
|
11051
11004
|
}
|
|
11052
11005
|
var ListViewInner = (props, ref) => {
|
|
11053
|
-
const sentinelRef =
|
|
11054
|
-
const containerRef =
|
|
11006
|
+
const sentinelRef = React71.useRef(null);
|
|
11007
|
+
const containerRef = React71.useRef(null);
|
|
11055
11008
|
useEndReached(sentinelRef, () => {
|
|
11056
11009
|
if (!props.isLoading) {
|
|
11057
11010
|
props.loadMore?.();
|
|
11058
11011
|
}
|
|
11059
11012
|
});
|
|
11060
|
-
const emptyDataSouce =
|
|
11013
|
+
const emptyDataSouce = React71.useMemo(() => {
|
|
11061
11014
|
return Array.isArray(props.dataSource) && props.dataSource.length <= 0;
|
|
11062
11015
|
}, [props.dataSource]);
|
|
11063
|
-
const listViewElement =
|
|
11016
|
+
const listViewElement = React71.useMemo(() => {
|
|
11064
11017
|
if (!props.dataSource) {
|
|
11065
11018
|
return null;
|
|
11066
11019
|
}
|
|
@@ -11077,16 +11030,16 @@ var ListViewInner = (props, ref) => {
|
|
|
11077
11030
|
}
|
|
11078
11031
|
);
|
|
11079
11032
|
}
|
|
11080
|
-
return props.dataSource.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
11033
|
+
return props.dataSource.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(React71__namespace.default.Fragment, { children: props.renderItem(item, index, props.extraData) }, index));
|
|
11081
11034
|
}, [emptyDataSouce, props.dataSource, props.extraData, props.emptyView]);
|
|
11082
|
-
const loadingViewElement =
|
|
11035
|
+
const loadingViewElement = React71.useMemo(() => {
|
|
11083
11036
|
if ((props.dataSource?.length || 0) === 0) return null;
|
|
11084
11037
|
if (!props.isLoading) {
|
|
11085
11038
|
return null;
|
|
11086
11039
|
}
|
|
11087
11040
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "oui-flex oui-py-2 oui-justify-center oui-items-center", children: /* @__PURE__ */ jsxRuntime.jsx(Spinner, {}) });
|
|
11088
11041
|
}, [props.isLoading, props.dataSource]);
|
|
11089
|
-
|
|
11042
|
+
React71.useImperativeHandle(ref, () => {
|
|
11090
11043
|
return {
|
|
11091
11044
|
scroll: (direction) => {
|
|
11092
11045
|
containerRef.current?.scroll({
|
|
@@ -11114,7 +11067,7 @@ var ListViewInner = (props, ref) => {
|
|
|
11114
11067
|
{
|
|
11115
11068
|
className: tailwindVariants.cn(
|
|
11116
11069
|
"oui-space-y-3 oui-h-full oui-w-full",
|
|
11117
|
-
emptyDataSouce && "oui-absolute oui-
|
|
11070
|
+
emptyDataSouce && "oui-absolute oui-bottom-0 oui-left-0 oui-right-0 oui-top-0",
|
|
11118
11071
|
props.contentClassName
|
|
11119
11072
|
)({ twMerge: true }),
|
|
11120
11073
|
children: listViewElement
|
|
@@ -11132,7 +11085,7 @@ var ListViewInner = (props, ref) => {
|
|
|
11132
11085
|
}
|
|
11133
11086
|
);
|
|
11134
11087
|
};
|
|
11135
|
-
var ListView =
|
|
11088
|
+
var ListView = React71.forwardRef(ListViewInner);
|
|
11136
11089
|
var Collapsible = CollapsiblePrimitive__namespace.Root;
|
|
11137
11090
|
var CollapsibleTrigger2 = CollapsiblePrimitive__namespace.CollapsibleTrigger;
|
|
11138
11091
|
var CollapsibleContent2 = (props) => {
|
|
@@ -11147,16 +11100,16 @@ var CollapsibleContent2 = (props) => {
|
|
|
11147
11100
|
}
|
|
11148
11101
|
);
|
|
11149
11102
|
};
|
|
11150
|
-
var CollapseContext =
|
|
11103
|
+
var CollapseContext = React71.createContext(
|
|
11151
11104
|
{}
|
|
11152
11105
|
);
|
|
11153
11106
|
var useCollapseContext = () => {
|
|
11154
|
-
return
|
|
11107
|
+
return React71.useContext(CollapseContext);
|
|
11155
11108
|
};
|
|
11156
11109
|
var Panel = (props) => {
|
|
11157
11110
|
const { activeKey, setActiveKey } = useCollapseContext();
|
|
11158
11111
|
const { header, headerClassName, itemKey, disabled } = props;
|
|
11159
|
-
const headerNode =
|
|
11112
|
+
const headerNode = React71.useMemo(() => {
|
|
11160
11113
|
if (typeof header === "string") {
|
|
11161
11114
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11162
11115
|
"div",
|
|
@@ -11201,8 +11154,8 @@ var Panel = (props) => {
|
|
|
11201
11154
|
};
|
|
11202
11155
|
var CollapseRoot = (props) => {
|
|
11203
11156
|
const { activeKey = "", children } = props;
|
|
11204
|
-
const [internalActiveKey, setInternalActiveKey] =
|
|
11205
|
-
const memoizedValue =
|
|
11157
|
+
const [internalActiveKey, setInternalActiveKey] = React71.useState(activeKey);
|
|
11158
|
+
const memoizedValue = React71.useMemo(() => {
|
|
11206
11159
|
return {
|
|
11207
11160
|
activeKey: internalActiveKey,
|
|
11208
11161
|
setActiveKey: setInternalActiveKey
|
|
@@ -11222,11 +11175,11 @@ var Marquee = (props) => {
|
|
|
11222
11175
|
className,
|
|
11223
11176
|
setApi
|
|
11224
11177
|
} = props;
|
|
11225
|
-
const isHorizontal =
|
|
11178
|
+
const isHorizontal = React71.useMemo(
|
|
11226
11179
|
() => carouselOptions.axis !== "y",
|
|
11227
11180
|
[carouselOptions.axis]
|
|
11228
11181
|
);
|
|
11229
|
-
const emblaOptions =
|
|
11182
|
+
const emblaOptions = React71.useMemo(() => {
|
|
11230
11183
|
return {
|
|
11231
11184
|
loop: true,
|
|
11232
11185
|
align: "start",
|
|
@@ -11236,7 +11189,7 @@ var Marquee = (props) => {
|
|
|
11236
11189
|
...carouselOptions
|
|
11237
11190
|
};
|
|
11238
11191
|
}, [carouselOptions]);
|
|
11239
|
-
const autoScrollPluginOptions =
|
|
11192
|
+
const autoScrollPluginOptions = React71.useMemo(() => {
|
|
11240
11193
|
return {
|
|
11241
11194
|
speed: 1,
|
|
11242
11195
|
direction: "forward",
|
|
@@ -11250,12 +11203,12 @@ var Marquee = (props) => {
|
|
|
11250
11203
|
const [emblaRef, emblaApi] = useEmblaCarousel__default.default(emblaOptions, [
|
|
11251
11204
|
AutoScroll__default.default(autoScrollPluginOptions)
|
|
11252
11205
|
]);
|
|
11253
|
-
|
|
11206
|
+
React71__namespace.default.useEffect(() => {
|
|
11254
11207
|
if (emblaApi && setApi) {
|
|
11255
11208
|
setApi(emblaApi);
|
|
11256
11209
|
}
|
|
11257
11210
|
}, [emblaApi, setApi]);
|
|
11258
|
-
const renderSlides =
|
|
11211
|
+
const renderSlides = React71.useMemo(() => {
|
|
11259
11212
|
if (!Array.isArray(data) || data.length === 0) {
|
|
11260
11213
|
return null;
|
|
11261
11214
|
}
|
|
@@ -11404,7 +11357,7 @@ var dropdownMenuVariants = tailwindVariants.tv({
|
|
|
11404
11357
|
size: "lg"
|
|
11405
11358
|
}
|
|
11406
11359
|
});
|
|
11407
|
-
var DropdownMenuContent =
|
|
11360
|
+
var DropdownMenuContent = React71__namespace.forwardRef(({ className, sideOffset = 4, size, ...props }, ref) => {
|
|
11408
11361
|
const { content } = dropdownMenuVariants({ size });
|
|
11409
11362
|
return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11410
11363
|
DropdownMenuPrimitive__namespace.Content,
|
|
@@ -11417,7 +11370,7 @@ var DropdownMenuContent = React70__namespace.forwardRef(({ className, sideOffset
|
|
|
11417
11370
|
) });
|
|
11418
11371
|
});
|
|
11419
11372
|
DropdownMenuContent.displayName = DropdownMenuPrimitive__namespace.Content.displayName;
|
|
11420
|
-
var DropdownMenuItem =
|
|
11373
|
+
var DropdownMenuItem = React71__namespace.forwardRef(({ className, inset, size, ...props }, ref) => {
|
|
11421
11374
|
const { item } = dropdownMenuVariants({ size });
|
|
11422
11375
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11423
11376
|
DropdownMenuPrimitive__namespace.Item,
|
|
@@ -11429,7 +11382,7 @@ var DropdownMenuItem = React70__namespace.forwardRef(({ className, inset, size,
|
|
|
11429
11382
|
);
|
|
11430
11383
|
});
|
|
11431
11384
|
DropdownMenuItem.displayName = DropdownMenuPrimitive__namespace.Item.displayName;
|
|
11432
|
-
var DropdownMenuLabel =
|
|
11385
|
+
var DropdownMenuLabel = React71__namespace.forwardRef(({ className, inset, ...props }, ref) => {
|
|
11433
11386
|
const { label } = dropdownMenuVariants({
|
|
11434
11387
|
inset
|
|
11435
11388
|
});
|
|
@@ -11443,7 +11396,7 @@ var DropdownMenuLabel = React70__namespace.forwardRef(({ className, inset, ...pr
|
|
|
11443
11396
|
);
|
|
11444
11397
|
});
|
|
11445
11398
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive__namespace.Label.displayName;
|
|
11446
|
-
var DropdownMenuSeparator =
|
|
11399
|
+
var DropdownMenuSeparator = React71__namespace.forwardRef(({ className, ...props }, ref) => {
|
|
11447
11400
|
const { separator } = dropdownMenuVariants();
|
|
11448
11401
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11449
11402
|
DropdownMenuPrimitive__namespace.Separator,
|
|
@@ -11465,7 +11418,7 @@ var DropdownMenuShortcut = ({
|
|
|
11465
11418
|
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
11466
11419
|
var SimpleDropdownMenu = (props) => {
|
|
11467
11420
|
const { currentValue, menu, render, size, children, ...contentProps } = props;
|
|
11468
|
-
const items =
|
|
11421
|
+
const items = React71.useMemo(() => {
|
|
11469
11422
|
if (typeof props.render === "function") {
|
|
11470
11423
|
return props.menu.map((item, index) => {
|
|
11471
11424
|
return props.render?.(item, index);
|
|
@@ -11503,19 +11456,23 @@ var SimpleDropdownMenu = (props) => {
|
|
|
11503
11456
|
) })
|
|
11504
11457
|
] });
|
|
11505
11458
|
};
|
|
11459
|
+
|
|
11460
|
+
// src/provider/componentProvider.tsx
|
|
11461
|
+
var COMPONENTS_PLUGIN_ID = "orderly-components-provider-overrides";
|
|
11506
11462
|
var ComponentsProvider = (props) => {
|
|
11507
|
-
|
|
11463
|
+
React71.useEffect(() => {
|
|
11508
11464
|
if (props.components && Object.keys(props.components).length) {
|
|
11509
|
-
|
|
11510
|
-
|
|
11511
|
-
|
|
11512
|
-
|
|
11513
|
-
|
|
11514
|
-
|
|
11515
|
-
|
|
11516
|
-
|
|
11517
|
-
|
|
11518
|
-
|
|
11465
|
+
const interceptors = Object.entries(props.components).map(
|
|
11466
|
+
([position, Element]) => ({
|
|
11467
|
+
target: pluginCore.positionToPath(position),
|
|
11468
|
+
component: (_Original, slotProps) => React71.createElement(Element, slotProps)
|
|
11469
|
+
})
|
|
11470
|
+
);
|
|
11471
|
+
pluginCore.OrderlyPluginRegistry.register({
|
|
11472
|
+
id: COMPONENTS_PLUGIN_ID,
|
|
11473
|
+
name: "ComponentsProvider",
|
|
11474
|
+
interceptors
|
|
11475
|
+
});
|
|
11519
11476
|
}
|
|
11520
11477
|
}, [props.components]);
|
|
11521
11478
|
return props.children;
|
|
@@ -11530,13 +11487,13 @@ var OrderlyThemeProvider = (props) => {
|
|
|
11530
11487
|
setCurrentThemeId,
|
|
11531
11488
|
children
|
|
11532
11489
|
} = props;
|
|
11533
|
-
const resolveComponentTheme =
|
|
11490
|
+
const resolveComponentTheme = React71.useCallback(
|
|
11534
11491
|
(component, defaultValue) => {
|
|
11535
11492
|
return overrides?.[component] || defaultValue;
|
|
11536
11493
|
},
|
|
11537
11494
|
[overrides]
|
|
11538
11495
|
);
|
|
11539
|
-
const memoizedValue =
|
|
11496
|
+
const memoizedValue = React71.useMemo(() => {
|
|
11540
11497
|
return {
|
|
11541
11498
|
getComponentTheme: resolveComponentTheme,
|
|
11542
11499
|
themes: themes ?? [],
|
|
@@ -11553,9 +11510,9 @@ var OrderlyThemeProvider = (props) => {
|
|
|
11553
11510
|
]);
|
|
11554
11511
|
return /* @__PURE__ */ jsxRuntime.jsx(OrderlyThemeContext.Provider, { value: memoizedValue, children: /* @__PURE__ */ jsxRuntime.jsx(ComponentsProvider, { components, children }) });
|
|
11555
11512
|
};
|
|
11556
|
-
var Either =
|
|
11513
|
+
var Either = React71.memo((props) => {
|
|
11557
11514
|
const { value, children, left } = props;
|
|
11558
|
-
const inputValue =
|
|
11515
|
+
const inputValue = React71.useMemo(
|
|
11559
11516
|
() => Boolean(typeof value === "function" ? value() : value),
|
|
11560
11517
|
[value]
|
|
11561
11518
|
);
|
|
@@ -11877,6 +11834,82 @@ Object.defineProperty(exports, "cn", {
|
|
|
11877
11834
|
enumerable: true,
|
|
11878
11835
|
get: function () { return tailwindVariants.cnBase; }
|
|
11879
11836
|
});
|
|
11837
|
+
Object.defineProperty(exports, "ExtensionPositionEnum", {
|
|
11838
|
+
enumerable: true,
|
|
11839
|
+
get: function () { return pluginCore.ExtensionPositionEnum; }
|
|
11840
|
+
});
|
|
11841
|
+
Object.defineProperty(exports, "ExtensionProvider", {
|
|
11842
|
+
enumerable: true,
|
|
11843
|
+
get: function () { return pluginCore.ExtensionProvider; }
|
|
11844
|
+
});
|
|
11845
|
+
Object.defineProperty(exports, "ExtensionSlot", {
|
|
11846
|
+
enumerable: true,
|
|
11847
|
+
get: function () { return pluginCore.ExtensionSlot; }
|
|
11848
|
+
});
|
|
11849
|
+
Object.defineProperty(exports, "OrderlyExtensionRegistry", {
|
|
11850
|
+
enumerable: true,
|
|
11851
|
+
get: function () { return pluginCore.OrderlyExtensionRegistry; }
|
|
11852
|
+
});
|
|
11853
|
+
Object.defineProperty(exports, "OrderlyPluginProvider", {
|
|
11854
|
+
enumerable: true,
|
|
11855
|
+
get: function () { return pluginCore.OrderlyPluginProvider; }
|
|
11856
|
+
});
|
|
11857
|
+
Object.defineProperty(exports, "OrderlyPluginRegistry", {
|
|
11858
|
+
enumerable: true,
|
|
11859
|
+
get: function () { return pluginCore.OrderlyPluginRegistry; }
|
|
11860
|
+
});
|
|
11861
|
+
Object.defineProperty(exports, "PluginErrorBoundary", {
|
|
11862
|
+
enumerable: true,
|
|
11863
|
+
get: function () { return pluginCore.PluginErrorBoundary; }
|
|
11864
|
+
});
|
|
11865
|
+
Object.defineProperty(exports, "PluginScopeContext", {
|
|
11866
|
+
enumerable: true,
|
|
11867
|
+
get: function () { return pluginCore.PluginScopeContext; }
|
|
11868
|
+
});
|
|
11869
|
+
Object.defineProperty(exports, "PluginScopeProvider", {
|
|
11870
|
+
enumerable: true,
|
|
11871
|
+
get: function () { return pluginCore.PluginScopeProvider; }
|
|
11872
|
+
});
|
|
11873
|
+
Object.defineProperty(exports, "createInterceptor", {
|
|
11874
|
+
enumerable: true,
|
|
11875
|
+
get: function () { return pluginCore.createInterceptor; }
|
|
11876
|
+
});
|
|
11877
|
+
Object.defineProperty(exports, "createOrderlySDK", {
|
|
11878
|
+
enumerable: true,
|
|
11879
|
+
get: function () { return pluginCore.createOrderlySDK; }
|
|
11880
|
+
});
|
|
11881
|
+
Object.defineProperty(exports, "injectable", {
|
|
11882
|
+
enumerable: true,
|
|
11883
|
+
get: function () { return pluginCore.injectable; }
|
|
11884
|
+
});
|
|
11885
|
+
Object.defineProperty(exports, "installExtension", {
|
|
11886
|
+
enumerable: true,
|
|
11887
|
+
get: function () { return pluginCore.installExtension; }
|
|
11888
|
+
});
|
|
11889
|
+
Object.defineProperty(exports, "positionToPath", {
|
|
11890
|
+
enumerable: true,
|
|
11891
|
+
get: function () { return pluginCore.positionToPath; }
|
|
11892
|
+
});
|
|
11893
|
+
Object.defineProperty(exports, "setExtensionBuilder", {
|
|
11894
|
+
enumerable: true,
|
|
11895
|
+
get: function () { return pluginCore.setExtensionBuilder; }
|
|
11896
|
+
});
|
|
11897
|
+
Object.defineProperty(exports, "useExtensionContext", {
|
|
11898
|
+
enumerable: true,
|
|
11899
|
+
get: function () { return pluginCore.useExtensionContext; }
|
|
11900
|
+
});
|
|
11901
|
+
Object.defineProperty(exports, "useInjectedComponent", {
|
|
11902
|
+
enumerable: true,
|
|
11903
|
+
get: function () { return pluginCore.useInjectedComponent; }
|
|
11904
|
+
});
|
|
11905
|
+
Object.defineProperty(exports, "useOrderlyPluginContext", {
|
|
11906
|
+
enumerable: true,
|
|
11907
|
+
get: function () { return pluginCore.useOrderlyPluginContext; }
|
|
11908
|
+
});
|
|
11909
|
+
Object.defineProperty(exports, "usePluginScope", {
|
|
11910
|
+
enumerable: true,
|
|
11911
|
+
get: function () { return pluginCore.usePluginScope; }
|
|
11912
|
+
});
|
|
11880
11913
|
Object.defineProperty(exports, "toast", {
|
|
11881
11914
|
enumerable: true,
|
|
11882
11915
|
get: function () { return reactHotToast__default.default; }
|
|
@@ -11992,8 +12025,6 @@ exports.EmptyDataState = EmptyDataState;
|
|
|
11992
12025
|
exports.EmptyStateIcon = EmptyStateIcon;
|
|
11993
12026
|
exports.EsOrderlyIcon = EsOrderlyIcon;
|
|
11994
12027
|
exports.ExclamationFillIcon = ExclamationFillIcon;
|
|
11995
|
-
exports.ExtensionPositionEnum = ExtensionPositionEnum;
|
|
11996
|
-
exports.ExtensionSlot = ExtensionSlot;
|
|
11997
12028
|
exports.EyeCloseIcon = EyeCloseIcon;
|
|
11998
12029
|
exports.EyeIcon = EyeIcon;
|
|
11999
12030
|
exports.FeeTierIcon = FeeTierIcon;
|
|
@@ -12005,7 +12036,9 @@ exports.HoverCardContent = HoverCardContent;
|
|
|
12005
12036
|
exports.HoverCardRoot = HoverCardRoot;
|
|
12006
12037
|
exports.HoverCardTrigger = HoverCardTrigger;
|
|
12007
12038
|
exports.Icon = Icon;
|
|
12039
|
+
exports.IconButton = IconButton;
|
|
12008
12040
|
exports.InfoCircleIcon = InfoCircleIcon;
|
|
12041
|
+
exports.InjectableEmptyDataState = InjectableEmptyDataState;
|
|
12009
12042
|
exports.Input = Input2;
|
|
12010
12043
|
exports.InputAdditional = InputAdditional;
|
|
12011
12044
|
exports.LIGHT_THEME_CSS_VARS = LIGHT_THEME_CSS_VARS;
|
|
@@ -12123,14 +12156,13 @@ exports.convertValueToPercentage = convertValueToPercentage;
|
|
|
12123
12156
|
exports.dotStatusVariants = dotStatusVariants;
|
|
12124
12157
|
exports.formatAddress = formatAddress;
|
|
12125
12158
|
exports.gradientTextVariants = gradientTextVariants;
|
|
12159
|
+
exports.iconButtonVariants = iconButtonVariants;
|
|
12126
12160
|
exports.inputFormatter = formatter_exports;
|
|
12127
|
-
exports.installExtension = installExtension;
|
|
12128
12161
|
exports.modal = modal;
|
|
12129
12162
|
exports.parseNumber = parseNumber;
|
|
12130
12163
|
exports.registerSimpleDialog = registerSimpleDialog;
|
|
12131
12164
|
exports.registerSimpleSheet = registerSimpleSheet;
|
|
12132
12165
|
exports.scrollAreaVariants = scrollAreaVariants;
|
|
12133
|
-
exports.setExtensionBuilder = setExtensionBuilder;
|
|
12134
12166
|
exports.startViewTransition = startViewTransition;
|
|
12135
12167
|
exports.statisticVariants = statisticVariants;
|
|
12136
12168
|
exports.textVariants = textVariants;
|