@bioturing/components 0.46.4 → 0.47.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/base-menu/component.js +19 -21
- package/dist/components/base-menu/component.js.map +1 -1
- package/dist/components/base-menu/index.js +12 -7
- package/dist/components/base-menu/index.js.map +1 -1
- package/dist/components/checkbox/component.d.ts +2 -2
- package/dist/components/checkbox/component.d.ts.map +1 -1
- package/dist/components/checkbox/component.js.map +1 -1
- package/dist/components/choice-list/component.js +12 -12
- package/dist/components/data-table/component.d.ts.map +1 -1
- package/dist/components/data-table/component.js +73 -64
- package/dist/components/data-table/component.js.map +1 -1
- package/dist/components/data-table/components/TableBody.d.ts +1 -1
- package/dist/components/data-table/components/TableBody.d.ts.map +1 -1
- package/dist/components/data-table/components/TableBody.js +62 -53
- package/dist/components/data-table/components/TableBody.js.map +1 -1
- package/dist/components/data-table/components/TableHeader.d.ts +1 -1
- package/dist/components/data-table/components/TableHeader.d.ts.map +1 -1
- package/dist/components/data-table/components/TableHeader.js +46 -46
- package/dist/components/data-table/components/TableHeader.js.map +1 -1
- package/dist/components/data-table/components/TablePagination.d.ts.map +1 -1
- package/dist/components/data-table/components/TablePagination.js +22 -28
- package/dist/components/data-table/components/TablePagination.js.map +1 -1
- package/dist/components/data-table/hooks.d.ts.map +1 -1
- package/dist/components/data-table/hooks.js +15 -14
- package/dist/components/data-table/hooks.js.map +1 -1
- package/dist/components/data-table/style.css +1 -1
- package/dist/components/data-table/types.d.ts +1 -1
- package/dist/components/data-table/types.d.ts.map +1 -1
- package/dist/components/data-table/variant-minimal.css +1 -0
- package/dist/components/data-table/variant-zebra.css +1 -0
- package/dist/components/dialog/Dialog.js +46 -46
- package/dist/components/dialog/Dialog.js.map +1 -1
- package/dist/components/dialog/dialog.css +1 -1
- package/dist/components/form/FormItem/ItemHolder.d.ts +6 -5
- package/dist/components/form/FormItem/ItemHolder.d.ts.map +1 -1
- package/dist/components/form/FormItem/ItemHolder.js +32 -29
- package/dist/components/form/FormItem/ItemHolder.js.map +1 -1
- package/dist/components/form/FormItem/index.d.ts +6 -0
- package/dist/components/form/FormItem/index.d.ts.map +1 -1
- package/dist/components/form/FormItem/index.js +138 -127
- package/dist/components/form/FormItem/index.js.map +1 -1
- package/dist/components/form/FormValidationContext.d.ts +5 -0
- package/dist/components/form/FormValidationContext.d.ts.map +1 -0
- package/dist/components/form/FormValidationContext.js +7 -0
- package/dist/components/form/FormValidationContext.js.map +1 -0
- package/dist/components/form/component.d.ts +6 -1
- package/dist/components/form/component.d.ts.map +1 -1
- package/dist/components/form/component.js +30 -20
- package/dist/components/form/component.js.map +1 -1
- package/dist/components/form/formValidationRule.d.ts +19 -0
- package/dist/components/form/formValidationRule.d.ts.map +1 -0
- package/dist/components/form/formValidationRule.js +22 -0
- package/dist/components/form/formValidationRule.js.map +1 -0
- package/dist/components/form/index.d.ts +2 -0
- package/dist/components/form/index.d.ts.map +1 -1
- package/dist/components/form/useFormValidation.d.ts +3 -0
- package/dist/components/form/useFormValidation.d.ts.map +1 -0
- package/dist/components/form/useFormValidation.js +18 -0
- package/dist/components/form/useFormValidation.js.map +1 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/keyboard-shortcut/component.d.ts +2 -0
- package/dist/components/keyboard-shortcut/component.d.ts.map +1 -1
- package/dist/components/keyboard-shortcut/component.js +69 -49
- package/dist/components/keyboard-shortcut/component.js.map +1 -1
- package/dist/components/modal/Modal.d.ts +1 -1
- package/dist/components/modal/Modal.js +9 -9
- package/dist/components/modal/Modal.js.map +1 -1
- package/dist/components/modal/style.css +1 -1
- package/dist/components/theme-provider/component.d.ts +3 -1
- package/dist/components/theme-provider/component.d.ts.map +1 -1
- package/dist/components/theme-provider/component.js +32 -31
- package/dist/components/theme-provider/component.js.map +1 -1
- package/dist/components/theme-provider/context/index.d.ts +2 -1
- package/dist/components/theme-provider/context/index.d.ts.map +1 -1
- package/dist/components/theme-provider/context/provider.d.ts +2 -3
- package/dist/components/theme-provider/context/provider.d.ts.map +1 -1
- package/dist/components/theme-provider/context/provider.js +13 -6
- package/dist/components/theme-provider/context/provider.js.map +1 -1
- package/dist/components/theme-provider/context/themeStore.d.ts +15 -0
- package/dist/components/theme-provider/context/themeStore.d.ts.map +1 -1
- package/dist/components/theme-provider/context/themeStore.js +10 -9
- package/dist/components/theme-provider/context/themeStore.js.map +1 -1
- package/dist/components/theme-provider/style.css +1 -1
- package/dist/components/tooltip/component.d.ts.map +1 -1
- package/dist/components/tooltip/component.js +23 -12
- package/dist/components/tooltip/component.js.map +1 -1
- package/dist/index.js +286 -275
- package/dist/index.js.map +1 -1
- package/dist/metadata.d.ts +9 -0
- package/dist/metadata.d.ts.map +1 -1
- package/dist/metadata.js +14 -0
- package/dist/metadata.js.map +1 -1
- package/dist/stats.html +1 -1
- package/package.json +6 -6
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import
|
|
2
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
3
|
+
import t from "react";
|
|
4
4
|
import './style.css';/* empty css */
|
|
5
5
|
import { useCls as c } from "../utils/antdUtils.js";
|
|
6
|
-
import { clsx as m } from "../utils/cn.js";
|
|
7
6
|
import { WithRenderProp as u } from "../utils/WithRenderProp.js";
|
|
8
|
-
|
|
7
|
+
import { clsx as m } from "../utils/cn.js";
|
|
8
|
+
const v = t.forwardRef(({ className: e, children: s, ...r }, o) => {
|
|
9
9
|
const a = c();
|
|
10
|
-
return /* @__PURE__ */
|
|
11
|
-
}), b =
|
|
10
|
+
return /* @__PURE__ */ n("div", { className: m(a("base-menu-root"), e), ref: o, ...r, children: s });
|
|
11
|
+
}), b = t.forwardRef(({ className: e, children: s, ...r }, o) => {
|
|
12
12
|
const a = c();
|
|
13
|
-
return /* @__PURE__ */
|
|
13
|
+
return /* @__PURE__ */ n(
|
|
14
14
|
"div",
|
|
15
15
|
{
|
|
16
16
|
className: m(a("base-menu-popup"), e),
|
|
@@ -19,10 +19,9 @@ const v = n.forwardRef(({ className: e, children: s, ...r }, o) => {
|
|
|
19
19
|
children: s
|
|
20
20
|
}
|
|
21
21
|
);
|
|
22
|
-
})
|
|
23
|
-
n.forwardRef(({ className: e, children: s, ...r }, o) => {
|
|
22
|
+
}), w = t.forwardRef(({ className: e, children: s, ...r }, o) => {
|
|
24
23
|
const a = c();
|
|
25
|
-
return /* @__PURE__ */
|
|
24
|
+
return /* @__PURE__ */ n(
|
|
26
25
|
"div",
|
|
27
26
|
{
|
|
28
27
|
className: m(a("base-menu-container"), e),
|
|
@@ -31,14 +30,12 @@ n.forwardRef(({ className: e, children: s, ...r }, o) => {
|
|
|
31
30
|
children: s
|
|
32
31
|
}
|
|
33
32
|
);
|
|
34
|
-
})
|
|
35
|
-
const w = n.forwardRef(({ className: e, children: s, ...r }, o) => {
|
|
33
|
+
}), B = t.forwardRef(({ className: e, children: s, ...r }, o) => {
|
|
36
34
|
const a = c();
|
|
37
|
-
return /* @__PURE__ */
|
|
38
|
-
})
|
|
39
|
-
n.forwardRef(({ className: e, children: s, ...r }, o) => {
|
|
35
|
+
return /* @__PURE__ */ n("div", { className: m(a("base-menu-list"), e), ref: o, ...r, children: s });
|
|
36
|
+
}), M = t.forwardRef(({ className: e, children: s, ...r }, o) => {
|
|
40
37
|
const a = c();
|
|
41
|
-
return /* @__PURE__ */
|
|
38
|
+
return /* @__PURE__ */ n(
|
|
42
39
|
"div",
|
|
43
40
|
{
|
|
44
41
|
className: m(a("base-menu-search"), e),
|
|
@@ -47,10 +44,9 @@ n.forwardRef(({ className: e, children: s, ...r }, o) => {
|
|
|
47
44
|
children: s
|
|
48
45
|
}
|
|
49
46
|
);
|
|
50
|
-
})
|
|
51
|
-
const N = n.forwardRef(({ className: e, children: s, ...r }, o) => {
|
|
47
|
+
}), N = t.forwardRef(({ className: e, children: s, ...r }, o) => {
|
|
52
48
|
const a = c();
|
|
53
|
-
return /* @__PURE__ */
|
|
49
|
+
return /* @__PURE__ */ n(
|
|
54
50
|
u,
|
|
55
51
|
{
|
|
56
52
|
className: m(a("base-menu-divider"), e),
|
|
@@ -61,9 +57,11 @@ const N = n.forwardRef(({ className: e, children: s, ...r }, o) => {
|
|
|
61
57
|
);
|
|
62
58
|
});
|
|
63
59
|
export {
|
|
60
|
+
w as BaseMenuContainer,
|
|
64
61
|
N as BaseMenuDivider,
|
|
65
|
-
|
|
62
|
+
B as BaseMenuList,
|
|
66
63
|
b as BaseMenuPopup,
|
|
67
|
-
v as BaseMenuRoot
|
|
64
|
+
v as BaseMenuRoot,
|
|
65
|
+
M as BaseMenuSearch
|
|
68
66
|
};
|
|
69
67
|
//# sourceMappingURL=component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../../src/components/base-menu/component.tsx"],"sourcesContent":["\"use client\";\nimport { clsx, useCls, WithRenderProp, WithRenderPropProps } from \"../utils\";\nimport React from \"react\";\n\nimport \"./style.css\";\n\nexport const BaseMenuRoot = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithRef<\"div\">\n>(({ className, children, ...rest }, ref) => {\n const cls = useCls();\n\n return (\n <div className={clsx(cls(\"base-menu-root\"), className)} ref={ref} {...rest}>\n {children}\n </div>\n );\n});\n\nexport const BaseMenuPopup = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithRef<\"div\">\n>(({ className, children, ...rest }, ref) => {\n const cls = useCls();\n\n return (\n <div\n className={clsx(cls(\"base-menu-popup\"), className)}\n ref={ref}\n {...rest}\n >\n {children}\n </div>\n );\n});\n\nexport const BaseMenuContainer = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithRef<\"div\">\n>(({ className, children, ...rest }, ref) => {\n const cls = useCls();\n\n return (\n <div\n className={clsx(cls(\"base-menu-container\"), className)}\n ref={ref}\n {...rest}\n >\n {children}\n </div>\n );\n});\n\nexport const BaseMenuList = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithRef<\"div\">\n>(({ className, children, ...rest }, ref) => {\n const cls = useCls();\n\n return (\n <div className={clsx(cls(\"base-menu-list\"), className)} ref={ref} {...rest}>\n {children}\n </div>\n );\n});\n\nexport const BaseMenuSearch = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithRef<\"div\">\n>(({ className, children, ...rest }, ref) => {\n const cls = useCls();\n\n return (\n <div\n className={clsx(cls(\"base-menu-search\"), className)}\n ref={ref}\n {...rest}\n >\n {children}\n </div>\n );\n});\n\nexport const BaseMenuDivider = React.forwardRef<\n HTMLDivElement,\n WithRenderPropProps\n>(({ className, children, ...rest }, ref) => {\n const cls = useCls();\n\n return (\n <WithRenderProp\n className={clsx(cls(\"base-menu-divider\"), className)}\n ref={ref}\n {...rest}\n >\n {children}\n </WithRenderProp>\n );\n});\n"],"names":["BaseMenuRoot","React","className","children","rest","ref","cls","useCls","jsx","clsx","BaseMenuPopup","BaseMenuList","BaseMenuDivider","WithRenderProp"],"mappings":";;;;;;;AAMO,MAAMA,IAAeC,EAAM,WAGhC,CAAC,EAAE,WAAAC,GAAW,UAAAC,GAAU,GAAGC,EAAA,GAAQC,MAAQ;AAC3C,QAAMC,IAAMC,EAAA;AAEZ,SACE,gBAAAC,EAAC,OAAA,EAAI,WAAWC,EAAKH,EAAI,gBAAgB,GAAGJ,CAAS,GAAG,KAAAG,GAAW,GAAGD,GACnE,UAAAD,EAAA,CACH;AAEJ,CAAC,GAEYO,IAAgBT,EAAM,WAGjC,CAAC,EAAE,WAAAC,GAAW,UAAAC,GAAU,GAAGC,EAAA,GAAQC,MAAQ;AAC3C,QAAMC,IAAMC,EAAA;AAEZ,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAKH,EAAI,iBAAiB,GAAGJ,CAAS;AAAA,MACjD,KAAAG;AAAA,MACC,GAAGD;AAAA,MAEH,UAAAD;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../src/components/base-menu/component.tsx"],"sourcesContent":["\"use client\";\nimport { clsx, useCls, WithRenderProp, WithRenderPropProps } from \"../utils\";\nimport React from \"react\";\n\nimport \"./style.css\";\n\nexport const BaseMenuRoot = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithRef<\"div\">\n>(({ className, children, ...rest }, ref) => {\n const cls = useCls();\n\n return (\n <div className={clsx(cls(\"base-menu-root\"), className)} ref={ref} {...rest}>\n {children}\n </div>\n );\n});\n\nexport const BaseMenuPopup = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithRef<\"div\">\n>(({ className, children, ...rest }, ref) => {\n const cls = useCls();\n\n return (\n <div\n className={clsx(cls(\"base-menu-popup\"), className)}\n ref={ref}\n {...rest}\n >\n {children}\n </div>\n );\n});\n\nexport const BaseMenuContainer = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithRef<\"div\">\n>(({ className, children, ...rest }, ref) => {\n const cls = useCls();\n\n return (\n <div\n className={clsx(cls(\"base-menu-container\"), className)}\n ref={ref}\n {...rest}\n >\n {children}\n </div>\n );\n});\n\nexport const BaseMenuList = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithRef<\"div\">\n>(({ className, children, ...rest }, ref) => {\n const cls = useCls();\n\n return (\n <div className={clsx(cls(\"base-menu-list\"), className)} ref={ref} {...rest}>\n {children}\n </div>\n );\n});\n\nexport const BaseMenuSearch = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithRef<\"div\">\n>(({ className, children, ...rest }, ref) => {\n const cls = useCls();\n\n return (\n <div\n className={clsx(cls(\"base-menu-search\"), className)}\n ref={ref}\n {...rest}\n >\n {children}\n </div>\n );\n});\n\nexport const BaseMenuDivider = React.forwardRef<\n HTMLDivElement,\n WithRenderPropProps\n>(({ className, children, ...rest }, ref) => {\n const cls = useCls();\n\n return (\n <WithRenderProp\n className={clsx(cls(\"base-menu-divider\"), className)}\n ref={ref}\n {...rest}\n >\n {children}\n </WithRenderProp>\n );\n});\n"],"names":["BaseMenuRoot","React","className","children","rest","ref","cls","useCls","jsx","clsx","BaseMenuPopup","BaseMenuContainer","BaseMenuList","BaseMenuSearch","BaseMenuDivider","WithRenderProp"],"mappings":";;;;;;;AAMO,MAAMA,IAAeC,EAAM,WAGhC,CAAC,EAAE,WAAAC,GAAW,UAAAC,GAAU,GAAGC,EAAA,GAAQC,MAAQ;AAC3C,QAAMC,IAAMC,EAAA;AAEZ,SACE,gBAAAC,EAAC,OAAA,EAAI,WAAWC,EAAKH,EAAI,gBAAgB,GAAGJ,CAAS,GAAG,KAAAG,GAAW,GAAGD,GACnE,UAAAD,EAAA,CACH;AAEJ,CAAC,GAEYO,IAAgBT,EAAM,WAGjC,CAAC,EAAE,WAAAC,GAAW,UAAAC,GAAU,GAAGC,EAAA,GAAQC,MAAQ;AAC3C,QAAMC,IAAMC,EAAA;AAEZ,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAKH,EAAI,iBAAiB,GAAGJ,CAAS;AAAA,MACjD,KAAAG;AAAA,MACC,GAAGD;AAAA,MAEH,UAAAD;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC,GAEYQ,IAAoBV,EAAM,WAGrC,CAAC,EAAE,WAAAC,GAAW,UAAAC,GAAU,GAAGC,EAAA,GAAQC,MAAQ;AAC3C,QAAMC,IAAMC,EAAA;AAEZ,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAKH,EAAI,qBAAqB,GAAGJ,CAAS;AAAA,MACrD,KAAAG;AAAA,MACC,GAAGD;AAAA,MAEH,UAAAD;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC,GAEYS,IAAeX,EAAM,WAGhC,CAAC,EAAE,WAAAC,GAAW,UAAAC,GAAU,GAAGC,EAAA,GAAQC,MAAQ;AAC3C,QAAMC,IAAMC,EAAA;AAEZ,SACE,gBAAAC,EAAC,OAAA,EAAI,WAAWC,EAAKH,EAAI,gBAAgB,GAAGJ,CAAS,GAAG,KAAAG,GAAW,GAAGD,GACnE,UAAAD,EAAA,CACH;AAEJ,CAAC,GAEYU,IAAiBZ,EAAM,WAGlC,CAAC,EAAE,WAAAC,GAAW,UAAAC,GAAU,GAAGC,EAAA,GAAQC,MAAQ;AAC3C,QAAMC,IAAMC,EAAA;AAEZ,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAKH,EAAI,kBAAkB,GAAGJ,CAAS;AAAA,MAClD,KAAAG;AAAA,MACC,GAAGD;AAAA,MAEH,UAAAD;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC,GAEYW,IAAkBb,EAAM,WAGnC,CAAC,EAAE,WAAAC,GAAW,UAAAC,GAAU,GAAGC,EAAA,GAAQC,MAAQ;AAC3C,QAAMC,IAAMC,EAAA;AAEZ,SACE,gBAAAC;AAAA,IAACO;AAAA,IAAA;AAAA,MACC,WAAWN,EAAKH,EAAI,mBAAmB,GAAGJ,CAAS;AAAA,MACnD,KAAAG;AAAA,MACC,GAAGD;AAAA,MAEH,UAAAD;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC;"}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { BaseMenuDivider as e, BaseMenuList as o, BaseMenuSearch as n, BaseMenuContainer as a, BaseMenuPopup as t, BaseMenuRoot as r } from "./component.js";
|
|
2
|
+
import { BaseMenuItem as s } from "./item.js";
|
|
3
|
+
const B = {
|
|
4
|
+
Root: r,
|
|
5
|
+
Popup: t,
|
|
6
|
+
Container: a,
|
|
7
|
+
Search: n,
|
|
8
|
+
List: o,
|
|
9
|
+
Divider: e,
|
|
10
|
+
Item: s
|
|
7
11
|
};
|
|
8
12
|
export {
|
|
9
|
-
|
|
13
|
+
B as BaseMenu,
|
|
14
|
+
s as BaseMenuItem
|
|
10
15
|
};
|
|
11
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/base-menu/index.ts"],"sourcesContent":["import {\n BaseMenuRoot,\n BaseMenuPopup,\n BaseMenuContainer,\n BaseMenuSearch,\n BaseMenuList,\n BaseMenuDivider,\n} from \"./component\";\nimport { BaseMenuItem, type BaseMenuItemProps } from \"./item\";\n\nexport { BaseMenuItem, type BaseMenuItemProps };\nexport const BaseMenu = {\n Root: BaseMenuRoot,\n Popup: BaseMenuPopup,\n Container: BaseMenuContainer,\n Search: BaseMenuSearch,\n List: BaseMenuList,\n Divider: BaseMenuDivider,\n Item: BaseMenuItem,\n};\n"],"names":["BaseMenu","BaseMenuRoot","BaseMenuPopup","BaseMenuList","BaseMenuDivider"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/base-menu/index.ts"],"sourcesContent":["import {\n BaseMenuRoot,\n BaseMenuPopup,\n BaseMenuContainer,\n BaseMenuSearch,\n BaseMenuList,\n BaseMenuDivider,\n} from \"./component\";\nimport { BaseMenuItem, type BaseMenuItemProps } from \"./item\";\n\nexport { BaseMenuItem, type BaseMenuItemProps };\nexport const BaseMenu = {\n Root: BaseMenuRoot,\n Popup: BaseMenuPopup,\n Container: BaseMenuContainer,\n Search: BaseMenuSearch,\n List: BaseMenuList,\n Divider: BaseMenuDivider,\n Item: BaseMenuItem,\n};\n"],"names":["BaseMenu","BaseMenuRoot","BaseMenuPopup","BaseMenuContainer","BaseMenuSearch","BaseMenuList","BaseMenuDivider","BaseMenuItem"],"mappings":";;AAWO,MAAMA,IAAW;AAAA,EACtB,MAAMC;AAAA,EACN,OAAOC;AAAA,EACP,WAAWC;AAAA,EACX,QAAQC;AAAA,EACR,MAAMC;AAAA,EACN,SAASC;AAAA,EACT,MAAMC;AACR;"}
|
|
@@ -3,7 +3,7 @@ export interface CheckboxProps extends AntCheckboxProps {
|
|
|
3
3
|
/**
|
|
4
4
|
* Checkbox appearance variant
|
|
5
5
|
* @default 'default'
|
|
6
|
-
|
|
6
|
+
*/
|
|
7
7
|
variant?: "default" | "outlined";
|
|
8
8
|
}
|
|
9
9
|
declare const MainCheckboxInner: ({ variant, className, ...props }: CheckboxProps, ref: React.Ref<React.ComponentRef<typeof AntCheckbox>>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -12,5 +12,5 @@ export declare const Checkbox: ((props: CheckboxProps & {
|
|
|
12
12
|
}) => ReturnType<typeof MainCheckboxInner>) & {
|
|
13
13
|
Group: <T = any>(props: import('antd/es/checkbox').CheckboxGroupProps<T> & React.RefAttributes<HTMLDivElement>) => React.ReactElement;
|
|
14
14
|
};
|
|
15
|
-
export {};
|
|
15
|
+
export type { CheckboxChangeEvent, CheckboxRef, CheckboxGroupProps, CheckboxOptionType, } from 'antd/es/checkbox';
|
|
16
16
|
//# sourceMappingURL=component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/components/checkbox/component.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,IAAI,WAAW,EACvB,KAAK,aAAa,IAAI,gBAAgB,EACvC,MAAM,MAAM,CAAC;AAKd,OAAO,aAAa,CAAC;AAGrB,MAAM,WAAW,aAAc,SAAQ,gBAAgB;IACrD;;;
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/components/checkbox/component.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,IAAI,WAAW,EACvB,KAAK,aAAa,IAAI,gBAAgB,EACvC,MAAM,MAAM,CAAC;AAKd,OAAO,aAAa,CAAC;AAGrB,MAAM,WAAW,aAAc,SAAQ,gBAAgB;IACrD;;;MAGE;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;CACjC;AAGD,QAAA,MAAM,iBAAiB,GACrB,kCAA8C,aAAa,EAC3D,KAAK,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,WAAW,CAAC,CAAC,4CASvD,CAAC;AAUF,eAAO,MAAM,QAAQ,WANZ,aAAa,GAAG;IACrB,GAAG,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC;CAClE,KACE,UAAU,CAAC,OAAO,iBAAiB,CAAC;;CAKvC,CAAC;AAEH,YAAY,EACV,mBAAmB,EACnB,WAAW,EACX,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../../src/components/checkbox/component.tsx"],"sourcesContent":["\"use client\";\nimport {\n Checkbox as AntCheckbox,\n type CheckboxProps as AntCheckboxProps,\n} from \"antd\";\nimport { forwardRef } from \"react\";\nimport { clsx, useCls } from \"../utils\";\n\n// Import component-specific styles\nimport \"./style.css\";\n\n// Define props interface extending Ant Design's CheckboxProps\nexport interface CheckboxProps extends AntCheckboxProps {\n /**\n * Checkbox appearance variant\n * @default 'default'\n
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../src/components/checkbox/component.tsx"],"sourcesContent":["\"use client\";\nimport {\n Checkbox as AntCheckbox,\n type CheckboxProps as AntCheckboxProps,\n} from \"antd\";\nimport { forwardRef } from \"react\";\nimport { clsx, useCls } from \"../utils\";\n\n// Import component-specific styles\nimport \"./style.css\";\n\n// Define props interface extending Ant Design's CheckboxProps\nexport interface CheckboxProps extends AntCheckboxProps {\n /**\n * Checkbox appearance variant\n * @default 'default'\n */\n variant?: \"default\" | \"outlined\";\n}\n\n// Create inner function\nconst MainCheckboxInner = (\n { variant = \"default\", className, ...props }: CheckboxProps,\n ref: React.Ref<React.ComponentRef<typeof AntCheckbox>>\n) => {\n const cls = useCls();\n const combinedClassName = clsx(\n className,\n variant === \"outlined\" && cls(\"checkbox-outlined\")\n );\n \n return <AntCheckbox ref={ref} className={combinedClassName} {...props} />;\n};\n\n// Use forwardRef with type assertion\nconst MainCheckbox = forwardRef(MainCheckboxInner) as (\n props: CheckboxProps & {\n ref?: React.ForwardedRef<React.ComponentRef<typeof AntCheckbox>>;\n }\n) => ReturnType<typeof MainCheckboxInner>;\n\n// Create the final component with Group property\nexport const Checkbox = Object.assign(MainCheckbox, {\n Group: AntCheckbox.Group,\n});\n\nexport type {\n CheckboxChangeEvent,\n CheckboxRef,\n CheckboxGroupProps,\n CheckboxOptionType,\n} from \"antd/es/checkbox\";\n"],"names":["MainCheckboxInner","variant","className","props","ref","cls","useCls","combinedClassName","clsx","AntCheckbox","MainCheckbox","forwardRef","Checkbox"],"mappings":";;;;;;;AAqBA,MAAMA,IAAoB,CACxB,EAAE,SAAAC,IAAU,WAAW,WAAAC,GAAW,GAAGC,EAAA,GACrCC,MACG;AACH,QAAMC,IAAMC,EAAA,GACNC,IAAoBC;AAAA,IACxBN;AAAA,IACAD,MAAY,cAAcI,EAAI,mBAAmB;AAAA,EAAA;AAGnD,2BAAQI,GAAA,EAAY,KAAAL,GAAU,WAAWG,GAAoB,GAAGJ,GAAO;AACzE,GAGMO,IAAeC,EAAWX,CAAiB,GAOpCY,IAAW,OAAO,OAAOF,GAAc;AAAA,EAClD,OAAOD,EAAY;AACrB,CAAC;"}
|
|
@@ -5,13 +5,13 @@ import { useMemo as F, useContext as p, useCallback as f } from "react";
|
|
|
5
5
|
import L from "antd/es/config-provider/DisabledContext";
|
|
6
6
|
import { FormItemInputContext as x } from "antd/es/form/context";
|
|
7
7
|
import './style.css';/* empty css */
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { Input as _ } from "../input/component.js";
|
|
8
|
+
import { useControlledState as P } from "../hooks/useControlledState.js";
|
|
9
|
+
import { useCls as R } from "../utils/antdUtils.js";
|
|
10
|
+
import { clsx as M } from "../utils/cn.js";
|
|
11
|
+
import { Input as T } from "../input/component.js";
|
|
13
12
|
import { Checkbox as b } from "../checkbox/component.js";
|
|
14
|
-
import { ScrollArea as
|
|
13
|
+
import { ScrollArea as _ } from "../scroll-area/component.js";
|
|
14
|
+
import { Radio as q } from "../radio/component.js";
|
|
15
15
|
const le = ({
|
|
16
16
|
options: i,
|
|
17
17
|
multiple: r,
|
|
@@ -27,9 +27,9 @@ const le = ({
|
|
|
27
27
|
disabled: w = !1,
|
|
28
28
|
status: z
|
|
29
29
|
}) => {
|
|
30
|
-
const [t, s] =
|
|
30
|
+
const [t, s] = P(C, I, g), n = F(() => r ? Array.isArray(t) ? t : t ? [t] : [] : Array.isArray(t) ? t.length > 0 ? [t[0]] : [] : t ? [t] : [], [t, r]);
|
|
31
31
|
p(x);
|
|
32
|
-
const D = p(L), c = w || D, o =
|
|
32
|
+
const D = p(L), c = w || D, o = R(), j = f(() => {
|
|
33
33
|
if (r) {
|
|
34
34
|
const e = i.map((a) => a.value).filter(Boolean);
|
|
35
35
|
s(e);
|
|
@@ -55,12 +55,12 @@ const le = ({
|
|
|
55
55
|
open: !0,
|
|
56
56
|
inline: !0,
|
|
57
57
|
modal: !1,
|
|
58
|
-
children: /* @__PURE__ */ v("div", { className:
|
|
58
|
+
children: /* @__PURE__ */ v("div", { className: M(o("choice-list"), y), children: [
|
|
59
59
|
/* @__PURE__ */ l(x.Provider, { value: {}, children: /* @__PURE__ */ l(
|
|
60
60
|
d.Input,
|
|
61
61
|
{
|
|
62
62
|
render: ({ ref: e, ...a }) => /* @__PURE__ */ l(
|
|
63
|
-
|
|
63
|
+
T.Search,
|
|
64
64
|
{
|
|
65
65
|
...a,
|
|
66
66
|
...S,
|
|
@@ -94,7 +94,7 @@ const le = ({
|
|
|
94
94
|
}
|
|
95
95
|
);
|
|
96
96
|
})(),
|
|
97
|
-
/* @__PURE__ */ v(
|
|
97
|
+
/* @__PURE__ */ v(_, { className: o("choice-list-items"), fadeEdges: !0, children: [
|
|
98
98
|
/* @__PURE__ */ l(d.List, { children: (e) => /* @__PURE__ */ l(
|
|
99
99
|
d.Item,
|
|
100
100
|
{
|
|
@@ -111,7 +111,7 @@ const le = ({
|
|
|
111
111
|
children: e.label
|
|
112
112
|
}
|
|
113
113
|
) : /* @__PURE__ */ l(
|
|
114
|
-
|
|
114
|
+
q,
|
|
115
115
|
{
|
|
116
116
|
tabIndex: -1,
|
|
117
117
|
checked: e.value ? n.includes(e.value) : !1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/components/data-table/component.tsx"],"names":[],"mappings":"AACA,OAAc,EAKZ,KAAK,GAAG,EACT,MAAM,OAAO,CAAC;AAOf,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAGjE,OAAO,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/components/data-table/component.tsx"],"names":[],"mappings":"AACA,OAAc,EAKZ,KAAK,GAAG,EACT,MAAM,OAAO,CAAC;AAOf,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAGjE,OAAO,aAAa,CAAC;AACrB,OAAO,qBAAqB,CAAC;AAC7B,OAAO,uBAAuB,CAAC;AAU/B,QAAA,MAAM,cAAc,GAClB,UAAU,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAEhE,OAAO,cAAc,CAAC,UAAU,CAAC,EACjC,KAAK,GAAG,CAAC,YAAY,CAAC,4CAiKvB,CAAC;AAQF,eAAO,MAAM,SAAS,GALpB,UAAU,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,mCAE/B,cAAc,CAAC,UAAU,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC,CAAA;CAAE,KAC5D,UAAU,CAAC,OAAO,cAAc,CAEK,CAAC"}
|
|
@@ -1,84 +1,93 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { Spin as
|
|
5
|
-
import { useDataTable as
|
|
6
|
-
import { convertSelectionToAntFormat as
|
|
7
|
-
import './style.css';/* empty css */
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
2
|
+
import { jsx as o, jsxs as p } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as x, useRef as g, useState as H, useEffect as h } from "react";
|
|
4
|
+
import { Spin as N } from "../spin/component.js";
|
|
5
|
+
import { useDataTable as W } from "./hooks.js";
|
|
6
|
+
import { convertSelectionToAntFormat as I } from "./utils.js";
|
|
7
|
+
import './variant-minimal.css';import './variant-zebra.css';import './style.css';/* empty css */
|
|
8
|
+
/* empty css */
|
|
9
|
+
/* empty css */
|
|
10
|
+
import { TableHeader as P } from "./components/TableHeader.js";
|
|
11
|
+
import { TableBody as k } from "./components/TableBody.js";
|
|
12
|
+
import { TablePagination as j } from "./components/TablePagination.js";
|
|
13
|
+
import { useCls as B } from "../utils/antdUtils.js";
|
|
14
|
+
import { clsx as E } from "../utils/cn.js";
|
|
15
|
+
const F = (d, A) => {
|
|
14
16
|
const {
|
|
15
17
|
dataSource: i = [],
|
|
16
|
-
className:
|
|
17
|
-
size:
|
|
18
|
-
variant:
|
|
19
|
-
emptyDescription:
|
|
18
|
+
className: S,
|
|
19
|
+
size: y = "large",
|
|
20
|
+
variant: m = "default",
|
|
21
|
+
emptyDescription: z,
|
|
20
22
|
rowKey: c
|
|
21
|
-
} =
|
|
23
|
+
} = d, e = B(), w = g(null), {
|
|
22
24
|
table: a,
|
|
23
|
-
isLoading:
|
|
25
|
+
isLoading: v,
|
|
24
26
|
spinProps: R,
|
|
25
|
-
hasRowSelection:
|
|
26
|
-
hasPagination:
|
|
27
|
-
paginationConfig:
|
|
27
|
+
hasRowSelection: u,
|
|
28
|
+
hasPagination: f,
|
|
29
|
+
paginationConfig: C,
|
|
28
30
|
rowSelectionConfig: n
|
|
29
|
-
} =
|
|
30
|
-
if (
|
|
31
|
-
const { selectedRows:
|
|
31
|
+
} = W(d), T = (t) => {
|
|
32
|
+
if (u && (t.toggleSelected(), n?.onSelect)) {
|
|
33
|
+
const { selectedRows: l } = I(
|
|
32
34
|
a.getState().rowSelection,
|
|
33
35
|
i,
|
|
34
36
|
c
|
|
35
37
|
);
|
|
36
38
|
n.onSelect(
|
|
37
|
-
|
|
38
|
-
!
|
|
39
|
-
|
|
39
|
+
t.original,
|
|
40
|
+
!t.getIsSelected(),
|
|
41
|
+
l,
|
|
40
42
|
new Event("click")
|
|
41
43
|
);
|
|
42
44
|
}
|
|
43
|
-
},
|
|
45
|
+
}, r = g(null), [b, D] = H({
|
|
44
46
|
vertical: !1,
|
|
45
47
|
horizontal: !1
|
|
46
|
-
});
|
|
47
|
-
return
|
|
48
|
-
|
|
49
|
-
vertical:
|
|
50
|
-
horizontal:
|
|
48
|
+
}), s = !!a.getState().columnSizingInfo?.isResizingColumn;
|
|
49
|
+
return h(() => {
|
|
50
|
+
r.current && D({
|
|
51
|
+
vertical: r.current.scrollHeight > r.current.clientHeight,
|
|
52
|
+
horizontal: r.current.scrollWidth > r.current.clientWidth
|
|
51
53
|
});
|
|
52
|
-
}, [i]),
|
|
54
|
+
}, [i]), h(() => {
|
|
55
|
+
if (!s || typeof document > "u") return;
|
|
56
|
+
const t = document.body.style.cursor, l = document.body.style.userSelect;
|
|
57
|
+
return document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", () => {
|
|
58
|
+
document.body.style.cursor = t, document.body.style.userSelect = l;
|
|
59
|
+
};
|
|
60
|
+
}, [s]), /* @__PURE__ */ o(
|
|
53
61
|
"div",
|
|
54
62
|
{
|
|
55
|
-
ref:
|
|
56
|
-
className:
|
|
57
|
-
e("table-wrapper"
|
|
58
|
-
e(`table-${
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
f
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
ref: w,
|
|
64
|
+
className: E(
|
|
65
|
+
e("data-table-wrapper"),
|
|
66
|
+
e(`data-table-${y}`),
|
|
67
|
+
m === "zebra" ? e("data-table-zebra") : "",
|
|
68
|
+
m === "minimal" ? e("data-table-minimal") : "",
|
|
69
|
+
f ? e("data-table-has-pagination") : "",
|
|
70
|
+
b.vertical ? e("data-table-scroll-vertical") : "",
|
|
71
|
+
b.horizontal ? e("data-table-scroll-horizontal") : "",
|
|
72
|
+
s ? e("data-table-resizing") : "",
|
|
73
|
+
S
|
|
65
74
|
),
|
|
66
|
-
children: /* @__PURE__ */ p(
|
|
67
|
-
/* @__PURE__ */
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
-
let
|
|
70
|
-
if (
|
|
71
|
-
|
|
75
|
+
children: /* @__PURE__ */ p(N, { spinning: v, ...R, children: [
|
|
76
|
+
/* @__PURE__ */ o("div", { className: e("data-table"), children: /* @__PURE__ */ o("div", { className: e("data-table-container"), ref: r, children: /* @__PURE__ */ o("div", { className: e("data-table-content"), children: /* @__PURE__ */ p("table", { children: [
|
|
77
|
+
/* @__PURE__ */ o("colgroup", { children: a.getHeaderGroups()[0]?.headers.map((t) => {
|
|
78
|
+
let l;
|
|
79
|
+
if (t.id === "select")
|
|
80
|
+
l = n?.columnWidth || 32;
|
|
72
81
|
else
|
|
73
82
|
try {
|
|
74
|
-
|
|
83
|
+
l = `${t.getSize()}px`;
|
|
75
84
|
} catch {
|
|
76
|
-
|
|
85
|
+
l = t.column.columnDef.meta?.width;
|
|
77
86
|
}
|
|
78
|
-
return /* @__PURE__ */
|
|
87
|
+
return /* @__PURE__ */ o("col", { style: { width: l } }, t.id);
|
|
79
88
|
}) }),
|
|
80
|
-
/* @__PURE__ */
|
|
81
|
-
|
|
89
|
+
/* @__PURE__ */ o(
|
|
90
|
+
P,
|
|
82
91
|
{
|
|
83
92
|
table: a,
|
|
84
93
|
rowSelectionConfig: n,
|
|
@@ -86,32 +95,32 @@ const $ = (s, G) => {
|
|
|
86
95
|
rowKey: c
|
|
87
96
|
}
|
|
88
97
|
),
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
|
|
98
|
+
/* @__PURE__ */ o(
|
|
99
|
+
k,
|
|
91
100
|
{
|
|
92
101
|
table: a,
|
|
93
102
|
dataSource: i,
|
|
94
|
-
emptyDescription:
|
|
95
|
-
hasRowSelection:
|
|
103
|
+
emptyDescription: z,
|
|
104
|
+
hasRowSelection: u,
|
|
96
105
|
onRowClick: T,
|
|
97
106
|
rowSelectionConfig: n,
|
|
98
107
|
rowKey: c
|
|
99
108
|
}
|
|
100
109
|
)
|
|
101
110
|
] }) }) }) }),
|
|
102
|
-
|
|
103
|
-
|
|
111
|
+
f && /* @__PURE__ */ o(
|
|
112
|
+
j,
|
|
104
113
|
{
|
|
105
114
|
table: a,
|
|
106
|
-
paginationConfig:
|
|
115
|
+
paginationConfig: C,
|
|
107
116
|
totalCount: a.getPreFilteredRowModel().rows.length
|
|
108
117
|
}
|
|
109
118
|
)
|
|
110
119
|
] })
|
|
111
120
|
}
|
|
112
121
|
);
|
|
113
|
-
},
|
|
122
|
+
}, $ = x(F), ee = $;
|
|
114
123
|
export {
|
|
115
|
-
|
|
124
|
+
ee as DataTable
|
|
116
125
|
};
|
|
117
126
|
//# sourceMappingURL=component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../../src/components/data-table/component.tsx"],"sourcesContent":["\"use client\";\nimport React, {\n forwardRef,\n useEffect,\n useRef,\n useState,\n type Ref,\n} from \"react\";\nimport { type Row } from \"@tanstack/react-table\";\nimport { clsx,
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../src/components/data-table/component.tsx"],"sourcesContent":["\"use client\";\nimport React, {\n forwardRef,\n useEffect,\n useRef,\n useState,\n type Ref,\n} from \"react\";\nimport { type Row } from \"@tanstack/react-table\";\nimport { clsx, useCls } from \"../utils\";\nimport { Spin } from \"../spin/component\";\nimport { TableHeader, TableBody, TablePagination } from \"./components\";\nimport { useDataTable } from \"./hooks\";\nimport { convertSelectionToAntFormat } from \"./utils\";\nimport { type DataTableProps, type DataTableRef } from \"./types\";\n\n// Import component-specific styles\nimport \"./style.css\";\nimport \"./variant-zebra.css\";\nimport \"./variant-minimal.css\";\n\n// Extended meta type for column definitions\ninterface ExtendedColumnMeta {\n align?: \"left\" | \"center\" | \"right\";\n width?: string | number;\n fixed?: \"left\" | \"right\" | boolean;\n ellipsis?: boolean;\n}\n\nconst InnerDataTable = <\n RecordType extends Record<string, any> = Record<string, unknown>\n>(\n props: DataTableProps<RecordType>,\n ref: Ref<DataTableRef>\n) => {\n const {\n dataSource = [],\n className,\n size = \"large\",\n variant = \"default\",\n emptyDescription,\n rowKey,\n } = props;\n\n const cls = useCls();\n const tableWrapperRef = useRef<HTMLDivElement>(null);\n\n // Use the custom hook for table logic\n const {\n table,\n isLoading,\n spinProps,\n hasRowSelection,\n hasPagination,\n paginationConfig,\n rowSelectionConfig,\n } = useDataTable(props);\n\n // Handle row click for selection\n const handleRowClick = (row: Row<RecordType>) => {\n if (hasRowSelection) {\n row.toggleSelected();\n if (rowSelectionConfig?.onSelect) {\n const { selectedRowKeys, selectedRows } = convertSelectionToAntFormat(\n table.getState().rowSelection,\n dataSource,\n rowKey\n );\n rowSelectionConfig.onSelect(\n row.original,\n !row.getIsSelected(),\n selectedRows,\n new Event(\"click\")\n );\n }\n }\n };\n\n // cls(\"table-scroll-horizontal\"))\n\n const tableContainerRef = useRef<HTMLDivElement>(null);\n\n const [hasScroll, setHasScroll] = useState({\n vertical: false,\n horizontal: false,\n });\n\n const isColumnResizing = Boolean(\n table.getState().columnSizingInfo?.isResizingColumn\n );\n\n useEffect(() => {\n if (tableContainerRef.current) {\n setHasScroll({\n vertical:\n tableContainerRef.current.scrollHeight >\n tableContainerRef.current.clientHeight,\n horizontal:\n tableContainerRef.current.scrollWidth >\n tableContainerRef.current.clientWidth,\n });\n }\n }, [dataSource]);\n\n useEffect(() => {\n if (!isColumnResizing || typeof document === \"undefined\") return;\n\n const originalCursor = document.body.style.cursor;\n const originalUserSelect = document.body.style.userSelect;\n\n document.body.style.cursor = \"col-resize\";\n document.body.style.userSelect = \"none\";\n\n return () => {\n document.body.style.cursor = originalCursor;\n document.body.style.userSelect = originalUserSelect;\n };\n }, [isColumnResizing]);\n\n return (\n <div\n ref={tableWrapperRef}\n className={clsx(\n cls(\"data-table-wrapper\"),\n cls(`data-table-${size}`),\n variant === \"zebra\" ? cls(\"data-table-zebra\") : \"\",\n variant === \"minimal\" ? cls(\"data-table-minimal\") : \"\",\n hasPagination ? cls(\"data-table-has-pagination\") : \"\",\n hasScroll.vertical ? cls(\"data-table-scroll-vertical\") : \"\",\n hasScroll.horizontal ? cls(\"data-table-scroll-horizontal\") : \"\",\n isColumnResizing ? cls(\"data-table-resizing\") : \"\",\n className\n )}\n >\n <Spin spinning={isLoading} {...spinProps}>\n <div className={cls(\"data-table\")}>\n <div className={cls(\"data-table-container\")} ref={tableContainerRef}>\n <div className={cls(\"data-table-content\")}>\n <table>\n <colgroup>\n {table.getHeaderGroups()[0]?.headers.map((header) => {\n let columnWidth: string | number | undefined;\n\n if (header.id === \"select\") {\n columnWidth = rowSelectionConfig?.columnWidth || 32;\n } else {\n // Try to get the current size from TanStack, fallback to meta width\n try {\n columnWidth = `${header.getSize()}px`;\n } catch (error) {\n // Fallback to static width from column meta\n columnWidth = (\n header.column.columnDef.meta as ExtendedColumnMeta\n )?.width;\n }\n }\n\n return (\n <col key={header.id} style={{ width: columnWidth }} />\n );\n })}\n </colgroup>\n\n <TableHeader\n table={table}\n rowSelectionConfig={rowSelectionConfig}\n dataSource={dataSource}\n rowKey={rowKey}\n />\n\n <TableBody\n table={table}\n dataSource={dataSource}\n emptyDescription={emptyDescription}\n hasRowSelection={hasRowSelection}\n onRowClick={handleRowClick}\n rowSelectionConfig={rowSelectionConfig}\n rowKey={rowKey}\n />\n </table>\n </div>\n </div>\n </div>\n\n {hasPagination && (\n <TablePagination\n table={table}\n paginationConfig={paginationConfig}\n totalCount={table.getPreFilteredRowModel().rows.length}\n />\n )}\n </Spin>\n </div>\n );\n};\n\nconst InternalDataTable = forwardRef(InnerDataTable) as <\n RecordType extends Record<string, any> = Record<string, unknown>\n>(\n props: DataTableProps<RecordType> & { ref?: Ref<DataTableRef> }\n) => ReturnType<typeof InnerDataTable>;\n\nexport const DataTable = InternalDataTable;\n"],"names":["InnerDataTable","props","ref","dataSource","className","size","variant","emptyDescription","rowKey","cls","useCls","tableWrapperRef","useRef","table","isLoading","spinProps","hasRowSelection","hasPagination","paginationConfig","rowSelectionConfig","useDataTable","handleRowClick","row","selectedRows","convertSelectionToAntFormat","tableContainerRef","hasScroll","setHasScroll","useState","isColumnResizing","useEffect","originalCursor","originalUserSelect","jsx","clsx","jsxs","Spin","header","columnWidth","TableHeader","TableBody","TablePagination","InternalDataTable","forwardRef","DataTable"],"mappings":"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"}
|
|
@@ -10,6 +10,6 @@ interface TableBodyProps<RecordType extends Record<string, any> = Record<string,
|
|
|
10
10
|
rowSelectionConfig?: DataTableRowSelection<RecordType>;
|
|
11
11
|
rowKey?: RowKey | ((record: RecordType, index?: number) => RowKey);
|
|
12
12
|
}
|
|
13
|
-
export declare const TableBody: <RecordType extends Record<string, any> = Record<string, unknown>>({ table, dataSource, emptyDescription, hasRowSelection, onRowClick, rowSelectionConfig, rowKey }: TableBodyProps<RecordType>) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const TableBody: <RecordType extends Record<string, any> = Record<string, unknown>>({ table, dataSource, emptyDescription, hasRowSelection, onRowClick, rowSelectionConfig, rowKey, }: TableBodyProps<RecordType>) => import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
export {};
|
|
15
15
|
//# sourceMappingURL=TableBody.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableBody.d.ts","sourceRoot":"","sources":["../../../../src/components/data-table/components/TableBody.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAc,KAAK,KAAK,EAAE,KAAK,GAAG,EAA0B,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"TableBody.d.ts","sourceRoot":"","sources":["../../../../src/components/data-table/components/TableBody.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAc,KAAK,KAAK,EAAE,KAAK,GAAG,EAA0B,MAAM,uBAAuB,CAAC;AAMjG,OAAO,EAAE,KAAK,qBAAqB,EAAE,KAAK,MAAM,EAAE,MAAM,UAAU,CAAC;AAWnE,UAAU,cAAc,CAAC,UAAU,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACvF,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IACzB,UAAU,EAAE,UAAU,EAAE,CAAC;IACzB,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACnC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;IAC5C,kBAAkB,CAAC,EAAE,qBAAqB,CAAC,UAAU,CAAC,CAAC;IACvD,MAAM,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC;CACpE;AAED,eAAO,MAAM,SAAS,GAAI,UAAU,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,mGAQzF,cAAc,CAAC,UAAU,CAAC,4CA0H5B,CAAC"}
|