@aivenio/aquarium 6.2.0 → 6.3.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/_variables.scss +1 -0
- package/dist/atoms.cjs +192 -128
- package/dist/atoms.mjs +104 -40
- package/dist/charts.cjs +1 -0
- package/dist/charts.mjs +1 -0
- package/dist/src/atoms/DataList/DataList.js +1 -1
- package/dist/src/atoms/Modal/Modal.d.ts +73 -3
- package/dist/src/atoms/Modal/Modal.js +48 -41
- package/dist/src/atoms/Timeline/Timeline.d.ts +3 -2
- package/dist/src/atoms/Timeline/Timeline.js +2 -2
- package/dist/src/molecules/Modal/Modal.js +2 -2
- package/dist/src/molecules/Timeline/Timeline.d.ts +3 -2
- package/dist/src/molecules/Timeline/Timeline.js +16 -4
- package/dist/src/tokens/tokens.json +1 -0
- package/dist/src/utils/useScrollFade.d.ts +17 -0
- package/dist/src/utils/useScrollFade.js +44 -0
- package/dist/styles.css +19 -6
- package/dist/system.cjs +778 -707
- package/dist/system.mjs +202 -131
- package/dist/tokens.json +1 -0
- package/dist/tsconfig.module.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/system.mjs
CHANGED
|
@@ -1815,6 +1815,7 @@ var tokens_default = {
|
|
|
1815
1815
|
code: {
|
|
1816
1816
|
background: "rgba(250,250,250,1)",
|
|
1817
1817
|
text: "rgba(45,46,48,1)",
|
|
1818
|
+
variable: "rgba(123,45,139,1)",
|
|
1818
1819
|
keyword: "rgba(202, 33, 101, 1)",
|
|
1819
1820
|
string: "rgba(0, 127, 115, 1)",
|
|
1820
1821
|
function: "rgba(9, 128, 193, 1)",
|
|
@@ -5690,7 +5691,7 @@ Combobox.Skeleton = ComboboxSkeleton;
|
|
|
5690
5691
|
Combobox.Skeleton.displayName = "Combobox.Skeleton";
|
|
5691
5692
|
|
|
5692
5693
|
// src/molecules/CommandPalette/CommandPalette.tsx
|
|
5693
|
-
import React64, { useEffect as
|
|
5694
|
+
import React64, { useEffect as useEffect8 } from "react";
|
|
5694
5695
|
import {
|
|
5695
5696
|
Collection as AriaCollection2,
|
|
5696
5697
|
composeRenderProps as composeRenderProps3,
|
|
@@ -5811,12 +5812,12 @@ DropdownMenu.EmptyStateContainer = EmptyStateContainer2;
|
|
|
5811
5812
|
// src/molecules/CommandPalette/CommandPaletteProvider.tsx
|
|
5812
5813
|
import React63, {
|
|
5813
5814
|
createContext as createContext3,
|
|
5814
|
-
useCallback,
|
|
5815
|
+
useCallback as useCallback2,
|
|
5815
5816
|
useContext as useContext6,
|
|
5816
|
-
useEffect as
|
|
5817
|
+
useEffect as useEffect7,
|
|
5817
5818
|
useMemo as useMemo3,
|
|
5818
5819
|
useReducer as useReducer2,
|
|
5819
|
-
useRef as
|
|
5820
|
+
useRef as useRef8
|
|
5820
5821
|
} from "react";
|
|
5821
5822
|
import {
|
|
5822
5823
|
Autocomplete as AriaAutocomplete,
|
|
@@ -5834,38 +5835,46 @@ import { isCtrlKeyPressed } from "@react-aria/utils";
|
|
|
5834
5835
|
// src/atoms/Modal/Modal.tsx
|
|
5835
5836
|
import React59 from "react";
|
|
5836
5837
|
import { tv as tv17 } from "tailwind-variants";
|
|
5837
|
-
|
|
5838
|
-
|
|
5839
|
-
|
|
5840
|
-
|
|
5841
|
-
|
|
5842
|
-
|
|
5843
|
-
|
|
5844
|
-
|
|
5845
|
-
|
|
5846
|
-
|
|
5847
|
-
|
|
5848
|
-
|
|
5849
|
-
|
|
5850
|
-
"before:to-transparent",
|
|
5851
|
-
"before:z-10"
|
|
5852
|
-
],
|
|
5853
|
-
after: [
|
|
5854
|
-
'after:content-[""]',
|
|
5855
|
-
"after:pointer-events-none",
|
|
5856
|
-
"after:sticky",
|
|
5857
|
-
"after:bottom-3",
|
|
5858
|
-
"after:left-0",
|
|
5859
|
-
"after:h-5",
|
|
5860
|
-
"after:flex-shrink-0",
|
|
5861
|
-
"after:bg-gradient-to-t",
|
|
5862
|
-
"after:from-overlay",
|
|
5863
|
-
"after:to-transparent",
|
|
5864
|
-
"after:z-10"
|
|
5865
|
-
]
|
|
5838
|
+
|
|
5839
|
+
// src/utils/useScrollFade.ts
|
|
5840
|
+
import { useCallback, useEffect as useEffect6, useRef as useRef7, useState as useState6 } from "react";
|
|
5841
|
+
var useScrollFade = () => {
|
|
5842
|
+
const topSentinelRef = useRef7(null);
|
|
5843
|
+
const bottomSentinelRef = useRef7(null);
|
|
5844
|
+
const observerRef = useRef7(null);
|
|
5845
|
+
const [showTopFade, setShowTopFade] = useState6(false);
|
|
5846
|
+
const [showBottomFade, setShowBottomFade] = useState6(false);
|
|
5847
|
+
const containerRef = useCallback((container2) => {
|
|
5848
|
+
observerRef.current?.disconnect();
|
|
5849
|
+
if (!container2) {
|
|
5850
|
+
return;
|
|
5866
5851
|
}
|
|
5867
|
-
|
|
5868
|
-
|
|
5852
|
+
observerRef.current = new IntersectionObserver(
|
|
5853
|
+
(entries) => {
|
|
5854
|
+
entries.forEach((entry) => {
|
|
5855
|
+
if (entry.target === topSentinelRef.current) {
|
|
5856
|
+
setShowTopFade(!entry.isIntersecting);
|
|
5857
|
+
} else if (entry.target === bottomSentinelRef.current) {
|
|
5858
|
+
setShowBottomFade(!entry.isIntersecting);
|
|
5859
|
+
}
|
|
5860
|
+
});
|
|
5861
|
+
},
|
|
5862
|
+
{ root: container2, threshold: 0 }
|
|
5863
|
+
);
|
|
5864
|
+
if (topSentinelRef.current) {
|
|
5865
|
+
observerRef.current.observe(topSentinelRef.current);
|
|
5866
|
+
}
|
|
5867
|
+
if (bottomSentinelRef.current) {
|
|
5868
|
+
observerRef.current.observe(bottomSentinelRef.current);
|
|
5869
|
+
}
|
|
5870
|
+
}, []);
|
|
5871
|
+
useEffect6(() => {
|
|
5872
|
+
return () => observerRef.current?.disconnect();
|
|
5873
|
+
}, []);
|
|
5874
|
+
return { containerRef, topSentinelRef, bottomSentinelRef, showTopFade, showBottomFade };
|
|
5875
|
+
};
|
|
5876
|
+
|
|
5877
|
+
// src/atoms/Modal/Modal.tsx
|
|
5869
5878
|
var modalStyles = tv17({
|
|
5870
5879
|
slots: {
|
|
5871
5880
|
overlay: "inset-0 overflow-y-auto z-modal fixed",
|
|
@@ -5877,11 +5886,7 @@ var modalStyles = tv17({
|
|
|
5877
5886
|
title: "",
|
|
5878
5887
|
subtitle: "max-w-[700px]",
|
|
5879
5888
|
closeButtonContainer: "absolute top-[24px] right-[28px]",
|
|
5880
|
-
body:
|
|
5881
|
-
"grow overflow-y-auto text-default flex flex-col outline-none",
|
|
5882
|
-
bodyMaskClasses({ position: "before" }),
|
|
5883
|
-
bodyMaskClasses({ position: "after" })
|
|
5884
|
-
],
|
|
5889
|
+
body: "grow overflow-y-auto text-default flex flex-col outline-none",
|
|
5885
5890
|
bodyContent: "px-7 grow",
|
|
5886
5891
|
footer: "px-7 pt-4 pb-6",
|
|
5887
5892
|
actions: "flex gap-3 justify-end"
|
|
@@ -5925,10 +5930,48 @@ var modalStyles = tv17({
|
|
|
5925
5930
|
false: {
|
|
5926
5931
|
headerImage: "bg-medium"
|
|
5927
5932
|
}
|
|
5933
|
+
},
|
|
5934
|
+
showTopFade: {
|
|
5935
|
+
true: {
|
|
5936
|
+
body: [
|
|
5937
|
+
'before:content-[""]',
|
|
5938
|
+
"before:pointer-events-none",
|
|
5939
|
+
"before:sticky",
|
|
5940
|
+
"before:top-0",
|
|
5941
|
+
"before:left-0",
|
|
5942
|
+
"before:h-5",
|
|
5943
|
+
"before:-mb-5",
|
|
5944
|
+
"before:flex-shrink-0",
|
|
5945
|
+
"before:bg-gradient-to-b",
|
|
5946
|
+
"before:from-overlay",
|
|
5947
|
+
"before:to-transparent",
|
|
5948
|
+
"before:z-10"
|
|
5949
|
+
]
|
|
5950
|
+
}
|
|
5951
|
+
},
|
|
5952
|
+
showBottomFade: {
|
|
5953
|
+
true: {
|
|
5954
|
+
body: [
|
|
5955
|
+
'after:content-[""]',
|
|
5956
|
+
"after:pointer-events-none",
|
|
5957
|
+
"after:sticky",
|
|
5958
|
+
"after:bottom-0",
|
|
5959
|
+
"after:left-0",
|
|
5960
|
+
"after:h-[60px]",
|
|
5961
|
+
"after:-mt-[60px]",
|
|
5962
|
+
"after:flex-shrink-0",
|
|
5963
|
+
"after:bg-gradient-to-t",
|
|
5964
|
+
"after:from-overlay",
|
|
5965
|
+
"after:to-transparent",
|
|
5966
|
+
"after:z-10"
|
|
5967
|
+
]
|
|
5968
|
+
}
|
|
5928
5969
|
}
|
|
5929
5970
|
},
|
|
5930
5971
|
defaultVariants: {
|
|
5931
|
-
isResponsive: true
|
|
5972
|
+
isResponsive: true,
|
|
5973
|
+
showTopFade: false,
|
|
5974
|
+
showBottomFade: false
|
|
5932
5975
|
},
|
|
5933
5976
|
compoundVariants: [
|
|
5934
5977
|
{
|
|
@@ -6038,10 +6081,31 @@ Modal.TitleContainer = ({ children, className, ...rest }) => {
|
|
|
6038
6081
|
const { titleContainer: titleContainer2 } = modalStyles();
|
|
6039
6082
|
return /* @__PURE__ */ React59.createElement("div", { ...rest, className: titleContainer2({ className }) }, children);
|
|
6040
6083
|
};
|
|
6041
|
-
|
|
6084
|
+
var ModalBody = ({
|
|
6085
|
+
children,
|
|
6086
|
+
className,
|
|
6087
|
+
noFooter = false,
|
|
6088
|
+
maxHeight,
|
|
6089
|
+
style,
|
|
6090
|
+
size,
|
|
6091
|
+
...rest
|
|
6092
|
+
}) => {
|
|
6042
6093
|
const { body, bodyContent } = modalStyles({ size });
|
|
6043
|
-
|
|
6094
|
+
const { containerRef, topSentinelRef, bottomSentinelRef, showTopFade, showBottomFade } = useScrollFade();
|
|
6095
|
+
return /* @__PURE__ */ React59.createElement(
|
|
6096
|
+
"div",
|
|
6097
|
+
{
|
|
6098
|
+
...rest,
|
|
6099
|
+
ref: containerRef,
|
|
6100
|
+
className: body({ className, showTopFade, showBottomFade }),
|
|
6101
|
+
style: { maxHeight, ...style }
|
|
6102
|
+
},
|
|
6103
|
+
/* @__PURE__ */ React59.createElement("div", { ref: topSentinelRef, "aria-hidden": "true", className: "h-1px" }),
|
|
6104
|
+
/* @__PURE__ */ React59.createElement("div", { className: bodyContent({ noFooter }) }, children),
|
|
6105
|
+
/* @__PURE__ */ React59.createElement("div", { ref: bottomSentinelRef, "aria-hidden": "true", className: "h-1px -mt-1px" })
|
|
6106
|
+
);
|
|
6044
6107
|
};
|
|
6108
|
+
Modal.Body = ModalBody;
|
|
6045
6109
|
Modal.Footer = ({ children, className, ...rest }) => {
|
|
6046
6110
|
const { footer } = modalStyles();
|
|
6047
6111
|
return /* @__PURE__ */ React59.createElement("div", { ...rest, className: footer({ className }) }, children);
|
|
@@ -6240,9 +6304,9 @@ var useCommandPaletteRootContext = () => {
|
|
|
6240
6304
|
};
|
|
6241
6305
|
var useCommandPalette = () => {
|
|
6242
6306
|
const [state, dispatch] = useCommandPaletteRootContext();
|
|
6243
|
-
const open =
|
|
6244
|
-
const close =
|
|
6245
|
-
const toggle =
|
|
6307
|
+
const open = useCallback2(() => dispatch({ type: 3 /* Open */ }), [dispatch]);
|
|
6308
|
+
const close = useCallback2(() => dispatch({ type: 4 /* Close */ }), [dispatch]);
|
|
6309
|
+
const toggle = useCallback2(
|
|
6246
6310
|
() => dispatch(state.isOpen ? { type: 4 /* Close */ } : { type: 3 /* Open */ }),
|
|
6247
6311
|
[dispatch, state.isOpen]
|
|
6248
6312
|
);
|
|
@@ -6262,7 +6326,7 @@ var CommandPaletteProvider = ({
|
|
|
6262
6326
|
onInputChange
|
|
6263
6327
|
}) => {
|
|
6264
6328
|
const [state, dispatch] = useReducer2(reducer2, { registrations: [], isOpen: false, levelStack: [ROOT_LEVEL] });
|
|
6265
|
-
const guardedDispatch =
|
|
6329
|
+
const guardedDispatch = useCallback2(
|
|
6266
6330
|
(action) => {
|
|
6267
6331
|
if (isDisabled && action.type === 3 /* Open */) {
|
|
6268
6332
|
return;
|
|
@@ -6271,12 +6335,12 @@ var CommandPaletteProvider = ({
|
|
|
6271
6335
|
},
|
|
6272
6336
|
[isDisabled]
|
|
6273
6337
|
);
|
|
6274
|
-
|
|
6338
|
+
useEffect7(() => {
|
|
6275
6339
|
if (isDisabled && state.isOpen) {
|
|
6276
6340
|
dispatch({ type: 4 /* Close */ });
|
|
6277
6341
|
}
|
|
6278
6342
|
}, [isDisabled, state.isOpen]);
|
|
6279
|
-
|
|
6343
|
+
useEffect7(() => {
|
|
6280
6344
|
if (shortcut === null || isDisabled) {
|
|
6281
6345
|
return;
|
|
6282
6346
|
}
|
|
@@ -6289,8 +6353,8 @@ var CommandPaletteProvider = ({
|
|
|
6289
6353
|
document.addEventListener("keydown", handleKeyDown);
|
|
6290
6354
|
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
6291
6355
|
}, [shortcut, state.isOpen, isDisabled]);
|
|
6292
|
-
const isInitialMount =
|
|
6293
|
-
|
|
6356
|
+
const isInitialMount = useRef8(true);
|
|
6357
|
+
useEffect7(() => {
|
|
6294
6358
|
if (isInitialMount.current) {
|
|
6295
6359
|
isInitialMount.current = false;
|
|
6296
6360
|
return;
|
|
@@ -6417,13 +6481,13 @@ var CommandPaletteOverlay = ({
|
|
|
6417
6481
|
var Commands = ({ children }) => {
|
|
6418
6482
|
const id = useId6();
|
|
6419
6483
|
const [, dispatch] = useCommandPaletteRootContext();
|
|
6420
|
-
|
|
6484
|
+
useEffect8(() => {
|
|
6421
6485
|
dispatch({ type: 0 /* Register */, registration: { id, children } });
|
|
6422
6486
|
return () => {
|
|
6423
6487
|
dispatch({ type: 1 /* Unregister */, id });
|
|
6424
6488
|
};
|
|
6425
6489
|
}, []);
|
|
6426
|
-
|
|
6490
|
+
useEffect8(() => {
|
|
6427
6491
|
dispatch({ type: 2 /* Update */, registration: { id, children } });
|
|
6428
6492
|
}, [dispatch, id, children]);
|
|
6429
6493
|
return null;
|
|
@@ -6505,7 +6569,7 @@ var Container2 = ({ maxWidth = "xl", children }) => /* @__PURE__ */ React65.crea
|
|
|
6505
6569
|
);
|
|
6506
6570
|
|
|
6507
6571
|
// src/molecules/DataList/DataList.tsx
|
|
6508
|
-
import React83, { useRef as
|
|
6572
|
+
import React83, { useRef as useRef11 } from "react";
|
|
6509
6573
|
import { useControlledState as useControlledState3 } from "@react-stately/utils";
|
|
6510
6574
|
import { clsx as clsx26 } from "clsx";
|
|
6511
6575
|
import { castArray as castArray3, compact, groupBy as groupBy2, isArray as isArray2, isFunction as isFunction3, noop as noop2 } from "lodash-es";
|
|
@@ -6521,7 +6585,7 @@ import { clsx as clsx22 } from "clsx";
|
|
|
6521
6585
|
import { clamp } from "lodash-es";
|
|
6522
6586
|
|
|
6523
6587
|
// src/molecules/Input/Input.tsx
|
|
6524
|
-
import React66, { forwardRef, useCallback as
|
|
6588
|
+
import React66, { forwardRef, useCallback as useCallback3, useImperativeHandle, useState as useState7 } from "react";
|
|
6525
6589
|
import { useId as useId7 } from "@react-aria/utils";
|
|
6526
6590
|
import { clsx as clsx21 } from "clsx";
|
|
6527
6591
|
import { omit as omit5, toString } from "lodash-es";
|
|
@@ -6597,9 +6661,9 @@ var createInputComponent = (displayName, options = {}) => {
|
|
|
6597
6661
|
const InputComponent = React66.forwardRef((inputProps, ref) => {
|
|
6598
6662
|
const { readOnly = false, value: valueProp, onChange: onChangeProp, ...props } = inputProps;
|
|
6599
6663
|
const isControlled = typeof valueProp !== "undefined";
|
|
6600
|
-
const [valueState, setValueState] =
|
|
6664
|
+
const [valueState, setValueState] = useState7(props.defaultValue ?? "");
|
|
6601
6665
|
const value = isControlled ? valueProp : valueState;
|
|
6602
|
-
const handleChange =
|
|
6666
|
+
const handleChange = useCallback3(
|
|
6603
6667
|
(e) => {
|
|
6604
6668
|
const next = e.target.value;
|
|
6605
6669
|
if (!isControlled) {
|
|
@@ -6655,7 +6719,7 @@ Input2.Skeleton = () => /* @__PURE__ */ React66.createElement(LabelControl.Skele
|
|
|
6655
6719
|
Input2.Skeleton.displayName = "Input.Skeleton";
|
|
6656
6720
|
|
|
6657
6721
|
// src/molecules/Select/Select.tsx
|
|
6658
|
-
import React67, { useEffect as
|
|
6722
|
+
import React67, { useEffect as useEffect9, useRef as useRef9, useState as useState8 } from "react";
|
|
6659
6723
|
import { ariaHideOutside as ariaHideOutside2 } from "@react-aria/overlays";
|
|
6660
6724
|
import { useId as useId8 } from "@react-aria/utils";
|
|
6661
6725
|
import { useSelect } from "downshift";
|
|
@@ -6707,11 +6771,11 @@ var _SelectBase = (props) => {
|
|
|
6707
6771
|
children,
|
|
6708
6772
|
...rest
|
|
6709
6773
|
} = withDefaults;
|
|
6710
|
-
const [hasFocus, setFocus] =
|
|
6711
|
-
const inputRef =
|
|
6712
|
-
const popoverRef =
|
|
6713
|
-
const targetRef =
|
|
6714
|
-
const menuRef =
|
|
6774
|
+
const [hasFocus, setFocus] = useState8(false);
|
|
6775
|
+
const inputRef = useRef9(null);
|
|
6776
|
+
const popoverRef = useRef9(null);
|
|
6777
|
+
const targetRef = useRef9(null);
|
|
6778
|
+
const menuRef = useRef9(null);
|
|
6715
6779
|
const items = hasOptionGroups(options) ? options.flatMap((g) => g.options) : options;
|
|
6716
6780
|
const findItemByValue = (val) => {
|
|
6717
6781
|
if (val === null) {
|
|
@@ -6742,7 +6806,7 @@ var _SelectBase = (props) => {
|
|
|
6742
6806
|
*/
|
|
6743
6807
|
scrollIntoView: (node, _menuNode) => node.scrollIntoView({ block: "nearest" })
|
|
6744
6808
|
});
|
|
6745
|
-
|
|
6809
|
+
useEffect9(() => {
|
|
6746
6810
|
if (isOpen && inputRef.current && popoverRef.current) {
|
|
6747
6811
|
return ariaHideOutside2([inputRef.current, popoverRef.current]);
|
|
6748
6812
|
}
|
|
@@ -6953,7 +7017,7 @@ var Pagination = ({
|
|
|
6953
7017
|
};
|
|
6954
7018
|
|
|
6955
7019
|
// src/molecules/Pagination/usePagination.tsx
|
|
6956
|
-
import { useEffect as
|
|
7020
|
+
import { useEffect as useEffect10, useState as useState9 } from "react";
|
|
6957
7021
|
import { clamp as clamp2 } from "lodash-es";
|
|
6958
7022
|
var initialState = {
|
|
6959
7023
|
currentPage: 1,
|
|
@@ -6961,8 +7025,8 @@ var initialState = {
|
|
|
6961
7025
|
};
|
|
6962
7026
|
var getPageIndex = (currentPage, pageSize) => currentPage === 0 ? 0 : (currentPage - 1) * pageSize;
|
|
6963
7027
|
var usePagination = (items, options) => {
|
|
6964
|
-
const [currentPage, setCurrentPage] =
|
|
6965
|
-
const [pageSize, setPageSize] =
|
|
7028
|
+
const [currentPage, setCurrentPage] = useState9(options?.initialPage ?? initialState.currentPage);
|
|
7029
|
+
const [pageSize, setPageSize] = useState9(options?.initialPageSize ?? initialState.pageSize);
|
|
6966
7030
|
const totalPages = items.length > 0 ? Math.ceil(items.length / pageSize) : 1;
|
|
6967
7031
|
const hasPreviousPage = currentPage > 1;
|
|
6968
7032
|
const hasNextPage = currentPage < totalPages;
|
|
@@ -6972,7 +7036,7 @@ var usePagination = (items, options) => {
|
|
|
6972
7036
|
setPageSize(pageSize2);
|
|
6973
7037
|
setCurrentPage(clamp2(options?.initialPage ?? initialState.currentPage, 1, newTotalPages));
|
|
6974
7038
|
};
|
|
6975
|
-
|
|
7039
|
+
useEffect10(() => {
|
|
6976
7040
|
setCurrentPage(clamp2(options?.initialPage ?? initialState.currentPage, 1, totalPages));
|
|
6977
7041
|
}, [items.length]);
|
|
6978
7042
|
return [
|
|
@@ -7349,7 +7413,7 @@ var toolbarContainerClasses = tv19({
|
|
|
7349
7413
|
base: "col-span-full flex items-stretch py-4 px-l2 border-b border-muted",
|
|
7350
7414
|
variants: {
|
|
7351
7415
|
sticky: {
|
|
7352
|
-
true: "sticky top-[
|
|
7416
|
+
true: "sticky top-[43px] bg-layer z-10",
|
|
7353
7417
|
false: ""
|
|
7354
7418
|
}
|
|
7355
7419
|
}
|
|
@@ -7460,7 +7524,7 @@ DataList.Toolbar = {
|
|
|
7460
7524
|
};
|
|
7461
7525
|
|
|
7462
7526
|
// src/utils/stickyStyles.tsx
|
|
7463
|
-
import React73, { useCallback as
|
|
7527
|
+
import React73, { useCallback as useCallback4, useLayoutEffect as useLayoutEffect2, useMemo as useMemo4, useRef as useRef10, useState as useState10 } from "react";
|
|
7464
7528
|
import { animated as animated4, useSpring as useSpring3 } from "@react-spring/web";
|
|
7465
7529
|
import { throttle } from "lodash-es";
|
|
7466
7530
|
function useStickyStyles(scrollProgress, axis, { borderColor, boxShadowColor }) {
|
|
@@ -7511,8 +7575,8 @@ function useScrollProgress({
|
|
|
7511
7575
|
skip,
|
|
7512
7576
|
throttleMs = 50
|
|
7513
7577
|
}) {
|
|
7514
|
-
const [scrollState, setScrollState] =
|
|
7515
|
-
const currentStateRef =
|
|
7578
|
+
const [scrollState, setScrollState] = useState10(null);
|
|
7579
|
+
const currentStateRef = useRef10(null);
|
|
7516
7580
|
const throttledSetScrollState = useMemo4(
|
|
7517
7581
|
() => throttle((value) => {
|
|
7518
7582
|
const currentState = currentStateRef.current;
|
|
@@ -7524,7 +7588,7 @@ function useScrollProgress({
|
|
|
7524
7588
|
}, throttleMs),
|
|
7525
7589
|
[throttleMs]
|
|
7526
7590
|
);
|
|
7527
|
-
const handleScroll =
|
|
7591
|
+
const handleScroll = useCallback4(() => {
|
|
7528
7592
|
const element = containerRef.current;
|
|
7529
7593
|
if (!element) {
|
|
7530
7594
|
return;
|
|
@@ -8324,7 +8388,7 @@ var DataList2 = ({
|
|
|
8324
8388
|
["aria-label"]: ariaLabel,
|
|
8325
8389
|
...rest
|
|
8326
8390
|
}) => {
|
|
8327
|
-
const containerRef =
|
|
8391
|
+
const containerRef = useRef11(null);
|
|
8328
8392
|
const hasStickyColumns = columns.some((column) => column.sticky);
|
|
8329
8393
|
const stickyStyles = useScrollStyles({ containerRef, skip: !hasStickyColumns });
|
|
8330
8394
|
const [selected, setSelected] = useControlledState3(
|
|
@@ -8537,7 +8601,7 @@ DataList2.Skeleton = DataListSkeleton;
|
|
|
8537
8601
|
DataList2.Toolbar = DataListToolbar;
|
|
8538
8602
|
|
|
8539
8603
|
// src/molecules/DataTable/DataTable.tsx
|
|
8540
|
-
import React86, { useRef as
|
|
8604
|
+
import React86, { useRef as useRef12 } from "react";
|
|
8541
8605
|
import { clsx as clsx27 } from "clsx";
|
|
8542
8606
|
import { compact as compact2, isFunction as isFunction4 } from "lodash-es";
|
|
8543
8607
|
|
|
@@ -8596,7 +8660,7 @@ var DataTable = ({
|
|
|
8596
8660
|
onPrev,
|
|
8597
8661
|
...rest
|
|
8598
8662
|
}) => {
|
|
8599
|
-
const containerRef =
|
|
8663
|
+
const containerRef = useRef12(null);
|
|
8600
8664
|
const hasStickyColumns = columns.some((column) => column.sticky);
|
|
8601
8665
|
const stickyStyles = useScrollStyles({ containerRef, skip: !hasStickyColumns });
|
|
8602
8666
|
const defaultSortedColumn = columns.find((c) => c.headerName === defaultSort?.headerName);
|
|
@@ -11741,7 +11805,7 @@ var ModalTitle = ({ children, ...props }) => {
|
|
|
11741
11805
|
};
|
|
11742
11806
|
|
|
11743
11807
|
// src/molecules/Tabs/Tabs.tsx
|
|
11744
|
-
import React98, { useEffect as
|
|
11808
|
+
import React98, { useEffect as useEffect11, useLayoutEffect as useLayoutEffect3, useRef as useRef13, useState as useState11 } from "react";
|
|
11745
11809
|
import { clsx as clsx28 } from "clsx";
|
|
11746
11810
|
import { isNumber as isNumber6, kebabCase } from "lodash-es";
|
|
11747
11811
|
var isTabComponent = (c) => {
|
|
@@ -11849,12 +11913,12 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
|
11849
11913
|
const childArr = React98.Children.toArray(children);
|
|
11850
11914
|
const firstTab = childArr[0];
|
|
11851
11915
|
const firstTabValue = isTabComponent(firstTab) ? firstTab.props.value : -1;
|
|
11852
|
-
const [selected, setSelected] =
|
|
11853
|
-
const [leftCaret, showLeftCaret] =
|
|
11854
|
-
const [rightCaret, showRightCaret] =
|
|
11855
|
-
const parentRef =
|
|
11856
|
-
const containerRef =
|
|
11857
|
-
const tabsRef =
|
|
11916
|
+
const [selected, setSelected] = useState11(value ?? defaultValue ?? firstTabValue ?? 0);
|
|
11917
|
+
const [leftCaret, showLeftCaret] = useState11(false);
|
|
11918
|
+
const [rightCaret, showRightCaret] = useState11(false);
|
|
11919
|
+
const parentRef = useRef13(null);
|
|
11920
|
+
const containerRef = useRef13(null);
|
|
11921
|
+
const tabsRef = useRef13(null);
|
|
11858
11922
|
const revealSelectedTab = ({ smooth }) => {
|
|
11859
11923
|
const container2 = containerRef.current;
|
|
11860
11924
|
const tabs = tabsRef.current;
|
|
@@ -11889,7 +11953,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
|
11889
11953
|
showLeftCaret(hasLeftCaret);
|
|
11890
11954
|
showRightCaret(hasRightCaret);
|
|
11891
11955
|
};
|
|
11892
|
-
|
|
11956
|
+
useEffect11(() => {
|
|
11893
11957
|
if (value === void 0) {
|
|
11894
11958
|
return;
|
|
11895
11959
|
}
|
|
@@ -12544,13 +12608,13 @@ var ModalTabs = createTabsComponent(
|
|
|
12544
12608
|
ModalTab,
|
|
12545
12609
|
TabItem,
|
|
12546
12610
|
"ModalTabs",
|
|
12547
|
-
(children, selected, props) => /* @__PURE__ */ React107.createElement(Modal.Body, { maxHeight: props.maxHeight }, /* @__PURE__ */ React107.createElement(TabContainer,
|
|
12611
|
+
(children, selected, props) => /* @__PURE__ */ React107.createElement(Modal.Body, { maxHeight: props.maxHeight }, /* @__PURE__ */ React107.createElement(TabContainer, null, children.find(
|
|
12548
12612
|
(node, index) => node?.props.value === selected || index === selected
|
|
12549
12613
|
)))
|
|
12550
12614
|
);
|
|
12551
12615
|
|
|
12552
12616
|
// src/molecules/MultiInput/MultiInput.tsx
|
|
12553
|
-
import React109, { useEffect as
|
|
12617
|
+
import React109, { useEffect as useEffect12, useRef as useRef14, useState as useState12 } from "react";
|
|
12554
12618
|
import { useId as useId13 } from "@react-aria/utils";
|
|
12555
12619
|
import { castArray as castArray6, identity, omit as omit13 } from "lodash-es";
|
|
12556
12620
|
|
|
@@ -12631,11 +12695,11 @@ var MultiInputBase = ({
|
|
|
12631
12695
|
valid = true,
|
|
12632
12696
|
...props
|
|
12633
12697
|
}) => {
|
|
12634
|
-
const inputRef =
|
|
12635
|
-
const [items, setItems] =
|
|
12636
|
-
const [hasFocus, setFocus] =
|
|
12698
|
+
const inputRef = useRef14(null);
|
|
12699
|
+
const [items, setItems] = useState12(value ?? defaultValue ?? []);
|
|
12700
|
+
const [hasFocus, setFocus] = useState12(false);
|
|
12637
12701
|
const keyCodes = [delimiter !== "enter" ? " " : null, delimiter !== "space" ? "Enter" : null].filter(identity);
|
|
12638
|
-
|
|
12702
|
+
useEffect12(() => {
|
|
12639
12703
|
const requiresUpdate = value !== void 0 || defaultValue === void 0;
|
|
12640
12704
|
if (requiresUpdate && JSON.stringify(value) !== JSON.stringify(items)) {
|
|
12641
12705
|
setItems(value ?? []);
|
|
@@ -12757,8 +12821,8 @@ var MultiInputBase = ({
|
|
|
12757
12821
|
var BaseMultiInputSkeleton = () => /* @__PURE__ */ React109.createElement(Skeleton, { height: 38 });
|
|
12758
12822
|
MultiInputBase.Skeleton = BaseMultiInputSkeleton;
|
|
12759
12823
|
var MultiInput = (props) => {
|
|
12760
|
-
const [value, setValue] =
|
|
12761
|
-
|
|
12824
|
+
const [value, setValue] = useState12(props.value ?? props.defaultValue ?? []);
|
|
12825
|
+
useEffect12(() => {
|
|
12762
12826
|
setValue(props.value ?? []);
|
|
12763
12827
|
}, [JSON.stringify(props.value)]);
|
|
12764
12828
|
const defaultId = useId13();
|
|
@@ -12800,7 +12864,7 @@ MultiInput.Skeleton = MultiInputSkeleton;
|
|
|
12800
12864
|
MultiInput.Skeleton.displayName = "MultiInput.Skeleton";
|
|
12801
12865
|
|
|
12802
12866
|
// src/molecules/MultiSelect/MultiSelect.tsx
|
|
12803
|
-
import React110, { useEffect as
|
|
12867
|
+
import React110, { useEffect as useEffect13, useRef as useRef15, useState as useState13 } from "react";
|
|
12804
12868
|
import { ariaHideOutside as ariaHideOutside3 } from "@react-aria/overlays";
|
|
12805
12869
|
import { useId as useId14 } from "@react-aria/utils";
|
|
12806
12870
|
import { useCombobox as useCombobox2, useMultipleSelection } from "downshift";
|
|
@@ -12830,12 +12894,12 @@ var MultiSelectBase = ({
|
|
|
12830
12894
|
children,
|
|
12831
12895
|
...props
|
|
12832
12896
|
}) => {
|
|
12833
|
-
const popoverRef =
|
|
12834
|
-
const targetRef =
|
|
12835
|
-
const menuRef =
|
|
12836
|
-
const inputRef =
|
|
12837
|
-
const [inputValue, setInputValue] =
|
|
12838
|
-
const [hasFocus, setFocus] =
|
|
12897
|
+
const popoverRef = useRef15(null);
|
|
12898
|
+
const targetRef = useRef15(null);
|
|
12899
|
+
const menuRef = useRef15(null);
|
|
12900
|
+
const inputRef = useRef15(null);
|
|
12901
|
+
const [inputValue, setInputValue] = useState13("");
|
|
12902
|
+
const [hasFocus, setFocus] = useState13(false);
|
|
12839
12903
|
const { selectedItems, addSelectedItem, removeSelectedItem, getDropdownProps, getSelectedItemProps } = useMultipleSelection(
|
|
12840
12904
|
/*
|
|
12841
12905
|
* For some reason useMultipleSelection does not accept
|
|
@@ -12913,7 +12977,7 @@ var MultiSelectBase = ({
|
|
|
12913
12977
|
*/
|
|
12914
12978
|
scrollIntoView: (node, _menuNode) => node.scrollIntoView({ block: "nearest" })
|
|
12915
12979
|
});
|
|
12916
|
-
|
|
12980
|
+
useEffect13(() => {
|
|
12917
12981
|
if (isOpen && inputRef.current && popoverRef.current) {
|
|
12918
12982
|
return ariaHideOutside3([inputRef.current, popoverRef.current]);
|
|
12919
12983
|
}
|
|
@@ -13548,7 +13612,7 @@ RadioButtonGroup.Skeleton = RadioButtonGroupSkeleton;
|
|
|
13548
13612
|
RadioButtonGroup.Skeleton.displayName = "RadioButtonGroup.Skeleton";
|
|
13549
13613
|
|
|
13550
13614
|
// src/molecules/Section/Section.tsx
|
|
13551
|
-
import React126, { useRef as
|
|
13615
|
+
import React126, { useRef as useRef16 } from "react";
|
|
13552
13616
|
import { useButton as useButton4 } from "@react-aria/button";
|
|
13553
13617
|
import { useId as useId17 } from "@react-aria/utils";
|
|
13554
13618
|
import { animated as animated6, useSpring as useSpring5 } from "@react-spring/web";
|
|
@@ -13711,8 +13775,8 @@ var Section4 = (props) => {
|
|
|
13711
13775
|
const [isCollapsed, setCollapsed] = React126.useState(_collapsed ?? _defaultCollapsed);
|
|
13712
13776
|
const [isResting, setResting] = React126.useState(true);
|
|
13713
13777
|
const [ref, { height }] = useMeasure();
|
|
13714
|
-
const toggleAreaRef =
|
|
13715
|
-
const isMounted =
|
|
13778
|
+
const toggleAreaRef = useRef16(null);
|
|
13779
|
+
const isMounted = useRef16(true);
|
|
13716
13780
|
React126.useEffect(
|
|
13717
13781
|
() => () => {
|
|
13718
13782
|
isMounted.current = false;
|
|
@@ -14012,7 +14076,7 @@ Step2.displayName = "Stepper.Step";
|
|
|
14012
14076
|
Stepper2.Step = Step2;
|
|
14013
14077
|
|
|
14014
14078
|
// src/molecules/SwitchGroup/SwitchGroup.tsx
|
|
14015
|
-
import React130, { useState as
|
|
14079
|
+
import React130, { useState as useState14 } from "react";
|
|
14016
14080
|
import { useId as useId18 } from "@react-aria/utils";
|
|
14017
14081
|
var SwitchGroup = ({
|
|
14018
14082
|
value,
|
|
@@ -14023,7 +14087,7 @@ var SwitchGroup = ({
|
|
|
14023
14087
|
children,
|
|
14024
14088
|
...props
|
|
14025
14089
|
}) => {
|
|
14026
|
-
const [selectedItems, setSelectedItems] =
|
|
14090
|
+
const [selectedItems, setSelectedItems] = useState14(value ?? defaultValue ?? []);
|
|
14027
14091
|
if (value !== void 0 && value !== selectedItems) {
|
|
14028
14092
|
setSelectedItems(value);
|
|
14029
14093
|
}
|
|
@@ -14059,7 +14123,7 @@ SwitchGroup.Skeleton = SwitchGroupSkeleton;
|
|
|
14059
14123
|
SwitchGroup.Skeleton.displayName = "SwitchGroup.Skeleton";
|
|
14060
14124
|
|
|
14061
14125
|
// src/molecules/Textarea/Textarea.tsx
|
|
14062
|
-
import React131, { useState as
|
|
14126
|
+
import React131, { useState as useState15 } from "react";
|
|
14063
14127
|
import { useId as useId19 } from "@react-aria/utils";
|
|
14064
14128
|
import { clsx as clsx39 } from "clsx";
|
|
14065
14129
|
import { omit as omit17, toString as toString2 } from "lodash-es";
|
|
@@ -14076,7 +14140,7 @@ var TextareaBase = React131.forwardRef(
|
|
|
14076
14140
|
);
|
|
14077
14141
|
TextareaBase.Skeleton = () => /* @__PURE__ */ React131.createElement(Skeleton, { height: 58 });
|
|
14078
14142
|
var Textarea = React131.forwardRef((props, ref) => {
|
|
14079
|
-
const [value, setValue] =
|
|
14143
|
+
const [value, setValue] = useState15(props.value ?? props.defaultValue ?? "");
|
|
14080
14144
|
const defaultId = useId19();
|
|
14081
14145
|
const id = props.id ?? defaultId;
|
|
14082
14146
|
const errorMessageId = useId19();
|
|
@@ -14119,12 +14183,12 @@ Textarea.Skeleton = TextAreaSkeleton;
|
|
|
14119
14183
|
Textarea.Skeleton.displayName = "Textarea.Skeleton";
|
|
14120
14184
|
|
|
14121
14185
|
// src/molecules/Timeline/Timeline.tsx
|
|
14122
|
-
import
|
|
14186
|
+
import React134 from "react";
|
|
14123
14187
|
|
|
14124
14188
|
// src/atoms/Timeline/Timeline.tsx
|
|
14125
14189
|
import React132 from "react";
|
|
14126
14190
|
import { clsx as clsx40 } from "clsx";
|
|
14127
|
-
var Timeline = ({ className, ...rest }) => /* @__PURE__ */ React132.createElement("
|
|
14191
|
+
var Timeline = ({ className, ...rest }) => /* @__PURE__ */ React132.createElement("li", { ...rest, className: clsx40("grid grid-cols-[16px_1fr] gap-x-4", className) });
|
|
14128
14192
|
var Content2 = ({ className, ...rest }) => /* @__PURE__ */ React132.createElement("div", { ...rest, className: clsx40("pb-6", className) });
|
|
14129
14193
|
var Separator = ({ className, ...rest }) => /* @__PURE__ */ React132.createElement("div", { ...rest, className: clsx40("flex items-center justify-center h-5 w-5", className) });
|
|
14130
14194
|
var LineContainer = ({ className, ...rest }) => /* @__PURE__ */ React132.createElement("div", { ...rest, className: clsx40("flex justify-center py-1", className) });
|
|
@@ -14136,25 +14200,32 @@ Timeline.Separator = Separator;
|
|
|
14136
14200
|
Timeline.LineContainer = LineContainer;
|
|
14137
14201
|
Timeline.Content = Content2;
|
|
14138
14202
|
|
|
14203
|
+
// src/atoms/VisuallyHidden/VisuallyHidden.tsx
|
|
14204
|
+
import React133 from "react";
|
|
14205
|
+
import { VisuallyHidden as AriaVisuallyHidden } from "@react-aria/visually-hidden";
|
|
14206
|
+
var VisuallyHidden = (props) => {
|
|
14207
|
+
return /* @__PURE__ */ React133.createElement(AriaVisuallyHidden, { ...props });
|
|
14208
|
+
};
|
|
14209
|
+
|
|
14139
14210
|
// src/molecules/Timeline/Timeline.tsx
|
|
14140
14211
|
var TimelineItem = () => null;
|
|
14141
|
-
var Timeline2 = ({ children }) => /* @__PURE__ */
|
|
14212
|
+
var Timeline2 = ({ children, "aria-label": ariaLabel }) => /* @__PURE__ */ React134.createElement("ol", { className: "Aquarium-Timeline", "aria-label": ariaLabel }, React134.Children.map(children, (item) => {
|
|
14142
14213
|
if (!isComponentType(item, TimelineItem)) {
|
|
14143
14214
|
throw new Error("<Timeline> can only have <Timeline.Item> components as children");
|
|
14144
14215
|
} else {
|
|
14145
14216
|
const { props, key } = item;
|
|
14146
|
-
return /* @__PURE__ */
|
|
14217
|
+
return /* @__PURE__ */ React134.createElement(Timeline, { key: key ?? props.title }, /* @__PURE__ */ React134.createElement(Timeline.Separator, null, props.variant === "error" ? /* @__PURE__ */ React134.createElement(React134.Fragment, null, /* @__PURE__ */ React134.createElement(VisuallyHidden, null, "Error: "), /* @__PURE__ */ React134.createElement(Icon, { icon: error_default, color: "danger-default" })) : props.variant === "warning" ? /* @__PURE__ */ React134.createElement(React134.Fragment, null, /* @__PURE__ */ React134.createElement(VisuallyHidden, null, "Warning: "), /* @__PURE__ */ React134.createElement(Icon, { icon: warningSign_default, color: "warning-default" })) : props.variant === "info" ? /* @__PURE__ */ React134.createElement(React134.Fragment, null, /* @__PURE__ */ React134.createElement(VisuallyHidden, null, "Info: "), /* @__PURE__ */ React134.createElement(Icon, { icon: time_default, color: "info-default" })) : props.variant === "success" ? /* @__PURE__ */ React134.createElement(React134.Fragment, null, /* @__PURE__ */ React134.createElement(VisuallyHidden, null, "Success: "), /* @__PURE__ */ React134.createElement(Icon, { icon: tickCircle_default, color: "success-default" })) : props.variant === "loading" ? /* @__PURE__ */ React134.createElement(React134.Fragment, null, /* @__PURE__ */ React134.createElement(VisuallyHidden, null, "Loading: "), /* @__PURE__ */ React134.createElement(Icon, { icon: loading_default, color: "default" })) : /* @__PURE__ */ React134.createElement(Timeline.Separator.Dot, null)), /* @__PURE__ */ React134.createElement(Typography2.Small, { color: "muted" }, props.title), /* @__PURE__ */ React134.createElement(Timeline.LineContainer, null, /* @__PURE__ */ React134.createElement(Timeline.LineContainer.Line, null)), /* @__PURE__ */ React134.createElement(Timeline.Content, null, /* @__PURE__ */ React134.createElement(Typography2.Default, null, props.children)));
|
|
14147
14218
|
}
|
|
14148
14219
|
}));
|
|
14149
|
-
var TimelineItemSkeleton = () => /* @__PURE__ */
|
|
14150
|
-
var TimelineSkeleton = ({ items = 3 }) => /* @__PURE__ */
|
|
14220
|
+
var TimelineItemSkeleton = () => /* @__PURE__ */ React134.createElement(Timeline, null, /* @__PURE__ */ React134.createElement(Timeline.Separator, null, /* @__PURE__ */ React134.createElement(Skeleton, { width: 6, height: 6, rounded: true })), /* @__PURE__ */ React134.createElement(Skeleton, { height: 12, width: 120 }), /* @__PURE__ */ React134.createElement(Timeline.LineContainer, null, /* @__PURE__ */ React134.createElement(Skeleton, { width: 2, height: "100%" })), /* @__PURE__ */ React134.createElement(Timeline.Content, null, /* @__PURE__ */ React134.createElement(Box, { display: "flex", flexDirection: "column", gap: "3" }, /* @__PURE__ */ React134.createElement(Skeleton, { height: 32, width: "100%" }), /* @__PURE__ */ React134.createElement(Skeleton, { height: 32, width: "73%" }), /* @__PURE__ */ React134.createElement(Skeleton, { height: 32, width: "80%" }))));
|
|
14221
|
+
var TimelineSkeleton = ({ items = 3 }) => /* @__PURE__ */ React134.createElement("ol", { className: "Aquarium-Timeline", "aria-busy": "true", "aria-label": "Loading timeline" }, /* @__PURE__ */ React134.createElement("div", { "aria-hidden": true }, Array.from({ length: items }).map((_, key) => /* @__PURE__ */ React134.createElement(TimelineItemSkeleton, { key }))));
|
|
14151
14222
|
Timeline2.Item = TimelineItem;
|
|
14152
14223
|
Timeline2.Skeleton = TimelineSkeleton;
|
|
14153
14224
|
Timeline2.Skeleton.displayName = "Timeline.Skeleton";
|
|
14154
14225
|
|
|
14155
14226
|
// src/molecules/TimePicker/TimePicker.tsx
|
|
14156
|
-
import
|
|
14157
|
-
var TimePicker = (props) => /* @__PURE__ */
|
|
14227
|
+
import React135 from "react";
|
|
14228
|
+
var TimePicker = (props) => /* @__PURE__ */ React135.createElement(TimeField2, { ...props });
|
|
14158
14229
|
|
|
14159
14230
|
// src/utils/table/sortByColumn.ts
|
|
14160
14231
|
var sortByColumn = (items, column, sortState) => {
|
|
@@ -14176,13 +14247,13 @@ var sortByColumn = (items, column, sortState) => {
|
|
|
14176
14247
|
};
|
|
14177
14248
|
|
|
14178
14249
|
// src/utils/table/useSortState.ts
|
|
14179
|
-
import
|
|
14180
|
-
var useSortState = (initialSortState) =>
|
|
14250
|
+
import React136 from "react";
|
|
14251
|
+
var useSortState = (initialSortState) => React136.useState(initialSortState);
|
|
14181
14252
|
|
|
14182
14253
|
// src/utils/table/useTableSelect.ts
|
|
14183
|
-
import
|
|
14254
|
+
import React137 from "react";
|
|
14184
14255
|
var useTableSelect = (data31, { key }) => {
|
|
14185
|
-
const [selected, setSelected] =
|
|
14256
|
+
const [selected, setSelected] = React137.useState([]);
|
|
14186
14257
|
const allSelected = selected.length === data31.length;
|
|
14187
14258
|
const isSelected = (dot) => selected.includes(dot[key]);
|
|
14188
14259
|
const selectAll = () => setSelected(data31.map((dot) => dot[key]));
|
|
@@ -14207,7 +14278,7 @@ var useTableSelect = (data31, { key }) => {
|
|
|
14207
14278
|
};
|
|
14208
14279
|
|
|
14209
14280
|
// src/molecules/ItemList/ItemList.tsx
|
|
14210
|
-
import
|
|
14281
|
+
import React138 from "react";
|
|
14211
14282
|
var ItemList = ({
|
|
14212
14283
|
columns,
|
|
14213
14284
|
items,
|
|
@@ -14219,9 +14290,9 @@ var ItemList = ({
|
|
|
14219
14290
|
const templateColumns = columns.map((column) => column.width ?? "auto");
|
|
14220
14291
|
const [sortState, setSortState] = useSortState(defaultSort);
|
|
14221
14292
|
const sortedItems = onSortChanged ? items : sortByColumn(items, columns, sortState);
|
|
14222
|
-
return /* @__PURE__ */
|
|
14293
|
+
return /* @__PURE__ */ React138.createElement(Template, { className: "Aquarium-ItemList", columns: templateColumns, role: "table" }, /* @__PURE__ */ React138.createElement(DataList.Row, { header: true }, columns.map((column) => {
|
|
14223
14294
|
if (columnHasSort(column)) {
|
|
14224
|
-
return /* @__PURE__ */
|
|
14295
|
+
return /* @__PURE__ */ React138.createElement(
|
|
14225
14296
|
DataList.SortCell,
|
|
14226
14297
|
{
|
|
14227
14298
|
sticky,
|
|
@@ -14249,11 +14320,11 @@ var ItemList = ({
|
|
|
14249
14320
|
column.headerName
|
|
14250
14321
|
);
|
|
14251
14322
|
}
|
|
14252
|
-
return /* @__PURE__ */
|
|
14253
|
-
})), /* @__PURE__ */
|
|
14323
|
+
return /* @__PURE__ */ React138.createElement(DataList.HeadCell, { key: column.key ?? column.headerName, ...cellProps(column), sticky }, column.headerName);
|
|
14324
|
+
})), /* @__PURE__ */ React138.createElement(Rows, { columns, items: sortedItems, level: 0, ...infiniteProps }));
|
|
14254
14325
|
};
|
|
14255
14326
|
var Rows = ({ columns, items, level, isLastGroup, ...infiniteProps }) => {
|
|
14256
|
-
return /* @__PURE__ */
|
|
14327
|
+
return /* @__PURE__ */ React138.createElement(
|
|
14257
14328
|
List,
|
|
14258
14329
|
{
|
|
14259
14330
|
...level === 0 ? infiniteProps : {},
|
|
@@ -14262,22 +14333,22 @@ var Rows = ({ columns, items, level, isLastGroup, ...infiniteProps }) => {
|
|
|
14262
14333
|
const hasSubItems = item.items && item.items.length > 0;
|
|
14263
14334
|
const isLastItem = itemIndex === items.length - 1;
|
|
14264
14335
|
const noDivider = level === 0 && isLastItem || level > 0 && (isLastGroup || !isLastItem) || hasSubItems;
|
|
14265
|
-
return /* @__PURE__ */
|
|
14336
|
+
return /* @__PURE__ */ React138.createElement(React138.Fragment, { key: item.id }, /* @__PURE__ */ React138.createElement(DataList.Row, { noDivider }, /* @__PURE__ */ React138.createElement(
|
|
14266
14337
|
List,
|
|
14267
14338
|
{
|
|
14268
14339
|
items: columns,
|
|
14269
|
-
renderItem: (column, columnIndex) => /* @__PURE__ */
|
|
14340
|
+
renderItem: (column, columnIndex) => /* @__PURE__ */ React138.createElement(
|
|
14270
14341
|
DataList.Cell,
|
|
14271
14342
|
{
|
|
14272
14343
|
key: column.key ?? column.headerName,
|
|
14273
14344
|
...cellProps(column),
|
|
14274
14345
|
style: level > 1 && columnIndex === 0 ? { paddingLeft: (level - 1) * 60 } : void 0
|
|
14275
14346
|
},
|
|
14276
|
-
level > 0 && columnIndex === 0 && /* @__PURE__ */
|
|
14277
|
-
/* @__PURE__ */
|
|
14347
|
+
level > 0 && columnIndex === 0 && /* @__PURE__ */ React138.createElement(DataList.TreeLine, { isLast: itemIndex === items.length - 1 }),
|
|
14348
|
+
/* @__PURE__ */ React138.createElement(DataListCell, { column, row: item, index: columnIndex, rows: items })
|
|
14278
14349
|
)
|
|
14279
14350
|
}
|
|
14280
|
-
)), item.items && /* @__PURE__ */
|
|
14351
|
+
)), item.items && /* @__PURE__ */ React138.createElement(WithGroup, { level }, /* @__PURE__ */ React138.createElement(
|
|
14281
14352
|
Rows,
|
|
14282
14353
|
{
|
|
14283
14354
|
columns,
|
|
@@ -14290,7 +14361,7 @@ var Rows = ({ columns, items, level, isLastGroup, ...infiniteProps }) => {
|
|
|
14290
14361
|
}
|
|
14291
14362
|
);
|
|
14292
14363
|
};
|
|
14293
|
-
var WithGroup = ({ level, children }) => level === 0 ? /* @__PURE__ */
|
|
14364
|
+
var WithGroup = ({ level, children }) => level === 0 ? /* @__PURE__ */ React138.createElement(DataList.Row, { isGroup: true }, children) : /* @__PURE__ */ React138.createElement(React138.Fragment, null, children);
|
|
14294
14365
|
|
|
14295
14366
|
// src/molecules/index.ts
|
|
14296
14367
|
var SelectItem = Select.Item;
|