@bioturing/components 0.15.4 → 0.15.5
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/Breadcrumb/style.css +1 -1
- package/dist/components/Breadcrumb/useItemRender.js +17 -16
- package/dist/components/Breadcrumb/useItemRender.js.map +1 -1
- package/dist/components/Collapse/component.js +34 -0
- package/dist/components/Collapse/component.js.map +1 -0
- package/dist/components/Collapse/style.css +1 -0
- package/dist/components/Modal/Modal.js +8 -8
- package/dist/components/Modal/Modal.js.map +1 -1
- package/dist/components/Table/component.js +81 -73
- package/dist/components/Table/component.js.map +1 -1
- package/dist/components/Tag/component.js.map +1 -1
- package/dist/components/Truncate/style.css +1 -1
- package/dist/index.d.ts +20 -19
- package/dist/index.js +171 -170
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer components{.ds-breadcrumb{display:flex}.ds-breadcrumb ol{display:inline-flex;flex:1;min-width:0;gap:.25rem 0}.ds-breadcrumb>ol>li{display:inline-flex;align-items:center;flex:0 1 0;max-width:100%}.ds-breadcrumb>ol>li.ds-breadcrumb-separator{flex:0}.ds-breadcrumb>ol>li .ds-breadcrumb-link{display:inline-flex;align-items:center;flex:0 1 auto;min-width:0;
|
|
1
|
+
@layer components{.ds-breadcrumb{display:flex}.ds-breadcrumb ol{display:inline-flex;flex:1;min-width:0;gap:.25rem 0}.ds-breadcrumb>ol>li{display:inline-flex;align-items:center;flex:0 1 0;max-width:100%}.ds-breadcrumb>ol>li.ds-breadcrumb-separator{flex:0}.ds-breadcrumb>ol>li .ds-breadcrumb-link{display:inline-flex;align-items:center;flex:0 1 auto;min-width:0;gap:.5rem}.ds-breadcrumb .ds-breadcrumb-item-name{flex:1 1 auto;min-width:0}.ds-breadcrumb .ds-breadcrumb-item-icon{flex:0 0 auto}.ds-breadcrumb.ds-breadcrumb-nowrap{display:flex;align-items:center;flex-grow:1;min-width:0}.ds-breadcrumb.ds-breadcrumb-nowrap ol{flex-wrap:nowrap}:is(.ds-breadcrumb.ds-breadcrumb-nowrap ol) li:not(.ds-breadcrumb-separator){flex:0 1 auto;min-width:0;display:flex;transition:all .2s ease}:is(:is(.ds-breadcrumb.ds-breadcrumb-nowrap ol) li:not(.ds-breadcrumb-separator)) span.ds-breadcrumb-link{display:flex;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}:is(.ds-breadcrumb.ds-breadcrumb-nowrap ol) li:not(.ds-breadcrumb-separator){max-width:100%}:is(.ds-breadcrumb.ds-breadcrumb-nowrap ol) li:last-child{flex:0 0 auto}:is(.ds-breadcrumb.ds-breadcrumb-nowrap ol):hover li:last-child{flex-shrink:1}:is(.ds-breadcrumb.ds-breadcrumb-nowrap ol) li:hover{flex-shrink:0}:is(.ds-breadcrumb.ds-breadcrumb-nowrap ol) li:last-child:hover{flex-shrink:0}}
|
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { renderItem as
|
|
1
|
+
import { jsxs as g, Fragment as p, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { renderItem as u } from "antd/es/breadcrumb/useItemRender";
|
|
3
3
|
import { cn as l } from "../utils/cn.js";
|
|
4
|
-
|
|
4
|
+
import { Truncate as m } from "../Truncate/component.js";
|
|
5
|
+
function h(e, r) {
|
|
5
6
|
if (e.title === void 0 || e.title === null)
|
|
6
7
|
return null;
|
|
7
|
-
const
|
|
8
|
+
const o = Object.keys(r).join("|");
|
|
8
9
|
return typeof e.title == "object" ? e.title : String(e.title).replace(
|
|
9
|
-
new RegExp(`:(${
|
|
10
|
-
(n,
|
|
10
|
+
new RegExp(`:(${o})`, "g"),
|
|
11
|
+
(n, c) => r[c] || n
|
|
11
12
|
);
|
|
12
13
|
}
|
|
13
|
-
function
|
|
14
|
-
return (n,
|
|
15
|
-
if (
|
|
16
|
-
return
|
|
17
|
-
const
|
|
18
|
-
/* @__PURE__ */
|
|
19
|
-
/* @__PURE__ */
|
|
20
|
-
] }) : i;
|
|
21
|
-
return
|
|
14
|
+
function N(e, r) {
|
|
15
|
+
return (n, c, s, d, a) => {
|
|
16
|
+
if (r)
|
|
17
|
+
return r(n, c, s, d);
|
|
18
|
+
const t = h(n, c), f = n.icon ? /* @__PURE__ */ g(p, { children: [
|
|
19
|
+
/* @__PURE__ */ i("span", { className: l(`${e}-item-icon`), children: n.icon }),
|
|
20
|
+
/* @__PURE__ */ i("span", { className: l(`${e}-item-name`), children: typeof t == "string" ? /* @__PURE__ */ i(m, { children: t }) : t })
|
|
21
|
+
] }) : typeof t == "string" ? /* @__PURE__ */ i(m, { children: t }) : t;
|
|
22
|
+
return u(e, n, f, a);
|
|
22
23
|
};
|
|
23
24
|
}
|
|
24
25
|
export {
|
|
25
|
-
|
|
26
|
+
N as default
|
|
26
27
|
};
|
|
27
28
|
//# sourceMappingURL=useItemRender.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useItemRender.js","sources":["../../../src/components/Breadcrumb/useItemRender.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../utils\";\nimport { renderItem } from \"antd/es/breadcrumb/useItemRender\";\nimport { InternalRouteType } from \"antd/es/breadcrumb/Breadcrumb\";\nimport type { BreadcrumbProps } from \"./types\";\n\ntype AddParameters<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n TFunction extends (...args: any) => any,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n TParameters extends [...args: any]\n> = (\n ...args: [...Parameters<TFunction>, ...TParameters]\n) => ReturnType<TFunction>;\n\ntype ItemRender = NonNullable<BreadcrumbProps[\"itemRender\"]>;\ntype InternalItemRenderParams = AddParameters<ItemRender, [href?: string]>;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction getBreadcrumbName(route: InternalRouteType, params: any) {\n if (route.title === undefined || route.title === null) {\n return null;\n }\n const paramsKeys = Object.keys(params).join(\"|\");\n return typeof route.title === \"object\"\n ? route.title\n : String(route.title).replace(\n new RegExp(`:(${paramsKeys})`, \"g\"),\n (replacement, key) => params[key] || replacement\n );\n}\n\nexport default function useItemRender(\n prefixCls: string,\n itemRender?: ItemRender\n) {\n const mergedItemRender: InternalItemRenderParams = (\n item,\n params,\n routes,\n path,\n href\n ) => {\n if (itemRender) {\n return itemRender(item, params, routes, path);\n }\n const name = getBreadcrumbName(item, params);\n const child = item.icon ? (\n <>\n <span className={cn(`${prefixCls}-item-icon`)}>{item.icon}</span>\n <span className={cn(`${prefixCls}-item-name`)}>{name}</span>\n </>\n ) : (\n name\n );\n\n return renderItem(prefixCls, item, child, href);\n };\n\n return mergedItemRender;\n}\n"],"names":["getBreadcrumbName","route","params","paramsKeys","replacement","key","useItemRender","prefixCls","itemRender","item","routes","path","href","name","child","jsxs","Fragment","jsx","cn","renderItem"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useItemRender.js","sources":["../../../src/components/Breadcrumb/useItemRender.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../utils\";\nimport { renderItem } from \"antd/es/breadcrumb/useItemRender\";\nimport { InternalRouteType } from \"antd/es/breadcrumb/Breadcrumb\";\nimport type { BreadcrumbProps } from \"./types\";\nimport { Truncate } from \"../Truncate\";\n\ntype AddParameters<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n TFunction extends (...args: any) => any,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n TParameters extends [...args: any]\n> = (\n ...args: [...Parameters<TFunction>, ...TParameters]\n) => ReturnType<TFunction>;\n\ntype ItemRender = NonNullable<BreadcrumbProps[\"itemRender\"]>;\ntype InternalItemRenderParams = AddParameters<ItemRender, [href?: string]>;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction getBreadcrumbName(route: InternalRouteType, params: any) {\n if (route.title === undefined || route.title === null) {\n return null;\n }\n const paramsKeys = Object.keys(params).join(\"|\");\n return typeof route.title === \"object\"\n ? route.title\n : String(route.title).replace(\n new RegExp(`:(${paramsKeys})`, \"g\"),\n (replacement, key) => params[key] || replacement\n );\n}\n\nexport default function useItemRender(\n prefixCls: string,\n itemRender?: ItemRender\n) {\n const mergedItemRender: InternalItemRenderParams = (\n item,\n params,\n routes,\n path,\n href\n ) => {\n if (itemRender) {\n return itemRender(item, params, routes, path);\n }\n const name = getBreadcrumbName(item, params);\n const child = item.icon ? (\n <>\n <span className={cn(`${prefixCls}-item-icon`)}>{item.icon}</span>\n <span className={cn(`${prefixCls}-item-name`)}>\n {typeof name === \"string\" ? <Truncate>{name}</Truncate> : name}\n </span>\n </>\n ) : typeof name === \"string\" ? (\n <Truncate>{name}</Truncate>\n ) : (\n name\n );\n\n return renderItem(prefixCls, item, child, href);\n };\n\n return mergedItemRender;\n}\n"],"names":["getBreadcrumbName","route","params","paramsKeys","replacement","key","useItemRender","prefixCls","itemRender","item","routes","path","href","name","child","jsxs","Fragment","jsx","cn","Truncate","renderItem"],"mappings":";;;;AAoBA,SAASA,EAAkBC,GAA0BC,GAAa;AAChE,MAAID,EAAM,UAAU,UAAaA,EAAM,UAAU;AACxC,WAAA;AAET,QAAME,IAAa,OAAO,KAAKD,CAAM,EAAE,KAAK,GAAG;AACxC,SAAA,OAAOD,EAAM,SAAU,WAC1BA,EAAM,QACN,OAAOA,EAAM,KAAK,EAAE;AAAA,IAClB,IAAI,OAAO,KAAKE,CAAU,KAAK,GAAG;AAAA,IAClC,CAACC,GAAaC,MAAQH,EAAOG,CAAG,KAAKD;AAAA,EACvC;AACN;AAEwB,SAAAE,EACtBC,GACAC,GACA;AA4BO,SA3B4C,CACjDC,GACAP,GACAQ,GACAC,GACAC,MACG;AACH,QAAIJ;AACF,aAAOA,EAAWC,GAAMP,GAAQQ,GAAQC,CAAI;AAExC,UAAAE,IAAOb,EAAkBS,GAAMP,CAAM,GACrCY,IAAQL,EAAK,OAEf,gBAAAM,EAAAC,GAAA,EAAA,UAAA;AAAA,MAAC,gBAAAC,EAAA,QAAA,EAAK,WAAWC,EAAG,GAAGX,CAAS,YAAY,GAAI,YAAK,KAAK,CAAA;AAAA,MACzD,gBAAAU,EAAA,QAAA,EAAK,WAAWC,EAAG,GAAGX,CAAS,YAAY,GACzC,UAAA,OAAOM,KAAS,WAAW,gBAAAI,EAACE,GAAU,EAAA,UAAAN,EAAA,CAAK,IAAcA,EAC5D,CAAA;AAAA,IAAA,GACF,IACE,OAAOA,KAAS,WACjB,gBAAAI,EAAAE,GAAA,EAAU,YAAK,CAAA,IAEhBN;AAGF,WAAOO,EAAWb,GAAWE,GAAMK,GAAOF,CAAI;AAAA,EAChD;AAGF;"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { Collapse as r } from "antd";
|
|
3
|
+
import { forwardRef as p } from "react";
|
|
4
|
+
import './style.css';/* empty css */
|
|
5
|
+
import { useCls as t } from "../utils/antdUtils.js";
|
|
6
|
+
import { clsx as c } from "../utils/cn.js";
|
|
7
|
+
const m = (s, o) => {
|
|
8
|
+
const { className: e, ...l } = s, n = t();
|
|
9
|
+
return /* @__PURE__ */ a(
|
|
10
|
+
r,
|
|
11
|
+
{
|
|
12
|
+
ref: o,
|
|
13
|
+
className: n("collapse", e),
|
|
14
|
+
...l
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
}, i = p(m), f = (s) => {
|
|
18
|
+
const { className: o, ...e } = s, l = t();
|
|
19
|
+
return console.warn(
|
|
20
|
+
"[bioturing-ds] Collapse.Panel is deprecated. Please use items prop instead."
|
|
21
|
+
), /* @__PURE__ */ a(
|
|
22
|
+
r.Panel,
|
|
23
|
+
{
|
|
24
|
+
className: c(l("collapse-panel"), o),
|
|
25
|
+
...e
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}, b = Object.assign(i, {
|
|
29
|
+
Panel: f
|
|
30
|
+
});
|
|
31
|
+
export {
|
|
32
|
+
b as Collapse
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../src/components/Collapse/component.tsx"],"sourcesContent":["\"use client\";\nimport {\n Collapse as AntCollapse,\n type CollapseProps as AntCollapseProps,\n type CollapsePanelProps as AntCollapsePanelProps,\n} from \"antd\";\nimport { type ForwardedRef, forwardRef } from \"react\";\nimport { useCls, clsx } from \"../utils\";\n\n// Import component-specific styles\nimport \"./style.css\";\n\n// Define props interface extending Ant Design's CollapseProps\nexport interface CollapseProps extends AntCollapseProps {}\n\n// Define props interface extending Ant Design's CollapsePanelProps\nexport interface CollapsePanelProps extends AntCollapsePanelProps {}\n\n// Create inner function with forwarded ref\nconst CollapseInner = (\n props: CollapseProps,\n ref: ForwardedRef<HTMLDivElement>\n) => {\n const { className, ...restProps } = props;\n const cls = useCls();\n return (\n <AntCollapse\n ref={ref}\n className={cls(\"collapse\", className)}\n {...restProps}\n />\n );\n};\n\n// Use forwardRef with type assertion\nconst MainCollapse = forwardRef(CollapseInner) as (\n props: CollapseProps & {\n ref?: React.ForwardedRef<HTMLDivElement>;\n }\n) => ReturnType<typeof CollapseInner>;\n\n// Create the Panel component (deprecated)\nconst Panel = (props: CollapsePanelProps) => {\n const { className, ...restProps } = props;\n const cls = useCls();\n console.warn(\n \"[bioturing-ds] Collapse.Panel is deprecated. Please use items prop instead.\"\n );\n return (\n <AntCollapse.Panel\n className={clsx(cls(\"collapse-panel\"), className)}\n {...restProps}\n />\n );\n};\n\n// Create the final component with Panel property\nexport const Collapse = Object.assign(MainCollapse, {\n Panel: Panel,\n});\n"],"names":["CollapseInner","props","ref","className","restProps","cls","useCls","jsx","AntCollapse","MainCollapse","forwardRef","Panel","clsx","Collapse"],"mappings":";;;;;;AAmBA,MAAMA,IAAgB,CACpBC,GACAC,MACG;AACH,QAAM,EAAE,WAAAC,GAAW,GAAGC,EAAA,IAAcH,GAC9BI,IAAMC,EAAO;AAEjB,SAAA,gBAAAC;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,KAAAN;AAAA,MACA,WAAWG,EAAI,YAAYF,CAAS;AAAA,MACnC,GAAGC;AAAA,IAAA;AAAA,EACN;AAEJ,GAGMK,IAAeC,EAAWV,CAAa,GAOvCW,IAAQ,CAACV,MAA8B;AAC3C,QAAM,EAAE,WAAAE,GAAW,GAAGC,EAAA,IAAcH,GAC9BI,IAAMC,EAAO;AACX,iBAAA;AAAA,IACN;AAAA,EACF,GAEE,gBAAAC;AAAA,IAACC,EAAY;AAAA,IAAZ;AAAA,MACC,WAAWI,EAAKP,EAAI,gBAAgB,GAAGF,CAAS;AAAA,MAC/C,GAAGC;AAAA,IAAA;AAAA,EACN;AAEJ,GAGaS,IAAW,OAAO,OAAOJ,GAAc;AAAA,EAClD,OAAAE;AACF,CAAC;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer components{.ds-collapse .ds-collapse-header{display:flex;align-items:center}.ds-collapse .ds-collapse-expand-icon{display:flex;align-items:center;justify-content:center;flex-shrink:0;flex-grow:0}.ds-collapse .ds-collapse-header-text{flex-shrink:1;flex-grow:1;min-width:0;display:flex}}
|
|
@@ -5,8 +5,8 @@ import { useState as R, useRef as ue, useCallback as pe, useEffect as he } from
|
|
|
5
5
|
import { ModalContextProvider as be } from "antd/es/modal/context";
|
|
6
6
|
import L from "antd/es/modal/components/NormalCancelBtn";
|
|
7
7
|
import C from "antd/es/modal/components/NormalOkBtn";
|
|
8
|
-
import { getConfirmLocale as
|
|
9
|
-
import { useLocale as
|
|
8
|
+
import { getConfirmLocale as ge } from "antd/es/modal/locale";
|
|
9
|
+
import { useLocale as ve } from "antd/es/locale";
|
|
10
10
|
import { ModalSize as f } from "./constants.js";
|
|
11
11
|
import { Stack as h } from "../Stack/index.js";
|
|
12
12
|
import { Truncate as ye } from "../Truncate/component.js";
|
|
@@ -14,10 +14,10 @@ import { IconButton as we } from "../IconButton/component.js";
|
|
|
14
14
|
import { useCls as xe } from "../utils/antdUtils.js";
|
|
15
15
|
const We = ({
|
|
16
16
|
open: b,
|
|
17
|
-
closeIcon:
|
|
17
|
+
closeIcon: g,
|
|
18
18
|
children: j,
|
|
19
19
|
size: E,
|
|
20
|
-
footer:
|
|
20
|
+
footer: v,
|
|
21
21
|
width: F,
|
|
22
22
|
style: P,
|
|
23
23
|
styles: c,
|
|
@@ -46,7 +46,7 @@ const We = ({
|
|
|
46
46
|
bodyScrollable: Y = !0,
|
|
47
47
|
...Z
|
|
48
48
|
}) => {
|
|
49
|
-
const _ =
|
|
49
|
+
const _ = g === void 0 ? /* @__PURE__ */ e(fe, { size: 16, weight: "bold" }) : g, t = E || (Q === "default" ? "medium" : "xsmall"), ee = F || f[t], oe = {
|
|
50
50
|
"--ds-modal-bg": `var(--ds-color-bg-${V || (t && t in f && parseInt(f[t]) <= parseInt(f.medium) ? "elevated" : "container")})`,
|
|
51
51
|
...P,
|
|
52
52
|
...t === "fullscreen" ? { top: 0, maxWidth: "100%", height: "100%" } : {}
|
|
@@ -76,7 +76,7 @@ const We = ({
|
|
|
76
76
|
he(() => () => {
|
|
77
77
|
d.current && (d.current.disconnect(), d.current = null);
|
|
78
78
|
}, []);
|
|
79
|
-
const [s] =
|
|
79
|
+
const [s] = ve("Modal", ge()), le = y || (s == null ? void 0 : s.okText), se = x || (s == null ? void 0 : s.cancelText), S = {
|
|
80
80
|
loading: A,
|
|
81
81
|
...$
|
|
82
82
|
}, O = {
|
|
@@ -110,7 +110,7 @@ const We = ({
|
|
|
110
110
|
title: /* @__PURE__ */ m(N, { children: [
|
|
111
111
|
/* @__PURE__ */ m(h, { align: "center", gap: 8, className: a("modal-title-wrapper"), children: [
|
|
112
112
|
/* @__PURE__ */ e(h.Child, { grow: !0, children: typeof u == "string" ? /* @__PURE__ */ e(ye, { children: u }) : u }),
|
|
113
|
-
/* @__PURE__ */ m(h.Child, { stack: !0, hug: !0, align: "center", children: [
|
|
113
|
+
/* @__PURE__ */ m(h.Child, { stack: !0, hug: !0, align: "center", gap: 8, children: [
|
|
114
114
|
D,
|
|
115
115
|
/* @__PURE__ */ e(
|
|
116
116
|
we,
|
|
@@ -148,7 +148,7 @@ const We = ({
|
|
|
148
148
|
cancelText: x,
|
|
149
149
|
okType: "primary",
|
|
150
150
|
confirmLoading: w,
|
|
151
|
-
footer: typeof
|
|
151
|
+
footer: typeof v > "u" ? z && k ? null : ce : v,
|
|
152
152
|
centered: K,
|
|
153
153
|
...Z,
|
|
154
154
|
children: j
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.js","sources":["../../../src/components/Modal/Modal.tsx"],"sourcesContent":["\"use client\";\nimport {\n default as AntModal,\n type ModalProps as AntModalProps,\n} from \"antd/es/modal\";\nimport { XIcon } from \"@bioturing/assets\";\nimport React, { useCallback, useEffect, useRef, useState } from \"react\";\nimport { useCls } from \"../utils\";\nimport { ModalContextProvider } from \"antd/es/modal/context\";\nimport NormalCancelBtn from \"antd/es/modal/components/NormalCancelBtn\";\nimport NormalOkBtn from \"antd/es/modal/components/NormalOkBtn\";\nimport { getConfirmLocale } from \"antd/es/modal/locale\";\nimport { useLocale } from \"antd/es/locale\";\nimport { IconButton } from \"../IconButton\";\nimport { ModalSize } from \"./constants\";\nimport { ModalType } from \"./functions\";\nimport { Truncate } from \"../Truncate\";\nimport { Stack } from \"../Stack\";\n\n// Define props interface extending Ant Design's ModalProps\nexport interface ModalProps extends Omit<AntModalProps, \"centered\"> {\n /**\n * Predefined sizes for the modal\n * - xsmall: 400px\n * - small: 520px\n * - medium: 640px (default)\n * - large: 840px\n * - xlarge: 1024px\n * - fullscreen: 100vw (takes full screen width with margins)\n * @default \"medium\" for default type, \"xsmall\" for other types\n */\n size?:\n | \"xsmall\"\n | \"small\"\n | \"medium\"\n | \"large\"\n | \"xlarge\"\n | \"xxlarge\"\n | \"fullscreen\";\n /**\n * Mark modal as loading\n * @default false\n */\n loading?: boolean;\n /**\n * Hide Ok button\n * @default false\n */\n hideOkButton?: boolean;\n /**\n * Hide Cancel button\n * @default false\n */\n hideCancelButton?: boolean;\n /**\n * Custom Content Padding\n * @default \"24px\"\n */\n contentPadding?: number | string | boolean;\n /**\n * Add more content below the title\n */\n afterTitle?: React.ReactNode;\n /**\n * Add more actions before close button\n */\n beforeCloseButton?: React.ReactNode;\n /**\n * Add more actions after close button\n */\n afterCloseButton?: React.ReactNode;\n /**\n * Set header and footer to fixed position\n * @default false\n */\n defaultFixedHeaderFooter?: boolean;\n /**\n * Centered Modal\n * @default true\n */\n centered?: boolean;\n /**\n * Modal type\n * @default \"default\"\n */\n type?: ModalType;\n /**\n * Default open state for uncontrolled modal\n * @default true\n */\n defaultOpen?: boolean;\n /**\n * Modal background\n * @default \"elevated\" if size smaller than \"medium\", otherwise \"container\"\n */\n background?: \"elevated\" | \"container\";\n /**\n * Modal old close callback\n * @deprecated use onCancel instead\n */\n onClose?: () => void;\n /**\n * Make modal body scrollable\n * @default true\n */\n bodyScrollable?: boolean;\n}\n\n// Create Modal component\nexport const Modal = ({\n open: externalOpen,\n closeIcon,\n children,\n size: sizeProp,\n footer,\n width,\n style,\n styles,\n classNames,\n okButtonProps,\n cancelButtonProps,\n loading,\n onOk,\n onCancel,\n okText,\n okType = \"primary\",\n confirmLoading,\n cancelText = \"Close\",\n hideOkButton = false,\n hideCancelButton = false,\n contentPadding,\n title,\n afterTitle,\n beforeCloseButton,\n afterCloseButton,\n defaultFixedHeaderFooter = false,\n centered = true,\n type = \"default\",\n defaultOpen = true,\n background: backgroundProp,\n bodyScrollable = true,\n ...rest\n}: ModalProps) => {\n // Default close icon with Phosphor icon\n const defaultCloseIcon =\n closeIcon === undefined ? <XIcon size={16} weight=\"bold\" /> : closeIcon;\n\n // Use custom width if provided, otherwise use the size from the map\n const defaultModalSize = type === \"default\" ? \"medium\" : \"xsmall\";\n\n const size: keyof typeof ModalSize = sizeProp || defaultModalSize;\n const modalWidth = width || ModalSize[size];\n\n const background =\n backgroundProp ||\n (size &&\n size in ModalSize &&\n parseInt(ModalSize[size]) <= parseInt(ModalSize.medium)\n ? \"elevated\"\n : \"container\");\n\n // Apply additional styles for fullscreen mode\n const modalStyle = {\n \"--ds-modal-bg\": `var(--ds-color-bg-${background})`,\n ...style,\n ...(size === \"fullscreen\"\n ? { top: 0, maxWidth: \"100%\", height: \"100%\" }\n : {}),\n };\n\n const modalStyles = {\n ...styles,\n body: {\n ...((typeof contentPadding != \"undefined\"\n ? {\n \"--ds-modal-content-padding\":\n contentPadding === false || contentPadding === 0\n ? \"0\"\n : typeof contentPadding == \"number\"\n ? `${contentPadding}px`\n : contentPadding,\n }\n : {}) as React.CSSProperties),\n ...styles?.body,\n },\n };\n\n const [isContentOverflow, setIsContentOverflow] = useState(false);\n\n const cls = useCls();\n\n const resizeObserverRef = useRef<ResizeObserver | null>(null);\n\n const modalInnerRef = useCallback(\n (node: HTMLElement | null) => {\n // If the node is null (component unmounting), just return\n if (!node) return;\n\n const modalBody = node.querySelector(\".\" + cls(\"modal-body\"));\n if (!(modalBody instanceof HTMLElement)) return;\n\n // Create ResizeObserver to detect overflow\n const resizeObserver = new ResizeObserver(() => {\n const hasOverflow = modalBody.scrollHeight > modalBody.clientHeight;\n setIsContentOverflow(hasOverflow);\n });\n\n // Store reference to the observer\n resizeObserverRef.current = resizeObserver;\n\n // Start observing\n resizeObserver.observe(modalBody);\n\n // Initial check\n const hasOverflow = modalBody.scrollHeight > modalBody.clientHeight;\n setIsContentOverflow(hasOverflow);\n },\n [cls]\n );\n\n // clean up resize observer\n useEffect(() => {\n return () => {\n if (resizeObserverRef.current) {\n resizeObserverRef.current.disconnect();\n resizeObserverRef.current = null;\n }\n };\n }, []);\n\n const [locale] = useLocale(\"Modal\", getConfirmLocale());\n\n const okTextLocale: React.ReactNode = okText || locale?.okText;\n const cancelTextLocale = cancelText || locale?.cancelText;\n\n const modalOkButtonProps = {\n loading: loading,\n ...okButtonProps,\n };\n\n const modalCancelButtonProps = {\n ...cancelButtonProps,\n };\n\n const [internalOpen, setInternalOpen] = useState(defaultOpen);\n\n const uncontrolledOpen = typeof externalOpen === \"undefined\";\n\n const open = uncontrolledOpen ? internalOpen : externalOpen;\n\n const defaultFooter = (\n <ModalContextProvider\n value={{\n okButtonProps: modalOkButtonProps,\n cancelButtonProps: modalCancelButtonProps,\n onCancel,\n onOk,\n okType,\n confirmLoading,\n okTextLocale,\n cancelTextLocale,\n }}\n >\n {hideOkButton ? (\n <NormalCancelBtn />\n ) : hideCancelButton ? (\n <NormalOkBtn />\n ) : (\n <>\n <NormalCancelBtn />\n <NormalOkBtn />\n </>\n )}\n </ModalContextProvider>\n );\n const renderTitle = () => {\n return (\n <>\n <Stack align=\"center\" gap={8} className={cls(\"modal-title-wrapper\")}>\n <Stack.Child grow>\n {typeof title === \"string\" ? <Truncate>{title}</Truncate> : title}\n </Stack.Child>\n <Stack.Child stack hug align=\"center\">\n {beforeCloseButton}\n <IconButton\n onClick={(e: React.MouseEvent<HTMLButtonElement>) =>\n onCancel?.(e)\n }\n >\n {defaultCloseIcon}\n </IconButton>\n {afterCloseButton}\n </Stack.Child>\n {}\n </Stack>\n {afterTitle ? afterTitle : null}\n </>\n );\n };\n return (\n <AntModal\n closeIcon={false}\n open={open}\n width={modalWidth}\n style={modalStyle}\n title={renderTitle()}\n classNames={{\n ...classNames,\n wrapper: cls(\n \"modal-wrap\",\n size == \"fullscreen\" && \"modal-fullscreen\",\n isContentOverflow && \"modal-content-overflow\",\n bodyScrollable === false && \"modal-no-body-scroll\",\n defaultFixedHeaderFooter || isContentOverflow || size == \"fullscreen\"\n ? \"modal-fixed\"\n : \"\"\n ),\n }}\n styles={modalStyles}\n modalRender={(modal) => (\n <div ref={modalInnerRef} className={cls(\"modal-inner\")}>\n {modal}\n </div>\n )}\n okButtonProps={modalOkButtonProps}\n cancelButtonProps={modalCancelButtonProps}\n onOk={(e) => {\n if (uncontrolledOpen) setInternalOpen(false);\n onOk?.(e);\n }}\n onCancel={(e) => {\n if (uncontrolledOpen) setInternalOpen(false);\n onCancel?.(e);\n }}\n okText={okText}\n cancelText={cancelText}\n okType=\"primary\"\n confirmLoading={confirmLoading}\n footer={\n typeof footer === \"undefined\"\n ? hideOkButton && hideCancelButton\n ? null\n : defaultFooter\n : footer\n }\n centered={centered}\n {...rest}\n >\n {children}\n </AntModal>\n );\n};\n"],"names":["Modal","externalOpen","closeIcon","children","sizeProp","footer","width","style","styles","classNames","okButtonProps","cancelButtonProps","loading","onOk","onCancel","okText","okType","confirmLoading","cancelText","hideOkButton","hideCancelButton","contentPadding","title","afterTitle","beforeCloseButton","afterCloseButton","defaultFixedHeaderFooter","centered","type","defaultOpen","backgroundProp","bodyScrollable","rest","defaultCloseIcon","jsx","XIcon","size","modalWidth","ModalSize","modalStyle","modalStyles","isContentOverflow","setIsContentOverflow","useState","cls","useCls","resizeObserverRef","useRef","modalInnerRef","useCallback","node","modalBody","resizeObserver","hasOverflow","useEffect","locale","useLocale","getConfirmLocale","okTextLocale","cancelTextLocale","modalOkButtonProps","modalCancelButtonProps","internalOpen","setInternalOpen","uncontrolledOpen","open","defaultFooter","ModalContextProvider","NormalCancelBtn","NormalOkBtn","jsxs","Fragment","AntModal","Stack","Truncate","IconButton","e","modal"],"mappings":";;;;;;;;;;;;;;AA6GO,MAAMA,KAAQ,CAAC;AAAA,EACpB,MAAMC;AAAA,EACN,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAMC;AAAA,EACN,QAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,YAAAC;AAAA,EACA,eAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,SAAAC;AAAA,EACA,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,QAAAC,IAAS;AAAA,EACT,gBAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,cAAAC,IAAe;AAAA,EACf,kBAAAC,IAAmB;AAAA,EACnB,gBAAAC;AAAA,EACA,OAAAC;AAAA,EACA,YAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,kBAA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,EAAK,GAC3ClD,KAAA,QAAAA,EAAW8D;AAAA,MACb;AAAA,MACA,QAAA7D;AAAA,MACA,YAAAG;AAAA,MACA,QAAO;AAAA,MACP,gBAAAD;AAAA,MACA,QACE,OAAOZ,IAAW,MACdc,KAAgBC,IACd,OACA8C,KACF7D;AAAA,MAEN,UAAAsB;AAAA,MACC,GAAGK;AAAA,MAEH,UAAA7B;AAAA,IAAA;AAAA,EACH;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"Modal.js","sources":["../../../src/components/Modal/Modal.tsx"],"sourcesContent":["\"use client\";\nimport {\n default as AntModal,\n type ModalProps as AntModalProps,\n} from \"antd/es/modal\";\nimport { XIcon } from \"@bioturing/assets\";\nimport React, { useCallback, useEffect, useRef, useState } from \"react\";\nimport { useCls } from \"../utils\";\nimport { ModalContextProvider } from \"antd/es/modal/context\";\nimport NormalCancelBtn from \"antd/es/modal/components/NormalCancelBtn\";\nimport NormalOkBtn from \"antd/es/modal/components/NormalOkBtn\";\nimport { getConfirmLocale } from \"antd/es/modal/locale\";\nimport { useLocale } from \"antd/es/locale\";\nimport { IconButton } from \"../IconButton\";\nimport { ModalSize } from \"./constants\";\nimport { ModalType } from \"./functions\";\nimport { Truncate } from \"../Truncate\";\nimport { Stack } from \"../Stack\";\n\n// Define props interface extending Ant Design's ModalProps\nexport interface ModalProps extends Omit<AntModalProps, \"centered\"> {\n /**\n * Predefined sizes for the modal\n * - xsmall: 400px\n * - small: 520px\n * - medium: 640px (default)\n * - large: 840px\n * - xlarge: 1024px\n * - fullscreen: 100vw (takes full screen width with margins)\n * @default \"medium\" for default type, \"xsmall\" for other types\n */\n size?:\n | \"xsmall\"\n | \"small\"\n | \"medium\"\n | \"large\"\n | \"xlarge\"\n | \"xxlarge\"\n | \"fullscreen\";\n /**\n * Mark modal as loading\n * @default false\n */\n loading?: boolean;\n /**\n * Hide Ok button\n * @default false\n */\n hideOkButton?: boolean;\n /**\n * Hide Cancel button\n * @default false\n */\n hideCancelButton?: boolean;\n /**\n * Custom Content Padding\n * @default \"24px\"\n */\n contentPadding?: number | string | boolean;\n /**\n * Add more content below the title\n */\n afterTitle?: React.ReactNode;\n /**\n * Add more actions before close button\n */\n beforeCloseButton?: React.ReactNode;\n /**\n * Add more actions after close button\n */\n afterCloseButton?: React.ReactNode;\n /**\n * Set header and footer to fixed position\n * @default false\n */\n defaultFixedHeaderFooter?: boolean;\n /**\n * Centered Modal\n * @default true\n */\n centered?: boolean;\n /**\n * Modal type\n * @default \"default\"\n */\n type?: ModalType;\n /**\n * Default open state for uncontrolled modal\n * @default true\n */\n defaultOpen?: boolean;\n /**\n * Modal background\n * @default \"elevated\" if size smaller than \"medium\", otherwise \"container\"\n */\n background?: \"elevated\" | \"container\";\n /**\n * Modal old close callback\n * @deprecated use onCancel instead\n */\n onClose?: () => void;\n /**\n * Make modal body scrollable\n * @default true\n */\n bodyScrollable?: boolean;\n}\n\n// Create Modal component\nexport const Modal = ({\n open: externalOpen,\n closeIcon,\n children,\n size: sizeProp,\n footer,\n width,\n style,\n styles,\n classNames,\n okButtonProps,\n cancelButtonProps,\n loading,\n onOk,\n onCancel,\n okText,\n okType = \"primary\",\n confirmLoading,\n cancelText = \"Close\",\n hideOkButton = false,\n hideCancelButton = false,\n contentPadding,\n title,\n afterTitle,\n beforeCloseButton,\n afterCloseButton,\n defaultFixedHeaderFooter = false,\n centered = true,\n type = \"default\",\n defaultOpen = true,\n background: backgroundProp,\n bodyScrollable = true,\n ...rest\n}: ModalProps) => {\n // Default close icon with Phosphor icon\n const defaultCloseIcon =\n closeIcon === undefined ? <XIcon size={16} weight=\"bold\" /> : closeIcon;\n\n // Use custom width if provided, otherwise use the size from the map\n const defaultModalSize = type === \"default\" ? \"medium\" : \"xsmall\";\n\n const size: keyof typeof ModalSize = sizeProp || defaultModalSize;\n const modalWidth = width || ModalSize[size];\n\n const background =\n backgroundProp ||\n (size &&\n size in ModalSize &&\n parseInt(ModalSize[size]) <= parseInt(ModalSize.medium)\n ? \"elevated\"\n : \"container\");\n\n // Apply additional styles for fullscreen mode\n const modalStyle = {\n \"--ds-modal-bg\": `var(--ds-color-bg-${background})`,\n ...style,\n ...(size === \"fullscreen\"\n ? { top: 0, maxWidth: \"100%\", height: \"100%\" }\n : {}),\n };\n\n const modalStyles = {\n ...styles,\n body: {\n ...((typeof contentPadding != \"undefined\"\n ? {\n \"--ds-modal-content-padding\":\n contentPadding === false || contentPadding === 0\n ? \"0\"\n : typeof contentPadding == \"number\"\n ? `${contentPadding}px`\n : contentPadding,\n }\n : {}) as React.CSSProperties),\n ...styles?.body,\n },\n };\n\n const [isContentOverflow, setIsContentOverflow] = useState(false);\n\n const cls = useCls();\n\n const resizeObserverRef = useRef<ResizeObserver | null>(null);\n\n const modalInnerRef = useCallback(\n (node: HTMLElement | null) => {\n // If the node is null (component unmounting), just return\n if (!node) return;\n\n const modalBody = node.querySelector(\".\" + cls(\"modal-body\"));\n if (!(modalBody instanceof HTMLElement)) return;\n\n // Create ResizeObserver to detect overflow\n const resizeObserver = new ResizeObserver(() => {\n const hasOverflow = modalBody.scrollHeight > modalBody.clientHeight;\n setIsContentOverflow(hasOverflow);\n });\n\n // Store reference to the observer\n resizeObserverRef.current = resizeObserver;\n\n // Start observing\n resizeObserver.observe(modalBody);\n\n // Initial check\n const hasOverflow = modalBody.scrollHeight > modalBody.clientHeight;\n setIsContentOverflow(hasOverflow);\n },\n [cls]\n );\n\n // clean up resize observer\n useEffect(() => {\n return () => {\n if (resizeObserverRef.current) {\n resizeObserverRef.current.disconnect();\n resizeObserverRef.current = null;\n }\n };\n }, []);\n\n const [locale] = useLocale(\"Modal\", getConfirmLocale());\n\n const okTextLocale: React.ReactNode = okText || locale?.okText;\n const cancelTextLocale = cancelText || locale?.cancelText;\n\n const modalOkButtonProps = {\n loading: loading,\n ...okButtonProps,\n };\n\n const modalCancelButtonProps = {\n ...cancelButtonProps,\n };\n\n const [internalOpen, setInternalOpen] = useState(defaultOpen);\n\n const uncontrolledOpen = typeof externalOpen === \"undefined\";\n\n const open = uncontrolledOpen ? internalOpen : externalOpen;\n\n const defaultFooter = (\n <ModalContextProvider\n value={{\n okButtonProps: modalOkButtonProps,\n cancelButtonProps: modalCancelButtonProps,\n onCancel,\n onOk,\n okType,\n confirmLoading,\n okTextLocale,\n cancelTextLocale,\n }}\n >\n {hideOkButton ? (\n <NormalCancelBtn />\n ) : hideCancelButton ? (\n <NormalOkBtn />\n ) : (\n <>\n <NormalCancelBtn />\n <NormalOkBtn />\n </>\n )}\n </ModalContextProvider>\n );\n const renderTitle = () => {\n return (\n <>\n <Stack align=\"center\" gap={8} className={cls(\"modal-title-wrapper\")}>\n <Stack.Child grow>\n {typeof title === \"string\" ? <Truncate>{title}</Truncate> : title}\n </Stack.Child>\n <Stack.Child stack hug align=\"center\" gap={8}>\n {beforeCloseButton}\n <IconButton\n onClick={(e: React.MouseEvent<HTMLButtonElement>) =>\n onCancel?.(e)\n }\n >\n {defaultCloseIcon}\n </IconButton>\n {afterCloseButton}\n </Stack.Child>\n {}\n </Stack>\n {afterTitle ? afterTitle : null}\n </>\n );\n };\n return (\n <AntModal\n closeIcon={false}\n open={open}\n width={modalWidth}\n style={modalStyle}\n title={renderTitle()}\n classNames={{\n ...classNames,\n wrapper: cls(\n \"modal-wrap\",\n size == \"fullscreen\" && \"modal-fullscreen\",\n isContentOverflow && \"modal-content-overflow\",\n bodyScrollable === false && \"modal-no-body-scroll\",\n defaultFixedHeaderFooter || isContentOverflow || size == \"fullscreen\"\n ? \"modal-fixed\"\n : \"\"\n ),\n }}\n styles={modalStyles}\n modalRender={(modal) => (\n <div ref={modalInnerRef} className={cls(\"modal-inner\")}>\n {modal}\n </div>\n )}\n okButtonProps={modalOkButtonProps}\n cancelButtonProps={modalCancelButtonProps}\n onOk={(e) => {\n if (uncontrolledOpen) setInternalOpen(false);\n onOk?.(e);\n }}\n onCancel={(e) => {\n if (uncontrolledOpen) setInternalOpen(false);\n onCancel?.(e);\n }}\n okText={okText}\n cancelText={cancelText}\n okType=\"primary\"\n confirmLoading={confirmLoading}\n footer={\n typeof footer === \"undefined\"\n ? hideOkButton && hideCancelButton\n ? null\n : defaultFooter\n : footer\n }\n centered={centered}\n {...rest}\n >\n {children}\n </AntModal>\n );\n};\n"],"names":["Modal","externalOpen","closeIcon","children","sizeProp","footer","width","style","styles","classNames","okButtonProps","cancelButtonProps","loading","onOk","onCancel","okText","okType","confirmLoading","cancelText","hideOkButton","hideCancelButton","contentPadding","title","afterTitle","beforeCloseButton","afterCloseButton","defaultFixedHeaderFooter","centered","type","defaultOpen","backgroundProp","bodyScrollable","rest","defaultCloseIcon","jsx","XIcon","size","modalWidth","ModalSize","modalStyle","modalStyles","isContentOverflow","setIsContentOverflow","useState","cls","useCls","resizeObserverRef","useRef","modalInnerRef","useCallback","node","modalBody","resizeObserver","hasOverflow","useEffect","locale","useLocale","getConfirmLocale","okTextLocale","cancelTextLocale","modalOkButtonProps","modalCancelButtonProps","internalOpen","setInternalOpen","uncontrolledOpen","open","defaultFooter","ModalContextProvider","NormalCancelBtn","NormalOkBtn","jsxs","Fragment","AntModal","Stack","Truncate","IconButton","e","modal"],"mappings":";;;;;;;;;;;;;;AA6GO,MAAMA,KAAQ,CAAC;AAAA,EACpB,MAAMC;AAAA,EACN,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAMC;AAAA,EACN,QAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,YAAAC;AAAA,EACA,eAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,SAAAC;AAAA,EACA,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,QAAAC,IAAS;AAAA,EACT,gBAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,cAAAC,IAAe;AAAA,EACf,kBAAAC,IAAmB;AAAA,EACnB,gBAAAC;AAAA,EACA,OAAAC;AAAA,EACA,YAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,kBAA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AZ,OAAkC,EAAK,GAC3ClD,KAAA,QAAAA,EAAW8D;AAAA,MACb;AAAA,MACA,QAAA7D;AAAA,MACA,YAAAG;AAAA,MACA,QAAO;AAAA,MACP,gBAAAD;AAAA,MACA,QACE,OAAOZ,IAAW,MACdc,KAAgBC,IACd,OACA8C,KACF7D;AAAA,MAEN,UAAAsB;AAAA,MACC,GAAGK;AAAA,MAEH,UAAA7B;AAAA,IAAA;AAAA,EACH;AAEJ;"}
|
|
@@ -1,100 +1,108 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { FunnelIcon as
|
|
4
|
-
import { Empty as
|
|
5
|
-
import { forwardRef as
|
|
1
|
+
import { jsx as t, jsxs as j, Fragment as x } from "react/jsx-runtime";
|
|
2
|
+
import o from "antd/es/table";
|
|
3
|
+
import { FunnelIcon as A, CaretUpIcon as g, CaretDownIcon as L } from "@bioturing/assets";
|
|
4
|
+
import { Empty as U } from "../Empty/component.js";
|
|
5
|
+
import { forwardRef as H, useState as M, useRef as R, useEffect as D, useCallback as P } from "react";
|
|
6
6
|
import './style.css';/* empty css */
|
|
7
|
-
import { useCls as
|
|
8
|
-
const
|
|
9
|
-
columns:
|
|
10
|
-
locale:
|
|
11
|
-
emptyDescription:
|
|
12
|
-
loading:
|
|
13
|
-
virtual:
|
|
14
|
-
scroll:
|
|
15
|
-
...
|
|
7
|
+
import { useCls as $ } from "../utils/antdUtils.js";
|
|
8
|
+
const k = ({
|
|
9
|
+
columns: N,
|
|
10
|
+
locale: S,
|
|
11
|
+
emptyDescription: T,
|
|
12
|
+
loading: c,
|
|
13
|
+
virtual: s,
|
|
14
|
+
scroll: d = {},
|
|
15
|
+
...y
|
|
16
16
|
}, r) => {
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
x: "fit-content"
|
|
20
|
-
y: "fit-content"
|
|
17
|
+
const i = $(), [O, b] = M(
|
|
18
|
+
s ? {} : {
|
|
19
|
+
x: "fit-content"
|
|
21
20
|
}
|
|
22
|
-
),
|
|
23
|
-
|
|
24
|
-
var
|
|
25
|
-
if (!
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
21
|
+
), a = R(null);
|
|
22
|
+
D(() => {
|
|
23
|
+
var I;
|
|
24
|
+
if (!a.current || !s) return;
|
|
25
|
+
const e = (I = a.current) == null ? void 0 : I.nativeElement, n = e == null ? void 0 : e.parentElement;
|
|
26
|
+
if (!n) return;
|
|
27
|
+
const l = e == null ? void 0 : e.querySelector(
|
|
28
|
+
`.${i("table-thead")}`
|
|
29
|
+
), m = e == null ? void 0 : e.querySelector(
|
|
30
|
+
`.${i("table-pagination")}`
|
|
31
|
+
);
|
|
32
|
+
let C = 0;
|
|
33
|
+
if (m) {
|
|
34
|
+
const p = getComputedStyle(m).marginTop, u = getComputedStyle(m).marginBottom;
|
|
35
|
+
C = m.offsetHeight + parseInt(p) + parseInt(u);
|
|
36
|
+
}
|
|
37
|
+
const E = new ResizeObserver((p) => {
|
|
38
|
+
for (const u of p)
|
|
39
|
+
u.target && b({
|
|
40
|
+
y: n.offsetHeight - (l ? l == null ? void 0 : l.offsetHeight : 0) - C
|
|
33
41
|
});
|
|
34
42
|
});
|
|
35
|
-
return n &&
|
|
36
|
-
n &&
|
|
43
|
+
return n && s && E.observe(n), () => {
|
|
44
|
+
n && s && E.disconnect();
|
|
37
45
|
};
|
|
38
|
-
}, [
|
|
39
|
-
const
|
|
40
|
-
sortIcon: ({ sortOrder:
|
|
46
|
+
}, [s, i]);
|
|
47
|
+
const h = N ? N.map((e) => ({
|
|
48
|
+
sortIcon: ({ sortOrder: n }) => /* @__PURE__ */ t(
|
|
41
49
|
"span",
|
|
42
50
|
{
|
|
43
|
-
className:
|
|
51
|
+
className: i(
|
|
44
52
|
"table-column-sort-icon",
|
|
45
|
-
|
|
53
|
+
n ? `table-column-sort-icon-${n}` : "table-column-sort-icon-none"
|
|
46
54
|
),
|
|
47
|
-
children:
|
|
48
|
-
/* @__PURE__ */
|
|
55
|
+
children: n ? n === "ascend" ? /* @__PURE__ */ t(g, { weight: "fill" }) : /* @__PURE__ */ t(L, { weight: "fill" }) : /* @__PURE__ */ j(x, { children: [
|
|
56
|
+
/* @__PURE__ */ t(g, { weight: "fill" }),
|
|
49
57
|
" ",
|
|
50
|
-
/* @__PURE__ */
|
|
58
|
+
/* @__PURE__ */ t(L, { weight: "fill" })
|
|
51
59
|
] })
|
|
52
60
|
}
|
|
53
61
|
),
|
|
54
|
-
filterIcon: (
|
|
55
|
-
...
|
|
56
|
-
})) : void 0,
|
|
57
|
-
emptyText: /* @__PURE__ */
|
|
58
|
-
...
|
|
62
|
+
filterIcon: (n) => /* @__PURE__ */ t("span", { className: i("table-column-filter-icon"), children: /* @__PURE__ */ t(A, { weight: "fill" }) }),
|
|
63
|
+
...e
|
|
64
|
+
})) : void 0, _ = {
|
|
65
|
+
emptyText: /* @__PURE__ */ t(U, { description: T }),
|
|
66
|
+
...S
|
|
59
67
|
};
|
|
60
|
-
let
|
|
61
|
-
typeof
|
|
62
|
-
spinning:
|
|
63
|
-
indicator: /* @__PURE__ */
|
|
64
|
-
} : typeof
|
|
68
|
+
let f;
|
|
69
|
+
typeof c == "boolean" ? f = {
|
|
70
|
+
spinning: c,
|
|
71
|
+
indicator: /* @__PURE__ */ t("span", { className: i("spin-loader") })
|
|
72
|
+
} : typeof c == "object" && (f = {
|
|
65
73
|
spinning: !0,
|
|
66
|
-
indicator: /* @__PURE__ */
|
|
67
|
-
...
|
|
74
|
+
indicator: /* @__PURE__ */ t("span", { className: i("spin-loader") }),
|
|
75
|
+
...c
|
|
68
76
|
});
|
|
69
|
-
const
|
|
70
|
-
(
|
|
71
|
-
|
|
77
|
+
const w = P(
|
|
78
|
+
(e) => {
|
|
79
|
+
e && (typeof r == "function" && r(e), r && typeof r == "object" && "current" in r && (r.current = e), a.current = e);
|
|
72
80
|
},
|
|
73
81
|
[r]
|
|
74
82
|
);
|
|
75
|
-
return /* @__PURE__ */
|
|
76
|
-
|
|
83
|
+
return /* @__PURE__ */ t(
|
|
84
|
+
o,
|
|
77
85
|
{
|
|
78
|
-
ref:
|
|
79
|
-
columns:
|
|
80
|
-
loading:
|
|
81
|
-
locale:
|
|
82
|
-
virtual:
|
|
83
|
-
scroll: { ...
|
|
84
|
-
...
|
|
86
|
+
ref: w,
|
|
87
|
+
columns: h,
|
|
88
|
+
loading: f,
|
|
89
|
+
locale: _,
|
|
90
|
+
virtual: s,
|
|
91
|
+
scroll: { ...O, ...d },
|
|
92
|
+
...y
|
|
85
93
|
}
|
|
86
94
|
);
|
|
87
|
-
},
|
|
88
|
-
Column:
|
|
89
|
-
ColumnGroup:
|
|
90
|
-
SELECTION_COLUMN:
|
|
91
|
-
EXPAND_COLUMN:
|
|
92
|
-
SELECTION_ALL:
|
|
93
|
-
SELECTION_INVERT:
|
|
94
|
-
SELECTION_NONE:
|
|
95
|
-
Summary:
|
|
95
|
+
}, q = H(k), J = Object.assign(q, {
|
|
96
|
+
Column: o.Column,
|
|
97
|
+
ColumnGroup: o.ColumnGroup,
|
|
98
|
+
SELECTION_COLUMN: o.SELECTION_COLUMN,
|
|
99
|
+
EXPAND_COLUMN: o.EXPAND_COLUMN,
|
|
100
|
+
SELECTION_ALL: o.SELECTION_ALL,
|
|
101
|
+
SELECTION_INVERT: o.SELECTION_INVERT,
|
|
102
|
+
SELECTION_NONE: o.SELECTION_NONE,
|
|
103
|
+
Summary: o.Summary
|
|
96
104
|
});
|
|
97
105
|
export {
|
|
98
|
-
|
|
106
|
+
J as Table
|
|
99
107
|
};
|
|
100
108
|
//# 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
|
|
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 let tpaginationHeight = 0;\n if (tpagination) {\n const mt = getComputedStyle(tpagination).marginTop;\n const mb = getComputedStyle(tpagination).marginBottom;\n tpaginationHeight =\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 tpaginationHeight,\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 {...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","rest","ref","cls","useCls","scroll","setScroll","useState","innerRef","useRef","useEffect","tableEl","_a","parentEl","thead","tpagination","tpaginationHeight","mt","mb","resizeObserver","entries","entry","modifiedColumns","column","sortOrder","jsx","CaretUpIcon","CaretDownIcon","jsxs","Fragment","_filtered","FunnelIcon","modifiedLocale","Empty","spinProps","callbackRef","useCallback","tableRef","AntTable","InternalTable","forwardRef","Table"],"mappings":";;;;;;;AAsCA,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,GAAGC;AACL,GACAC,MACG;AACH,QAAMC,IAAMC,EAAO,GACb,CAACC,GAAQC,CAAS,IAAIC;AAAA,IAC1BR,IACI,CAAA,IACA;AAAA,MACE,GAAG;AAAA,IAAA;AAAA,EAEX,GAEMS,IAAWC,EAAiB,IAAI;AAEtC,EAAAC,EAAU,MAAM;;AACd,QAAI,CAACF,EAAS,WAAW,CAACT,EAAS;AAC7B,UAAAY,KAAUC,IAAAJ,EAAS,YAAT,gBAAAI,EAAkB,eAC5BC,IAAWF,KAAA,gBAAAA,EAAS;AAC1B,QAAI,CAACE,EAAU;AACf,UAAMC,IAAQH,KAAA,gBAAAA,EAAS;AAAA,MACrB,IAAIR,EAAI,aAAa,CAAC;AAAA,OAElBY,IAAcJ,KAAA,gBAAAA,EAAS;AAAA,MAC3B,IAAIR,EAAI,kBAAkB,CAAC;AAAA;AAE7B,QAAIa,IAAoB;AACxB,QAAID,GAAa;AACT,YAAAE,IAAK,iBAAiBF,CAAW,EAAE,WACnCG,IAAK,iBAAiBH,CAAW,EAAE;AACzC,MAAAC,IACED,EAAY,eAAe,SAASE,CAAE,IAAI,SAASC,CAAE;AAAA,IAAA;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,MAAAsC;AACA,EAAA,OAAOpC,KAAY,YACToC,IAAA;AAAA,IACV,UAAUpC;AAAA,IACV,WAAY,gBAAA2B,EAAA,QAAA,EAAK,WAAWtB,EAAI,aAAa,EAAG,CAAA;AAAA,EAClD,IACS,OAAOL,KAAY,aAChBoC,IAAA;AAAA,IACV,UAAU;AAAA,IACV,WAAY,gBAAAT,EAAA,QAAA,EAAK,WAAWtB,EAAI,aAAa,GAAG;AAAA,IAChD,GAAGL;AAAA,EACL;AAEF,QAAMqC,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,SAAAjC;AAAA,MACA,QAAQ,EAAE,GAAGM,GAAQ,GAAGL,EAAW;AAAA,MAClC,GAAGC;AAAA,IAAA;AAAA,EACN;AAEJ,GAEMsC,IAAgBC,EAAW9C,CAAkB,GAOtC+C,IAAQ,OAAO,OAAOF,GAAe;AAAA,EAChD,QAAQD,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
|
-
{"version":3,"file":"component.js","sources":["../../../src/components/Tag/component.tsx"],"sourcesContent":["\"use client\";\nimport { X } from \"@bioturing/assets\";\nimport {
|
|
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 +1 @@
|
|
|
1
|
-
@layer components{.ds-truncate{white-space:nowrap;overflow:hidden;
|
|
1
|
+
@layer components{.ds-truncate{white-space:nowrap;overflow:hidden;flex-grow:1;min-width:0;max-width:100%;display:block}.ds-truncate-end{text-overflow:ellipsis}.ds-truncate-middle{text-overflow:clip}.ds-truncate-multiline{display:-webkit-box;-webkit-line-clamp:var(--ds-line-clamp, 2);line-clamp:var(--ds-line-clamp, 2);-webkit-box-orient:vertical;overflow:hidden;white-space:normal;text-overflow:ellipsis;word-break:break-word}}
|
package/dist/index.d.ts
CHANGED
|
@@ -44,9 +44,8 @@ import { CheckboxOptionType } from 'antd';
|
|
|
44
44
|
import { CheckboxProps as CheckboxProps_2 } from 'antd';
|
|
45
45
|
import { CheckboxRef } from 'antd';
|
|
46
46
|
import { Col } from 'antd';
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import { CollapseProps } from 'antd';
|
|
47
|
+
import { CollapsePanelProps as CollapsePanelProps_2 } from 'antd';
|
|
48
|
+
import { CollapseProps as CollapseProps_2 } from 'antd';
|
|
50
49
|
import { ColorPicker } from 'antd';
|
|
51
50
|
import { ColorPickerProps } from 'antd';
|
|
52
51
|
import { ColProps } from 'antd';
|
|
@@ -199,14 +198,12 @@ import { TableColumnProps } from 'antd';
|
|
|
199
198
|
import { TableColumnsType } from 'antd';
|
|
200
199
|
import { TableColumnType } from 'antd';
|
|
201
200
|
import { TablePaginationConfig } from 'antd';
|
|
202
|
-
import { TableProps } from 'antd';
|
|
203
|
-
import { TableProps as TableProps_3 } from 'antd/es/table';
|
|
201
|
+
import { TableProps as TableProps_2 } from 'antd/es/table';
|
|
204
202
|
import { TableRef } from 'antd/es/table';
|
|
205
203
|
import { TabPaneProps } from 'antd';
|
|
206
204
|
import { Tabs } from 'antd';
|
|
207
205
|
import { TabsProps } from 'antd';
|
|
208
|
-
import { TagProps } from 'antd';
|
|
209
|
-
import { TagProps as TagProps_3 } from 'antd/es/tag';
|
|
206
|
+
import { TagProps as TagProps_2 } from 'antd/es/tag';
|
|
210
207
|
import { TagType } from 'antd';
|
|
211
208
|
import { TextAreaProps as TextAreaProps_2 } from 'antd/es/input';
|
|
212
209
|
import { Theme } from '@ant-design/cssinjs';
|
|
@@ -475,11 +472,19 @@ export declare interface CodeOption {
|
|
|
475
472
|
|
|
476
473
|
export { Col }
|
|
477
474
|
|
|
478
|
-
export
|
|
475
|
+
export declare const Collapse: ((props: CollapseProps & {
|
|
476
|
+
ref?: React.ForwardedRef<HTMLDivElement>;
|
|
477
|
+
}) => ReturnType<typeof CollapseInner>) & {
|
|
478
|
+
Panel: (props: CollapsePanelProps) => JSX.Element;
|
|
479
|
+
};
|
|
480
|
+
|
|
481
|
+
declare const CollapseInner: (props: CollapseProps, ref: ForwardedRef<HTMLDivElement>) => JSX.Element;
|
|
479
482
|
|
|
480
|
-
export
|
|
483
|
+
export declare interface CollapsePanelProps extends CollapsePanelProps_2 {
|
|
484
|
+
}
|
|
481
485
|
|
|
482
|
-
export
|
|
486
|
+
export declare interface CollapseProps extends CollapseProps_2 {
|
|
487
|
+
}
|
|
483
488
|
|
|
484
489
|
export { ColorPicker }
|
|
485
490
|
|
|
@@ -1109,7 +1114,7 @@ declare type IconButtonOwnProps<E extends ElementType = ElementType> = WithHrefP
|
|
|
1109
1114
|
|
|
1110
1115
|
export declare type IconButtonProps<E extends ElementType = "button"> = IconButtonOwnProps<E> & Omit<ComponentPropsWithoutRef<E>, keyof IconButtonOwnProps<E>>;
|
|
1111
1116
|
|
|
1112
|
-
declare const InnerInternalTable: <RecordType extends object = object>({ columns, locale, emptyDescription, loading, virtual, scroll: scrollProp, ...rest }:
|
|
1117
|
+
declare const InnerInternalTable: <RecordType extends object = object>({ columns, locale, emptyDescription, loading, virtual, scroll: scrollProp, ...rest }: TableProps<RecordType>, ref: Ref<TableRef>) => JSX.Element;
|
|
1113
1118
|
|
|
1114
1119
|
declare function InnerToast({ toast, }: {
|
|
1115
1120
|
toast: Toast_2.Root.ToastObject<ToastData>;
|
|
@@ -1144,7 +1149,7 @@ export declare interface InputProps extends InputProps_2 {
|
|
|
1144
1149
|
declare interface InternalFormProps<Values = any> extends React_2.ComponentProps<typeof default_8<Values>> {
|
|
1145
1150
|
}
|
|
1146
1151
|
|
|
1147
|
-
declare const InternalTable: <RecordType extends object = object>(props:
|
|
1152
|
+
declare const InternalTable: <RecordType extends object = object>(props: TableProps<RecordType> & {
|
|
1148
1153
|
ref?: ForwardedRef<TableRef>;
|
|
1149
1154
|
}) => ReturnType<typeof InnerInternalTable>;
|
|
1150
1155
|
|
|
@@ -2161,9 +2166,7 @@ export { TableColumnType }
|
|
|
2161
2166
|
|
|
2162
2167
|
export { TablePaginationConfig }
|
|
2163
2168
|
|
|
2164
|
-
export
|
|
2165
|
-
|
|
2166
|
-
declare interface TableProps_2<RecordType extends object = object> extends TableProps_3<RecordType> {
|
|
2169
|
+
export declare interface TableProps<RecordType extends object = object> extends TableProps_2<RecordType> {
|
|
2167
2170
|
/**
|
|
2168
2171
|
* Add empty description for the table
|
|
2169
2172
|
*/
|
|
@@ -2180,13 +2183,11 @@ export { Tabs }
|
|
|
2180
2183
|
|
|
2181
2184
|
export { TabsProps }
|
|
2182
2185
|
|
|
2183
|
-
export declare const Tag: (({ className, active, color, style, closeIcon, closable, ...rest }:
|
|
2186
|
+
export declare const Tag: (({ className, active, color, style, closeIcon, closable, ...rest }: TagProps) => JSX.Element) & {
|
|
2184
2187
|
CheckableTag: ForwardRefExoticComponent<CheckableTagProps & RefAttributes<HTMLSpanElement>>;
|
|
2185
2188
|
};
|
|
2186
2189
|
|
|
2187
|
-
export
|
|
2188
|
-
|
|
2189
|
-
declare interface TagProps_2 extends TagProps_3 {
|
|
2190
|
+
export declare interface TagProps extends TagProps_2 {
|
|
2190
2191
|
/**
|
|
2191
2192
|
* Indicates if the tag is active
|
|
2192
2193
|
* @default false
|
package/dist/index.js
CHANGED
|
@@ -1,59 +1,60 @@
|
|
|
1
1
|
import { componentMetadata as r, getComponentsByCategory as t } from "./metadata.js";
|
|
2
|
-
import { Affix as p, Alert as m, Anchor as s, App as f, AutoComplete as n, Avatar as x, BackTop as l, Calendar as i, Card as c, Carousel as u, Cascader as d, Col as C,
|
|
3
|
-
import { Select as
|
|
4
|
-
import { Modal as
|
|
5
|
-
import { IconButton as
|
|
6
|
-
import { Switch as
|
|
7
|
-
import { Checkbox as
|
|
8
|
-
import { Segmented as
|
|
9
|
-
import { Table as
|
|
10
|
-
import { Tag as
|
|
11
|
-
import { ThemeProvider as
|
|
12
|
-
import { Split as
|
|
13
|
-
import { Truncate as
|
|
14
|
-
import { DropdownMenu as
|
|
15
|
-
import { clsx as
|
|
16
|
-
import { reactNodeToString as
|
|
17
|
-
import { isTracebackError as
|
|
18
|
-
import { parseAntdPlacement as
|
|
19
|
-
import { WithAntdTokens as
|
|
20
|
-
import { Transition as
|
|
21
|
-
import { DefaultUpload as
|
|
22
|
-
import { useUploadItemRender as
|
|
23
|
-
import { ScrollArea as
|
|
24
|
-
import { Popover as
|
|
25
|
-
import { Slider as
|
|
26
|
-
import { Tooltip as
|
|
27
|
-
import { Breadcrumb as
|
|
28
|
-
import { useUniqueKeysTree as
|
|
29
|
-
import { getUniqueKeysFromOriginals as
|
|
30
|
-
import { Tree as
|
|
31
|
-
import { Spin as
|
|
32
|
-
import { Empty as
|
|
33
|
-
import { Form as
|
|
34
|
-
import { Field as
|
|
35
|
-
import { Tour as
|
|
36
|
-
import { Toast as
|
|
37
|
-
import { toast as
|
|
38
|
-
import { VerticalCollapsiblePanel as
|
|
39
|
-
import { PopupPanel as
|
|
40
|
-
import { CodeBlock as
|
|
41
|
-
import { StackChild as
|
|
42
|
-
import { Stack as
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
2
|
+
import { Affix as p, Alert as m, Anchor as s, App as f, AutoComplete as n, Avatar as x, BackTop as l, Calendar as i, Card as c, Carousel as u, Cascader as d, Col as C, ColorPicker as T, ConfigProvider as h, DatePicker as k, Descriptions as g, Divider as S, Drawer as P, Dropdown as A, Flex as y, FloatButton as b, Grid as B, InputNumber as D, Layout as R, List as M, Mentions as v, Menu as F, Pagination as w, Popconfirm as E, Progress as I, QRCode as U, Rate as K, Result as L, Row as W, Skeleton as q, Space as G, Statistic as N, Steps as V, Tabs as O, TimePicker as Q, Timeline as j, Transfer as z, TreeSelect as H, Typography as J, Watermark as X, message as Y, notification as Z, theme as _, unstableSetRender as $, version as oo } from "antd";
|
|
3
|
+
import { Select as ro } from "./components/Select/component.js";
|
|
4
|
+
import { Modal as ao } from "./components/Modal/index.js";
|
|
5
|
+
import { IconButton as mo } from "./components/IconButton/component.js";
|
|
6
|
+
import { Switch as fo } from "./components/Switch/component.js";
|
|
7
|
+
import { Checkbox as xo } from "./components/Checkbox/component.js";
|
|
8
|
+
import { Segmented as io } from "./components/Segmented/component.js";
|
|
9
|
+
import { Table as uo } from "./components/Table/component.js";
|
|
10
|
+
import { Tag as To } from "./components/Tag/component.js";
|
|
11
|
+
import { ThemeProvider as ko } from "./components/ThemeProvider/component.js";
|
|
12
|
+
import { Split as So, Splitter as Po } from "./components/Splitter/component.js";
|
|
13
|
+
import { Truncate as yo } from "./components/Truncate/component.js";
|
|
14
|
+
import { DropdownMenu as Bo } from "./components/DropdownMenu/component.js";
|
|
15
|
+
import { clsx as Ro, cn as Mo, cx as vo } from "./components/utils/cn.js";
|
|
16
|
+
import { reactNodeToString as wo } from "./components/utils/reactToString.js";
|
|
17
|
+
import { isTracebackError as Io } from "./components/utils/isTracebackError.js";
|
|
18
|
+
import { parseAntdPlacement as Ko, useAntdCssVarClassname as Lo, useCls as Wo, useGetPrefixCls as qo } from "./components/utils/antdUtils.js";
|
|
19
|
+
import { WithAntdTokens as No } from "./components/utils/WithAntdTokens.js";
|
|
20
|
+
import { Transition as Oo } from "./components/Transition/component.js";
|
|
21
|
+
import { DefaultUpload as jo, Upload as zo } from "./components/Upload/component.js";
|
|
22
|
+
import { useUploadItemRender as Jo } from "./components/Upload/hooks.js";
|
|
23
|
+
import { ScrollArea as Yo } from "./components/ScrollArea/component.js";
|
|
24
|
+
import { Popover as _o } from "./components/Popover/component.js";
|
|
25
|
+
import { Slider as oe } from "./components/Slider/component.js";
|
|
26
|
+
import { Tooltip as re } from "./components/Tooltip/component.js";
|
|
27
|
+
import { Breadcrumb as ae } from "./components/Breadcrumb/component.js";
|
|
28
|
+
import { useUniqueKeysTree as me } from "./components/Tree/useUniqueKeysTree.js";
|
|
29
|
+
import { getUniqueKeysFromOriginals as fe, processTreeData as ne } from "./components/Tree/helpers.js";
|
|
30
|
+
import { Tree as le } from "./components/Tree/components.js";
|
|
31
|
+
import { Spin as ce } from "./components/Spin/component.js";
|
|
32
|
+
import { Empty as de, EmptyIcon as Ce } from "./components/Empty/component.js";
|
|
33
|
+
import { Form as he } from "./components/Form/component.js";
|
|
34
|
+
import { Field as ge } from "./components/Field/component.js";
|
|
35
|
+
import { Tour as Pe } from "./components/Tour/component.js";
|
|
36
|
+
import { Toast as ye } from "./components/Toast/component.js";
|
|
37
|
+
import { toast as Be, toastManager as De } from "./components/Toast/function.js";
|
|
38
|
+
import { VerticalCollapsiblePanel as Me } from "./components/VerticalCollapsiblePanel/component.js";
|
|
39
|
+
import { PopupPanel as Fe } from "./components/PopupPanel/component.js";
|
|
40
|
+
import { CodeBlock as Ee } from "./components/CodeBlock/component.js";
|
|
41
|
+
import { StackChild as Ue } from "./components/Stack/StackChild.js";
|
|
42
|
+
import { Stack as Le } from "./components/Stack/index.js";
|
|
43
|
+
import { Collapse as qe } from "./components/Collapse/component.js";
|
|
44
|
+
import { Input as Ne } from "./components/Input/component.js";
|
|
45
|
+
import { Badge as Oe } from "./components/Badge/component.js";
|
|
46
|
+
import { Radio as je } from "./components/Radio/component.js";
|
|
47
|
+
import { Button as He } from "./components/Button/component.js";
|
|
48
|
+
import { DSRoot as Xe } from "./components/DSRoot/component.js";
|
|
49
|
+
import { useForm as Ze, useWatch as _e } from "antd/es/form/Form";
|
|
50
|
+
import { useBreakpoint as or, useMessage as er, useModal as rr, useToken as tr } from "./components/hooks/antd.js";
|
|
51
|
+
import { default as pr } from "antd/es/app/useApp";
|
|
52
|
+
import { useAnimationsFinished as sr, useEnhancedEffect as fr, useEventCallback as nr, useLatestRef as xr } from "./components/hooks/base-ui.js";
|
|
53
|
+
import { useControlledState as ir } from "./components/hooks/useControlledState.js";
|
|
54
|
+
import { useCharts as ur } from "./components/hooks/useCharts.js";
|
|
55
|
+
import { antdColorTokens as Cr, darkTheme as Tr, lightTheme as hr } from "./tokens/and-theme/tokens.js";
|
|
56
|
+
import { categoricalChartColorKeys as gr, categoricalChartColorTokens as Sr, categoricalChartsColors as Pr } from "./tokens/charts/index.js";
|
|
57
|
+
import { chartColorTokens as yr, rawChartColorTokens as br } from "./tokens/charts/tokens.js";
|
|
57
58
|
export {
|
|
58
59
|
p as Affix,
|
|
59
60
|
m as Alert,
|
|
@@ -62,127 +63,127 @@ export {
|
|
|
62
63
|
n as AutoComplete,
|
|
63
64
|
x as Avatar,
|
|
64
65
|
l as BackTop,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
Oe as Badge,
|
|
67
|
+
ae as Breadcrumb,
|
|
68
|
+
He as Button,
|
|
68
69
|
i as Calendar,
|
|
69
70
|
c as Card,
|
|
70
71
|
u as Carousel,
|
|
71
72
|
d as Cascader,
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
xo as Checkbox,
|
|
74
|
+
Ee as CodeBlock,
|
|
74
75
|
C as Col,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
76
|
+
qe as Collapse,
|
|
77
|
+
T as ColorPicker,
|
|
78
|
+
h as ConfigProvider,
|
|
79
|
+
Xe as DSRoot,
|
|
80
|
+
k as DatePicker,
|
|
81
|
+
jo as DefaultUpload,
|
|
82
|
+
g as Descriptions,
|
|
83
|
+
S as Divider,
|
|
84
|
+
P as Drawer,
|
|
85
|
+
A as Dropdown,
|
|
86
|
+
Bo as DropdownMenu,
|
|
87
|
+
de as Empty,
|
|
88
|
+
Ce as EmptyIcon,
|
|
89
|
+
ge as Field,
|
|
90
|
+
y as Flex,
|
|
91
|
+
b as FloatButton,
|
|
92
|
+
he as Form,
|
|
93
|
+
B as Grid,
|
|
94
|
+
mo as IconButton,
|
|
95
|
+
Ne as Input,
|
|
96
|
+
D as InputNumber,
|
|
97
|
+
R as Layout,
|
|
98
|
+
M as List,
|
|
99
|
+
v as Mentions,
|
|
100
|
+
F as Menu,
|
|
101
|
+
ao as Modal,
|
|
102
|
+
w as Pagination,
|
|
103
|
+
E as Popconfirm,
|
|
104
|
+
_o as Popover,
|
|
105
|
+
Fe as PopupPanel,
|
|
106
|
+
I as Progress,
|
|
107
|
+
U as QRCode,
|
|
108
|
+
je as Radio,
|
|
109
|
+
K as Rate,
|
|
110
|
+
L as Result,
|
|
111
|
+
W as Row,
|
|
112
|
+
Yo as ScrollArea,
|
|
113
|
+
io as Segmented,
|
|
114
|
+
ro as Select,
|
|
115
|
+
q as Skeleton,
|
|
116
|
+
oe as Slider,
|
|
117
|
+
G as Space,
|
|
118
|
+
ce as Spin,
|
|
119
|
+
So as Split,
|
|
120
|
+
Po as Splitter,
|
|
121
|
+
Le as Stack,
|
|
122
|
+
Ue as StackChild,
|
|
123
|
+
N as Statistic,
|
|
124
|
+
V as Steps,
|
|
125
|
+
fo as Switch,
|
|
126
|
+
uo as Table,
|
|
127
|
+
O as Tabs,
|
|
128
|
+
To as Tag,
|
|
129
|
+
ko as ThemeProvider,
|
|
130
|
+
Q as TimePicker,
|
|
131
|
+
j as Timeline,
|
|
132
|
+
ye as Toast,
|
|
133
|
+
re as Tooltip,
|
|
134
|
+
Pe as Tour,
|
|
135
|
+
z as Transfer,
|
|
136
|
+
Oo as Transition,
|
|
137
|
+
le as Tree,
|
|
138
|
+
H as TreeSelect,
|
|
139
|
+
yo as Truncate,
|
|
140
|
+
J as Typography,
|
|
141
|
+
zo as Upload,
|
|
142
|
+
Me as VerticalCollapsiblePanel,
|
|
143
|
+
X as Watermark,
|
|
144
|
+
No as WithAntdTokens,
|
|
145
|
+
Cr as antdColorTokens,
|
|
146
|
+
gr as categoricalChartColorKeys,
|
|
147
|
+
Sr as categoricalChartColorTokens,
|
|
148
|
+
Pr as categoricalChartsColors,
|
|
149
|
+
yr as chartColorTokens,
|
|
150
|
+
Ro as clsx,
|
|
151
|
+
Mo as cn,
|
|
151
152
|
r as componentMetadata,
|
|
152
|
-
|
|
153
|
-
|
|
153
|
+
vo as cx,
|
|
154
|
+
Tr as darkTheme,
|
|
154
155
|
t as getComponentsByCategory,
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
156
|
+
fe as getUniqueKeysFromOriginals,
|
|
157
|
+
Io as isTracebackError,
|
|
158
|
+
hr as lightTheme,
|
|
159
|
+
Y as message,
|
|
160
|
+
Z as notification,
|
|
161
|
+
Ko as parseAntdPlacement,
|
|
162
|
+
ne as processTreeData,
|
|
163
|
+
br as rawChartColorTokens,
|
|
164
|
+
wo as reactNodeToString,
|
|
165
|
+
_ as theme,
|
|
166
|
+
Be as toast,
|
|
167
|
+
De as toastManager,
|
|
168
|
+
$ as unstableSetRender,
|
|
169
|
+
sr as useAnimationsFinished,
|
|
170
|
+
Lo as useAntdCssVarClassname,
|
|
171
|
+
pr as useApp,
|
|
172
|
+
or as useBreakpoint,
|
|
173
|
+
ur as useCharts,
|
|
174
|
+
Wo as useCls,
|
|
175
|
+
ir as useControlledState,
|
|
176
|
+
fr as useEnhancedEffect,
|
|
177
|
+
nr as useEventCallback,
|
|
178
|
+
Ze as useForm,
|
|
179
|
+
qo as useGetPrefixCls,
|
|
180
|
+
xr as useLatestRef,
|
|
181
|
+
er as useMessage,
|
|
182
|
+
rr as useModal,
|
|
183
|
+
tr as useToken,
|
|
184
|
+
me as useUniqueKeysTree,
|
|
185
|
+
Jo as useUploadItemRender,
|
|
186
|
+
_e as useWatch,
|
|
187
|
+
oo as version
|
|
187
188
|
};
|
|
188
189
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|