@fakeoai/ui 0.0.1 → 0.0.2
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/README.md +17 -62
- package/dist/components/filter.d.ts +21 -0
- package/dist/components/filter.d.ts.map +1 -0
- package/dist/components/filter.js +34 -0
- package/dist/components/filter.js.map +1 -0
- package/dist/components/input.d.ts +4 -0
- package/dist/components/input.d.ts.map +1 -0
- package/dist/components/input.js +12 -0
- package/dist/components/input.js.map +1 -0
- package/dist/components/loading.d.ts +3 -0
- package/dist/components/loading.d.ts.map +1 -0
- package/dist/components/loading.js +11 -0
- package/dist/components/loading.js.map +1 -0
- package/dist/components/nprogress.d.ts +2 -0
- package/dist/components/nprogress.d.ts.map +1 -0
- package/dist/components/nprogress.js +35 -0
- package/dist/components/nprogress.js.map +1 -0
- package/dist/components/pagination.d.ts +8 -0
- package/dist/components/pagination.d.ts.map +1 -0
- package/dist/components/pagination.js +14 -0
- package/dist/components/pagination.js.map +1 -0
- package/dist/components/sheet.d.ts +20 -0
- package/dist/components/sheet.d.ts.map +1 -0
- package/dist/components/sheet.js +38 -0
- package/dist/components/sheet.js.map +1 -0
- package/dist/components/table.d.ts +18 -0
- package/dist/components/table.d.ts.map +1 -0
- package/dist/components/table.js +84 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/tooltip.d.ts +5 -0
- package/dist/components/tooltip.d.ts.map +1 -0
- package/dist/components/tooltip.js +9 -0
- package/dist/components/tooltip.js.map +1 -0
- package/dist/hooks/use-table-selection.d.ts +9 -0
- package/dist/hooks/use-table-selection.d.ts.map +1 -0
- package/dist/hooks/use-table-selection.js +25 -0
- package/dist/hooks/use-table-selection.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/utils/cn.d.ts +3 -0
- package/dist/utils/cn.d.ts.map +1 -0
- package/dist/utils/cn.js +6 -0
- package/dist/utils/cn.js.map +1 -0
- package/package.json +28 -36
- package/dist/index.d.mts +0 -14
- package/dist/index.mjs +0 -93
- package/dist/index.mjs.map +0 -1
- package/dist/style.css +0 -1
- package/dist/style.d.mts +0 -2
package/README.md
CHANGED
|
@@ -1,82 +1,37 @@
|
|
|
1
|
-
#
|
|
1
|
+
# tokens2-ui
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
从 `tokens2` 项目抽离出的可复用 UI 组件和公共逻辑。
|
|
4
4
|
|
|
5
5
|
## 安装
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
|
|
9
|
-
# 或
|
|
10
|
-
yarn add my-react-component-library
|
|
11
|
-
# 或
|
|
12
|
-
pnpm add my-react-component-library
|
|
8
|
+
pnpm add tokens2-ui
|
|
13
9
|
```
|
|
14
10
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
```tsx
|
|
18
|
-
import { Button, Card } from "my-react-component-library";
|
|
19
|
-
|
|
20
|
-
function App() {
|
|
21
|
-
return (
|
|
22
|
-
<Card title="示例卡片">
|
|
23
|
-
<Button variant="primary" size="md">
|
|
24
|
-
点击我
|
|
25
|
-
</Button>
|
|
26
|
-
</Card>
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
```
|
|
11
|
+
同时安装 peer dependencies:
|
|
30
12
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
### Button
|
|
34
|
-
|
|
35
|
-
按钮组件,支持多种样式和尺寸。
|
|
36
|
-
|
|
37
|
-
```tsx
|
|
38
|
-
<Button variant="primary" size="md" onClick={() => console.log("clicked")}>
|
|
39
|
-
按钮文本
|
|
40
|
-
</Button>
|
|
13
|
+
```bash
|
|
14
|
+
pnpm add react react-dom antd @heroui/react @radix-ui/react-dialog @tanstack/react-query class-variance-authority lucide-react nprogress
|
|
41
15
|
```
|
|
42
16
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
- `variant`: 'primary' | 'secondary' | 'outline'
|
|
46
|
-
- `size`: 'sm' | 'md' | 'lg'
|
|
47
|
-
- `onClick`: () => void
|
|
48
|
-
- `disabled`: boolean
|
|
49
|
-
- `className`: string
|
|
50
|
-
|
|
51
|
-
### Card
|
|
52
|
-
|
|
53
|
-
卡片组件,用于展示内容。
|
|
17
|
+
## 使用
|
|
54
18
|
|
|
55
19
|
```tsx
|
|
56
|
-
|
|
57
|
-
卡片内容
|
|
58
|
-
</Card>
|
|
20
|
+
import { Table, Input, Tooltip, useTableSelection } from 'tokens2-ui'
|
|
59
21
|
```
|
|
60
22
|
|
|
61
|
-
|
|
23
|
+
## 说明
|
|
62
24
|
|
|
63
|
-
-
|
|
64
|
-
- `
|
|
65
|
-
- `
|
|
25
|
+
- 组件使用了 Tailwind 类名,消费方需要具备对应样式体系。
|
|
26
|
+
- `Table` 依赖 `antd` 和 `@heroui/react`。
|
|
27
|
+
- `useTableSelection` 适合替代页面里单独的选中行 store。
|
|
66
28
|
|
|
67
|
-
##
|
|
29
|
+
## 发布
|
|
68
30
|
|
|
69
31
|
```bash
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
# 开发模式
|
|
74
|
-
npm run dev
|
|
75
|
-
|
|
76
|
-
# 构建
|
|
77
|
-
npm run build
|
|
32
|
+
pnpm --filter tokens2-ui build
|
|
33
|
+
cd packages/tokens-ui
|
|
34
|
+
npm publish --access public
|
|
78
35
|
```
|
|
79
36
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
MIT
|
|
37
|
+
发布前建议先修改 `package.json` 里的 `name`,确保 npm 包名可用且归你所有。
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ColumnType } from 'antd/es/table';
|
|
2
|
+
import type React from 'react';
|
|
3
|
+
export declare const searchFilter: (options: {
|
|
4
|
+
placeholder: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
}) => Pick<ColumnType<any>, 'filterDropdown' | 'filterIcon'>;
|
|
7
|
+
interface SelectFilterItem {
|
|
8
|
+
label: React.ReactNode;
|
|
9
|
+
text?: string;
|
|
10
|
+
value: string | number;
|
|
11
|
+
}
|
|
12
|
+
export declare const selectionFilter: (options: {
|
|
13
|
+
options: SelectFilterItem[];
|
|
14
|
+
renderValue?: (item: SelectFilterItem) => React.ReactNode;
|
|
15
|
+
placeholder: string;
|
|
16
|
+
className?: string;
|
|
17
|
+
multiple?: boolean;
|
|
18
|
+
}) => Pick<ColumnType<any>, 'filterDropdown' | 'filterIcon'>;
|
|
19
|
+
export declare const dateRangePickerFilter: () => ColumnType<any>;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=filter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../src/components/filter.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE/C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,eAAO,MAAM,YAAY,EAAE,CAAC,OAAO,EAAE;IACnC,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,KAAK,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,gBAAgB,GAAG,YAAY,CAuCzD,CAAA;AAEF,UAAU,gBAAgB;IACxB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CACvB;AAED,eAAO,MAAM,eAAe,EAAE,CAAC,OAAO,EAAE;IACtC,OAAO,EAAE,gBAAgB,EAAE,CAAA;IAC3B,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,KAAK,CAAC,SAAS,CAAA;IACzD,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,KAAK,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,gBAAgB,GAAG,YAAY,CAqDzD,CAAA;AAEF,eAAO,MAAM,qBAAqB,QAAO,UAAU,CAAC,GAAG,CA2CrD,CAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button, DateRangePicker, Input, Select, SelectItem, } from '@heroui/react';
|
|
3
|
+
import { parseDate } from '@internationalized/date';
|
|
4
|
+
import { Calendar, Search, SlidersHorizontal } from 'lucide-react';
|
|
5
|
+
import { cn } from '../utils/cn';
|
|
6
|
+
export const searchFilter = ({ placeholder, className, }) => ({
|
|
7
|
+
filterDropdown: ({ setSelectedKeys, selectedKeys, confirm, clearFilters }) => (_jsxs("div", { className: cn('flex flex-col gap-2 p-2 w-[250px]', className), children: [_jsx(Input, { size: "sm", variant: "bordered", placeholder: placeholder, value: selectedKeys[0] || '', onChange: event => setSelectedKeys(event.target.value ? [event.target.value] : []) }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Button, { variant: "light", className: "h-7 w-full", size: "sm", onPress: () => {
|
|
8
|
+
clearFilters?.();
|
|
9
|
+
confirm();
|
|
10
|
+
}, children: "\u6E05\u7A7A" }), _jsx(Button, { className: "h-7 w-full", size: "sm", color: "primary", onPress: () => confirm(), children: "\u67E5\u8BE2" })] })] })),
|
|
11
|
+
filterIcon: _jsx(Search, { className: "w-4 h-4" }),
|
|
12
|
+
});
|
|
13
|
+
export const selectionFilter = ({ placeholder, options, className, renderValue, multiple = false, }) => ({
|
|
14
|
+
filterDropdown: ({ selectedKeys, setSelectedKeys, confirm, clearFilters }) => (_jsxs("div", { className: cn('flex flex-col gap-2 p-2 w-[250px]', className), children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Button, { variant: "light", className: "h-7 w-full", size: "sm", onPress: () => {
|
|
15
|
+
clearFilters?.();
|
|
16
|
+
confirm();
|
|
17
|
+
}, children: "\u6E05\u7A7A" }), _jsx(Button, { className: "h-7 w-full", size: "sm", color: "primary", onPress: () => confirm(), children: "\u67E5\u8BE2" })] }), _jsx(Select, { size: "sm", selectedKeys: new Set(selectedKeys), onSelectionChange: keys => setSelectedKeys(Array.from(keys)), placeholder: placeholder, selectionMode: multiple ? 'multiple' : 'single', variant: "bordered", items: options, renderValue: renderValue
|
|
18
|
+
? items => items.map(item => renderValue(item.data))
|
|
19
|
+
: undefined, children: item => (_jsx(SelectItem, { children: renderValue?.(item) ?? item.label }, item.value)) })] })),
|
|
20
|
+
filterIcon: _jsx(SlidersHorizontal, { className: "w-4 h-4" }),
|
|
21
|
+
});
|
|
22
|
+
export const dateRangePickerFilter = () => ({
|
|
23
|
+
filterDropdown: ({ selectedKeys, setSelectedKeys, confirm, clearFilters }) => (_jsxs("div", { className: "flex flex-col gap-2 p-2 w-[280px]", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Button, { variant: "light", className: "h-7 w-full", size: "sm", onPress: () => {
|
|
24
|
+
clearFilters?.();
|
|
25
|
+
confirm();
|
|
26
|
+
}, children: "\u6E05\u7A7A" }), _jsx(Button, { className: "h-7 w-full", size: "sm", color: "primary", onPress: () => confirm(), children: "\u67E5\u8BE2" })] }), _jsx(DateRangePicker, { className: "max-w-xs", variant: "bordered", label: "\u9009\u62E9\u65E5\u671F\u8303\u56F4", value: selectedKeys.length
|
|
27
|
+
? {
|
|
28
|
+
start: parseDate(selectedKeys[0]),
|
|
29
|
+
end: parseDate(selectedKeys[1]),
|
|
30
|
+
}
|
|
31
|
+
: null, onChange: value => setSelectedKeys([value?.start.toString(), value?.end.toString()]) })] })),
|
|
32
|
+
filterIcon: _jsx(Calendar, { className: "w-4 h-4" }),
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=filter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filter.js","sourceRoot":"","sources":["../../src/components/filter.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,MAAM,EACN,eAA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AQ,EAAY,CAAC,CAAC,GAEvF,IACE,CACP;IACD,UAAU,EAAE,KAAC,QAAQ,IAAC,SAAS,EAAC,SAAS,GAAG;CAC7C,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/components/input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,UAAU,EAAE,MAAM,eAAe,CAAA;AACnE,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,eAAO,MAAM,KAAK,kGAiBjB,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Input as HeroInput } from '@heroui/react';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { cn } from '../utils/cn';
|
|
5
|
+
export const Input = React.forwardRef(function Input({ classNames, ...props }, ref) {
|
|
6
|
+
return (_jsx(HeroInput, { ref: ref, ...props, classNames: {
|
|
7
|
+
...(classNames ?? {}),
|
|
8
|
+
label: cn('group-data-[filled-within=true]:!-translate-y-1/2 group-data-[filled-within=true]:top-0 bg-transparent group-data-[filled-within=true]:bg-white group-data-[filled-within=true]:dark:bg-black transition-[transform,color,left,opacity,background] px-1', classNames?.label),
|
|
9
|
+
input: cn('h-full', classNames?.input),
|
|
10
|
+
} }));
|
|
11
|
+
});
|
|
12
|
+
//# sourceMappingURL=input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.js","sourceRoot":"","sources":["../../src/components/input.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,IAAI,SAAS,EAAmB,MAAM,eAAe,CAAA;AACnE,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAA;AAEhC,MAAM,CAAC,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CACnC,SAAS,KAAK,CAAC,EAAE,UAAU,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG;IAC1C,OAAO,CACL,KAAC,SAAS,IACR,GAAG,EAAE,GAAG,KACJ,KAAK,EACT,UAAU,EAAE;YACV,GAAG,CAAC,UAAU,IAAI,EAAE,CAAC;YACrB,KAAK,EAAE,EAAE,CACP,yPAAyP,EACzP,UAAU,EAAE,KAAK,CAClB;YACD,KAAK,EAAE,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,KAAK,CAAC;SACvC,GACD,CACH,CAAA;AACH,CAAC,CACF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loading.d.ts","sourceRoot":"","sources":["../../src/components/loading.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAG1D,wBAAgB,OAAO,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,YAAY,2CAc5D"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Spinner } from '@heroui/react';
|
|
3
|
+
import { cn } from '../utils/cn';
|
|
4
|
+
export function Loading({ className, ...props }) {
|
|
5
|
+
return (_jsx(Spinner, { color: "default", className: cn('absolute inset-0', className), label: "\u52A0\u8F7D\u4E2D...", classNames: {
|
|
6
|
+
circle2: 'border-b-foreground',
|
|
7
|
+
circle1: 'border-b-foreground',
|
|
8
|
+
label: 'text-sm mt-2',
|
|
9
|
+
}, ...props }));
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=loading.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loading.js","sourceRoot":"","sources":["../../src/components/loading.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAqB,MAAM,eAAe,CAAA;AAC1D,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAA;AAEhC,MAAM,UAAU,OAAO,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAgB;IAC3D,OAAO,CACL,KAAC,OAAO,IACN,KAAK,EAAC,SAAS,EACf,SAAS,EAAE,EAAE,CAAC,kBAAkB,EAAE,SAAS,CAAC,EAC5C,KAAK,EAAC,uBAAQ,EACd,UAAU,EAAE;YACV,OAAO,EAAE,qBAAqB;YAC9B,OAAO,EAAE,qBAAqB;YAC9B,KAAK,EAAE,cAAc;SACtB,KACG,KAAK,GACT,CACH,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nprogress.d.ts","sourceRoot":"","sources":["../../src/components/nprogress.tsx"],"names":[],"mappings":"AAKA,wBAAgB,QAAQ,SAqCvB"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import NProgress from 'nprogress';
|
|
3
|
+
NProgress.configure({ showSpinner: false });
|
|
4
|
+
export function Progress() {
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
let lastHref = window.location.href;
|
|
7
|
+
const handleRouteChange = () => {
|
|
8
|
+
NProgress.start();
|
|
9
|
+
const timer = window.setTimeout(() => NProgress.done(), 100);
|
|
10
|
+
return () => {
|
|
11
|
+
window.clearTimeout(timer);
|
|
12
|
+
NProgress.done();
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
const observer = new MutationObserver(() => {
|
|
16
|
+
const currentHref = window.location.href;
|
|
17
|
+
if (currentHref !== lastHref) {
|
|
18
|
+
lastHref = currentHref;
|
|
19
|
+
handleRouteChange();
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
observer.observe(document, {
|
|
23
|
+
subtree: true,
|
|
24
|
+
childList: true,
|
|
25
|
+
});
|
|
26
|
+
window.addEventListener('popstate', handleRouteChange);
|
|
27
|
+
handleRouteChange();
|
|
28
|
+
return () => {
|
|
29
|
+
observer.disconnect();
|
|
30
|
+
window.removeEventListener('popstate', handleRouteChange);
|
|
31
|
+
};
|
|
32
|
+
}, []);
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=nprogress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nprogress.js","sourceRoot":"","sources":["../../src/components/nprogress.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,SAAS,MAAM,WAAW,CAAA;AAEjC,SAAS,CAAC,SAAS,CAAC,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC,CAAA;AAE3C,MAAM,UAAU,QAAQ;IACtB,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAA;QAEnC,MAAM,iBAAiB,GAAG,GAAG,EAAE;YAC7B,SAAS,CAAC,KAAK,EAAE,CAAA;YACjB,MAAM,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,GAAG,CAAC,CAAA;YAE5D,OAAO,GAAG,EAAE;gBACV,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CAAA;gBAC1B,SAAS,CAAC,IAAI,EAAE,CAAA;YAClB,CAAC,CAAA;QACH,CAAC,CAAA;QAED,MAAM,QAAQ,GAAG,IAAI,gBAAgB,CAAC,GAAG,EAAE;YACzC,MAAM,WAAW,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAA;YACxC,IAAI,WAAW,KAAK,QAAQ,EAAE,CAAC;gBAC7B,QAAQ,GAAG,WAAW,CAAA;gBACtB,iBAAiB,EAAE,CAAA;YACrB,CAAC;QACH,CAAC,CAAC,CAAA;QAEF,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE;YACzB,OAAO,EAAE,IAAI;YACb,SAAS,EAAE,IAAI;SAChB,CAAC,CAAA;QAEF,MAAM,CAAC,gBAAgB,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAAA;QACtD,iBAAiB,EAAE,CAAA;QAEnB,OAAO,GAAG,EAAE;YACV,QAAQ,CAAC,UAAU,EAAE,CAAA;YACrB,MAAM,CAAC,mBAAmB,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAAA;QAC3D,CAAC,CAAA;IACH,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,OAAO,IAAI,CAAA;AACb,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface PaginationProps {
|
|
2
|
+
current: number;
|
|
3
|
+
total: number;
|
|
4
|
+
pageSize: number;
|
|
5
|
+
onChange: (page: number, pageSize: number) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function Pagination({ current, total, pageSize, onChange, }: PaginationProps): import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
//# sourceMappingURL=pagination.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../src/components/pagination.tsx"],"names":[],"mappings":"AAKA,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;CACnD;AAED,wBAAgB,UAAU,CAAC,EACzB,OAAO,EACP,KAAK,EACL,QAAQ,EACR,QAAQ,GACT,EAAE,eAAe,kDAsCjB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Pagination as HeroPagination, Select, SelectItem } from '@heroui/react';
|
|
3
|
+
import { useMemo } from 'react';
|
|
4
|
+
const sizes = ['10', '20', '50', '100', '500', '1000', '10000'];
|
|
5
|
+
export function Pagination({ current, total, pageSize, onChange, }) {
|
|
6
|
+
const totalPages = useMemo(() => Math.ceil(total / Number(pageSize)), [total, pageSize]);
|
|
7
|
+
if (!totalPages)
|
|
8
|
+
return null;
|
|
9
|
+
return (_jsxs("div", { className: "flex w-full justify-center items-center gap-4 flex-wrap", children: [_jsxs("div", { className: "absolute hidden sm:block left-4 text-small text-default-400 justify-items-start", children: ["\u603B\u6570\uFF1A", total] }), _jsx(HeroPagination, { isCompact: true, size: "sm", showControls: true, showShadow: true, page: current, total: totalPages, onChange: page => onChange(page, pageSize) }), _jsx(Select, { size: "sm", className: "w-auto", classNames: {
|
|
10
|
+
innerWrapper: 'w-full pr-6',
|
|
11
|
+
popoverContent: 'w-fit',
|
|
12
|
+
}, selectedKeys: [String(pageSize)], onChange: e => onChange(1, Number(e.target.value || 20)), children: sizes.map(size => (_jsx(SelectItem, { children: `${size} 条/页` }, size))) })] }));
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=pagination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.js","sourceRoot":"","sources":["../../src/components/pagination.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAChF,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAE/B,MAAM,KAAK,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAA;AAS/D,MAAM,UAAU,UAAU,CAAC,EACzB,OAAO,EACP,KAAK,EACL,QAAQ,EACR,QAAQ,GACQ;IAChB,MAAM,UAAU,GAAG,OAAO,CACxB,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,EACzC,CAAC,KAAK,EAAE,QAAQ,CAAC,CAClB,CAAA;IAED,IAAI,CAAC,UAAU;QAAE,OAAO,IAAI,CAAA;IAE5B,OAAO,CACL,eAAK,SAAS,EAAC,yDAAyD,aACtE,eAAK,SAAS,EAAC,iFAAiF,mCAC1F,KAAK,IACL,EACN,KAAC,cAAc,IACb,SAAS,QACT,IAAI,EAAC,IAAI,EACT,YAAY,QACZ,UAAU,QACV,IAAI,EAAE,OAAO,EACb,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,GAC1C,EACF,KAAC,MAAM,IACL,IAAI,EAAC,IAAI,EACT,SAAS,EAAC,QAAQ,EAClB,UAAU,EAAE;oBACV,YAAY,EAAE,aAAa;oBAC3B,cAAc,EAAE,OAAO;iBACxB,EACD,YAAY,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,EAChC,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,YAEvD,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CACjB,KAAC,UAAU,cAAa,GAAG,IAAI,MAAM,IAApB,IAAI,CAA8B,CACpD,CAAC,GACK,IACL,CACP,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as SheetPrimitive from '@radix-ui/react-dialog';
|
|
2
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
declare const Sheet: React.FC<SheetPrimitive.DialogProps>;
|
|
5
|
+
declare const SheetTrigger: React.ForwardRefExoticComponent<SheetPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
declare const SheetClose: React.ForwardRefExoticComponent<SheetPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
declare const SheetPortal: React.FC<SheetPrimitive.DialogPortalProps>;
|
|
8
|
+
declare const SheetOverlay: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const sheetVariants: (props?: ({
|
|
10
|
+
side?: "top" | "bottom" | "left" | "right" | null | undefined;
|
|
11
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
12
|
+
interface SheetContentProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>, VariantProps<typeof sheetVariants> {
|
|
13
|
+
}
|
|
14
|
+
declare const SheetContent: React.ForwardRefExoticComponent<SheetContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
declare function SheetHeader({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
declare function SheetFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
declare const SheetTitle: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
18
|
+
declare const SheetDescription: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
19
|
+
export { Sheet, SheetPortal, SheetOverlay, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, };
|
|
20
|
+
//# sourceMappingURL=sheet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sheet.d.ts","sourceRoot":"","sources":["../../src/components/sheet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,QAAA,MAAM,KAAK,sCAAsB,CAAA;AACjC,QAAA,MAAM,YAAY,6GAAyB,CAAA;AAC3C,QAAA,MAAM,UAAU,2GAAuB,CAAA;AACvC,QAAA,MAAM,WAAW,4CAAwB,CAAA;AAEzC,QAAA,MAAM,YAAY,6JAYhB,CAAA;AAGF,QAAA,MAAM,aAAa;;8EAiBlB,CAAA;AAED,UAAU,iBACR,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,cAAc,CAAC,OAAO,CAAC,EACnE,YAAY,CAAC,OAAO,aAAa,CAAC;CAAG;AAEzC,QAAA,MAAM,YAAY,0FAchB,CAAA;AAGF,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,2CAUtC;AAED,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,2CAUtC;AAED,QAAA,MAAM,UAAU,mKASd,CAAA;AAGF,QAAA,MAAM,gBAAgB,6KASpB,CAAA;AAGF,OAAO,EACL,KAAK,EACL,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,WAAW,EACX,WAAW,EACX,UAAU,EACV,gBAAgB,GACjB,CAAA"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as SheetPrimitive from '@radix-ui/react-dialog';
|
|
3
|
+
import { cva } from 'class-variance-authority';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { cn } from '../utils/cn';
|
|
6
|
+
const Sheet = SheetPrimitive.Root;
|
|
7
|
+
const SheetTrigger = SheetPrimitive.Trigger;
|
|
8
|
+
const SheetClose = SheetPrimitive.Close;
|
|
9
|
+
const SheetPortal = SheetPrimitive.Portal;
|
|
10
|
+
const SheetOverlay = React.forwardRef(({ className, ...props }, ref) => (_jsx(SheetPrimitive.Overlay, { ref: ref, className: cn('fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0', className), ...props })));
|
|
11
|
+
SheetOverlay.displayName = SheetPrimitive.Overlay.displayName;
|
|
12
|
+
const sheetVariants = cva('fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500', {
|
|
13
|
+
variants: {
|
|
14
|
+
side: {
|
|
15
|
+
top: 'inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top',
|
|
16
|
+
bottom: 'inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom',
|
|
17
|
+
left: 'inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm',
|
|
18
|
+
right: 'inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
defaultVariants: {
|
|
22
|
+
side: 'right',
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
const SheetContent = React.forwardRef(({ side = 'right', className, children, ...props }, ref) => (_jsxs(SheetPortal, { children: [_jsx(SheetOverlay, {}), _jsx(SheetPrimitive.Content, { ref: ref, className: cn(sheetVariants({ side }), className), ...props, children: children })] })));
|
|
26
|
+
SheetContent.displayName = SheetPrimitive.Content.displayName;
|
|
27
|
+
function SheetHeader({ className, ...props }) {
|
|
28
|
+
return (_jsx("div", { className: cn('flex flex-col space-y-2 text-center sm:text-left', className), ...props }));
|
|
29
|
+
}
|
|
30
|
+
function SheetFooter({ className, ...props }) {
|
|
31
|
+
return (_jsx("div", { className: cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className), ...props }));
|
|
32
|
+
}
|
|
33
|
+
const SheetTitle = React.forwardRef(({ className, ...props }, ref) => (_jsx(SheetPrimitive.Title, { ref: ref, className: cn('text-lg font-semibold text-foreground', className), ...props })));
|
|
34
|
+
SheetTitle.displayName = SheetPrimitive.Title.displayName;
|
|
35
|
+
const SheetDescription = React.forwardRef(({ className, ...props }, ref) => (_jsx(SheetPrimitive.Description, { ref: ref, className: cn('text-sm text-muted-foreground', className), ...props })));
|
|
36
|
+
SheetDescription.displayName = SheetPrimitive.Description.displayName;
|
|
37
|
+
export { Sheet, SheetPortal, SheetOverlay, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, };
|
|
38
|
+
//# sourceMappingURL=sheet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sheet.js","sourceRoot":"","sources":["../../src/components/sheet.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,cAAc,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAA;AACjE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAA;AAEhC,MAAM,KAAK,GAAG,cAAc,CAAC,IAAI,CAAA;AACjC,MAAM,YAAY,GAAG,cAAc,CAAC,OAAO,CAAA;AAC3C,MAAM,UAAU,GAAG,cAAc,CAAC,KAAK,CAAA;AACvC,MAAM,WAAW,GAAG,cAAc,CAAC,MAAM,CAAA;AAEzC,MAAM,YAAY,GAAG,KAAK,CAAC,UAAU,CAGnC,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAClC,KAAC,cAAc,CAAC,OAAO,IACrB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACX,wJAAwJ,EACxJ,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAC,CAAA;AACF,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC,OAAO,CAAC,WAAW,CAAA;AAE7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S,EAAE,EAAE,CAAC,uCAAuC,EAAE,SAAS,CAAC,KAC7D,KAAK,GACT,CACH,CAAC,CAAA;AACF,UAAU,CAAC,WAAW,GAAG,cAAc,CAAC,KAAK,CAAC,WAAW,CAAA;AAEzD,MAAM,gBAAgB,GAAG,KAAK,CAAC,UAAU,CAGvC,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAClC,KAAC,cAAc,CAAC,WAAW,IACzB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,+BAA+B,EAAE,SAAS,CAAC,KACrD,KAAK,GACT,CACH,CAAC,CAAA;AACF,gBAAgB,CAAC,WAAW,GAAG,cAAc,CAAC,WAAW,CAAC,WAAW,CAAA;AAErE,OAAO,EACL,KAAK,EACL,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,WAAW,EACX,WAAW,EACX,UAAU,EACV,gBAAgB,GACjB,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type TableProps } from 'antd';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { type PaginationProps } from './pagination';
|
|
4
|
+
export interface TableAction<T> {
|
|
5
|
+
label?: string;
|
|
6
|
+
handler?: (record: T) => void;
|
|
7
|
+
render?: (record: T) => JSX.Element;
|
|
8
|
+
}
|
|
9
|
+
export type TableActionFunc<T> = (record: T) => TableAction<T>[];
|
|
10
|
+
export interface TokensTableProps<T> extends Omit<TableProps<T>, 'pagination' | 'loading'> {
|
|
11
|
+
loading?: boolean;
|
|
12
|
+
buttons?: React.ReactNode;
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
actions?: TableAction<T>[] | TableActionFunc<T>;
|
|
15
|
+
pagination: PaginationProps;
|
|
16
|
+
}
|
|
17
|
+
export declare function Table<T>({ loading, dataSource, pagination, columns, buttons, children, actions, className, expandable, rowKey, ...props }: TokensTableProps<T>): import("react/jsx-runtime").JSX.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,0 +1,84 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button, Dropdown, DropdownItem, DropdownMenu, DropdownTrigger, } from '@heroui/react';
|
|
3
|
+
import { Table as AntdTable } from 'antd';
|
|
4
|
+
import { EllipsisVertical } from 'lucide-react';
|
|
5
|
+
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
6
|
+
import { Loading } from './loading';
|
|
7
|
+
import { Pagination } from './pagination';
|
|
8
|
+
import { cn } from '../utils/cn';
|
|
9
|
+
function getRecordKey(record, rowKey) {
|
|
10
|
+
if (typeof rowKey === 'function')
|
|
11
|
+
return rowKey(record);
|
|
12
|
+
if (typeof rowKey === 'string') {
|
|
13
|
+
return record[rowKey];
|
|
14
|
+
}
|
|
15
|
+
return (record.key ??
|
|
16
|
+
record.id);
|
|
17
|
+
}
|
|
18
|
+
export function Table({ loading, dataSource, pagination, columns, buttons, children, actions, className, expandable, rowKey, ...props }) {
|
|
19
|
+
const [expandedRowKeys, setExpandedRowKeys] = useState([]);
|
|
20
|
+
const prevDataSourceRef = useRef(dataSource);
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
if (dataSource !== prevDataSourceRef.current) {
|
|
23
|
+
prevDataSourceRef.current = dataSource;
|
|
24
|
+
setExpandedRowKeys([]);
|
|
25
|
+
}
|
|
26
|
+
}, [dataSource]);
|
|
27
|
+
const mergedExpandable = useMemo(() => {
|
|
28
|
+
if (!expandable)
|
|
29
|
+
return undefined;
|
|
30
|
+
return {
|
|
31
|
+
...expandable,
|
|
32
|
+
expandedRowKeys,
|
|
33
|
+
onExpand: (expanded, record) => {
|
|
34
|
+
setExpandedRowKeys(expanded ? [getRecordKey(record, rowKey)] : []);
|
|
35
|
+
expandable.onExpand?.(expanded, record);
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
}, [expandable, expandedRowKeys, rowKey]);
|
|
39
|
+
const finalColumns = useMemo(() => {
|
|
40
|
+
return columns
|
|
41
|
+
?.concat(actions
|
|
42
|
+
? {
|
|
43
|
+
title: '操作',
|
|
44
|
+
key: 'actions',
|
|
45
|
+
width: 60,
|
|
46
|
+
fixed: 'right',
|
|
47
|
+
render: (_, record) => {
|
|
48
|
+
const actionList = typeof actions === 'function' ? actions(record) : actions;
|
|
49
|
+
if (!actionList.length)
|
|
50
|
+
return null;
|
|
51
|
+
return (_jsxs(Dropdown, { children: [_jsx(DropdownTrigger, { children: _jsx(Button, { isIconOnly: true, radius: "full", size: "sm", variant: "light", children: _jsx(EllipsisVertical, { className: "text-default-400" }) }) }), _jsx(DropdownMenu, { children: actionList.map((action, index) => (_jsx(DropdownItem, { onPress: () => action.handler?.(record), children: action.render ? action.render(record) : action.label }, index))) })] }));
|
|
52
|
+
},
|
|
53
|
+
}
|
|
54
|
+
: {})
|
|
55
|
+
.map(column => ({
|
|
56
|
+
align: 'center',
|
|
57
|
+
ellipsis: true,
|
|
58
|
+
width: 200,
|
|
59
|
+
...column,
|
|
60
|
+
}));
|
|
61
|
+
}, [actions, columns]);
|
|
62
|
+
const [scrollY, setScrollY] = useState(300);
|
|
63
|
+
const containerRef = useRef(null);
|
|
64
|
+
const buttonsRef = useRef(null);
|
|
65
|
+
const paginationRef = useRef(null);
|
|
66
|
+
useEffect(() => {
|
|
67
|
+
const calculateScrollHeight = () => {
|
|
68
|
+
if (!containerRef.current)
|
|
69
|
+
return;
|
|
70
|
+
const containerRect = containerRef.current.getBoundingClientRect();
|
|
71
|
+
const buttonsHeight = buttonsRef.current?.offsetHeight || 0;
|
|
72
|
+
const paginationHeight = paginationRef.current?.offsetHeight || 0;
|
|
73
|
+
const availableHeight = containerRect.height - (buttonsHeight + paginationHeight + 6 * 16 + 50);
|
|
74
|
+
setScrollY(Math.max(availableHeight, 200));
|
|
75
|
+
};
|
|
76
|
+
calculateScrollHeight();
|
|
77
|
+
window.addEventListener('resize', calculateScrollHeight);
|
|
78
|
+
return () => {
|
|
79
|
+
window.removeEventListener('resize', calculateScrollHeight);
|
|
80
|
+
};
|
|
81
|
+
}, [buttons]);
|
|
82
|
+
return (_jsxs("div", { ref: containerRef, className: cn('flex flex-col gap-4 p-4 flex-1 overflow-hidden', className), children: [buttons ? (_jsx("div", { ref: buttonsRef, className: "flex items-center sm:flex-row-reverse gap-4 flex-wrap", children: buttons })) : null, _jsx(AntdTable, { className: "next-table", size: "small", loading: { indicator: _jsx(Loading, { label: "" }), spinning: loading }, rowClassName: (_, index) => (index % 2 === 1 ? 'bg-default-50' : ''), dataSource: dataSource, pagination: false, virtual: true, columns: finalColumns, scroll: { y: scrollY }, rowKey: rowKey, expandable: mergedExpandable, ...props }), _jsx("div", { ref: paginationRef, children: _jsx(Pagination, { ...pagination }) }), children] }));
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.js","sourceRoot":"","sources":["../../src/components/table.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,MAAM,EACN,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,eAAe,GAChB,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,KAAK,IAAI,SAAS,EAAmB,MAAM,MAAM,CAAA;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAc,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,UAAU,EAAwB,MAAM,cAAc,CAAA;AAC/D,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAA;AAUhC,SAAS,YAAY,CACnB,MAAS,EACT,MAAgC;IAEhC,IAAI,OAAO,MAAM,KAAK,UAAU;QAAE,OAAO,MAAM,CAAC,MAAM,CAAC,CAAA;IACvD,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC/B,OAAQ,MAAkC,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C,IAAI,EACR,KAAC,SAAS,IACR,SAAS,EAAC,YAAY,EACtB,IAAI,EAAC,OAAO,EACZ,OAAO,EAAE,EAAE,SAAS,EAAE,KAAC,OAAO,IAAC,KAAK,EAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,EAC/D,YAAY,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC,EACpE,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,KAAK,EACjB,OAAO,QACP,OAAO,EAAE,YAAwC,EACjD,MAAM,EAAE,EAAE,CAAC,EAAE,OAAO,EAAE,EACtB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,gBAAgB,KACxB,KAAK,GACT,EACF,cAAK,GAAG,EAAE,aAAa,YACrB,KAAC,UAAU,OAAK,UAAU,GAAI,GAC1B,EACL,QAAQ,IACL,CACP,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../src/components/tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,YAAY,EAIlB,MAAM,eAAe,CAAA;AAGtB,wBAAgB,OAAO,CAAC,EACtB,QAAQ,EACR,OAAO,EACP,YAAY,GACb,EAAE,YAAY,GAAG;IAAE,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,2CA0B1C"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Tooltip as HeroTooltip, Popover, PopoverContent, PopoverTrigger, } from '@heroui/react';
|
|
3
|
+
import { cn } from '../utils/cn';
|
|
4
|
+
export function Tooltip({ children, content, wrapperClass, }) {
|
|
5
|
+
return (_jsxs(_Fragment, { children: [_jsx(HeroTooltip, { classNames: { content: 'max-w-[400px] break-all whitespace-pre-line' }, content: content, delay: 0, placement: "top", children: _jsx("div", { className: cn('hidden sm:block', wrapperClass), children: children }) }), _jsxs(Popover, { placement: "top", classNames: {
|
|
6
|
+
trigger: 'aria-expanded:scale-100 aria-expanded:opacity-100 z-0',
|
|
7
|
+
}, children: [_jsx(PopoverTrigger, { children: _jsx("div", { className: cn('sm:hidden w-full', wrapperClass), children: children }) }), _jsx(PopoverContent, { className: "max-w-[400px] break-all whitespace-pre-line", children: content })] })] }));
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=tooltip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip.js","sourceRoot":"","sources":["../../src/components/tooltip.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,OAAO,IAAI,WAAW,EAEtB,OAAO,EACP,cAAc,EACd,cAAc,GACf,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAA;AAEhC,MAAM,UAAU,OAAO,CAAC,EACtB,QAAQ,EACR,OAAO,EACP,YAAY,GAC6B;IACzC,OAAO,CACL,8BACE,KAAC,WAAW,IACV,UAAU,EAAE,EAAE,OAAO,EAAE,6CAA6C,EAAE,EACtE,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,CAAC,EACR,SAAS,EAAC,KAAK,YAEf,cAAK,SAAS,EAAE,EAAE,CAAC,iBAAiB,EAAE,YAAY,CAAC,YAAG,QAAQ,GAAO,GACzD,EACd,MAAC,OAAO,IACN,SAAS,EAAC,KAAK,EACf,UAAU,EAAE;oBACV,OAAO,EAAE,uDAAuD;iBACjE,aAED,KAAC,cAAc,cACb,cAAK,SAAS,EAAE,EAAE,CAAC,kBAAkB,EAAE,YAAY,CAAC,YAAG,QAAQ,GAAO,GACvD,EACjB,KAAC,cAAc,IAAC,SAAS,EAAC,6CAA6C,YACpE,OAAO,GACO,IACT,IACT,CACJ,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type RowKeyGetter<T> = keyof T | ((record: T) => React.Key);
|
|
2
|
+
export declare function useTableSelection<T extends Record<string, unknown>>(rows: T[] | undefined, rowKey?: RowKeyGetter<T>): {
|
|
3
|
+
selectedRowKeys: import("react").Key[];
|
|
4
|
+
setSelectedRowKeys: import("react").Dispatch<import("react").SetStateAction<import("react").Key[]>>;
|
|
5
|
+
selectedRows: T[];
|
|
6
|
+
selectedRow: T;
|
|
7
|
+
clearSelection: () => void;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=use-table-selection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-table-selection.d.ts","sourceRoot":"","sources":["../../src/hooks/use-table-selection.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,KAAK,CAAC,GAAG,CAAC,CAAA;AAWlE,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjE,IAAI,EAAE,CAAC,EAAE,GAAG,SAAS,EACrB,MAAM,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC;;;;;;EAiBzB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useMemo, useState } from 'react';
|
|
2
|
+
function getRowKey(record, rowKey) {
|
|
3
|
+
if (typeof rowKey === 'function')
|
|
4
|
+
return rowKey(record);
|
|
5
|
+
if (typeof rowKey === 'string')
|
|
6
|
+
return record[rowKey];
|
|
7
|
+
return (record.key ?? record.id) ?? '';
|
|
8
|
+
}
|
|
9
|
+
export function useTableSelection(rows, rowKey) {
|
|
10
|
+
const [selectedRowKeys, setSelectedRowKeys] = useState([]);
|
|
11
|
+
const selectedRows = useMemo(() => {
|
|
12
|
+
if (!rows?.length || !selectedRowKeys.length)
|
|
13
|
+
return [];
|
|
14
|
+
const keySet = new Set(selectedRowKeys);
|
|
15
|
+
return rows.filter(row => keySet.has(getRowKey(row, rowKey)));
|
|
16
|
+
}, [rowKey, rows, selectedRowKeys]);
|
|
17
|
+
return {
|
|
18
|
+
selectedRowKeys,
|
|
19
|
+
setSelectedRowKeys,
|
|
20
|
+
selectedRows,
|
|
21
|
+
selectedRow: selectedRows[0],
|
|
22
|
+
clearSelection: () => setSelectedRowKeys([]),
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=use-table-selection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-table-selection.js","sourceRoot":"","sources":["../../src/hooks/use-table-selection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAIzC,SAAS,SAAS,CAChB,MAAS,EACT,MAAwB;IAExB,IAAI,OAAO,MAAM,KAAK,UAAU;QAAE,OAAO,MAAM,CAAC,MAAM,CAAC,CAAA;IACvD,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC,MAAM,CAAc,CAAA;IAClE,OAAQ,CAAC,MAAM,CAAC,GAAG,IAAI,MAAM,CAAC,EAAE,CAAe,IAAI,EAAE,CAAA;AACvD,CAAC;AAED,MAAM,UAAU,iBAAiB,CAC/B,IAAqB,EACrB,MAAwB;IAExB,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,QAAQ,CAAc,EAAE,CAAC,CAAA;IAEvE,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,EAAE;QAChC,IAAI,CAAC,IAAI,EAAE,MAAM,IAAI,CAAC,eAAe,CAAC,MAAM;YAAE,OAAO,EAAE,CAAA;QACvD,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,eAAe,CAAC,CAAA;QACvC,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC,CAAA;IAC/D,CAAC,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,eAAe,CAAC,CAAC,CAAA;IAEnC,OAAO;QACL,eAAe;QACf,kBAAkB;QAClB,YAAY;QACZ,WAAW,EAAE,YAAY,CAAC,CAAC,CAAC;QAC5B,cAAc,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,EAAE,CAAC;KAC7C,CAAA;AACH,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './components/filter';
|
|
2
|
+
export * from './components/input';
|
|
3
|
+
export * from './components/loading';
|
|
4
|
+
export * from './components/nprogress';
|
|
5
|
+
export * from './components/pagination';
|
|
6
|
+
export * from './components/sheet';
|
|
7
|
+
export * from './components/table';
|
|
8
|
+
export * from './components/tooltip';
|
|
9
|
+
export * from './hooks/use-table-selection';
|
|
10
|
+
export * from './utils/cn';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,oBAAoB,CAAA;AAClC,cAAc,sBAAsB,CAAA;AACpC,cAAc,wBAAwB,CAAA;AACtC,cAAc,yBAAyB,CAAA;AACvC,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,sBAAsB,CAAA;AACpC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,YAAY,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './components/filter';
|
|
2
|
+
export * from './components/input';
|
|
3
|
+
export * from './components/loading';
|
|
4
|
+
export * from './components/nprogress';
|
|
5
|
+
export * from './components/pagination';
|
|
6
|
+
export * from './components/sheet';
|
|
7
|
+
export * from './components/table';
|
|
8
|
+
export * from './components/tooltip';
|
|
9
|
+
export * from './hooks/use-table-selection';
|
|
10
|
+
export * from './utils/cn';
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,oBAAoB,CAAA;AAClC,cAAc,sBAAsB,CAAA;AACpC,cAAc,wBAAwB,CAAA;AACtC,cAAc,yBAAyB,CAAA;AACvC,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,sBAAsB,CAAA;AACpC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,YAAY,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cn.d.ts","sourceRoot":"","sources":["../../src/utils/cn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAQ,MAAM,MAAM,CAAA;AAG5C,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC"}
|
package/dist/utils/cn.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cn.js","sourceRoot":"","sources":["../../src/utils/cn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,IAAI,EAAE,MAAM,MAAM,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAExC,MAAM,UAAU,EAAE,CAAC,GAAG,MAAoB;IACxC,OAAO,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAA;AAC9B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,52 +1,44 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fakeoai/ui",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"description": "Reusable UI components and common table logic extracted from tokens2.",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"main": "./dist/index.js",
|
|
6
|
-
"module": "./dist/index.
|
|
7
|
+
"module": "./dist/index.js",
|
|
7
8
|
"types": "./dist/index.d.ts",
|
|
8
|
-
"exports": {
|
|
9
|
-
".": {
|
|
10
|
-
"types": "./dist/index.d.ts",
|
|
11
|
-
"import": "./dist/index.mjs",
|
|
12
|
-
"require": "./dist/index.js"
|
|
13
|
-
},
|
|
14
|
-
"./style": "./dist/src/style.css"
|
|
15
|
-
},
|
|
16
9
|
"files": [
|
|
17
|
-
"dist"
|
|
10
|
+
"dist",
|
|
11
|
+
"README.md"
|
|
18
12
|
],
|
|
13
|
+
"sideEffects": false,
|
|
19
14
|
"scripts": {
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"dev": "tsup --watch",
|
|
23
|
-
"prepublishOnly": "npm run build"
|
|
15
|
+
"build": "tsc -p tsconfig.json",
|
|
16
|
+
"prepublishOnly": "pnpm run build"
|
|
24
17
|
},
|
|
25
|
-
"keywords": [
|
|
26
|
-
"react",
|
|
27
|
-
"components",
|
|
28
|
-
"ui",
|
|
29
|
-
"typescript"
|
|
30
|
-
],
|
|
31
|
-
"author": "Your Name",
|
|
32
|
-
"license": "MIT",
|
|
33
18
|
"peerDependencies": {
|
|
34
|
-
"react": "
|
|
35
|
-
"
|
|
19
|
+
"@heroui/react": "^2.7.8",
|
|
20
|
+
"@internationalized/date": "^3.8.0",
|
|
21
|
+
"@radix-ui/react-dialog": "^1.1.2",
|
|
22
|
+
"@tanstack/react-query": "^5.90.2",
|
|
23
|
+
"antd": "^5.22.7",
|
|
24
|
+
"class-variance-authority": "^0.7.0",
|
|
25
|
+
"lucide-react": "^0.468.0",
|
|
26
|
+
"nprogress": "^0.2.0",
|
|
27
|
+
"react": "^18.3.1",
|
|
28
|
+
"react-dom": "^18.3.1"
|
|
36
29
|
},
|
|
37
30
|
"dependencies": {
|
|
38
|
-
"@heroui/react": "^2.8.4",
|
|
39
31
|
"clsx": "^2.1.1",
|
|
40
|
-
"
|
|
41
|
-
"tailwind-merge": "^3.3.1",
|
|
42
|
-
"tsup": "^8.5.0",
|
|
43
|
-
"tsx": "^4.20.5",
|
|
44
|
-
"typescript": "^5.9.2"
|
|
32
|
+
"tailwind-merge": "^2.4.0"
|
|
45
33
|
},
|
|
46
34
|
"devDependencies": {
|
|
35
|
+
"@types/node": "^20.14.12",
|
|
47
36
|
"@types/nprogress": "^0.2.3",
|
|
48
|
-
"@types/react": "^
|
|
49
|
-
"@types/react-dom": "^
|
|
50
|
-
"
|
|
37
|
+
"@types/react": "^18.3.3",
|
|
38
|
+
"@types/react-dom": "^18.3.0",
|
|
39
|
+
"typescript": "^5.5.4"
|
|
40
|
+
},
|
|
41
|
+
"publishConfig": {
|
|
42
|
+
"access": "public"
|
|
51
43
|
}
|
|
52
|
-
}
|
|
44
|
+
}
|
package/dist/index.d.mts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { SpinnerProps, InputProps } from '@heroui/react';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { ClassValue } from 'clsx';
|
|
5
|
-
|
|
6
|
-
declare function Loading({ className, ...p }: SpinnerProps): react_jsx_runtime.JSX.Element;
|
|
7
|
-
|
|
8
|
-
declare const Input: React.ForwardRefExoticComponent<Omit<InputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
9
|
-
|
|
10
|
-
declare function Progress(): null;
|
|
11
|
-
|
|
12
|
-
declare function cn(...inputs: ClassValue[]): string;
|
|
13
|
-
|
|
14
|
-
export { Input, Loading, Progress, cn };
|
package/dist/index.mjs
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
// src/components/loading.tsx
|
|
2
|
-
import { Spinner } from "@heroui/react";
|
|
3
|
-
|
|
4
|
-
// src/utils/clsx.ts
|
|
5
|
-
import { clsx } from "clsx";
|
|
6
|
-
import { twMerge } from "tailwind-merge";
|
|
7
|
-
function cn(...inputs) {
|
|
8
|
-
return twMerge(clsx(inputs));
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
// src/components/loading.tsx
|
|
12
|
-
import { jsx } from "react/jsx-runtime";
|
|
13
|
-
function Loading({ className, ...p }) {
|
|
14
|
-
return /* @__PURE__ */ jsx(
|
|
15
|
-
Spinner,
|
|
16
|
-
{
|
|
17
|
-
color: "default",
|
|
18
|
-
className: cn("absolute inset-0", className),
|
|
19
|
-
label: "\u52A0\u8F7D\u4E2D...",
|
|
20
|
-
classNames: {
|
|
21
|
-
circle2: "border-b-foreground",
|
|
22
|
-
circle1: "border-b-foreground",
|
|
23
|
-
label: "text-sm mt-2"
|
|
24
|
-
},
|
|
25
|
-
...p
|
|
26
|
-
}
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// src/components/input.tsx
|
|
31
|
-
import { Input as NextInput } from "@heroui/react";
|
|
32
|
-
import React from "react";
|
|
33
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
34
|
-
var Input = React.forwardRef(function Input2({ classNames, ...props }, ref) {
|
|
35
|
-
return /* @__PURE__ */ jsx2(
|
|
36
|
-
NextInput,
|
|
37
|
-
{
|
|
38
|
-
ref,
|
|
39
|
-
...props,
|
|
40
|
-
classNames: {
|
|
41
|
-
...classNames ?? {},
|
|
42
|
-
label: cn(
|
|
43
|
-
"group-data-[filled-within=true]:!-translate-y-1/2 group-data-[filled-within=true]:top-0 bg-transparent group-data-[filled-within=true]:bg-white group-data-[filled-within=true]:dark:bg-black transition-[transform,color,left,opacity,background] px-1",
|
|
44
|
-
classNames?.label
|
|
45
|
-
),
|
|
46
|
-
input: cn("h-full", classNames?.input)
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
);
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
// src/components/nprogress.tsx
|
|
53
|
-
import NProgress from "nprogress";
|
|
54
|
-
import { useEffect } from "react";
|
|
55
|
-
NProgress.configure({ showSpinner: false });
|
|
56
|
-
function Progress() {
|
|
57
|
-
useEffect(() => {
|
|
58
|
-
let lastHref = window.location.href;
|
|
59
|
-
const handleRouteChange = () => {
|
|
60
|
-
NProgress.start();
|
|
61
|
-
const timer = setTimeout(() => NProgress.done(), 100);
|
|
62
|
-
return () => {
|
|
63
|
-
clearTimeout(timer);
|
|
64
|
-
NProgress.done();
|
|
65
|
-
};
|
|
66
|
-
};
|
|
67
|
-
const observer = new MutationObserver(() => {
|
|
68
|
-
const currentHref = window.location.href;
|
|
69
|
-
if (currentHref !== lastHref) {
|
|
70
|
-
lastHref = currentHref;
|
|
71
|
-
handleRouteChange();
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
observer.observe(document, {
|
|
75
|
-
subtree: true,
|
|
76
|
-
childList: true
|
|
77
|
-
});
|
|
78
|
-
window.addEventListener("popstate", handleRouteChange);
|
|
79
|
-
handleRouteChange();
|
|
80
|
-
return () => {
|
|
81
|
-
observer.disconnect();
|
|
82
|
-
window.removeEventListener("popstate", handleRouteChange);
|
|
83
|
-
};
|
|
84
|
-
}, []);
|
|
85
|
-
return null;
|
|
86
|
-
}
|
|
87
|
-
export {
|
|
88
|
-
Input,
|
|
89
|
-
Loading,
|
|
90
|
-
Progress,
|
|
91
|
-
cn
|
|
92
|
-
};
|
|
93
|
-
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/loading.tsx","../src/utils/clsx.ts","../src/components/input.tsx","../src/components/nprogress.tsx"],"sourcesContent":["import { Spinner, SpinnerProps } from \"@heroui/react\";\nimport { cn } from \"../utils/clsx\";\n\nexport function Loading({ className, ...p }: SpinnerProps) {\n return (\n <Spinner\n color=\"default\"\n className={cn(\"absolute inset-0\", className)}\n label=\"加载中...\"\n classNames={{\n circle2: \"border-b-foreground\",\n circle1: \"border-b-foreground\",\n label: \"text-sm mt-2\"\n }}\n {...p}\n />\n );\n}\n","import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import { Input as NextInput, InputProps } from \"@heroui/react\";\nimport React from \"react\";\nimport { cn } from \"../utils/clsx\";\n\nexport const Input = React.forwardRef<HTMLInputElement, InputProps>(function Input(\n { classNames, ...props },\n ref\n) {\n return (\n <NextInput\n ref={ref}\n {...(props as any)}\n classNames={{\n ...(classNames ?? {}),\n label: cn(\n \"group-data-[filled-within=true]:!-translate-y-1/2 group-data-[filled-within=true]:top-0 bg-transparent group-data-[filled-within=true]:bg-white group-data-[filled-within=true]:dark:bg-black transition-[transform,color,left,opacity,background] px-1\",\n classNames?.label\n ),\n input: cn(\"h-full\", classNames?.input)\n }}\n />\n );\n});\n","import NProgress from \"nprogress\";\nimport { useEffect } from \"react\";\n\nNProgress.configure({ showSpinner: false });\n\nexport function Progress() {\n useEffect(() => {\n let lastHref = window.location.href;\n\n const handleRouteChange = () => {\n NProgress.start();\n const timer = setTimeout(() => NProgress.done(), 100);\n return () => {\n clearTimeout(timer);\n NProgress.done();\n };\n };\n\n const observer = new MutationObserver(() => {\n const currentHref = window.location.href;\n if (currentHref !== lastHref) {\n lastHref = currentHref;\n handleRouteChange();\n }\n });\n\n observer.observe(document, {\n subtree: true,\n childList: true\n });\n\n window.addEventListener(\"popstate\", handleRouteChange);\n\n handleRouteChange();\n\n return () => {\n observer.disconnect();\n window.removeEventListener(\"popstate\", handleRouteChange);\n };\n }, []);\n\n return null;\n}\n"],"mappings":";AAAA,SAAS,eAA6B;;;ACAtC,SAA0B,YAAY;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ADAI;AAFG,SAAS,QAAQ,EAAE,WAAW,GAAG,EAAE,GAAiB;AACzD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAM;AAAA,MACN,WAAW,GAAG,oBAA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IAC1D;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,SAAO;AACT;","names":["jsx","Input"]}
|
package/dist/style.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@import url("nprogress/nprogress.css");
|
package/dist/style.d.mts
DELETED