@cozeloop/components 0.0.1
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 +3 -0
- package/dist/base-search-select/base-search-form-select.d.ts +3 -0
- package/dist/base-search-select/base-search-form-select.js +6 -0
- package/dist/base-search-select/base-search-form-select.js.map +1 -0
- package/dist/base-search-select/base-search-select.d.ts +9 -0
- package/dist/base-search-select/base-search-select.js +125 -0
- package/dist/base-search-select/base-search-select.js.map +1 -0
- package/dist/base-search-select/index.d.ts +3 -0
- package/dist/base-search-select/index.js +3 -0
- package/dist/base-search-select/index.js.map +1 -0
- package/dist/base-search-select/types.d.ts +10 -0
- package/dist/base-search-select/types.js +2 -0
- package/dist/base-search-select/types.js.map +1 -0
- package/dist/base-search-select/utils.d.ts +8 -0
- package/dist/base-search-select/utils.js +48 -0
- package/dist/base-search-select/utils.js.map +1 -0
- package/dist/code-editor/index.d.ts +3 -0
- package/dist/code-editor/index.js +6 -0
- package/dist/code-editor/index.js.map +1 -0
- package/dist/collapse-card/index.d.ts +13 -0
- package/dist/collapse-card/index.js +31 -0
- package/dist/collapse-card/index.js.map +1 -0
- package/dist/collapsible-card/index.d.ts +13 -0
- package/dist/collapsible-card/index.js +13 -0
- package/dist/collapsible-card/index.js.map +1 -0
- package/dist/column-manage-storage/index.d.ts +11 -0
- package/dist/column-manage-storage/index.js +48 -0
- package/dist/column-manage-storage/index.js.map +1 -0
- package/dist/columns-select/index.d.ts +19 -0
- package/dist/columns-select/index.js +79 -0
- package/dist/columns-select/index.js.map +1 -0
- package/dist/edit-icon-button/index.d.ts +8 -0
- package/dist/edit-icon-button/index.js +13 -0
- package/dist/edit-icon-button/index.js.map +1 -0
- package/dist/es/collapsible-card/index.js +45 -0
- package/dist/es/collapsible-card/index.module.js +5 -0
- package/dist/es/collapsible-card/index_module.css +48 -0
- package/dist/es/column-manage-storage/index.js +73 -0
- package/dist/es/columns-select/index.js +219 -0
- package/dist/es/hooks/use-infinite-scroll.js +178 -0
- package/dist/es/hooks/use-mouse-down-offset.js +41 -0
- package/dist/es/id-render/icon-button-container.js +61 -0
- package/dist/es/id-render/index.js +78 -0
- package/dist/es/index.js +66 -0
- package/dist/es/infinite-scroll-table/index.js +98 -0
- package/dist/es/input-slider/index.js +123 -0
- package/dist/es/input-slider/index.module.js +5 -0
- package/dist/es/input-slider/index_module.css +21 -0
- package/dist/es/large-txt-render/index.js +38 -0
- package/dist/es/page-content/index.js +108 -0
- package/dist/es/primary-page/index.js +4 -0
- package/dist/es/primary-page/primary-header.js +38 -0
- package/dist/es/resize-sidesheet/index.js +100 -0
- package/dist/es/resize-sidesheet/index.module.js +5 -0
- package/dist/es/resize-sidesheet/index_module.css +9 -0
- package/dist/es/resize-sidesheet/use-drag.js +31 -0
- package/dist/es/table/index.js +56 -0
- package/dist/es/table/index.module.js +5 -0
- package/dist/es/table/index_module.css +90 -0
- package/dist/es/table/sort-icon.js +105 -0
- package/dist/es/table/table-with-pagination.js +112 -0
- package/dist/es/table/table-without-pagniation.js +74 -0
- package/dist/es/table-col-actions/index.js +103 -0
- package/dist/es/table-header/index.js +68 -0
- package/dist/es/table-header/index.module.js +5 -0
- package/dist/es/table-header/index_module.css +3 -0
- package/dist/es/tabs/index.js +42 -0
- package/dist/es/tabs/index.module.js +5 -0
- package/dist/es/tabs/index_module.css +37 -0
- package/dist/es/text-with-copy/index.js +71 -0
- package/dist/es/tooltip-with-disabled/index.js +49 -0
- package/dist/es/utils/basic.js +44 -0
- package/dist/es/utils/rect.js +37 -0
- package/dist/hooks/use-infinite-scroll.d.ts +23 -0
- package/dist/hooks/use-infinite-scroll.js +133 -0
- package/dist/hooks/use-infinite-scroll.js.map +1 -0
- package/dist/hooks/use-mouse-down-offset.d.ts +9 -0
- package/dist/hooks/use-mouse-down-offset.js +39 -0
- package/dist/hooks/use-mouse-down-offset.js.map +1 -0
- package/dist/id-render/icon-button-container.d.ts +6 -0
- package/dist/id-render/icon-button-container.js +6 -0
- package/dist/id-render/icon-button-container.js.map +1 -0
- package/dist/id-render/index.d.ts +7 -0
- package/dist/id-render/index.js +21 -0
- package/dist/id-render/index.js.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/infinite-scroll-table/index.d.ts +19 -0
- package/dist/infinite-scroll-table/index.js +34 -0
- package/dist/infinite-scroll-table/index.js.map +1 -0
- package/dist/info-tooltip/index.d.ts +6 -0
- package/dist/info-tooltip/index.js +6 -0
- package/dist/info-tooltip/index.js.map +1 -0
- package/dist/input-slider/index.d.ts +14 -0
- package/dist/input-slider/index.js +81 -0
- package/dist/input-slider/index.js.map +1 -0
- package/dist/jump-button/jump-icon-button.d.ts +4 -0
- package/dist/jump-button/jump-icon-button.js +7 -0
- package/dist/jump-button/jump-icon-button.js.map +1 -0
- package/dist/large-txt-render/index.d.ts +4 -0
- package/dist/large-txt-render/index.js +26 -0
- package/dist/large-txt-render/index.js.map +1 -0
- package/dist/lib/collapsible-card/index.js +79 -0
- package/dist/lib/collapsible-card/index.module.js +25 -0
- package/dist/lib/collapsible-card/index_module.css +48 -0
- package/dist/lib/column-manage-storage/index.js +98 -0
- package/dist/lib/columns-select/index.js +241 -0
- package/dist/lib/hooks/use-infinite-scroll.js +195 -0
- package/dist/lib/hooks/use-mouse-down-offset.js +65 -0
- package/dist/lib/id-render/icon-button-container.js +89 -0
- package/dist/lib/id-render/index.js +112 -0
- package/dist/lib/index.js +110 -0
- package/dist/lib/infinite-scroll-table/index.js +126 -0
- package/dist/lib/input-slider/index.js +154 -0
- package/dist/lib/input-slider/index.module.js +25 -0
- package/dist/lib/input-slider/index_module.css +21 -0
- package/dist/lib/large-txt-render/index.js +62 -0
- package/dist/lib/page-content/index.js +136 -0
- package/dist/lib/primary-page/index.js +28 -0
- package/dist/lib/primary-page/primary-header.js +72 -0
- package/dist/lib/resize-sidesheet/index.js +129 -0
- package/dist/lib/resize-sidesheet/index.module.js +25 -0
- package/dist/lib/resize-sidesheet/index_module.css +9 -0
- package/dist/lib/resize-sidesheet/use-drag.js +55 -0
- package/dist/lib/table/index.js +88 -0
- package/dist/lib/table/index.module.js +25 -0
- package/dist/lib/table/index_module.css +90 -0
- package/dist/lib/table/sort-icon.js +137 -0
- package/dist/lib/table/table-with-pagination.js +146 -0
- package/dist/lib/table/table-without-pagniation.js +108 -0
- package/dist/lib/table-col-actions/index.js +123 -0
- package/dist/lib/table-header/index.js +96 -0
- package/dist/lib/table-header/index.module.js +25 -0
- package/dist/lib/table-header/index_module.css +3 -0
- package/dist/lib/tabs/index.js +74 -0
- package/dist/lib/tabs/index.module.js +25 -0
- package/dist/lib/tabs/index_module.css +37 -0
- package/dist/lib/text-with-copy/index.js +105 -0
- package/dist/lib/tooltip-with-disabled/index.js +71 -0
- package/dist/lib/utils/basic.js +78 -0
- package/dist/lib/utils/rect.js +65 -0
- package/dist/logic-expr/consts.d.ts +4 -0
- package/dist/logic-expr/consts.js +5 -0
- package/dist/logic-expr/consts.js.map +1 -0
- package/dist/logic-expr/expr-group-render.d.ts +2 -0
- package/dist/logic-expr/expr-group-render.js +60 -0
- package/dist/logic-expr/expr-group-render.js.map +1 -0
- package/dist/logic-expr/expr-render.d.ts +2 -0
- package/dist/logic-expr/expr-render.js +84 -0
- package/dist/logic-expr/expr-render.js.map +1 -0
- package/dist/logic-expr/index.d.ts +2 -0
- package/dist/logic-expr/index.js +2 -0
- package/dist/logic-expr/index.js.map +1 -0
- package/dist/logic-expr/logic-expr.d.ts +2 -0
- package/dist/logic-expr/logic-expr.js +187 -0
- package/dist/logic-expr/logic-expr.js.map +1 -0
- package/dist/logic-expr/logic-not.d.ts +10 -0
- package/dist/logic-expr/logic-not.js +20 -0
- package/dist/logic-expr/logic-not.js.map +1 -0
- package/dist/logic-expr/logic-toggle.d.ts +12 -0
- package/dist/logic-expr/logic-toggle.js +32 -0
- package/dist/logic-expr/logic-toggle.js.map +1 -0
- package/dist/logic-expr/types.d.ts +79 -0
- package/dist/logic-expr/types.js +2 -0
- package/dist/logic-expr/types.js.map +1 -0
- package/dist/open-detail-button/index.d.ts +6 -0
- package/dist/open-detail-button/index.js +11 -0
- package/dist/open-detail-button/index.js.map +1 -0
- package/dist/page-content/index.d.ts +20 -0
- package/dist/page-content/index.js +23 -0
- package/dist/page-content/index.js.map +1 -0
- package/dist/primary-page/index.d.ts +1 -0
- package/dist/primary-page/index.js +2 -0
- package/dist/primary-page/index.js.map +1 -0
- package/dist/primary-page/primary-header.d.ts +10 -0
- package/dist/primary-page/primary-header.js +4 -0
- package/dist/primary-page/primary-header.js.map +1 -0
- package/dist/resize-sidesheet/index.d.ts +6 -0
- package/dist/resize-sidesheet/index.js +15 -0
- package/dist/resize-sidesheet/index.js.map +1 -0
- package/dist/resize-sidesheet/use-drag.d.ts +10 -0
- package/dist/resize-sidesheet/use-drag.js +25 -0
- package/dist/resize-sidesheet/use-drag.js.map +1 -0
- package/dist/route/route-back-action.d.ts +6 -0
- package/dist/route/route-back-action.js +29 -0
- package/dist/route/route-back-action.js.map +1 -0
- package/dist/table/index.d.ts +2 -0
- package/dist/table/index.js +6 -0
- package/dist/table/index.js.map +1 -0
- package/dist/table/sort-icon.d.ts +8 -0
- package/dist/table/sort-icon.js +30 -0
- package/dist/table/sort-icon.js.map +1 -0
- package/dist/table/table-with-pagination.d.ts +14 -0
- package/dist/table/table-with-pagination.js +55 -0
- package/dist/table/table-with-pagination.js.map +1 -0
- package/dist/table/table-without-pagniation.d.ts +8 -0
- package/dist/table/table-without-pagniation.js +36 -0
- package/dist/table/table-without-pagniation.js.map +1 -0
- package/dist/table-col-actions/index.d.ts +17 -0
- package/dist/table-col-actions/index.js +24 -0
- package/dist/table-col-actions/index.js.map +1 -0
- package/dist/table-header/index.d.ts +12 -0
- package/dist/table-header/index.js +10 -0
- package/dist/table-header/index.js.map +1 -0
- package/dist/tabs/index.d.ts +2 -0
- package/dist/tabs/index.js +9 -0
- package/dist/tabs/index.js.map +1 -0
- package/dist/text-with-copy/index.d.ts +14 -0
- package/dist/text-with-copy/index.js +21 -0
- package/dist/text-with-copy/index.js.map +1 -0
- package/dist/tooltip-with-disabled/index.d.ts +5 -0
- package/dist/tooltip-with-disabled/index.js +9 -0
- package/dist/tooltip-with-disabled/index.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/dist/types/collapsible-card/index.d.ts +22 -0
- package/dist/types/column-manage-storage/index.d.ts +11 -0
- package/dist/types/columns-select/index.d.ts +29 -0
- package/dist/types/hooks/use-infinite-scroll.d.ts +23 -0
- package/dist/types/hooks/use-mouse-down-offset.d.ts +9 -0
- package/dist/types/id-render/icon-button-container.d.ts +12 -0
- package/dist/types/id-render/index.d.ts +13 -0
- package/dist/types/index.d.ts +19 -0
- package/dist/types/infinite-scroll-table/index.d.ts +19 -0
- package/dist/types/input-slider/index.d.ts +14 -0
- package/dist/types/large-txt-render/index.d.ts +4 -0
- package/dist/types/page-content/index.d.ts +36 -0
- package/dist/types/primary-page/index.d.ts +1 -0
- package/dist/types/primary-page/primary-header.d.ts +17 -0
- package/dist/types/resize-sidesheet/index.d.ts +6 -0
- package/dist/types/resize-sidesheet/use-drag.d.ts +10 -0
- package/dist/types/table/index.d.ts +2 -0
- package/dist/types/table/sort-icon.d.ts +13 -0
- package/dist/types/table/table-with-pagination.d.ts +14 -0
- package/dist/types/table/table-without-pagniation.d.ts +8 -0
- package/dist/types/table-col-actions/index.d.ts +21 -0
- package/dist/types/table-header/index.d.ts +20 -0
- package/dist/types/tabs/index.d.ts +2 -0
- package/dist/types/text-with-copy/index.d.ts +24 -0
- package/dist/types/tooltip-with-disabled/index.d.ts +9 -0
- package/dist/types/utils/basic.d.ts +1 -0
- package/dist/types/utils/rect.d.ts +10 -0
- package/dist/upload/index.d.ts +9 -0
- package/dist/upload/index.js +25 -0
- package/dist/upload/index.js.map +1 -0
- package/dist/user-profile/index.d.ts +8 -0
- package/dist/user-profile/index.js +16 -0
- package/dist/user-profile/index.js.map +1 -0
- package/dist/user-select/index.d.ts +0 -0
- package/dist/user-select/index.js +188 -0
- package/dist/user-select/index.js.map +1 -0
- package/dist/user-select/user-info.d.ts +8 -0
- package/dist/user-select/user-info.js +16 -0
- package/dist/user-select/user-info.js.map +1 -0
- package/dist/utils/basic.d.ts +1 -0
- package/dist/utils/basic.js +24 -0
- package/dist/utils/basic.js.map +1 -0
- package/dist/utils/rect.d.ts +10 -0
- package/dist/utils/rect.js +35 -0
- package/dist/utils/rect.js.map +1 -0
- package/dist/version-list/version-descriptions.d.ts +15 -0
- package/dist/version-list/version-descriptions.js +14 -0
- package/dist/version-list/version-descriptions.js.map +1 -0
- package/dist/version-list/version-item.d.ts +9 -0
- package/dist/version-list/version-item.js +6 -0
- package/dist/version-list/version-item.js.map +1 -0
- package/dist/version-list/version-list.d.ts +11 -0
- package/dist/version-list/version-list.js +11 -0
- package/dist/version-list/version-list.js.map +1 -0
- package/dist/version-list/version-switch-panel.d.ts +5 -0
- package/dist/version-list/version-switch-panel.js +10 -0
- package/dist/version-list/version-switch-panel.js.map +1 -0
- package/package.json +54 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { useEffect, useRef, useState } from "react";
|
|
2
|
+
import { useMouseDownOffset } from "../hooks/use-mouse-down-offset";
|
|
3
|
+
const DEFAULT_WIDTH = 500;
|
|
4
|
+
const MAX_WIDTH = 800;
|
|
5
|
+
const MIN_WIDTH = 300;
|
|
6
|
+
const useDrag = (options = {}) => {
|
|
7
|
+
const {
|
|
8
|
+
defaultWidth = DEFAULT_WIDTH,
|
|
9
|
+
maxWidth = MAX_WIDTH,
|
|
10
|
+
minWidth = MIN_WIDTH
|
|
11
|
+
} = options;
|
|
12
|
+
const [sidePaneWidth, setSidePaneWidth] = useState(defaultWidth);
|
|
13
|
+
const prevWidthRef = useRef(sidePaneWidth);
|
|
14
|
+
const { ref, isActive } = useMouseDownOffset(({ offsetX }) => {
|
|
15
|
+
const newWidth = prevWidthRef.current - offsetX;
|
|
16
|
+
setSidePaneWidth([maxWidth, newWidth, minWidth].sort((a, b) => a - b)[1]);
|
|
17
|
+
});
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
prevWidthRef.current = sidePaneWidth;
|
|
20
|
+
document.body.style.cursor = isActive ? "col-resize" : "";
|
|
21
|
+
document.body.style.userSelect = isActive ? "none" : "auto";
|
|
22
|
+
}, [isActive]);
|
|
23
|
+
return {
|
|
24
|
+
sidePaneWidth,
|
|
25
|
+
containerRef: ref,
|
|
26
|
+
isActive
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
useDrag
|
|
31
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
import { jsx } from "react/jsx-runtime";
|
|
33
|
+
import { IconCozIllusEmpty } from "@coze-arch/coze-design/illustrations";
|
|
34
|
+
import { EmptyState, Table } from "@coze-arch/coze-design";
|
|
35
|
+
import styles from "./index.module";
|
|
36
|
+
const LoopTable = (_a) => {
|
|
37
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
38
|
+
return /* @__PURE__ */ jsx(
|
|
39
|
+
Table,
|
|
40
|
+
__spreadProps(__spreadValues({
|
|
41
|
+
empty: /* @__PURE__ */ jsx(
|
|
42
|
+
EmptyState,
|
|
43
|
+
{
|
|
44
|
+
size: "full_screen",
|
|
45
|
+
icon: /* @__PURE__ */ jsx(IconCozIllusEmpty, {}),
|
|
46
|
+
title: "暂无数据"
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
}, props), {
|
|
50
|
+
id: styles["fornax-table"]
|
|
51
|
+
})
|
|
52
|
+
);
|
|
53
|
+
};
|
|
54
|
+
export {
|
|
55
|
+
LoopTable
|
|
56
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
#fornax-table_8eb2d {
|
|
2
|
+
/* stylelint-disable declaration-no-important */
|
|
3
|
+
/* stylelint-disable no-descending-specificity */
|
|
4
|
+
}
|
|
5
|
+
#fornax-table_8eb2d .semi-table-container {
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
border: 1px solid var(--line-color-border-2, #eaedf1);
|
|
8
|
+
border-radius: 6px;
|
|
9
|
+
}
|
|
10
|
+
#fornax-table_8eb2d .semi-table-header {
|
|
11
|
+
background-color: var(--coz-bg, #f0f0f7);
|
|
12
|
+
}
|
|
13
|
+
#fornax-table_8eb2d .semi-spin-wrapper svg {
|
|
14
|
+
width: 20px;
|
|
15
|
+
height: 20px;
|
|
16
|
+
}
|
|
17
|
+
#fornax-table_8eb2d .semi-table-row:hover > .semi-table-row-cell:first-child {
|
|
18
|
+
border-top-left-radius: 0;
|
|
19
|
+
border-bottom-left-radius: 0;
|
|
20
|
+
}
|
|
21
|
+
#fornax-table_8eb2d .semi-table-row:hover > .semi-table-row-cell:last-child {
|
|
22
|
+
border-top-right-radius: 0;
|
|
23
|
+
border-bottom-right-radius: 0;
|
|
24
|
+
}
|
|
25
|
+
#fornax-table_8eb2d .semi-table-tbody .semi-table-row:last-child .semi-table-row-cell {
|
|
26
|
+
border-bottom: none;
|
|
27
|
+
}
|
|
28
|
+
#fornax-table_8eb2d .semi-table-row-head {
|
|
29
|
+
box-sizing: border-box;
|
|
30
|
+
height: 42px;
|
|
31
|
+
padding: 5px 20px;
|
|
32
|
+
font-size: 13px;
|
|
33
|
+
font-weight: 500;
|
|
34
|
+
line-height: 20px;
|
|
35
|
+
color: var(--coz-fg-plus);
|
|
36
|
+
background: var(--coz-bg, #f0f0f7);
|
|
37
|
+
background-color: var(--coz-bg, #f0f0f7) !important;
|
|
38
|
+
border-bottom: 1px solid var(--line-color-border-2, #eaedf1);
|
|
39
|
+
}
|
|
40
|
+
#fornax-table_8eb2d .semi-table-row-head::before {
|
|
41
|
+
background-color: var(--coz-bg, #f0f0f7) !important;
|
|
42
|
+
}
|
|
43
|
+
#fornax-table_8eb2d .semi-table-row {
|
|
44
|
+
background-color: var(--coz-bg-max);
|
|
45
|
+
}
|
|
46
|
+
#fornax-table_8eb2d .semi-table-row:hover {
|
|
47
|
+
border-radius: 0 !important;
|
|
48
|
+
}
|
|
49
|
+
#fornax-table_8eb2d .semi-table-row:hover .semi-table-row-cell {
|
|
50
|
+
background-color: var(--coz-bg);
|
|
51
|
+
}
|
|
52
|
+
#fornax-table_8eb2d .semi-table-row:hover .semi-table-cell-fixed-left {
|
|
53
|
+
background-image: linear-gradient(0deg, var(--coz-bg), var(--coz-bg));
|
|
54
|
+
}
|
|
55
|
+
#fornax-table_8eb2d .semi-table-row:hover .semi-table-cell-fixed-right {
|
|
56
|
+
background-image: linear-gradient(0deg, var(--coz-bg), var(--coz-bg));
|
|
57
|
+
}
|
|
58
|
+
#fornax-table_8eb2d .semi-table-row-cell {
|
|
59
|
+
overflow: hidden;
|
|
60
|
+
box-sizing: border-box;
|
|
61
|
+
height: 42px;
|
|
62
|
+
padding: 10px 20px;
|
|
63
|
+
font-size: 13px;
|
|
64
|
+
font-weight: 400;
|
|
65
|
+
color: var(--coz-fg-primary);
|
|
66
|
+
vertical-align: top;
|
|
67
|
+
background-color: #fff;
|
|
68
|
+
border-radius: 0;
|
|
69
|
+
vertical-align: middle;
|
|
70
|
+
}
|
|
71
|
+
#fornax-table_8eb2d .semi-table-tbody > .semi-table-row > .semi-table-cell-fixed-left-last,
|
|
72
|
+
#fornax-table_8eb2d .semi-table-thead > .semi-table-row > .semi-table-row-head.semi-table-cell-fixed-left-last {
|
|
73
|
+
border-right: none;
|
|
74
|
+
box-shadow: 2px 0 8px rgba(0, 0, 0, 0.06);
|
|
75
|
+
}
|
|
76
|
+
#fornax-table_8eb2d .semi-table-tbody > .semi-table-row > .semi-table-cell-fixed-right-first,
|
|
77
|
+
#fornax-table_8eb2d .semi-table-thead > .semi-table-row > .semi-table-row-head.semi-table-cell-fixed-right-first {
|
|
78
|
+
border-left: none;
|
|
79
|
+
box-shadow: -2px 0 8px rgba(0, 0, 0, 0.06);
|
|
80
|
+
}
|
|
81
|
+
#fornax-table_8eb2d .semi-table-scroll-position-left .semi-table-tbody > .semi-table-row > .semi-table-cell-fixed-left-last,
|
|
82
|
+
#fornax-table_8eb2d .semi-table-scroll-position-left .semi-table-thead > .semi-table-row > .semi-table-cell-fixed-left-last,
|
|
83
|
+
#fornax-table_8eb2d .semi-table-scroll-position-right .semi-table-tbody > .semi-table-row > .semi-table-cell-fixed-right-first,
|
|
84
|
+
#fornax-table_8eb2d .semi-table-scroll-position-right .semi-table-thead > .semi-table-row > .semi-table-cell-fixed-right-first {
|
|
85
|
+
box-shadow: none !important;
|
|
86
|
+
}
|
|
87
|
+
#fornax-table_8eb2d .semi-table-bordered .semi-table-thead > .semi-table-row > .semi-table-row-head:last-child,
|
|
88
|
+
#fornax-table_8eb2d .semi-table-bordered .semi-table-tbody > .semi-table-row > .semi-table-row-cell:last-child {
|
|
89
|
+
border-right: none;
|
|
90
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
33
|
+
import { Tooltip } from "@coze-arch/coze-design";
|
|
34
|
+
import IconButtonContainer from "../id-render/icon-button-container";
|
|
35
|
+
const activeColor = "rgb(var(--coze-up-brand-9))";
|
|
36
|
+
const unActiveColor = "var(--coz-fg-dim)";
|
|
37
|
+
const IconSortArrow = (_a) => {
|
|
38
|
+
var _b = _a, {
|
|
39
|
+
sortOrder
|
|
40
|
+
} = _b, rest = __objRest(_b, [
|
|
41
|
+
"sortOrder"
|
|
42
|
+
]);
|
|
43
|
+
let descendColor = "currentColor";
|
|
44
|
+
let ascendColor = "currentColor";
|
|
45
|
+
if (sortOrder === "descend") {
|
|
46
|
+
descendColor = activeColor;
|
|
47
|
+
ascendColor = unActiveColor;
|
|
48
|
+
} else if (sortOrder === "ascend") {
|
|
49
|
+
descendColor = unActiveColor;
|
|
50
|
+
ascendColor = activeColor;
|
|
51
|
+
}
|
|
52
|
+
return /* @__PURE__ */ jsxs(
|
|
53
|
+
"svg",
|
|
54
|
+
__spreadProps(__spreadValues({
|
|
55
|
+
width: "14",
|
|
56
|
+
height: "14",
|
|
57
|
+
viewBox: "0 0 24 24",
|
|
58
|
+
fill: "currentColor",
|
|
59
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
60
|
+
}, rest), {
|
|
61
|
+
children: [
|
|
62
|
+
/* @__PURE__ */ jsx(
|
|
63
|
+
"path",
|
|
64
|
+
{
|
|
65
|
+
d: "M7.00012 1.99976C7.55241 1.99976 8.00012 2.44747 8.00012 2.99976V17.2677L9.6341 14.4376C9.91024 13.9593 10.5218 13.7954 11.0001 14.0715C11.4784 14.3477 11.6423 14.9593 11.3661 15.4376L7.8758 21.483C7.85628 21.5183 7.83468 21.5523 7.81118 21.5849C7.72727 21.7015 7.62174 21.7953 7.50337 21.8641C7.38229 21.9347 7.24502 21.9807 7.09848 21.995C7.06439 21.9984 7.03007 22 6.99566 21.9999C6.64882 22.0011 6.31102 21.8217 6.12517 21.4998L2.62517 15.4376C2.34903 14.9593 2.5129 14.3477 2.99119 14.0715C3.46949 13.7954 4.08108 13.9593 4.35722 14.4376L6.00012 17.2832V2.99976C6.00012 2.44747 6.44784 1.99976 7.00012 1.99976Z",
|
|
66
|
+
fill: descendColor
|
|
67
|
+
}
|
|
68
|
+
),
|
|
69
|
+
/* @__PURE__ */ jsx(
|
|
70
|
+
"path",
|
|
71
|
+
{
|
|
72
|
+
d: "M17.001 21.9999C16.4487 21.9999 16.001 21.5522 16.001 20.9999L16.001 6.73198L14.367 9.5621C14.0909 10.0404 13.4793 10.2043 13.001 9.92813C12.5227 9.65199 12.3589 9.04039 12.635 8.5621L16.1253 2.51665C16.1449 2.48135 16.1665 2.44735 16.19 2.41482C16.2739 2.29823 16.3794 2.20436 16.4978 2.13559C16.6189 2.06494 16.7561 2.019 16.9027 2.0047C16.9368 2.0013 16.9711 1.99964 17.0055 1.99977C17.3523 1.99854 17.6901 2.17802 17.876 2.49993L21.376 8.5621C21.6521 9.0404 21.4882 9.65199 21.0099 9.92813C20.5317 10.2043 19.9201 10.0404 19.6439 9.5621L18.001 6.71652L18.001 20.9999C18.001 21.5522 17.5533 21.9999 17.001 21.9999Z",
|
|
73
|
+
fill: ascendColor
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
]
|
|
77
|
+
})
|
|
78
|
+
);
|
|
79
|
+
};
|
|
80
|
+
function LoopTableSortIcon({
|
|
81
|
+
sortOrder
|
|
82
|
+
}) {
|
|
83
|
+
let tooltip = "点击升序";
|
|
84
|
+
if (sortOrder === "ascend") {
|
|
85
|
+
tooltip = "点击降序";
|
|
86
|
+
} else if (sortOrder === "descend") {
|
|
87
|
+
tooltip = "点击恢复默认排序";
|
|
88
|
+
}
|
|
89
|
+
return /* @__PURE__ */ jsx(Tooltip, { theme: "dark", content: tooltip, children: /* @__PURE__ */ jsx("div", { className: "flex items-center", children: /* @__PURE__ */ jsx(
|
|
90
|
+
IconButtonContainer,
|
|
91
|
+
{
|
|
92
|
+
icon: /* @__PURE__ */ jsx(
|
|
93
|
+
IconSortArrow,
|
|
94
|
+
{
|
|
95
|
+
sortOrder,
|
|
96
|
+
className: "text-[var(--coz-fg-secondary)]"
|
|
97
|
+
}
|
|
98
|
+
)
|
|
99
|
+
}
|
|
100
|
+
) }) });
|
|
101
|
+
}
|
|
102
|
+
export {
|
|
103
|
+
IconSortArrow,
|
|
104
|
+
LoopTableSortIcon as default
|
|
105
|
+
};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
21
|
+
import { useEffect, useMemo, useRef } from "react";
|
|
22
|
+
import { useSize } from "ahooks";
|
|
23
|
+
import { CozPagination } from "@coze-arch/coze-design";
|
|
24
|
+
import LoopTableSortIcon from "./sort-icon";
|
|
25
|
+
import { LoopTable } from "./index";
|
|
26
|
+
const PAGE_SIZE_OPTIONS = [10, 20, 50];
|
|
27
|
+
const DEFAULT_PAGE_SIZE = 10;
|
|
28
|
+
function TableWithPagination(props) {
|
|
29
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
30
|
+
const {
|
|
31
|
+
pageSizeOpts,
|
|
32
|
+
service,
|
|
33
|
+
header,
|
|
34
|
+
heightFull = false,
|
|
35
|
+
footerWithPagination
|
|
36
|
+
} = props;
|
|
37
|
+
const { columns } = (_a = props.tableProps) != null ? _a : {};
|
|
38
|
+
const tableContainerRef = useRef(null);
|
|
39
|
+
const size = useSize(tableContainerRef.current);
|
|
40
|
+
const tableHeaderSize = useSize(
|
|
41
|
+
(_b = tableContainerRef.current) == null ? void 0 : _b.querySelector(".semi-table-header")
|
|
42
|
+
);
|
|
43
|
+
const tablePagination = useMemo(
|
|
44
|
+
() => ({
|
|
45
|
+
currentPage: service.pagination.current,
|
|
46
|
+
pageSize: service.pagination.pageSize,
|
|
47
|
+
total: Number(service.pagination.total),
|
|
48
|
+
onChange: (page, pageSize) => {
|
|
49
|
+
service.pagination.onChange(page, pageSize);
|
|
50
|
+
},
|
|
51
|
+
showSizeChanger: true,
|
|
52
|
+
pageSizeOpts: pageSizeOpts != null ? pageSizeOpts : PAGE_SIZE_OPTIONS
|
|
53
|
+
}),
|
|
54
|
+
[service.pagination, pageSizeOpts]
|
|
55
|
+
);
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
var _a2, _b2;
|
|
58
|
+
if (service.pagination.current > 1 && ((_b2 = (_a2 = service == null ? void 0 : service.data) == null ? void 0 : _a2.list) == null ? void 0 : _b2.length) === 0) {
|
|
59
|
+
service.pagination.changeCurrent(1);
|
|
60
|
+
}
|
|
61
|
+
}, [service.pagination.current, (_c = service == null ? void 0 : service.data) == null ? void 0 : _c.list]);
|
|
62
|
+
const tableHeaderHeight = (_d = tableHeaderSize == null ? void 0 : tableHeaderSize.height) != null ? _d : 56;
|
|
63
|
+
return /* @__PURE__ */ jsxs(
|
|
64
|
+
"div",
|
|
65
|
+
{
|
|
66
|
+
className: `${heightFull ? "h-full flex overflow-hidden" : ""} flex flex-col gap-3`,
|
|
67
|
+
children: [
|
|
68
|
+
header ? header : null,
|
|
69
|
+
/* @__PURE__ */ jsx(
|
|
70
|
+
"div",
|
|
71
|
+
{
|
|
72
|
+
ref: tableContainerRef,
|
|
73
|
+
className: heightFull ? "flex-1 overflow-hidden" : "",
|
|
74
|
+
children: /* @__PURE__ */ jsx(
|
|
75
|
+
LoopTable,
|
|
76
|
+
__spreadProps(__spreadValues({}, props), {
|
|
77
|
+
tableProps: __spreadProps(__spreadValues({
|
|
78
|
+
empty: /* @__PURE__ */ jsx(Fragment, {})
|
|
79
|
+
}, (_e = props.tableProps) != null ? _e : {}), {
|
|
80
|
+
scroll: __spreadValues({
|
|
81
|
+
// 表格容器的高度减去表格头的高度
|
|
82
|
+
y: (size == null ? void 0 : size.height) === void 0 || !heightFull ? void 0 : size.height - tableHeaderHeight - 2
|
|
83
|
+
}, (_g = (_f = props.tableProps) == null ? void 0 : _f.scroll) != null ? _g : {}),
|
|
84
|
+
loading: service == null ? void 0 : service.loading,
|
|
85
|
+
columns: (_h = columns == null ? void 0 : columns.filter(
|
|
86
|
+
(column) => column.hidden !== true && column.checked !== false
|
|
87
|
+
)) == null ? void 0 : _h.map((column) => __spreadValues(__spreadValues({}, column), column.sorter && !column.sortIcon ? { sortIcon: LoopTableSortIcon } : {})),
|
|
88
|
+
dataSource: (_j = (_i = service == null ? void 0 : service.data) == null ? void 0 : _i.list) != null ? _j : []
|
|
89
|
+
})
|
|
90
|
+
})
|
|
91
|
+
)
|
|
92
|
+
}
|
|
93
|
+
),
|
|
94
|
+
service.pagination.current > 1 || ((_l = (_k = service == null ? void 0 : service.data) == null ? void 0 : _k.list) == null ? void 0 : _l.length) && ((_n = (_m = service == null ? void 0 : service.data) == null ? void 0 : _m.list) == null ? void 0 : _n.length) > 0 ? /* @__PURE__ */ jsxs("div", { className: "shrink-0 flex flex-row-reverse justify-between items-center", children: [
|
|
95
|
+
/* @__PURE__ */ jsx(
|
|
96
|
+
CozPagination,
|
|
97
|
+
__spreadProps(__spreadValues({}, tablePagination), {
|
|
98
|
+
showTotal: true,
|
|
99
|
+
showSizeChanger: true
|
|
100
|
+
})
|
|
101
|
+
),
|
|
102
|
+
footerWithPagination
|
|
103
|
+
] }) : null
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
export {
|
|
109
|
+
DEFAULT_PAGE_SIZE,
|
|
110
|
+
PAGE_SIZE_OPTIONS,
|
|
111
|
+
TableWithPagination
|
|
112
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
21
|
+
import { useRef } from "react";
|
|
22
|
+
import { useSize } from "ahooks";
|
|
23
|
+
import LoopTableSortIcon from "./sort-icon";
|
|
24
|
+
import { LoopTable } from "./index";
|
|
25
|
+
const PAGE_SIZE_OPTIONS = [10, 20, 50];
|
|
26
|
+
const DEFAULT_PAGE_SIZE = 10;
|
|
27
|
+
function TableWithoutPagination(props) {
|
|
28
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
29
|
+
const { header, heightFull = false } = props;
|
|
30
|
+
const { columns } = (_a = props.tableProps) != null ? _a : {};
|
|
31
|
+
const tableContainerRef = useRef(null);
|
|
32
|
+
const size = useSize(tableContainerRef.current);
|
|
33
|
+
const tableHeaderSize = useSize(
|
|
34
|
+
(_b = tableContainerRef.current) == null ? void 0 : _b.querySelector(".semi-table-header")
|
|
35
|
+
);
|
|
36
|
+
const tableHeaderHeight = (_c = tableHeaderSize == null ? void 0 : tableHeaderSize.height) != null ? _c : 56;
|
|
37
|
+
return /* @__PURE__ */ jsxs(
|
|
38
|
+
"div",
|
|
39
|
+
{
|
|
40
|
+
className: `${heightFull ? "h-full flex overflow-hidden" : ""} flex flex-col gap-3`,
|
|
41
|
+
children: [
|
|
42
|
+
header ? header : null,
|
|
43
|
+
/* @__PURE__ */ jsx(
|
|
44
|
+
"div",
|
|
45
|
+
{
|
|
46
|
+
ref: tableContainerRef,
|
|
47
|
+
className: heightFull ? "flex-1 overflow-hidden" : "",
|
|
48
|
+
children: /* @__PURE__ */ jsx(
|
|
49
|
+
LoopTable,
|
|
50
|
+
__spreadProps(__spreadValues({}, props), {
|
|
51
|
+
tableProps: __spreadProps(__spreadValues({
|
|
52
|
+
empty: /* @__PURE__ */ jsx(Fragment, {})
|
|
53
|
+
}, (_d = props.tableProps) != null ? _d : {}), {
|
|
54
|
+
scroll: __spreadValues({
|
|
55
|
+
// 表格容器的高度减去表格头的高度
|
|
56
|
+
y: (size == null ? void 0 : size.height) === void 0 || !heightFull ? void 0 : size.height - tableHeaderHeight - 2
|
|
57
|
+
}, (_f = (_e = props.tableProps) == null ? void 0 : _e.scroll) != null ? _f : {}),
|
|
58
|
+
columns: (_g = columns == null ? void 0 : columns.filter(
|
|
59
|
+
(column) => column.hidden !== true && column.checked !== false
|
|
60
|
+
)) == null ? void 0 : _g.map((column) => __spreadValues(__spreadValues({}, column), column.sorter && !column.sortIcon ? { sortIcon: LoopTableSortIcon } : {}))
|
|
61
|
+
})
|
|
62
|
+
})
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
export {
|
|
71
|
+
DEFAULT_PAGE_SIZE,
|
|
72
|
+
PAGE_SIZE_OPTIONS,
|
|
73
|
+
TableWithoutPagination
|
|
74
|
+
};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { IconCozMore } from "@coze-arch/coze-design/icons";
|
|
4
|
+
import {
|
|
5
|
+
Dropdown,
|
|
6
|
+
Space,
|
|
7
|
+
Typography
|
|
8
|
+
} from "@coze-arch/coze-design";
|
|
9
|
+
import { TooltipWhenDisabled } from "../tooltip-with-disabled";
|
|
10
|
+
function TableColActions({ actions, maxCount = 2, disabled }) {
|
|
11
|
+
const [visible, setVisible] = useState(false);
|
|
12
|
+
const filteredActions = actions.filter((action) => !action.hide);
|
|
13
|
+
const firstActions = filteredActions.slice(0, maxCount);
|
|
14
|
+
const moreActions = filteredActions.slice(maxCount);
|
|
15
|
+
return /* @__PURE__ */ jsx(
|
|
16
|
+
"div",
|
|
17
|
+
{
|
|
18
|
+
onClick: (e) => {
|
|
19
|
+
e.stopPropagation();
|
|
20
|
+
},
|
|
21
|
+
children: /* @__PURE__ */ jsxs(Space, { spacing: 12, children: [
|
|
22
|
+
firstActions.map((action, index) => {
|
|
23
|
+
var _a;
|
|
24
|
+
return /* @__PURE__ */ jsx(
|
|
25
|
+
TooltipWhenDisabled,
|
|
26
|
+
{
|
|
27
|
+
content: action.disabledTooltip || action.label,
|
|
28
|
+
disabled: Boolean(action.disabled),
|
|
29
|
+
children: /* @__PURE__ */ jsx(
|
|
30
|
+
Typography.Text,
|
|
31
|
+
{
|
|
32
|
+
size: "small",
|
|
33
|
+
className: "!text-[13px]",
|
|
34
|
+
type: action.type,
|
|
35
|
+
disabled: (_a = action.disabled) != null ? _a : disabled,
|
|
36
|
+
onClick: () => {
|
|
37
|
+
var _a2, _b;
|
|
38
|
+
if (!((_a2 = action.disabled) != null ? _a2 : disabled)) {
|
|
39
|
+
(_b = action.onClick) == null ? void 0 : _b.call(action);
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
link: !action.type,
|
|
43
|
+
children: action.icon ? null : action.label
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
},
|
|
47
|
+
index
|
|
48
|
+
);
|
|
49
|
+
}),
|
|
50
|
+
moreActions.length > 0 && /* @__PURE__ */ jsx(
|
|
51
|
+
Dropdown,
|
|
52
|
+
{
|
|
53
|
+
position: "bottomLeft",
|
|
54
|
+
visible,
|
|
55
|
+
trigger: "custom",
|
|
56
|
+
onClickOutSide: () => setVisible(false),
|
|
57
|
+
render: /* @__PURE__ */ jsx(Dropdown.Menu, { mode: "menu", children: moreActions.map((action, index) => {
|
|
58
|
+
var _a;
|
|
59
|
+
return /* @__PURE__ */ jsx(
|
|
60
|
+
Dropdown.Item,
|
|
61
|
+
{
|
|
62
|
+
disabled: (_a = action.disabled) != null ? _a : disabled,
|
|
63
|
+
onClick: () => {
|
|
64
|
+
var _a2, _b;
|
|
65
|
+
if (!((_a2 = action.disabled) != null ? _a2 : disabled)) {
|
|
66
|
+
setVisible(false);
|
|
67
|
+
(_b = action.onClick) == null ? void 0 : _b.call(action);
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
className: "min-w-[90px] !p-0 !pl-2",
|
|
71
|
+
icon: action.icon,
|
|
72
|
+
style: { minWidth: "90px" },
|
|
73
|
+
children: /* @__PURE__ */ jsx(
|
|
74
|
+
Typography.Text,
|
|
75
|
+
{
|
|
76
|
+
type: action.type,
|
|
77
|
+
size: "small",
|
|
78
|
+
className: "!text-[13px]",
|
|
79
|
+
link: !action.type,
|
|
80
|
+
children: action.label
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
},
|
|
84
|
+
index
|
|
85
|
+
);
|
|
86
|
+
}) }),
|
|
87
|
+
children: /* @__PURE__ */ jsx(
|
|
88
|
+
"div",
|
|
89
|
+
{
|
|
90
|
+
className: "flex items-center justify-center",
|
|
91
|
+
onClick: () => setVisible(true),
|
|
92
|
+
children: /* @__PURE__ */ jsx(IconCozMore, { className: "text-[#5A4DED]" })
|
|
93
|
+
}
|
|
94
|
+
)
|
|
95
|
+
}
|
|
96
|
+
)
|
|
97
|
+
] })
|
|
98
|
+
}
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
export {
|
|
102
|
+
TableColActions
|
|
103
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
21
|
+
import classNames from "classnames";
|
|
22
|
+
import { IconCozRefresh } from "@coze-arch/coze-design/icons";
|
|
23
|
+
import {
|
|
24
|
+
Button,
|
|
25
|
+
Space,
|
|
26
|
+
Tooltip
|
|
27
|
+
} from "@coze-arch/coze-design";
|
|
28
|
+
import { ColumnSelector } from "../columns-select";
|
|
29
|
+
import styles from "./index.module";
|
|
30
|
+
function TableHeader({
|
|
31
|
+
columnSelectorConfigProps,
|
|
32
|
+
filterForm,
|
|
33
|
+
actions,
|
|
34
|
+
className,
|
|
35
|
+
style,
|
|
36
|
+
spaceProps,
|
|
37
|
+
refreshButtonPros
|
|
38
|
+
}) {
|
|
39
|
+
return /* @__PURE__ */ jsxs(
|
|
40
|
+
"div",
|
|
41
|
+
{
|
|
42
|
+
className: classNames("flex flex-row justify-between w-full ", className),
|
|
43
|
+
style,
|
|
44
|
+
children: [
|
|
45
|
+
/* @__PURE__ */ jsx("div", { className: classNames("flex flex-row", styles["table-header-form"]), children: filterForm }),
|
|
46
|
+
/* @__PURE__ */ jsxs(Space, __spreadProps(__spreadValues({}, spaceProps || {}), { children: [
|
|
47
|
+
refreshButtonPros ? /* @__PURE__ */ jsx(Tooltip, { content: "刷新", theme: "dark", children: /* @__PURE__ */ jsx(
|
|
48
|
+
Button,
|
|
49
|
+
__spreadValues({
|
|
50
|
+
color: "primary",
|
|
51
|
+
icon: /* @__PURE__ */ jsx(IconCozRefresh, {})
|
|
52
|
+
}, refreshButtonPros)
|
|
53
|
+
) }) : null,
|
|
54
|
+
columnSelectorConfigProps ? /* @__PURE__ */ jsx(
|
|
55
|
+
ColumnSelector,
|
|
56
|
+
__spreadValues({
|
|
57
|
+
className: classNames(columnSelectorConfigProps.className)
|
|
58
|
+
}, columnSelectorConfigProps)
|
|
59
|
+
) : null,
|
|
60
|
+
actions
|
|
61
|
+
] }))
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
export {
|
|
67
|
+
TableHeader
|
|
68
|
+
};
|