@bioturing/components 0.15.5 → 0.16.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/components/Badge/component.js +16 -11
- package/dist/components/Badge/component.js.map +1 -1
- package/dist/components/Breadcrumb/component.js +4 -3
- package/dist/components/Breadcrumb/component.js.map +1 -1
- package/dist/components/Button/component.js +30 -3
- package/dist/components/Button/component.js.map +1 -1
- package/dist/components/Button/style.css +1 -1
- package/dist/components/CodeBlock/component.js +7 -6
- package/dist/components/CodeBlock/component.js.map +1 -1
- package/dist/components/CodeBlock/style.css +1 -1
- package/dist/components/Collapse/component.js +11 -10
- package/dist/components/Collapse/component.js.map +1 -1
- package/dist/components/DSRoot/component.js +8 -7
- package/dist/components/DSRoot/component.js.map +1 -1
- package/dist/components/DSRoot/context.js +5 -4
- package/dist/components/DSRoot/context.js.map +1 -1
- package/dist/components/DropdownMenu/component.js +1 -0
- package/dist/components/DropdownMenu/component.js.map +1 -1
- package/dist/components/Field/component.js +13 -12
- package/dist/components/Field/component.js.map +1 -1
- package/dist/components/Form/component.js +4 -3
- package/dist/components/Form/component.js.map +1 -1
- package/dist/components/Form/item.js +1 -0
- package/dist/components/Form/item.js.map +1 -1
- package/dist/components/IconButton/component.js +1 -0
- package/dist/components/IconButton/component.js.map +1 -1
- package/dist/components/Modal/Modal.js +1 -0
- package/dist/components/Modal/Modal.js.map +1 -1
- package/dist/components/Modal/ModalProvider.js +1 -0
- package/dist/components/Modal/ModalProvider.js.map +1 -1
- package/dist/components/Modal/index.js +11 -10
- package/dist/components/Modal/index.js.map +1 -1
- package/dist/components/Popover/component.js +6 -5
- package/dist/components/Popover/component.js.map +1 -1
- package/dist/components/PopupPanel/component.js +74 -68
- package/dist/components/PopupPanel/component.js.map +1 -1
- package/dist/components/ScrollArea/component.js +10 -9
- package/dist/components/ScrollArea/component.js.map +1 -1
- package/dist/components/Slider/component.js +9 -8
- package/dist/components/Slider/component.js.map +1 -1
- package/dist/components/Splitter/component.js +12 -11
- package/dist/components/Splitter/component.js.map +1 -1
- package/dist/components/Stack/Stack.js.map +1 -1
- package/dist/components/Stack/StackChild.js +26 -23
- package/dist/components/Stack/StackChild.js.map +1 -1
- package/dist/components/Stack/style.css +1 -1
- package/dist/components/Table/component.js +54 -50
- package/dist/components/Table/component.js.map +1 -1
- package/dist/components/Table/style.css +1 -1
- package/dist/components/Tag/component.js +6 -5
- package/dist/components/Tag/component.js.map +1 -1
- package/dist/components/ThemeProvider/component.js +15 -14
- package/dist/components/ThemeProvider/component.js.map +1 -1
- package/dist/components/Toast/component.js +17 -16
- package/dist/components/Toast/component.js.map +1 -1
- package/dist/components/Toast/function.js +5 -4
- package/dist/components/Toast/function.js.map +1 -1
- package/dist/components/Tooltip/component.js +13 -12
- package/dist/components/Tooltip/component.js.map +1 -1
- package/dist/components/Tour/component.js +5 -4
- package/dist/components/Tour/component.js.map +1 -1
- package/dist/components/Transition/component.js +45 -32
- package/dist/components/Transition/component.js.map +1 -1
- package/dist/components/Tree/components.js +9 -8
- package/dist/components/Tree/components.js.map +1 -1
- package/dist/components/Tree/helpers.js +1 -0
- package/dist/components/Tree/helpers.js.map +1 -1
- package/dist/components/Tree/useTreeCommon.js +12 -11
- package/dist/components/Tree/useTreeCommon.js.map +1 -1
- package/dist/components/Truncate/component.js +1 -0
- package/dist/components/Truncate/component.js.map +1 -1
- package/dist/components/Upload/component.js +13 -11
- package/dist/components/Upload/component.js.map +1 -1
- package/dist/components/Upload/dragger.js +3 -2
- package/dist/components/Upload/dragger.js.map +1 -1
- package/dist/components/Upload/hooks.js +3 -2
- package/dist/components/Upload/hooks.js.map +1 -1
- package/dist/components/Upload/style.css +1 -0
- package/dist/components/VerticalCollapsiblePanel/component.js +35 -32
- package/dist/components/VerticalCollapsiblePanel/component.js.map +1 -1
- package/dist/components/hooks/antd.js +4 -3
- package/dist/components/hooks/antd.js.map +1 -1
- package/dist/components/hooks/base-ui.js +34 -28
- package/dist/components/hooks/base-ui.js.map +1 -1
- package/dist/components/hooks/useControlledState.js +17 -9
- package/dist/components/hooks/useControlledState.js.map +1 -1
- package/dist/components/utils/WithAntdTokens.js +14 -13
- package/dist/components/utils/WithAntdTokens.js.map +1 -1
- package/dist/components/utils/antdUtils.js +1 -0
- package/dist/components/utils/antdUtils.js.map +1 -1
- package/dist/index.d.ts +112 -59
- package/dist/index.js +78 -70
- package/dist/index.js.map +1 -1
- package/dist/metadata.js +81 -87
- package/dist/metadata.js.map +1 -1
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../../src/components/ScrollArea/component.tsx"],"sourcesContent":["\"use client\";\nimport { type ReactNode } from \"react\";\nimport { ScrollArea as BaseScrollArea } from \"@base-ui-components/react\";\nimport { clsx, useCls } from \"../utils\";\n\n// Import component-specific styles\nimport \"./style.css\";\n\nexport interface ScrollAreaProps {\n children: ReactNode;\n /**\n * Additional class name for the root component\n */\n className?: string;\n /**\n * Custom class names for each part of the scroll area\n */\n classNames?: {\n /**\n * Class name for the viewport element\n */\n viewport?: string;\n /**\n * Class name for the scrollbar element\n */\n scrollbar?: string;\n /**\n * Class name for the thumb element\n */\n thumb?: string;\n };\n /**\n * Orientation of the scrollbar\n * @default \"vertical\"\n */\n orientation?: \"vertical\" | \"horizontal\";\n}\n\nexport const ScrollArea = ({\n children,\n className,\n classNames = {},\n orientation = \"vertical\",\n}: ScrollAreaProps) => {\n const cls = useCls();\n return (\n <BaseScrollArea.Root className={clsx(cls(\"scroll-area\"), className)}>\n <BaseScrollArea.Viewport\n className={clsx(cls(\"scroll-area-viewport\"), classNames?.viewport)}\n >\n <BaseScrollArea.Content className={clsx(cls(\"scroll-area-content\"))}>\n {children}\n </BaseScrollArea.Content>\n </BaseScrollArea.Viewport>\n <BaseScrollArea.Scrollbar\n className={clsx(cls(\"scroll-area-scrollbar\"), classNames?.scrollbar)}\n orientation={orientation}\n data-orientation={orientation}\n >\n <BaseScrollArea.Thumb\n className={clsx(cls(\"scroll-area-thumb\"), classNames?.thumb)}\n />\n </BaseScrollArea.Scrollbar>\n </BaseScrollArea.Root>\n );\n};\n"],"names":["ScrollArea","children","className","classNames","orientation","cls","useCls","jsxs","BaseScrollArea","clsx","jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../src/components/ScrollArea/component.tsx"],"sourcesContent":["\"use client\";\nimport { type ReactNode } from \"react\";\nimport { ScrollArea as BaseScrollArea } from \"@base-ui-components/react\";\nimport { clsx, useCls } from \"../utils\";\n\n// Import component-specific styles\nimport \"./style.css\";\n\nexport interface ScrollAreaProps {\n children: ReactNode;\n /**\n * Additional class name for the root component\n */\n className?: string;\n /**\n * Custom class names for each part of the scroll area\n */\n classNames?: {\n /**\n * Class name for the viewport element\n */\n viewport?: string;\n /**\n * Class name for the scrollbar element\n */\n scrollbar?: string;\n /**\n * Class name for the thumb element\n */\n thumb?: string;\n };\n /**\n * Orientation of the scrollbar\n * @default \"vertical\"\n */\n orientation?: \"vertical\" | \"horizontal\";\n}\n\nexport const ScrollArea = ({\n children,\n className,\n classNames = {},\n orientation = \"vertical\",\n}: ScrollAreaProps) => {\n const cls = useCls();\n return (\n <BaseScrollArea.Root className={clsx(cls(\"scroll-area\"), className)}>\n <BaseScrollArea.Viewport\n className={clsx(cls(\"scroll-area-viewport\"), classNames?.viewport)}\n >\n <BaseScrollArea.Content className={clsx(cls(\"scroll-area-content\"))}>\n {children}\n </BaseScrollArea.Content>\n </BaseScrollArea.Viewport>\n <BaseScrollArea.Scrollbar\n className={clsx(cls(\"scroll-area-scrollbar\"), classNames?.scrollbar)}\n orientation={orientation}\n data-orientation={orientation}\n >\n <BaseScrollArea.Thumb\n className={clsx(cls(\"scroll-area-thumb\"), classNames?.thumb)}\n />\n </BaseScrollArea.Scrollbar>\n </BaseScrollArea.Root>\n );\n};\n"],"names":["ScrollArea","children","className","classNames","orientation","cls","useCls","jsxs","BaseScrollArea","clsx","jsx"],"mappings":";;;;;;AAsCO,MAAMA,IAAa,CAAC;AAAA,EACzB,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC,IAAa,CAAC;AAAA,EACd,aAAAC,IAAc;AAChB,MAAuB;AACrB,QAAMC,IAAMC,EAAO;AAEjB,SAAA,gBAAAC,EAACC,EAAe,MAAf,EAAoB,WAAWC,EAAKJ,EAAI,aAAa,GAAGH,CAAS,GAChE,UAAA;AAAA,IAAA,gBAAAQ;AAAA,MAACF,EAAe;AAAA,MAAf;AAAA,QACC,WAAWC,EAAKJ,EAAI,sBAAsB,GAAGF,KAAA,gBAAAA,EAAY,QAAQ;AAAA,QAEjE,UAAA,gBAAAO,EAACF,EAAe,SAAf,EAAuB,WAAWC,EAAKJ,EAAI,qBAAqB,CAAC,GAC/D,UAAAJ,EACH,CAAA;AAAA,MAAA;AAAA,IACF;AAAA,IACA,gBAAAS;AAAA,MAACF,EAAe;AAAA,MAAf;AAAA,QACC,WAAWC,EAAKJ,EAAI,uBAAuB,GAAGF,KAAA,gBAAAA,EAAY,SAAS;AAAA,QACnE,aAAAC;AAAA,QACA,oBAAkBA;AAAA,QAElB,UAAA,gBAAAM;AAAA,UAACF,EAAe;AAAA,UAAf;AAAA,YACC,WAAWC,EAAKJ,EAAI,mBAAmB,GAAGF,KAAA,gBAAAA,EAAY,KAAK;AAAA,UAAA;AAAA,QAAA;AAAA,MAC7D;AAAA,IAAA;AAAA,EACF,GACF;AAEJ;"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
3
|
+
import i from "antd/es/slider";
|
|
4
|
+
import { useCls as m } from "../utils/antdUtils.js";
|
|
5
|
+
import { clsx as c } from "../utils/cn.js";
|
|
5
6
|
const d = ({ className: r, tooltip: o = {}, style: s, ...t }) => {
|
|
6
|
-
const
|
|
7
|
-
return /* @__PURE__ */
|
|
8
|
-
|
|
7
|
+
const e = m();
|
|
8
|
+
return /* @__PURE__ */ l(
|
|
9
|
+
i,
|
|
9
10
|
{
|
|
10
|
-
className:
|
|
11
|
+
className: c(e("slider"), r),
|
|
11
12
|
style: s,
|
|
12
13
|
...t,
|
|
13
14
|
tooltip: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../../src/components/Slider/component.tsx"],"sourcesContent":["\"use client\";\nimport {\n default as AntSlider,\n type SliderSingleProps,\n type SliderRangeProps,\n} from \"antd/es/slider\";\nimport { useCls, clsx } from \"../utils\";\n\n// Define props interface extending Ant Design's SliderProps\nexport type SliderProps = SliderSingleProps | SliderRangeProps;\n\nexport type { SliderSingleProps, SliderRangeProps };\n\n// Create Slider component\nconst Slider = ({ className, tooltip = {}, style, ...rest }: SliderProps) => {\n const cls = useCls();\n return (\n <AntSlider\n className={clsx(cls(\"slider\"), className)}\n style={style}\n {...rest}\n tooltip={{\n arrow: false,\n ...tooltip,\n }}\n />\n );\n};\n\nexport { Slider };\n"],"names":["Slider","className","tooltip","style","rest","cls","useCls","jsx","AntSlider","clsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../src/components/Slider/component.tsx"],"sourcesContent":["\"use client\";\nimport {\n default as AntSlider,\n type SliderSingleProps,\n type SliderRangeProps,\n} from \"antd/es/slider\";\nimport { useCls, clsx } from \"../utils\";\n\n// Define props interface extending Ant Design's SliderProps\nexport type SliderProps = SliderSingleProps | SliderRangeProps;\n\nexport type { SliderSingleProps, SliderRangeProps };\n\n// Create Slider component\nconst Slider = ({ className, tooltip = {}, style, ...rest }: SliderProps) => {\n const cls = useCls();\n return (\n <AntSlider\n className={clsx(cls(\"slider\"), className)}\n style={style}\n {...rest}\n tooltip={{\n arrow: false,\n ...tooltip,\n }}\n />\n );\n};\n\nexport { Slider };\n"],"names":["Slider","className","tooltip","style","rest","cls","useCls","jsx","AntSlider","clsx"],"mappings":";;;;;AAcM,MAAAA,IAAS,CAAC,EAAE,WAAAC,GAAW,SAAAC,IAAU,CAAA,GAAI,OAAAC,GAAO,GAAGC,QAAwB;AAC3E,QAAMC,IAAMC,EAAO;AAEjB,SAAA,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAKJ,EAAI,QAAQ,GAAGJ,CAAS;AAAA,MACxC,OAAAE;AAAA,MACC,GAAGC;AAAA,MACJ,SAAS;AAAA,QACP,OAAO;AAAA,QACP,GAAGF;AAAA,MAAA;AAAA,IACL;AAAA,EACF;AAEJ;"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import n from "antd/es/splitter/
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
3
|
+
import n from "antd/es/splitter/Splitter";
|
|
4
|
+
import p from "antd/es/splitter/Panel";
|
|
4
5
|
import './style.css';/* empty css */
|
|
5
6
|
import { useCls as m } from "../utils/antdUtils.js";
|
|
6
7
|
import { clsx as c } from "../utils/cn.js";
|
|
@@ -9,24 +10,24 @@ const a = ({
|
|
|
9
10
|
className: r,
|
|
10
11
|
style: e,
|
|
11
12
|
...i
|
|
12
|
-
}) => /* @__PURE__ */
|
|
13
|
+
}) => /* @__PURE__ */ l(p, { className: r, style: e, ...i, children: t }), S = ({
|
|
13
14
|
children: t,
|
|
14
15
|
className: r = "",
|
|
15
16
|
style: e = {},
|
|
16
17
|
showSplitBar: i = !0,
|
|
17
|
-
...
|
|
18
|
+
...o
|
|
18
19
|
}) => {
|
|
19
|
-
const
|
|
20
|
-
return /* @__PURE__ */
|
|
21
|
-
|
|
20
|
+
const s = m();
|
|
21
|
+
return /* @__PURE__ */ l(
|
|
22
|
+
n,
|
|
22
23
|
{
|
|
23
24
|
className: c(
|
|
24
|
-
|
|
25
|
-
!i &&
|
|
25
|
+
s("splitter"),
|
|
26
|
+
!i && s("splitter-hidden-split-bar"),
|
|
26
27
|
r
|
|
27
28
|
),
|
|
28
29
|
style: e,
|
|
29
|
-
...
|
|
30
|
+
...o,
|
|
30
31
|
children: t
|
|
31
32
|
}
|
|
32
33
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../../src/components/Splitter/component.tsx"],"sourcesContent":["\"use client\";\nimport React from \"react\";\nimport { default as AntdSplitter } from \"antd/es/splitter/Splitter\";\nimport { default as AntdSplitterPanel } from \"antd/es/splitter/Panel\";\nimport type {\n SplitterProps as AntdSplitterProps,\n PanelProps as AntdSplitterPanelProps,\n} from \"antd/es/splitter/interface\";\nimport { useCls, clsx } from \"../utils\";\n\n// Import component-specific styles\nimport \"./style.css\";\n\nexport type SplitterProps = React.PropsWithChildren<AntdSplitterProps> & {\n showSplitBar?: boolean;\n};\n\nexport type SplitterPanelProps =\n React.PropsWithChildren<AntdSplitterPanelProps>;\n\nconst SplitterPanel: React.FC<SplitterPanelProps> = ({\n children,\n className,\n style,\n ...rest\n}) => {\n return (\n <AntdSplitterPanel className={className} style={style} {...rest}>\n {children}\n </AntdSplitterPanel>\n );\n};\n\nconst MainSplitter: React.FC<SplitterProps> = ({\n children,\n className = \"\",\n style = {},\n showSplitBar = true,\n ...rest\n}) => {\n const cls = useCls();\n return (\n <AntdSplitter\n className={clsx(\n cls(\"splitter\"),\n !showSplitBar && cls(\"splitter-hidden-split-bar\"),\n className\n )}\n style={style}\n {...rest}\n >\n {children}\n </AntdSplitter>\n );\n};\n\nexport const Splitter = Object.assign(MainSplitter, {\n Panel: SplitterPanel,\n});\n\n// For backward compatibility\nexport const Split = Splitter;\n"],"names":["SplitterPanel","children","className","style","rest","AntdSplitterPanel","MainSplitter","showSplitBar","cls","useCls","jsx","AntdSplitter","clsx","Splitter","Split"],"mappings":"
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../src/components/Splitter/component.tsx"],"sourcesContent":["\"use client\";\nimport React from \"react\";\nimport { default as AntdSplitter } from \"antd/es/splitter/Splitter\";\nimport { default as AntdSplitterPanel } from \"antd/es/splitter/Panel\";\nimport type {\n SplitterProps as AntdSplitterProps,\n PanelProps as AntdSplitterPanelProps,\n} from \"antd/es/splitter/interface\";\nimport { useCls, clsx } from \"../utils\";\n\n// Import component-specific styles\nimport \"./style.css\";\n\nexport type SplitterProps = React.PropsWithChildren<AntdSplitterProps> & {\n showSplitBar?: boolean;\n};\n\nexport type SplitterPanelProps =\n React.PropsWithChildren<AntdSplitterPanelProps>;\n\nconst SplitterPanel: React.FC<SplitterPanelProps> = ({\n children,\n className,\n style,\n ...rest\n}) => {\n return (\n <AntdSplitterPanel className={className} style={style} {...rest}>\n {children}\n </AntdSplitterPanel>\n );\n};\n\nconst MainSplitter: React.FC<SplitterProps> = ({\n children,\n className = \"\",\n style = {},\n showSplitBar = true,\n ...rest\n}) => {\n const cls = useCls();\n return (\n <AntdSplitter\n className={clsx(\n cls(\"splitter\"),\n !showSplitBar && cls(\"splitter-hidden-split-bar\"),\n className\n )}\n style={style}\n {...rest}\n >\n {children}\n </AntdSplitter>\n );\n};\n\nexport const Splitter = Object.assign(MainSplitter, {\n Panel: SplitterPanel,\n});\n\n// For backward compatibility\nexport const Split = Splitter;\n"],"names":["SplitterPanel","children","className","style","rest","AntdSplitterPanel","MainSplitter","showSplitBar","cls","useCls","jsx","AntdSplitter","clsx","Splitter","Split"],"mappings":";;;;;;;AAoBA,MAAMA,IAA8C,CAAC;AAAA,EACnD,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,GAAGC;AACL,wBAEKC,GAAkB,EAAA,WAAAH,GAAsB,OAAAC,GAAe,GAAGC,GACxD,UAAAH,GACH,GAIEK,IAAwC,CAAC;AAAA,EAC7C,UAAAL;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,OAAAC,IAAQ,CAAC;AAAA,EACT,cAAAI,IAAe;AAAA,EACf,GAAGH;AACL,MAAM;AACJ,QAAMI,IAAMC,EAAO;AAEjB,SAAA,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAWC;AAAA,QACTJ,EAAI,UAAU;AAAA,QACd,CAACD,KAAgBC,EAAI,2BAA2B;AAAA,QAChDN;AAAA,MACF;AAAA,MACA,OAAAC;AAAA,MACC,GAAGC;AAAA,MAEH,UAAAH;AAAA,IAAA;AAAA,EACH;AAEJ,GAEaY,IAAW,OAAO,OAAOP,GAAc;AAAA,EAClD,OAAON;AACT,CAAC,GAGYc,IAAQD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stack.js","sources":["../../../src/components/Stack/Stack.tsx"],"sourcesContent":["import React from \"react\";\nimport { cn, useCls } from \"../utils\";\n\nexport type StackGap = 0 | 1 | 2 | 4 | 8 | 12 | 16 | 24;\n\nexport interface StackProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Whether the stack should hug its content (inline-flex) instead of filling available space\n * @default false\n */\n hug?: boolean;\n\n /**\n * Vertical alignment of items within the stack\n * @default \"flex-start\"\n */\n align?: \"flex-start\" | \"flex-end\" | \"center\" | \"stretch\" | \"baseline\";\n\n /**\n * Horizontal alignment of items within the stack\n * @default \"flex-start\"\n */\n justify?:\n | \"flex-start\"\n | \"flex-end\"\n | \"center\"\n | \"space-between\"\n | \"space-around\"\n | \"space-evenly\";\n\n /**\n * Whether the stack should render items vertically\n * @default false\n */\n vertical?: boolean;\n\n /**\n * Gap between stack items in pixels\n * @default 0\n */\n gap?: StackGap;\n\n /**\n * Wrap items to multiple lines if needed\n * @default false\n */\n wrap?: boolean;\n\n /**\n * Children of the stack\n */\n children?: React.ReactNode;\n}\n\nexport const Stack: React.FC<StackProps> = ({\n hug = false,\n align = \"flex-start\",\n justify = \"flex-start\",\n vertical = false,\n gap = 0,\n wrap = false,\n className,\n children,\n ...rest\n}) => {\n const cls = useCls();\n\n return (\n <div\n className={cn(\n cls(\"stack\"),\n hug ? cls(\"stack-hug\") : cls(\"stack-fill\"),\n cls(`stack-gap-${gap}`),\n vertical ? cls(\"stack-vertical\") : cls(\"stack-horizontal\"),\n wrap && cls(\"stack-wrap\"),\n cls(`stack-align-${align}`),\n cls(`stack-justify-${justify}`),\n className\n )}\n {...rest}\n >\n {children}\n </div>\n );\n};\n"],"names":["Stack","hug","align","justify","vertical","gap","wrap","className","children","rest","cls","useCls","jsx","cn"],"mappings":";;;AAsDO,MAAMA,IAA8B,CAAC;AAAA,EAC1C,KAAAC,IAAM;AAAA,EACN,OAAAC,IAAQ;AAAA,EACR,SAAAC,IAAU;AAAA,EACV,UAAAC,IAAW;AAAA,EACX,KAAAC,IAAM;AAAA,EACN,MAAAC,IAAO;AAAA,EACP,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,MAAM;AACJ,QAAMC,IAAMC,EAAO;AAGjB,SAAA,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC;AAAA,QACTH,EAAI,OAAO;AAAA,QACLA,EAANT,IAAU,cAAmB,YAAR;AAAA,QACrBS,EAAI,aAAaL,CAAG,EAAE;AAAA,QACXK,EAAXN,IAAe,mBAAwB,kBAAR;AAAA,QAC/BE,KAAQI,EAAI,YAAY;AAAA,QACxBA,EAAI,eAAeR,CAAK,EAAE;AAAA,QAC1BQ,EAAI,iBAAiBP,CAAO,EAAE;AAAA,QAC9BI;AAAA,MACF;AAAA,MACC,GAAGE;AAAA,MAEH,UAAAD;AAAA,IAAA;AAAA,EACH;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"Stack.js","sources":["../../../src/components/Stack/Stack.tsx"],"sourcesContent":["import React from \"react\";\nimport { cn, useCls } from \"../utils\";\n\nexport type StackGap = 0 | 1 | 2 | 4 | 8 | 12 | 16 | 24 | 28 | 32 | 40 | 48;\n\nexport interface StackProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Whether the stack should hug its content (inline-flex) instead of filling available space\n * @default false\n */\n hug?: boolean;\n\n /**\n * Vertical alignment of items within the stack\n * @default \"flex-start\"\n */\n align?: \"flex-start\" | \"flex-end\" | \"center\" | \"stretch\" | \"baseline\";\n\n /**\n * Horizontal alignment of items within the stack\n * @default \"flex-start\"\n */\n justify?:\n | \"flex-start\"\n | \"flex-end\"\n | \"center\"\n | \"space-between\"\n | \"space-around\"\n | \"space-evenly\";\n\n /**\n * Whether the stack should render items vertically\n * @default false\n */\n vertical?: boolean;\n\n /**\n * Gap between stack items in pixels\n * @default 0\n */\n gap?: StackGap;\n\n /**\n * Wrap items to multiple lines if needed\n * @default false\n */\n wrap?: boolean;\n\n /**\n * Children of the stack\n */\n children?: React.ReactNode;\n}\n\nexport const Stack: React.FC<StackProps> = ({\n hug = false,\n align = \"flex-start\",\n justify = \"flex-start\",\n vertical = false,\n gap = 0,\n wrap = false,\n className,\n children,\n ...rest\n}) => {\n const cls = useCls();\n\n return (\n <div\n className={cn(\n cls(\"stack\"),\n hug ? cls(\"stack-hug\") : cls(\"stack-fill\"),\n cls(`stack-gap-${gap}`),\n vertical ? cls(\"stack-vertical\") : cls(\"stack-horizontal\"),\n wrap && cls(\"stack-wrap\"),\n cls(`stack-align-${align}`),\n cls(`stack-justify-${justify}`),\n className\n )}\n {...rest}\n >\n {children}\n </div>\n );\n};\n"],"names":["Stack","hug","align","justify","vertical","gap","wrap","className","children","rest","cls","useCls","jsx","cn"],"mappings":";;;AAsDO,MAAMA,IAA8B,CAAC;AAAA,EAC1C,KAAAC,IAAM;AAAA,EACN,OAAAC,IAAQ;AAAA,EACR,SAAAC,IAAU;AAAA,EACV,UAAAC,IAAW;AAAA,EACX,KAAAC,IAAM;AAAA,EACN,MAAAC,IAAO;AAAA,EACP,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,MAAM;AACJ,QAAMC,IAAMC,EAAO;AAGjB,SAAA,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC;AAAA,QACTH,EAAI,OAAO;AAAA,QACLA,EAANT,IAAU,cAAmB,YAAR;AAAA,QACrBS,EAAI,aAAaL,CAAG,EAAE;AAAA,QACXK,EAAXN,IAAe,mBAAwB,kBAAR;AAAA,QAC/BE,KAAQI,EAAI,YAAY;AAAA,QACxBA,EAAI,eAAeR,CAAK,EAAE;AAAA,QAC1BQ,EAAI,iBAAiBP,CAAO,EAAE;AAAA,QAC9BI;AAAA,MACF;AAAA,MACC,GAAGE;AAAA,MAEH,UAAAD;AAAA,IAAA;AAAA,EACH;AAEJ;"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { useRender as
|
|
4
|
-
import { mergeProps as
|
|
5
|
-
import { Stack as
|
|
6
|
-
import { useCls as
|
|
7
|
-
import { cn as
|
|
2
|
+
import b from "react";
|
|
3
|
+
import { useRender as g } from "@base-ui-components/react/use-render";
|
|
4
|
+
import { mergeProps as N } from "@base-ui-components/react/merge-props";
|
|
5
|
+
import { Stack as V } from "./Stack.js";
|
|
6
|
+
import { useCls as v } from "../utils/antdUtils.js";
|
|
7
|
+
import { cn as E } from "../utils/cn.js";
|
|
8
8
|
const B = ({
|
|
9
9
|
flex: s,
|
|
10
10
|
grow: l = !1,
|
|
11
11
|
shrink: c = !1,
|
|
12
|
-
children:
|
|
12
|
+
children: t,
|
|
13
13
|
style: m,
|
|
14
14
|
stack: f = !1,
|
|
15
15
|
// stack props
|
|
@@ -22,7 +22,7 @@ const B = ({
|
|
|
22
22
|
className: x,
|
|
23
23
|
...h
|
|
24
24
|
}) => {
|
|
25
|
-
const
|
|
25
|
+
const e = v(), y = {
|
|
26
26
|
hug: i,
|
|
27
27
|
align: n,
|
|
28
28
|
justify: p,
|
|
@@ -31,25 +31,28 @@ const B = ({
|
|
|
31
31
|
wrap: u
|
|
32
32
|
};
|
|
33
33
|
let o = "";
|
|
34
|
-
typeof s == "boolean" && (o =
|
|
35
|
-
const r =
|
|
36
|
-
|
|
37
|
-
l &&
|
|
38
|
-
c &&
|
|
34
|
+
typeof s == "boolean" && (o = e(s ? "stack-child-flex-1" : "stack-child-flex-0"));
|
|
35
|
+
const r = E(
|
|
36
|
+
e("stack-child"),
|
|
37
|
+
l && e("stack-child-grow"),
|
|
38
|
+
c && e("stack-child-shrink"),
|
|
39
39
|
o,
|
|
40
40
|
x
|
|
41
|
-
), C =
|
|
42
|
-
render: () =>
|
|
43
|
-
props:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
), C = g({
|
|
42
|
+
render: () => b.isValidElement(t) ? t : /* @__PURE__ */ a("div", { children: t }),
|
|
43
|
+
props: N(
|
|
44
|
+
{
|
|
45
|
+
className: r,
|
|
46
|
+
style: {
|
|
47
|
+
...m,
|
|
48
|
+
flex: typeof s == "string" || typeof s == "number" ? s : void 0
|
|
49
|
+
},
|
|
50
|
+
...h
|
|
48
51
|
},
|
|
49
|
-
|
|
50
|
-
|
|
52
|
+
{}
|
|
53
|
+
)
|
|
51
54
|
});
|
|
52
|
-
return f ? /* @__PURE__ */ a(
|
|
55
|
+
return f ? /* @__PURE__ */ a(V, { ...y, className: r, children: t }) : C;
|
|
53
56
|
};
|
|
54
57
|
export {
|
|
55
58
|
B as StackChild
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StackChild.js","sources":["../../../src/components/Stack/StackChild.tsx"],"sourcesContent":["import React from \"react\";\nimport { cn, useCls } from \"../utils\";\nimport { useRender } from \"@base-ui-components/react/use-render\";\nimport { mergeProps } from \"@base-ui-components/react/merge-props\";\nimport { Stack, StackProps } from \"./Stack\";\n\nexport interface StackChildProps extends StackProps {\n /**\n * CSS flex property value (e.g. \"1\", \"1 0 auto\", \"0 1 auto\")\n * When boolean: true = 1, false = 0\n * @default undefined\n */\n flex?: string | number | boolean;\n\n /**\n * Whether this child should grow to fill available space\n * @default false\n */\n grow?: boolean;\n\n /**\n * Whether this child should shrink if necessary\n * @default false\n */\n shrink?: boolean;\n\n /**\n * Children of the stack child\n */\n children?: React.ReactNode;\n /**\n * Whether to render the child with a stack wrapper\n * @default false\n */\n stack?: boolean;\n}\n\nexport const StackChild: React.FC<StackChildProps> = ({\n flex,\n grow = false,\n shrink = false,\n children,\n style,\n stack = false,\n // stack props\n hug = false,\n align = \"flex-start\",\n justify = \"flex-start\",\n vertical = false,\n gap = 0,\n wrap = false,\n\n className,\n ...rest\n}) => {\n const cls = useCls();\n const stackProps = {\n hug,\n align,\n justify,\n vertical,\n gap,\n wrap,\n };\n\n // Determine flex class based on flex prop type\n let flexClass = \"\";\n if (typeof flex === \"boolean\") {\n flexClass = flex ? cls(\"stack-child-flex-1\") : cls(\"stack-child-flex-0\");\n }\n\n // Calculate the combined className\n const combinedClassName = cn(\n cls(\"stack-child\"),\n grow && cls(\"stack-child-grow\"),\n shrink && cls(\"stack-child-shrink\"),\n flexClass,\n className\n );\n\n // Calculate the flex style value\n const flexValue =\n typeof flex === \"string\" || typeof flex === \"number\" ? flex : undefined;\n\n // Use useRender to apply props directly to the child without creating a wrapper\n const
|
|
1
|
+
{"version":3,"file":"StackChild.js","sources":["../../../src/components/Stack/StackChild.tsx"],"sourcesContent":["import React from \"react\";\nimport { cn, useCls } from \"../utils\";\nimport { useRender } from \"@base-ui-components/react/use-render\";\nimport { mergeProps } from \"@base-ui-components/react/merge-props\";\nimport { Stack, StackProps } from \"./Stack\";\n\nexport interface StackChildProps extends StackProps {\n /**\n * CSS flex property value (e.g. \"1\", \"1 0 auto\", \"0 1 auto\")\n * When boolean: true = 1, false = 0\n * @default undefined\n */\n flex?: string | number | boolean;\n\n /**\n * Whether this child should grow to fill available space\n * @default false\n */\n grow?: boolean;\n\n /**\n * Whether this child should shrink if necessary\n * @default false\n */\n shrink?: boolean;\n\n /**\n * Children of the stack child\n */\n children?: React.ReactNode;\n /**\n * Whether to render the child with a stack wrapper\n * @default false\n */\n stack?: boolean;\n}\n\nexport const StackChild: React.FC<StackChildProps> = ({\n flex,\n grow = false,\n shrink = false,\n children,\n style,\n stack = false,\n // stack props\n hug = false,\n align = \"flex-start\",\n justify = \"flex-start\",\n vertical = false,\n gap = 0,\n wrap = false,\n\n className,\n ...rest\n}) => {\n const cls = useCls();\n const stackProps = {\n hug,\n align,\n justify,\n vertical,\n gap,\n wrap,\n };\n\n // Determine flex class based on flex prop type\n let flexClass = \"\";\n if (typeof flex === \"boolean\") {\n flexClass = flex ? cls(\"stack-child-flex-1\") : cls(\"stack-child-flex-0\");\n }\n\n // Calculate the combined className\n const combinedClassName = cn(\n cls(\"stack-child\"),\n grow && cls(\"stack-child-grow\"),\n shrink && cls(\"stack-child-shrink\"),\n flexClass,\n className\n );\n\n // Calculate the flex style value\n const flexValue =\n typeof flex === \"string\" || typeof flex === \"number\" ? flex : undefined;\n\n // Use useRender to apply props directly to the child without creating a wrapper\n const renderedElement = useRender({\n render: () =>\n React.isValidElement(children) ? children : <div>{children}</div>,\n props: mergeProps<\"div\">(\n {\n className: combinedClassName,\n style: {\n ...style,\n flex: flexValue,\n },\n ...rest,\n },\n {}\n ),\n });\n\n return stack ? (\n <Stack {...stackProps} className={combinedClassName}>\n {children}\n </Stack>\n ) : (\n renderedElement\n );\n};\n"],"names":["StackChild","flex","grow","shrink","children","style","stack","hug","align","justify","vertical","gap","wrap","className","rest","cls","useCls","stackProps","flexClass","combinedClassName","cn","renderedElement","useRender","React","jsx","mergeProps","Stack"],"mappings":";;;;;;;AAqCO,MAAMA,IAAwC,CAAC;AAAA,EACpD,MAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,QAAAC,IAAS;AAAA,EACT,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA;AAAA,EAER,KAAAC,IAAM;AAAA,EACN,OAAAC,IAAQ;AAAA,EACR,SAAAC,IAAU;AAAA,EACV,UAAAC,IAAW;AAAA,EACX,KAAAC,IAAM;AAAA,EACN,MAAAC,IAAO;AAAA,EAEP,WAAAC;AAAA,EACA,GAAGC;AACL,MAAM;AACJ,QAAMC,IAAMC,EAAO,GACbC,IAAa;AAAA,IACjB,KAAAV;AAAA,IACA,OAAAC;AAAA,IACA,SAAAC;AAAA,IACA,UAAAC;AAAA,IACA,KAAAC;AAAA,IACA,MAAAC;AAAA,EACF;AAGA,MAAIM,IAAY;AACZ,EAAA,OAAOjB,KAAS,cAClBiB,IAAmBH,EAAPd,IAAW,uBAA4B,oBAAR;AAI7C,QAAMkB,IAAoBC;AAAA,IACxBL,EAAI,aAAa;AAAA,IACjBb,KAAQa,EAAI,kBAAkB;AAAA,IAC9BZ,KAAUY,EAAI,oBAAoB;AAAA,IAClCG;AAAA,IACAL;AAAA,EACF,GAOMQ,IAAkBC,EAAU;AAAA,IAChC,QAAQ,MACNC,EAAM,eAAenB,CAAQ,IAAIA,IAAY,gBAAAoB,EAAA,OAAA,EAAK,UAAApB,GAAS;AAAA,IAC7D,OAAOqB;AAAA,MACL;AAAA,QACE,WAAWN;AAAA,QACX,OAAO;AAAA,UACL,GAAGd;AAAA,UACH,MAXN,OAAOJ,KAAS,YAAY,OAAOA,KAAS,WAAWA,IAAO;AAAA,QAY1D;AAAA,QACA,GAAGa;AAAA,MACL;AAAA,MACA,CAAA;AAAA,IAAC;AAAA,EACH,CACD;AAEM,SAAAR,sBACJoB,GAAO,EAAA,GAAGT,GAAY,WAAWE,GAC/B,UAAAf,EACH,CAAA,IAEAiB;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer components{.ds-stack{display:flex}.ds-stack-hug{display:inline-flex}.ds-stack-horizontal{flex-direction:row}.ds-stack-vertical{flex-direction:column}.ds-stack-fill.ds-stack-vertical{height:100%}.ds-stack-fill.ds-stack-horizontal{width:100%}.ds-stack-wrap{flex-wrap:wrap}.ds-stack-gap-0{gap:0}.ds-stack-gap-1{gap:1px}.ds-stack-gap-2{gap:2px}.ds-stack-gap-4{gap:4px}.ds-stack-gap-8{gap:8px}.ds-stack-gap-12{gap:12px}.ds-stack-gap-16{gap:16px}.ds-stack-gap-24
|
|
1
|
+
@layer components{.ds-stack{display:flex}.ds-stack-hug{display:inline-flex}.ds-stack-horizontal{flex-direction:row}.ds-stack-vertical{flex-direction:column}.ds-stack-fill.ds-stack-vertical{height:100%}.ds-stack-fill.ds-stack-horizontal{width:100%}.ds-stack-wrap{flex-wrap:wrap}.ds-stack-gap-0{gap:0}.ds-stack-gap-1{gap:1px}.ds-stack-gap-2{gap:2px}.ds-stack-gap-4{gap:4px}.ds-stack-gap-8{gap:8px}.ds-stack-gap-12{gap:12px}.ds-stack-gap-16{gap:16px}.ds-stack-gap-24{gap:24px}.ds-stack-gap-28{gap:28px}.ds-stack-gap-32{gap:32px}.ds-stack-gap-40{gap:40px}.ds-stack-gap-48{gap:48px}.ds-stack-align-flex-start{align-items:flex-start}.ds-stack-align-flex-end{align-items:flex-end}.ds-stack-align-center{align-items:center}.ds-stack-align-stretch{align-items:stretch}.ds-stack-align-baseline{align-items:baseline}.ds-stack-justify-flex-start{justify-content:flex-start}.ds-stack-justify-flex-end{justify-content:flex-end}.ds-stack-justify-center{justify-content:center}.ds-stack-justify-space-between{justify-content:space-between}.ds-stack-justify-space-around{justify-content:space-around}.ds-stack-justify-space-evenly{justify-content:space-evenly}.ds-stack-child{min-width:0;min-height:0}.ds-stack-child-flex-0{flex:0}.ds-stack-child-flex-1{flex:1}.ds-stack-child-grow{flex-grow:1}.ds-stack-child-shrink{flex-shrink:1}}
|
|
@@ -1,98 +1,102 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as t, jsxs as U, Fragment as z } from "react/jsx-runtime";
|
|
2
3
|
import o from "antd/es/table";
|
|
3
|
-
import { FunnelIcon as
|
|
4
|
-
import { Empty as
|
|
5
|
-
import { forwardRef as
|
|
4
|
+
import { FunnelIcon as H, CaretUpIcon as g, CaretDownIcon as L } from "@bioturing/assets";
|
|
5
|
+
import { Empty as M } from "../Empty/component.js";
|
|
6
|
+
import { forwardRef as P, useState as R, useRef as b, useEffect as D, useCallback as $ } from "react";
|
|
6
7
|
import './style.css';/* empty css */
|
|
7
|
-
import { useCls as
|
|
8
|
-
|
|
8
|
+
import { useCls as k } from "../utils/antdUtils.js";
|
|
9
|
+
import { clsx as q } from "../utils/cn.js";
|
|
10
|
+
const F = ({
|
|
9
11
|
columns: N,
|
|
10
12
|
locale: S,
|
|
11
13
|
emptyDescription: T,
|
|
12
|
-
loading:
|
|
13
|
-
virtual:
|
|
14
|
+
loading: s,
|
|
15
|
+
virtual: i,
|
|
14
16
|
scroll: d = {},
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
className: y,
|
|
18
|
+
variant: O,
|
|
19
|
+
...h
|
|
20
|
+
}, c) => {
|
|
21
|
+
const r = k(), [_, w] = R(
|
|
22
|
+
i ? {} : {
|
|
19
23
|
x: "fit-content"
|
|
20
24
|
}
|
|
21
|
-
),
|
|
25
|
+
), m = b(null), C = b(0);
|
|
22
26
|
D(() => {
|
|
23
27
|
var I;
|
|
24
|
-
if (!
|
|
25
|
-
const e = (I =
|
|
28
|
+
if (!m.current || !i) return;
|
|
29
|
+
const e = (I = m.current) == null ? void 0 : I.nativeElement, n = e == null ? void 0 : e.parentElement;
|
|
26
30
|
if (!n) return;
|
|
27
31
|
const l = e == null ? void 0 : e.querySelector(
|
|
28
|
-
`.${
|
|
29
|
-
),
|
|
30
|
-
`.${
|
|
32
|
+
`.${r("table-thead")}`
|
|
33
|
+
), a = e == null ? void 0 : e.querySelector(
|
|
34
|
+
`.${r("table-pagination")}`
|
|
31
35
|
);
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
C = m.offsetHeight + parseInt(p) + parseInt(u);
|
|
36
|
+
if (a) {
|
|
37
|
+
const p = getComputedStyle(a).marginTop, u = getComputedStyle(a).marginBottom;
|
|
38
|
+
C.current = a.offsetHeight + parseInt(p) + parseInt(u);
|
|
36
39
|
}
|
|
37
40
|
const E = new ResizeObserver((p) => {
|
|
38
41
|
for (const u of p)
|
|
39
|
-
u.target &&
|
|
40
|
-
y: n.offsetHeight - (l ? l == null ? void 0 : l.offsetHeight : 0) - C
|
|
42
|
+
u.target && w({
|
|
43
|
+
y: n.offsetHeight - (l ? l == null ? void 0 : l.offsetHeight : 0) - C.current
|
|
41
44
|
});
|
|
42
45
|
});
|
|
43
|
-
return n &&
|
|
44
|
-
n &&
|
|
46
|
+
return n && i && E.observe(n), () => {
|
|
47
|
+
n && i && E.disconnect();
|
|
45
48
|
};
|
|
46
|
-
}, [
|
|
47
|
-
const
|
|
49
|
+
}, [i, r]);
|
|
50
|
+
const x = N ? N.map((e) => ({
|
|
48
51
|
sortIcon: ({ sortOrder: n }) => /* @__PURE__ */ t(
|
|
49
52
|
"span",
|
|
50
53
|
{
|
|
51
|
-
className:
|
|
54
|
+
className: r(
|
|
52
55
|
"table-column-sort-icon",
|
|
53
56
|
n ? `table-column-sort-icon-${n}` : "table-column-sort-icon-none"
|
|
54
57
|
),
|
|
55
|
-
children: n ? n === "ascend" ? /* @__PURE__ */ t(g, { weight: "fill" }) : /* @__PURE__ */ t(L, { weight: "fill" }) : /* @__PURE__ */
|
|
58
|
+
children: n ? n === "ascend" ? /* @__PURE__ */ t(g, { weight: "fill" }) : /* @__PURE__ */ t(L, { weight: "fill" }) : /* @__PURE__ */ U(z, { children: [
|
|
56
59
|
/* @__PURE__ */ t(g, { weight: "fill" }),
|
|
57
60
|
" ",
|
|
58
61
|
/* @__PURE__ */ t(L, { weight: "fill" })
|
|
59
62
|
] })
|
|
60
63
|
}
|
|
61
64
|
),
|
|
62
|
-
filterIcon: (n) => /* @__PURE__ */ t("span", { className:
|
|
65
|
+
filterIcon: (n) => /* @__PURE__ */ t("span", { className: r("table-column-filter-icon"), children: /* @__PURE__ */ t(H, { weight: "fill" }) }),
|
|
63
66
|
...e
|
|
64
|
-
})) : void 0,
|
|
65
|
-
emptyText: /* @__PURE__ */ t(
|
|
67
|
+
})) : void 0, j = {
|
|
68
|
+
emptyText: /* @__PURE__ */ t(M, { description: T }),
|
|
66
69
|
...S
|
|
67
70
|
};
|
|
68
71
|
let f;
|
|
69
|
-
typeof
|
|
70
|
-
spinning:
|
|
71
|
-
indicator: /* @__PURE__ */ t("span", { className:
|
|
72
|
-
} : typeof
|
|
72
|
+
typeof s == "boolean" ? f = {
|
|
73
|
+
spinning: s,
|
|
74
|
+
indicator: /* @__PURE__ */ t("span", { className: r("spin-loader") })
|
|
75
|
+
} : typeof s == "object" && (f = {
|
|
73
76
|
spinning: !0,
|
|
74
|
-
indicator: /* @__PURE__ */ t("span", { className:
|
|
75
|
-
...
|
|
77
|
+
indicator: /* @__PURE__ */ t("span", { className: r("spin-loader") }),
|
|
78
|
+
...s
|
|
76
79
|
});
|
|
77
|
-
const
|
|
80
|
+
const A = $(
|
|
78
81
|
(e) => {
|
|
79
|
-
e && (typeof
|
|
82
|
+
e && (typeof c == "function" && c(e), c && typeof c == "object" && "current" in c && (c.current = e), m.current = e);
|
|
80
83
|
},
|
|
81
|
-
[
|
|
84
|
+
[c]
|
|
82
85
|
);
|
|
83
86
|
return /* @__PURE__ */ t(
|
|
84
87
|
o,
|
|
85
88
|
{
|
|
86
|
-
ref:
|
|
87
|
-
columns:
|
|
89
|
+
ref: A,
|
|
90
|
+
columns: x,
|
|
88
91
|
loading: f,
|
|
89
|
-
locale:
|
|
90
|
-
virtual:
|
|
91
|
-
scroll: { ...
|
|
92
|
-
|
|
92
|
+
locale: j,
|
|
93
|
+
virtual: i,
|
|
94
|
+
scroll: { ..._, ...d },
|
|
95
|
+
className: q(O === "zebra" ? r("table-zebra") : "", y),
|
|
96
|
+
...h
|
|
93
97
|
}
|
|
94
98
|
);
|
|
95
|
-
},
|
|
99
|
+
}, G = P(F), Y = Object.assign(G, {
|
|
96
100
|
Column: o.Column,
|
|
97
101
|
ColumnGroup: o.ColumnGroup,
|
|
98
102
|
SELECTION_COLUMN: o.SELECTION_COLUMN,
|
|
@@ -103,6 +107,6 @@ const k = ({
|
|
|
103
107
|
Summary: o.Summary
|
|
104
108
|
});
|
|
105
109
|
export {
|
|
106
|
-
|
|
110
|
+
Y as Table
|
|
107
111
|
};
|
|
108
112
|
//# sourceMappingURL=component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../../src/components/Table/component.tsx"],"sourcesContent":["\"use client\";\nimport {\n default as AntTable,\n type ColumnType,\n type TableProps as AntTableProps,\n type TableRef,\n} from \"antd/es/table\";\nimport { CaretDownIcon, CaretUpIcon, FunnelIcon } from \"@bioturing/assets\";\nimport { useCls } from \"../utils\";\nimport Empty from \"../Empty/component\";\nimport { SpinProps } from \"antd/es/spin\";\nimport {\n useState,\n useEffect,\n forwardRef,\n Ref,\n ForwardedRef,\n useCallback,\n useRef,\n} from \"react\";\n\n// Import component-specific styles\nimport \"./style.css\";\n\n// Define interface with all the generic type parameters from AntTable without any\nexport interface TableProps<RecordType extends object = object>\n extends AntTableProps<RecordType> {\n /**\n * Add empty description for the table\n */\n emptyDescription?: React.ReactNode;\n /**\n * Table ref\n */\n tableRef?: React.Ref<HTMLDivElement>;\n}\n\n// Simple wrapper component with proper generics\nconst InnerInternalTable = <RecordType extends object = object>(\n {\n columns,\n locale,\n emptyDescription,\n loading,\n virtual,\n scroll: scrollProp = {},\n ...rest\n }: TableProps<RecordType>,\n ref: Ref<TableRef>\n) => {\n const cls = useCls();\n const [scroll, setScroll] = useState<TableProps[\"scroll\"]>(\n virtual\n ? {}\n : {\n x: \"fit-content\",\n }\n );\n\n const innerRef = useRef<TableRef>(null);\n\n useEffect(() => {\n if (!innerRef.current || !virtual) return;\n const tableEl = innerRef.current?.nativeElement;\n const parentEl = tableEl?.parentElement;\n if (!parentEl) return;\n const thead = tableEl?.querySelector(\n `.${cls(\"table-thead\")}`\n ) as HTMLElement;\n const tpagination = tableEl?.querySelector(\n `.${cls(\"table-pagination\")}`\n ) as HTMLElement;\n
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../src/components/Table/component.tsx"],"sourcesContent":["\"use client\";\nimport {\n default as AntTable,\n type ColumnType,\n type TableProps as AntTableProps,\n type TableRef,\n} from \"antd/es/table\";\nimport { CaretDownIcon, CaretUpIcon, FunnelIcon } from \"@bioturing/assets\";\nimport { clsx, useCls } from \"../utils\";\nimport Empty from \"../Empty/component\";\nimport { SpinProps } from \"antd/es/spin\";\nimport {\n useState,\n useEffect,\n forwardRef,\n Ref,\n ForwardedRef,\n useCallback,\n useRef,\n} from \"react\";\n\n// Import component-specific styles\nimport \"./style.css\";\n\n// Define interface with all the generic type parameters from AntTable without any\nexport interface TableProps<RecordType extends object = object>\n extends AntTableProps<RecordType> {\n /**\n * Add empty description for the table\n */\n emptyDescription?: React.ReactNode;\n /**\n * Table ref\n */\n tableRef?: React.Ref<HTMLDivElement>;\n /**\n * Table style\n */\n variant?: \"default\" | \"zebra\";\n}\n\n// Simple wrapper component with proper generics\nconst InnerInternalTable = <RecordType extends object = object>(\n {\n columns,\n locale,\n emptyDescription,\n loading,\n virtual,\n scroll: scrollProp = {},\n className,\n variant,\n ...rest\n }: TableProps<RecordType>,\n ref: Ref<TableRef>\n) => {\n const cls = useCls();\n const [scroll, setScroll] = useState<TableProps[\"scroll\"]>(\n virtual\n ? {}\n : {\n x: \"fit-content\",\n }\n );\n\n const innerRef = useRef<TableRef>(null);\n const tablePaginationHeight = useRef<number>(0);\n\n useEffect(() => {\n if (!innerRef.current || !virtual) return;\n const tableEl = innerRef.current?.nativeElement;\n const parentEl = tableEl?.parentElement;\n if (!parentEl) return;\n const thead = tableEl?.querySelector(\n `.${cls(\"table-thead\")}`\n ) as HTMLElement;\n const tpagination = tableEl?.querySelector(\n `.${cls(\"table-pagination\")}`\n ) as HTMLElement;\n if (tpagination) {\n const mt = getComputedStyle(tpagination).marginTop;\n const mb = getComputedStyle(tpagination).marginBottom;\n tablePaginationHeight.current =\n tpagination.offsetHeight + parseInt(mt) + parseInt(mb);\n }\n const resizeObserver = new ResizeObserver((entries) => {\n for (const entry of entries) {\n if (entry.target) {\n setScroll({\n y:\n parentEl.offsetHeight -\n (thead ? thead?.offsetHeight : 0) -\n tablePaginationHeight.current,\n });\n }\n }\n });\n if (parentEl && virtual) {\n resizeObserver.observe(parentEl);\n }\n return () => {\n if (parentEl && virtual) {\n resizeObserver.disconnect();\n }\n };\n }, [virtual, cls]);\n\n const modifiedColumns = columns\n ? columns.map((column: ColumnType<RecordType>): ColumnType<RecordType> => {\n return {\n sortIcon: ({ sortOrder }) => {\n return (\n <span\n className={cls(\n \"table-column-sort-icon\",\n sortOrder\n ? `table-column-sort-icon-${sortOrder}`\n : `table-column-sort-icon-none`\n )}\n >\n {!sortOrder ? (\n <>\n <CaretUpIcon weight=\"fill\" />{\" \"}\n <CaretDownIcon weight=\"fill\" />\n </>\n ) : sortOrder === \"ascend\" ? (\n <CaretUpIcon weight=\"fill\" />\n ) : (\n <CaretDownIcon weight=\"fill\" />\n )}\n </span>\n );\n },\n filterIcon: (_filtered) => {\n return (\n <span className={cls(\"table-column-filter-icon\")}>\n <FunnelIcon weight=\"fill\" />\n </span>\n );\n },\n ...column,\n };\n })\n : undefined;\n const modifiedLocale = {\n emptyText: <Empty description={emptyDescription} />,\n ...locale,\n };\n let spinProps: SpinProps | undefined;\n if (typeof loading === \"boolean\") {\n spinProps = {\n spinning: loading,\n indicator: <span className={cls(\"spin-loader\")} />,\n };\n } else if (typeof loading === \"object\") {\n spinProps = {\n spinning: true,\n indicator: <span className={cls(\"spin-loader\")} />,\n ...loading,\n };\n }\n const callbackRef = useCallback(\n (tableRef: TableRef) => {\n if (tableRef) {\n if (typeof ref === \"function\") {\n ref(tableRef);\n }\n if (ref && typeof ref === \"object\" && \"current\" in ref) {\n ref.current = tableRef;\n }\n innerRef.current = tableRef;\n }\n },\n [ref]\n );\n\n return (\n <AntTable\n ref={callbackRef}\n columns={modifiedColumns}\n loading={spinProps}\n locale={modifiedLocale}\n virtual={virtual}\n scroll={{ ...scroll, ...scrollProp }}\n className={clsx(variant === \"zebra\" ? cls(\"table-zebra\") : \"\", className)}\n {...rest}\n />\n );\n};\n\nconst InternalTable = forwardRef(InnerInternalTable) as <\n RecordType extends object = object\n>(\n props: TableProps<RecordType> & { ref?: ForwardedRef<TableRef> }\n) => ReturnType<typeof InnerInternalTable>;\n\n// Create the final component with all static properties\nexport const Table = Object.assign(InternalTable, {\n Column: AntTable.Column,\n ColumnGroup: AntTable.ColumnGroup,\n SELECTION_COLUMN: AntTable.SELECTION_COLUMN,\n EXPAND_COLUMN: AntTable.EXPAND_COLUMN,\n SELECTION_ALL: AntTable.SELECTION_ALL,\n SELECTION_INVERT: AntTable.SELECTION_INVERT,\n SELECTION_NONE: AntTable.SELECTION_NONE,\n Summary: AntTable.Summary,\n}) as typeof InternalTable & {\n Column: typeof AntTable.Column;\n ColumnGroup: typeof AntTable.ColumnGroup;\n SELECTION_COLUMN: typeof AntTable.SELECTION_COLUMN;\n EXPAND_COLUMN: typeof AntTable.EXPAND_COLUMN;\n SELECTION_ALL: typeof AntTable.SELECTION_ALL;\n SELECTION_INVERT: typeof AntTable.SELECTION_INVERT;\n SELECTION_NONE: typeof AntTable.SELECTION_NONE;\n Summary: typeof AntTable.Summary;\n};\n"],"names":["InnerInternalTable","columns","locale","emptyDescription","loading","virtual","scrollProp","className","variant","rest","ref","cls","useCls","scroll","setScroll","useState","innerRef","useRef","tablePaginationHeight","useEffect","tableEl","_a","parentEl","thead","tpagination","mt","mb","resizeObserver","entries","entry","modifiedColumns","column","sortOrder","jsx","CaretUpIcon","CaretDownIcon","jsxs","Fragment","_filtered","FunnelIcon","modifiedLocale","Empty","spinProps","callbackRef","useCallback","tableRef","AntTable","clsx","InternalTable","forwardRef","Table"],"mappings":";;;;;;;;;AA0CA,MAAMA,IAAqB,CACzB;AAAA,EACE,SAAAC;AAAA,EACA,QAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,SAAAC;AAAA,EACA,SAAAC;AAAA,EACA,QAAQC,IAAa,CAAC;AAAA,EACtB,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,GAAGC;AACL,GACAC,MACG;AACH,QAAMC,IAAMC,EAAO,GACb,CAACC,GAAQC,CAAS,IAAIC;AAAA,IAC1BV,IACI,CAAA,IACA;AAAA,MACE,GAAG;AAAA,IAAA;AAAA,EAEX,GAEMW,IAAWC,EAAiB,IAAI,GAChCC,IAAwBD,EAAe,CAAC;AAE9C,EAAAE,EAAU,MAAM;;AACd,QAAI,CAACH,EAAS,WAAW,CAACX,EAAS;AAC7B,UAAAe,KAAUC,IAAAL,EAAS,YAAT,gBAAAK,EAAkB,eAC5BC,IAAWF,KAAA,gBAAAA,EAAS;AAC1B,QAAI,CAACE,EAAU;AACf,UAAMC,IAAQH,KAAA,gBAAAA,EAAS;AAAA,MACrB,IAAIT,EAAI,aAAa,CAAC;AAAA,OAElBa,IAAcJ,KAAA,gBAAAA,EAAS;AAAA,MAC3B,IAAIT,EAAI,kBAAkB,CAAC;AAAA;AAE7B,QAAIa,GAAa;AACT,YAAAC,IAAK,iBAAiBD,CAAW,EAAE,WACnCE,IAAK,iBAAiBF,CAAW,EAAE;AACzC,MAAAN,EAAsB,UACpBM,EAAY,eAAe,SAASC,CAAE,IAAI,SAASC,CAAE;AAAA,IAAA;AAEzD,UAAMC,IAAiB,IAAI,eAAe,CAACC,MAAY;AACrD,iBAAWC,KAASD;AAClB,QAAIC,EAAM,UACEf,EAAA;AAAA,UACR,GACEQ,EAAS,gBACRC,IAAQA,KAAA,gBAAAA,EAAO,eAAe,KAC/BL,EAAsB;AAAA,QAAA,CACzB;AAAA,IAEL,CACD;AACD,WAAII,KAAYjB,KACdsB,EAAe,QAAQL,CAAQ,GAE1B,MAAM;AACX,MAAIA,KAAYjB,KACdsB,EAAe,WAAW;AAAA,IAE9B;AAAA,EAAA,GACC,CAACtB,GAASM,CAAG,CAAC;AAEjB,QAAMmB,IAAkB7B,IACpBA,EAAQ,IAAI,CAAC8B,OACJ;AAAA,IACL,UAAU,CAAC,EAAE,WAAAC,QAET,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAWtB;AAAA,UACT;AAAA,UACAqB,IACI,0BAA0BA,CAAS,KACnC;AAAA,QACN;AAAA,QAEC,UAACA,IAKEA,MAAc,WACf,gBAAAC,EAAAC,GAAA,EAAY,QAAO,OAAA,CAAO,IAE3B,gBAAAD,EAACE,GAAc,EAAA,QAAO,OAAO,CAAA,IAN3B,gBAAAC,EAAAC,GAAA,EAAA,UAAA;AAAA,UAAC,gBAAAJ,EAAAC,GAAA,EAAY,QAAO,OAAO,CAAA;AAAA,UAAG;AAAA,UAC9B,gBAAAD,EAACE,GAAc,EAAA,QAAO,OAAO,CAAA;AAAA,QAC/B,EAAA,CAAA;AAAA,MAI6B;AAAA,IAEjC;AAAA,IAGJ,YAAY,CAACG,MAET,gBAAAL,EAAC,QAAK,EAAA,WAAWtB,EAAI,0BAA0B,GAC7C,UAAC,gBAAAsB,EAAAM,GAAA,EAAW,QAAO,OAAA,CAAO,EAC5B,CAAA;AAAA,IAGJ,GAAGR;AAAA,EACL,EACD,IACD,QACES,IAAiB;AAAA,IACrB,WAAW,gBAAAP,EAACQ,GAAM,EAAA,aAAatC,EAAkB,CAAA;AAAA,IACjD,GAAGD;AAAA,EACL;AACI,MAAAwC;AACA,EAAA,OAAOtC,KAAY,YACTsC,IAAA;AAAA,IACV,UAAUtC;AAAA,IACV,WAAY,gBAAA6B,EAAA,QAAA,EAAK,WAAWtB,EAAI,aAAa,EAAG,CAAA;AAAA,EAClD,IACS,OAAOP,KAAY,aAChBsC,IAAA;AAAA,IACV,UAAU;AAAA,IACV,WAAY,gBAAAT,EAAA,QAAA,EAAK,WAAWtB,EAAI,aAAa,GAAG;AAAA,IAChD,GAAGP;AAAA,EACL;AAEF,QAAMuC,IAAcC;AAAA,IAClB,CAACC,MAAuB;AACtB,MAAIA,MACE,OAAOnC,KAAQ,cACjBA,EAAImC,CAAQ,GAEVnC,KAAO,OAAOA,KAAQ,YAAY,aAAaA,MACjDA,EAAI,UAAUmC,IAEhB7B,EAAS,UAAU6B;AAAA,IAEvB;AAAA,IACA,CAACnC,CAAG;AAAA,EACN;AAGE,SAAA,gBAAAuB;AAAA,IAACa;AAAA,IAAA;AAAA,MACC,KAAKH;AAAA,MACL,SAASb;AAAA,MACT,SAASY;AAAA,MACT,QAAQF;AAAA,MACR,SAAAnC;AAAA,MACA,QAAQ,EAAE,GAAGQ,GAAQ,GAAGP,EAAW;AAAA,MACnC,WAAWyC,EAAKvC,MAAY,UAAUG,EAAI,aAAa,IAAI,IAAIJ,CAAS;AAAA,MACvE,GAAGE;AAAA,IAAA;AAAA,EACN;AAEJ,GAEMuC,IAAgBC,EAAWjD,CAAkB,GAOtCkD,IAAQ,OAAO,OAAOF,GAAe;AAAA,EAChD,QAAQF,EAAS;AAAA,EACjB,aAAaA,EAAS;AAAA,EACtB,kBAAkBA,EAAS;AAAA,EAC3B,eAAeA,EAAS;AAAA,EACxB,eAAeA,EAAS;AAAA,EACxB,kBAAkBA,EAAS;AAAA,EAC3B,gBAAgBA,EAAS;AAAA,EACzB,SAASA,EAAS;AACpB,CAAC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer components{.ds-table-column-sort-icon{display:flex;flex-direction:column}.ds-table-column-sort-icon svg{color:var(--ds-color-text-disabled);font-size:1rem}:is(.ds-table-column-sort-icon svg):hover{color:var(--ds-color-text-secondary)}.ds-table-column-sort-icon.ds-table-column-sort-icon-none svg{font-size:.75rem}.ds-table-column-sort-icon.ds-table-column-sort-icon-none>svg:first-child{margin-bottom:-2px}.ds-table-column-sort-icon.ds-table-column-sort-icon-none>svg:last-child{margin-top:-2px}.ds-table-column-filter-icon{display:flex;flex-direction:column}.ds-table-column-filter-icon svg{color:var(--ds-color-text-disabled);font-size:.875rem}:is(.ds-table-column-filter-icon svg):hover{color:var(--ds-color-text-secondary)}.ds-table-column-filter-icon.ds-table-column-filter-icon-active svg{color:var(--ds-color-primary)}.ds-table-wrapper .ds-table-ping-left .ds-table-cell-fix-left-first:after,.ds-table-wrapper .ds-table-ping-left .ds-table-cell-fix-left-last:after{box-shadow:inset 10px 0 8px -8px var(--ds-color-table-fixed-column-shadow)}.ds-table-wrapper .ds-table-ping-right .ds-table-cell-fix-right-first:after,.ds-table-wrapper .ds-table-ping-right .ds-table-cell-fix-right-last:after{box-shadow:inset -10px 0 8px -8px var(--ds-color-table-fixed-column-shadow)}.ds-table-wrapper .ds-table-ping-right:not(.ds-table-has-fix-right) .ds-table-container:after{box-shadow:inset -10px 0 8px -8px var(--ds-color-table-fixed-column-shadow)}.ds-table-wrapper .ds-table-ping-left:not(.ds-table-has-fix-left) .ds-table-container:before{box-shadow:inset 10px 0 8px -8px var(--ds-color-table-fixed-column-shadow)}.ds-table-wrapper{display:flex;flex-direction:column}.ds-table-wrapper .ds-spin-nested-loading,.ds-table-wrapper .ds-spin-container{display:flex;flex-direction:column;flex-shrink:1;flex-grow:1;min-height:0}:is(.ds-table-wrapper .ds-spin-container) .ds-table{flex-shrink:1;flex-grow:1;min-height:0}.ds-table{display:flex;flex-direction:column}.ds-table-container{flex-shrink:1;min-height:0;display:flex;flex-direction:column}.ds-table-header{flex-shrink:0}.ds-table-body{flex-shrink:1;min-height:0;min-width:0}}
|
|
1
|
+
@layer components{.ds-table-column-sort-icon{display:flex;flex-direction:column}.ds-table-column-sort-icon svg{color:var(--ds-color-text-disabled);font-size:1rem}:is(.ds-table-column-sort-icon svg):hover{color:var(--ds-color-text-secondary)}.ds-table-column-sort-icon.ds-table-column-sort-icon-none svg{font-size:.75rem}.ds-table-column-sort-icon.ds-table-column-sort-icon-none>svg:first-child{margin-bottom:-2px}.ds-table-column-sort-icon.ds-table-column-sort-icon-none>svg:last-child{margin-top:-2px}.ds-table-column-filter-icon{display:flex;flex-direction:column}.ds-table-column-filter-icon svg{color:var(--ds-color-text-disabled);font-size:.875rem}:is(.ds-table-column-filter-icon svg):hover{color:var(--ds-color-text-secondary)}.ds-table-column-filter-icon.ds-table-column-filter-icon-active svg{color:var(--ds-color-primary)}.ds-table-wrapper .ds-table-ping-left .ds-table-cell-fix-left-first:after,.ds-table-wrapper .ds-table-ping-left .ds-table-cell-fix-left-last:after{box-shadow:inset 10px 0 8px -8px var(--ds-color-table-fixed-column-shadow)}.ds-table-wrapper .ds-table-ping-right .ds-table-cell-fix-right-first:after,.ds-table-wrapper .ds-table-ping-right .ds-table-cell-fix-right-last:after{box-shadow:inset -10px 0 8px -8px var(--ds-color-table-fixed-column-shadow)}.ds-table-wrapper .ds-table-ping-right:not(.ds-table-has-fix-right) .ds-table-container:after{box-shadow:inset -10px 0 8px -8px var(--ds-color-table-fixed-column-shadow)}.ds-table-wrapper .ds-table-ping-left:not(.ds-table-has-fix-left) .ds-table-container:before{box-shadow:inset 10px 0 8px -8px var(--ds-color-table-fixed-column-shadow)}.ds-table-wrapper{display:flex;flex-direction:column}.ds-table-wrapper .ds-spin-nested-loading,.ds-table-wrapper .ds-spin-container{display:flex;flex-direction:column;flex-shrink:1;flex-grow:1;min-height:0}:is(.ds-table-wrapper .ds-spin-container) .ds-table{flex-shrink:1;flex-grow:1;min-height:0}.ds-table{display:flex;flex-direction:column}.ds-table-container{flex-shrink:1;min-height:0;display:flex;flex-direction:column}.ds-table-header{flex-shrink:0}.ds-table-body{flex-shrink:1;min-height:0;min-width:0}:is(.ds-table-zebra>.ds-spin-nested-loading>.ds-spin-container>.ds-table>.ds-table-container>.ds-table-content>table)>.ds-table-thead>tr>th,:is(.ds-table-zebra>.ds-spin-nested-loading>.ds-spin-container>.ds-table>.ds-table-container>.ds-table-content>table)>.ds-table-thead>tr>td{background:transparent}:is(.ds-table-zebra>.ds-spin-nested-loading>.ds-spin-container>.ds-table>.ds-table-container>.ds-table-content>table)>.ds-table-thead>tr>th,:is(.ds-table-zebra>.ds-spin-nested-loading>.ds-spin-container>.ds-table>.ds-table-container>.ds-table-content>table)>.ds-table-thead>tr>td,:is(.ds-table-zebra>.ds-spin-nested-loading>.ds-spin-container>.ds-table>.ds-table-container>.ds-table-content>table)>.ds-table-tbody>tr>th,:is(.ds-table-zebra>.ds-spin-nested-loading>.ds-spin-container>.ds-table>.ds-table-container>.ds-table-content>table)>.ds-table-tbody>tr>td{border-bottom:0}:is(.ds-table-zebra>.ds-spin-nested-loading>.ds-spin-container>.ds-table>.ds-table-container>.ds-table-content>table)>.ds-table-tbody>.ds-table-row:nth-child(2n) .ds-table-cell{background-color:var(--ds-color-fill-tertiary)}:is(:is(.ds-table-zebra>.ds-spin-nested-loading>.ds-spin-container>.ds-table>.ds-table-container>.ds-table-content>table)>.ds-table-tbody>.ds-table-row:nth-child(2n) .ds-table-cell):first-child{border-top-left-radius:var(--ds-border-radius);border-bottom-left-radius:var(--ds-border-radius)}:is(:is(.ds-table-zebra>.ds-spin-nested-loading>.ds-spin-container>.ds-table>.ds-table-container>.ds-table-content>table)>.ds-table-tbody>.ds-table-row:nth-child(2n) .ds-table-cell):last-child{border-top-right-radius:var(--ds-border-radius);border-bottom-right-radius:var(--ds-border-radius)}:is(.ds-table-zebra>.ds-spin-nested-loading>.ds-spin-container>.ds-table>.ds-table-container>.ds-table-content>table)>.ds-table-tbody>.ds-table-row:nth-child(2n)>.ds-table-cell-row-hover{background-color:var(--ds-color-fill-secondary)}:is(.ds-table-zebra>.ds-spin-nested-loading>.ds-spin-container>.ds-table>.ds-table-container>.ds-table-content>table)>.ds-table-tbody>tr>td.ds-table-column-sort{background-color:unset}}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
3
|
import { X as d } from "@bioturing/assets";
|
|
3
|
-
import
|
|
4
|
+
import t from "antd/es/tag";
|
|
4
5
|
import './style.css';/* empty css */
|
|
5
6
|
const g = ({
|
|
6
|
-
className:
|
|
7
|
+
className: r,
|
|
7
8
|
active: n = !1,
|
|
8
9
|
color: a,
|
|
9
10
|
style: c,
|
|
@@ -11,9 +12,9 @@ const g = ({
|
|
|
11
12
|
closable: e,
|
|
12
13
|
...i
|
|
13
14
|
}) => /* @__PURE__ */ o(
|
|
14
|
-
|
|
15
|
+
t,
|
|
15
16
|
{
|
|
16
|
-
className:
|
|
17
|
+
className: r,
|
|
17
18
|
color: a,
|
|
18
19
|
style: c,
|
|
19
20
|
closable: e,
|
|
@@ -22,7 +23,7 @@ const g = ({
|
|
|
22
23
|
...i
|
|
23
24
|
}
|
|
24
25
|
), C = Object.assign(g, {
|
|
25
|
-
CheckableTag:
|
|
26
|
+
CheckableTag: t.CheckableTag
|
|
26
27
|
});
|
|
27
28
|
export {
|
|
28
29
|
C as Tag
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../../src/components/Tag/component.tsx"],"sourcesContent":["\"use client\";\nimport { X } from \"@bioturing/assets\";\nimport {\n default as AntTag,\n type TagProps as AntTagProps,\n type TagType,\n} from \"antd/es/tag\";\n\n// Import component-specific styles\nimport \"./style.css\";\n\nexport { TagType };\n\n// Define props interface extending Ant Design's TagProps\nexport interface TagProps extends AntTagProps {\n /**\n * Indicates if the tag is active\n * @default false\n */\n active?: boolean;\n}\n\n// Create Tag component\nconst InternalTag = ({\n className,\n active = false,\n color,\n style,\n closeIcon,\n closable,\n ...rest\n}: TagProps) => {\n const renderedCloseIcon = <X weight=\"bold\" />;\n return (\n <AntTag\n className={className}\n color={color}\n style={style}\n closable={closable}\n closeIcon={closable ? closeIcon || renderedCloseIcon : undefined}\n {...(active ? { \"data-active\": \"true\" } : {})}\n {...rest}\n />\n );\n};\n\nexport const Tag = Object.assign(InternalTag, {\n CheckableTag: AntTag.CheckableTag,\n});\n"],"names":["InternalTag","className","active","color","style","closeIcon","closable","rest","jsx","AntTag","X","Tag"],"mappings":"
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../src/components/Tag/component.tsx"],"sourcesContent":["\"use client\";\nimport { X } from \"@bioturing/assets\";\nimport {\n default as AntTag,\n type TagProps as AntTagProps,\n type TagType,\n} from \"antd/es/tag\";\n\n// Import component-specific styles\nimport \"./style.css\";\n\nexport { TagType };\n\n// Define props interface extending Ant Design's TagProps\nexport interface TagProps extends AntTagProps {\n /**\n * Indicates if the tag is active\n * @default false\n */\n active?: boolean;\n}\n\n// Create Tag component\nconst InternalTag = ({\n className,\n active = false,\n color,\n style,\n closeIcon,\n closable,\n ...rest\n}: TagProps) => {\n const renderedCloseIcon = <X weight=\"bold\" />;\n return (\n <AntTag\n className={className}\n color={color}\n style={style}\n closable={closable}\n closeIcon={closable ? closeIcon || renderedCloseIcon : undefined}\n {...(active ? { \"data-active\": \"true\" } : {})}\n {...rest}\n />\n );\n};\n\nexport const Tag = Object.assign(InternalTag, {\n CheckableTag: AntTag.CheckableTag,\n});\n"],"names":["InternalTag","className","active","color","style","closeIcon","closable","rest","jsx","AntTag","X","Tag"],"mappings":";;;;;AAuBA,MAAMA,IAAc,CAAC;AAAA,EACnB,WAAAC;AAAA,EACA,QAAAC,IAAS;AAAA,EACT,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,MAGI,gBAAAC;AAAA,EAACC;AAAA,EAAA;AAAA,IACC,WAAAR;AAAA,IACA,OAAAE;AAAA,IACA,OAAAC;AAAA,IACA,UAAAE;AAAA,IACA,WAAWA,IAAWD,KAPA,gBAAAG,EAACE,GAAE,EAAA,QAAO,OAAO,CAAA,IAOgB;AAAA,IACtD,GAAIR,IAAS,EAAE,eAAe,WAAW,CAAC;AAAA,IAC1C,GAAGK;AAAA,EAAA;AACN,GAISI,IAAM,OAAO,OAAOX,GAAa;AAAA,EAC5C,cAAcS,EAAO;AACvB,CAAC;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as s } from "react/jsx-runtime";
|
|
2
3
|
import n from "antd/es/config-provider";
|
|
3
4
|
import { useLayoutEffect as f, Children as u, isValidElement as p, cloneElement as a } from "react";
|
|
@@ -7,32 +8,32 @@ import './style.css';/* empty css */
|
|
|
7
8
|
import { useCls as h } from "../utils/antdUtils.js";
|
|
8
9
|
import { clsx as c } from "../utils/cn.js";
|
|
9
10
|
const y = ({
|
|
10
|
-
children:
|
|
11
|
-
theme:
|
|
11
|
+
children: t,
|
|
12
|
+
theme: i,
|
|
12
13
|
appendClassesTo: r
|
|
13
14
|
}) => {
|
|
14
|
-
const l = h(),
|
|
15
|
+
const l = h(), m = c(l("theme-provider"), i.toString());
|
|
15
16
|
return f(() => {
|
|
16
|
-
const
|
|
17
|
-
return o && o.classList.add(...
|
|
18
|
-
o && o.classList.remove(...
|
|
17
|
+
const e = m.split(" "), o = typeof r == "string" ? document.querySelector(r) : r;
|
|
18
|
+
return o && o.classList.add(...e), () => {
|
|
19
|
+
o && o.classList.remove(...e);
|
|
19
20
|
};
|
|
20
|
-
}, [r,
|
|
21
|
+
}, [r, m]), r === void 0 ? u.map(t, (e) => p(e) ? a(e, {
|
|
21
22
|
className: c(
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
e.props.className,
|
|
24
|
+
m
|
|
24
25
|
)
|
|
25
|
-
}) :
|
|
26
|
+
}) : e) : t;
|
|
26
27
|
}, q = ({
|
|
27
|
-
theme:
|
|
28
|
-
appendClassesTo:
|
|
28
|
+
theme: t,
|
|
29
|
+
appendClassesTo: i,
|
|
29
30
|
children: r
|
|
30
31
|
}) => /* @__PURE__ */ s(g, { layer: !0, children: /* @__PURE__ */ s(
|
|
31
32
|
n,
|
|
32
33
|
{
|
|
33
|
-
theme:
|
|
34
|
+
theme: t == "light" ? d : v,
|
|
34
35
|
prefixCls: "ds",
|
|
35
|
-
children: /* @__PURE__ */ s(y, { theme:
|
|
36
|
+
children: /* @__PURE__ */ s(y, { theme: t, appendClassesTo: i, children: r })
|
|
36
37
|
}
|
|
37
38
|
) });
|
|
38
39
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../../src/components/ThemeProvider/component.tsx"],"sourcesContent":["\"use client\";\nimport {\n default as ConfigProvider,\n type ConfigProviderProps,\n} from \"antd/es/config-provider\";\nimport { Children, cloneElement, isValidElement, useLayoutEffect } from \"react\";\nimport { darkTheme, lightTheme } from \"../../tokens/and-theme/tokens\";\nimport { useCls, clsx } from \"../utils\";\nimport { StyleProvider } from \"@ant-design/cssinjs\";\n\n// Import component-specific styles\nimport \"./style.css\";\n\nexport interface ThemeProviderProps\n extends Omit<ConfigProviderProps, \"theme\" | \"prefixCls\"> {\n theme: \"light\" | \"dark\";\n appendClassesTo?: string | HTMLElement;\n}\n\nconst DSWrapper = ({\n children,\n theme,\n appendClassesTo,\n}: {\n children: React.ReactNode;\n theme: \"light\" | \"dark\";\n appendClassesTo?: string | HTMLElement;\n}) => {\n const cls = useCls();\n const className = clsx(cls(\"theme-provider\"), theme.toString());\n useLayoutEffect(() => {\n const classes = className.split(\" \");\n const el =\n typeof appendClassesTo === \"string\"\n ? document.querySelector(appendClassesTo)\n : appendClassesTo;\n if (el) {\n el.classList.add(...classes);\n }\n return () => {\n if (el) {\n el.classList.remove(...classes);\n }\n };\n }, [appendClassesTo, className]);\n return appendClassesTo === undefined\n ? Children.map(children, (child) => {\n if (isValidElement(child))\n return cloneElement(child, {\n className: clsx(\n (child.props as { className?: string }).className,\n className\n ),\n } as { className: string });\n return child;\n })\n : children;\n};\n\nexport const ThemeProvider = ({\n theme,\n appendClassesTo,\n children,\n}: ThemeProviderProps) => {\n return (\n <StyleProvider layer>\n <ConfigProvider\n theme={theme == \"light\" ? lightTheme : darkTheme}\n prefixCls=\"ds\"\n >\n <DSWrapper theme={theme} appendClassesTo={appendClassesTo}>\n {children}\n </DSWrapper>\n </ConfigProvider>\n </StyleProvider>\n );\n};\n"],"names":["DSWrapper","children","theme","appendClassesTo","cls","useCls","className","clsx","useLayoutEffect","classes","el","Children","child","isValidElement","cloneElement","ThemeProvider","jsx","StyleProvider","ConfigProvider","lightTheme","darkTheme"],"mappings":"
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../src/components/ThemeProvider/component.tsx"],"sourcesContent":["\"use client\";\nimport {\n default as ConfigProvider,\n type ConfigProviderProps,\n} from \"antd/es/config-provider\";\nimport { Children, cloneElement, isValidElement, useLayoutEffect } from \"react\";\nimport { darkTheme, lightTheme } from \"../../tokens/and-theme/tokens\";\nimport { useCls, clsx } from \"../utils\";\nimport { StyleProvider } from \"@ant-design/cssinjs\";\n\n// Import component-specific styles\nimport \"./style.css\";\n\nexport interface ThemeProviderProps\n extends Omit<ConfigProviderProps, \"theme\" | \"prefixCls\"> {\n theme: \"light\" | \"dark\";\n appendClassesTo?: string | HTMLElement;\n}\n\nconst DSWrapper = ({\n children,\n theme,\n appendClassesTo,\n}: {\n children: React.ReactNode;\n theme: \"light\" | \"dark\";\n appendClassesTo?: string | HTMLElement;\n}) => {\n const cls = useCls();\n const className = clsx(cls(\"theme-provider\"), theme.toString());\n useLayoutEffect(() => {\n const classes = className.split(\" \");\n const el =\n typeof appendClassesTo === \"string\"\n ? document.querySelector(appendClassesTo)\n : appendClassesTo;\n if (el) {\n el.classList.add(...classes);\n }\n return () => {\n if (el) {\n el.classList.remove(...classes);\n }\n };\n }, [appendClassesTo, className]);\n return appendClassesTo === undefined\n ? Children.map(children, (child) => {\n if (isValidElement(child))\n return cloneElement(child, {\n className: clsx(\n (child.props as { className?: string }).className,\n className\n ),\n } as { className: string });\n return child;\n })\n : children;\n};\n\nexport const ThemeProvider = ({\n theme,\n appendClassesTo,\n children,\n}: ThemeProviderProps) => {\n return (\n <StyleProvider layer>\n <ConfigProvider\n theme={theme == \"light\" ? lightTheme : darkTheme}\n prefixCls=\"ds\"\n >\n <DSWrapper theme={theme} appendClassesTo={appendClassesTo}>\n {children}\n </DSWrapper>\n </ConfigProvider>\n </StyleProvider>\n );\n};\n"],"names":["DSWrapper","children","theme","appendClassesTo","cls","useCls","className","clsx","useLayoutEffect","classes","el","Children","child","isValidElement","cloneElement","ThemeProvider","jsx","StyleProvider","ConfigProvider","lightTheme","darkTheme"],"mappings":";;;;;;;;;AAmBA,MAAMA,IAAY,CAAC;AAAA,EACjB,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,iBAAAC;AACF,MAIM;AACJ,QAAMC,IAAMC,EAAO,GACbC,IAAYC,EAAKH,EAAI,gBAAgB,GAAGF,EAAM,UAAU;AAC9D,SAAAM,EAAgB,MAAM;AACd,UAAAC,IAAUH,EAAU,MAAM,GAAG,GAC7BI,IACJ,OAAOP,KAAoB,WACvB,SAAS,cAAcA,CAAe,IACtCA;AACN,WAAIO,KACCA,EAAA,UAAU,IAAI,GAAGD,CAAO,GAEtB,MAAM;AACX,MAAIC,KACCA,EAAA,UAAU,OAAO,GAAGD,CAAO;AAAA,IAElC;AAAA,EAAA,GACC,CAACN,GAAiBG,CAAS,CAAC,GACxBH,MAAoB,SACvBQ,EAAS,IAAIV,GAAU,CAACW,MAClBC,EAAeD,CAAK,IACfE,EAAaF,GAAO;AAAA,IACzB,WAAWL;AAAA,MACRK,EAAM,MAAiC;AAAA,MACxCN;AAAA,IAAA;AAAA,EACF,CACwB,IACrBM,CACR,IACDX;AACN,GAEac,IAAgB,CAAC;AAAA,EAC5B,OAAAb;AAAA,EACA,iBAAAC;AAAA,EACA,UAAAF;AACF,MAEI,gBAAAe,EAACC,GAAc,EAAA,OAAK,IAClB,UAAA,gBAAAD;AAAA,EAACE;AAAA,EAAA;AAAA,IACC,OAAOhB,KAAS,UAAUiB,IAAaC;AAAA,IACvC,WAAU;AAAA,IAEV,UAAC,gBAAAJ,EAAAhB,GAAA,EAAU,OAAAE,GAAc,iBAAAC,GACtB,UAAAF,EACH,CAAA;AAAA,EAAA;AAAA,GAEJ;"}
|