@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,78 @@
|
|
|
1
|
+
var __async = (__this, __arguments, generator) => {
|
|
2
|
+
return new Promise((resolve, reject) => {
|
|
3
|
+
var fulfilled = (value) => {
|
|
4
|
+
try {
|
|
5
|
+
step(generator.next(value));
|
|
6
|
+
} catch (e) {
|
|
7
|
+
reject(e);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
var rejected = (value) => {
|
|
11
|
+
try {
|
|
12
|
+
step(generator.throw(value));
|
|
13
|
+
} catch (e) {
|
|
14
|
+
reject(e);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
18
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
22
|
+
import classNames from "classnames";
|
|
23
|
+
import { IconCozCopy } from "@coze-arch/coze-design/icons";
|
|
24
|
+
import { Toast, Tooltip } from "@coze-arch/coze-design";
|
|
25
|
+
import IconButtonContainer from "./icon-button-container";
|
|
26
|
+
function IDRender({
|
|
27
|
+
id,
|
|
28
|
+
showSuffixLength = 5,
|
|
29
|
+
enableCopy = true,
|
|
30
|
+
useTag = false,
|
|
31
|
+
defaultShowCopyBtn
|
|
32
|
+
}) {
|
|
33
|
+
var _a;
|
|
34
|
+
const idString = (_a = id == null ? void 0 : id.toString()) != null ? _a : "";
|
|
35
|
+
const suffix = idString.slice(
|
|
36
|
+
Math.max(idString.length - showSuffixLength, 0),
|
|
37
|
+
idString.length
|
|
38
|
+
);
|
|
39
|
+
return /* @__PURE__ */ jsxs(
|
|
40
|
+
"div",
|
|
41
|
+
{
|
|
42
|
+
className: "group flex items-center gap-1",
|
|
43
|
+
onClick: (e) => e.stopPropagation(),
|
|
44
|
+
children: [
|
|
45
|
+
/* @__PURE__ */ jsx(Tooltip, { content: idString, theme: "dark", children: useTag ? /* @__PURE__ */ jsxs("div", { className: "shrink-0 h-5 flex items-center px-2 rounded-[3px] border border-solid border-[var(--coz-stroke-plus)] font-medium text-[var(--coz-fg-primary)]", children: [
|
|
46
|
+
"#",
|
|
47
|
+
suffix || "-"
|
|
48
|
+
] }) : /* @__PURE__ */ jsxs("span", { className: "shrink-0", children: [
|
|
49
|
+
"#",
|
|
50
|
+
suffix || "-"
|
|
51
|
+
] }) }),
|
|
52
|
+
enableCopy ? /* @__PURE__ */ jsx(Tooltip, { content: "复制 ID", theme: "dark", children: /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
53
|
+
IconButtonContainer,
|
|
54
|
+
{
|
|
55
|
+
className: classNames(
|
|
56
|
+
"id-render-copy-action-button shrink-0 text-sm",
|
|
57
|
+
defaultShowCopyBtn ? "" : " hidden group-hover:flex"
|
|
58
|
+
),
|
|
59
|
+
icon: /* @__PURE__ */ jsx(IconCozCopy, {}),
|
|
60
|
+
onClick: (e) => __async(this, null, function* () {
|
|
61
|
+
e.stopPropagation();
|
|
62
|
+
try {
|
|
63
|
+
yield navigator.clipboard.writeText(idString);
|
|
64
|
+
Toast.success("复制成功");
|
|
65
|
+
} catch (error) {
|
|
66
|
+
console.error(error);
|
|
67
|
+
Toast.error("复制失败");
|
|
68
|
+
}
|
|
69
|
+
})
|
|
70
|
+
}
|
|
71
|
+
) }) }) : null
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
export {
|
|
77
|
+
IDRender
|
|
78
|
+
};
|
package/dist/es/index.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { ColumnSelector } from "./columns-select";
|
|
2
|
+
import { TooltipWhenDisabled } from "./tooltip-with-disabled";
|
|
3
|
+
import { LoopTable } from "./table";
|
|
4
|
+
import {
|
|
5
|
+
TableWithPagination,
|
|
6
|
+
DEFAULT_PAGE_SIZE,
|
|
7
|
+
PAGE_SIZE_OPTIONS
|
|
8
|
+
} from "./table/table-with-pagination";
|
|
9
|
+
import {
|
|
10
|
+
PageError,
|
|
11
|
+
PageLoading,
|
|
12
|
+
PageNoAuth,
|
|
13
|
+
PageNoContent,
|
|
14
|
+
PageNotFound,
|
|
15
|
+
FullPage
|
|
16
|
+
} from "./page-content";
|
|
17
|
+
import { TableColActions } from "./table-col-actions";
|
|
18
|
+
import { LoopTabs } from "./tabs";
|
|
19
|
+
import { LargeTxtRender } from "./large-txt-render";
|
|
20
|
+
import { InputSlider } from "./input-slider";
|
|
21
|
+
import { handleCopy } from "./utils/basic";
|
|
22
|
+
import { TextWithCopy } from "./text-with-copy";
|
|
23
|
+
import { IDRender } from "./id-render";
|
|
24
|
+
import { default as default2 } from "./id-render/icon-button-container";
|
|
25
|
+
import {
|
|
26
|
+
getColumnManageStorage,
|
|
27
|
+
setColumnsManageStorage,
|
|
28
|
+
dealColumnsWithStorage
|
|
29
|
+
} from "./column-manage-storage";
|
|
30
|
+
import { PrimaryPage } from "./primary-page";
|
|
31
|
+
import { ResizeSidesheet } from "./resize-sidesheet";
|
|
32
|
+
import {
|
|
33
|
+
InfiniteScrollTable
|
|
34
|
+
} from "./infinite-scroll-table";
|
|
35
|
+
import { TableHeader } from "./table-header";
|
|
36
|
+
import { TableWithoutPagination } from "./table/table-without-pagniation";
|
|
37
|
+
export {
|
|
38
|
+
ColumnSelector,
|
|
39
|
+
DEFAULT_PAGE_SIZE,
|
|
40
|
+
FullPage,
|
|
41
|
+
IDRender,
|
|
42
|
+
default2 as IconButtonContainer,
|
|
43
|
+
InfiniteScrollTable,
|
|
44
|
+
InputSlider,
|
|
45
|
+
LargeTxtRender,
|
|
46
|
+
LoopTable,
|
|
47
|
+
LoopTabs,
|
|
48
|
+
PAGE_SIZE_OPTIONS,
|
|
49
|
+
PageError,
|
|
50
|
+
PageLoading,
|
|
51
|
+
PageNoAuth,
|
|
52
|
+
PageNoContent,
|
|
53
|
+
PageNotFound,
|
|
54
|
+
PrimaryPage,
|
|
55
|
+
ResizeSidesheet,
|
|
56
|
+
TableColActions,
|
|
57
|
+
TableHeader,
|
|
58
|
+
TableWithPagination,
|
|
59
|
+
TableWithoutPagination,
|
|
60
|
+
TextWithCopy,
|
|
61
|
+
TooltipWhenDisabled,
|
|
62
|
+
dealColumnsWithStorage,
|
|
63
|
+
getColumnManageStorage,
|
|
64
|
+
handleCopy,
|
|
65
|
+
setColumnsManageStorage
|
|
66
|
+
};
|
|
@@ -0,0 +1,98 @@
|
|
|
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 {
|
|
34
|
+
forwardRef,
|
|
35
|
+
useRef,
|
|
36
|
+
useImperativeHandle
|
|
37
|
+
} from "react";
|
|
38
|
+
import classNames from "classnames";
|
|
39
|
+
import { useSize, useInfiniteScroll } from "ahooks";
|
|
40
|
+
import { IconCozIllusEmpty } from "@coze-arch/coze-design/illustrations";
|
|
41
|
+
import { EmptyState } from "@coze-arch/coze-design";
|
|
42
|
+
import { LoopTable } from "../table";
|
|
43
|
+
const InfiniteScrollTable = forwardRef(
|
|
44
|
+
(_a, ref) => {
|
|
45
|
+
var _b = _a, { service, options, className } = _b, restTableProps = __objRest(_b, ["service", "options", "className"]);
|
|
46
|
+
var _a2, _b2;
|
|
47
|
+
const containerRef = useRef(null);
|
|
48
|
+
const hookRes = useInfiniteScroll((d) => service == null ? void 0 : service(d), __spreadProps(__spreadValues({
|
|
49
|
+
isNoMore: (d) => !(d == null ? void 0 : d.hasMore)
|
|
50
|
+
}, options), {
|
|
51
|
+
reloadDeps: [...(options == null ? void 0 : options.reloadDeps) || []]
|
|
52
|
+
}));
|
|
53
|
+
const { data, loading, loadingMore, noMore, loadMore } = hookRes;
|
|
54
|
+
const scrollSize = useSize(containerRef);
|
|
55
|
+
const height = (scrollSize == null ? void 0 : scrollSize.height) || 0;
|
|
56
|
+
useImperativeHandle(ref, () => ({
|
|
57
|
+
// @ts-expect-error type
|
|
58
|
+
hookRes
|
|
59
|
+
}));
|
|
60
|
+
return /* @__PURE__ */ jsx(
|
|
61
|
+
"div",
|
|
62
|
+
{
|
|
63
|
+
className: classNames("w-full h-full overflow-hidden", className),
|
|
64
|
+
ref: containerRef,
|
|
65
|
+
children: /* @__PURE__ */ jsx(
|
|
66
|
+
LoopTable,
|
|
67
|
+
{
|
|
68
|
+
tableProps: __spreadProps(__spreadValues({}, restTableProps.tableProps), {
|
|
69
|
+
loading: loading || loadingMore,
|
|
70
|
+
pagination: false,
|
|
71
|
+
dataSource: (data == null ? void 0 : data.list) || [],
|
|
72
|
+
scroll: __spreadValues({
|
|
73
|
+
y: height - 48
|
|
74
|
+
}, (_a2 = restTableProps.tableProps) == null ? void 0 : _a2.scroll)
|
|
75
|
+
}),
|
|
76
|
+
empty: (_b2 = restTableProps.empty) != null ? _b2 : /* @__PURE__ */ jsx(
|
|
77
|
+
EmptyState,
|
|
78
|
+
{
|
|
79
|
+
size: "full_screen",
|
|
80
|
+
icon: /* @__PURE__ */ jsx(IconCozIllusEmpty, {}),
|
|
81
|
+
title: "暂无数据"
|
|
82
|
+
}
|
|
83
|
+
),
|
|
84
|
+
enableLoad: true,
|
|
85
|
+
loadMode: "cursor",
|
|
86
|
+
hasMore: !noMore,
|
|
87
|
+
onLoad: loadMore,
|
|
88
|
+
offsetY: 0,
|
|
89
|
+
strictDataSourceProp: true
|
|
90
|
+
}
|
|
91
|
+
)
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
export {
|
|
97
|
+
InfiniteScrollTable
|
|
98
|
+
};
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef } from "react";
|
|
3
|
+
import { isInteger, isUndefined } from "lodash-es";
|
|
4
|
+
import classNames from "classnames";
|
|
5
|
+
import {
|
|
6
|
+
CozInputNumber,
|
|
7
|
+
Slider
|
|
8
|
+
} from "@coze-arch/coze-design";
|
|
9
|
+
import styles from "./index.module";
|
|
10
|
+
const formateDecimalPlacesString = (value, prevValue, decimalPlaces) => {
|
|
11
|
+
if (isUndefined(decimalPlaces)) {
|
|
12
|
+
return value.toString();
|
|
13
|
+
}
|
|
14
|
+
const numberValue = Number(value);
|
|
15
|
+
const stringValue = value.toString();
|
|
16
|
+
if (Number.isNaN(numberValue)) {
|
|
17
|
+
return `${value}`;
|
|
18
|
+
}
|
|
19
|
+
if (decimalPlaces === 0 && !isInteger(Number(value)) && prevValue) {
|
|
20
|
+
return `${prevValue}`;
|
|
21
|
+
}
|
|
22
|
+
const decimalPointIndex = stringValue.indexOf(".");
|
|
23
|
+
if (decimalPointIndex < 0) {
|
|
24
|
+
return stringValue;
|
|
25
|
+
}
|
|
26
|
+
const formattedValue = stringValue.substring(
|
|
27
|
+
0,
|
|
28
|
+
decimalPointIndex + 1 + decimalPlaces
|
|
29
|
+
);
|
|
30
|
+
if (formattedValue.endsWith(".") && decimalPlaces === 0) {
|
|
31
|
+
return formattedValue.substring(0, formattedValue.length - 1);
|
|
32
|
+
}
|
|
33
|
+
return formattedValue;
|
|
34
|
+
};
|
|
35
|
+
function getDecimalPlaces(num) {
|
|
36
|
+
if (!num) {
|
|
37
|
+
return 0;
|
|
38
|
+
}
|
|
39
|
+
const numStr = num.toString();
|
|
40
|
+
if (numStr.includes(".")) {
|
|
41
|
+
const decimalPart = numStr.split(".")[1];
|
|
42
|
+
return decimalPart.length;
|
|
43
|
+
}
|
|
44
|
+
return 0;
|
|
45
|
+
}
|
|
46
|
+
const formateDecimalPlacesNumber = (value, prevValue, decimalPlaces, isPasted) => {
|
|
47
|
+
if (isUndefined(decimalPlaces)) {
|
|
48
|
+
if (isPasted) {
|
|
49
|
+
return value;
|
|
50
|
+
}
|
|
51
|
+
const currentDecimalPlaces = getDecimalPlaces(value);
|
|
52
|
+
const prevDecimalPlaces = getDecimalPlaces(prevValue);
|
|
53
|
+
if (prevDecimalPlaces === 2 && currentDecimalPlaces > 2 && !isUndefined(prevValue) && Math.abs(prevValue - value).toFixed(2) === "0.01") {
|
|
54
|
+
const pow2 = Math.pow(10, 2);
|
|
55
|
+
return Math.round(value * pow2) / pow2;
|
|
56
|
+
}
|
|
57
|
+
return value;
|
|
58
|
+
}
|
|
59
|
+
if (decimalPlaces === 0 && !isInteger(value) && prevValue) {
|
|
60
|
+
return prevValue;
|
|
61
|
+
}
|
|
62
|
+
const pow = Math.pow(10, decimalPlaces);
|
|
63
|
+
return Math.round(value * pow) / pow;
|
|
64
|
+
};
|
|
65
|
+
const InputSlider = ({
|
|
66
|
+
value,
|
|
67
|
+
onChange,
|
|
68
|
+
max = 1,
|
|
69
|
+
min = 0,
|
|
70
|
+
step = 1,
|
|
71
|
+
disabled,
|
|
72
|
+
decimalPlaces,
|
|
73
|
+
marks,
|
|
74
|
+
className
|
|
75
|
+
}) => {
|
|
76
|
+
const isPasted = useRef(false);
|
|
77
|
+
const onNumberChange = (numberValue) => {
|
|
78
|
+
const formattedValue = formateDecimalPlacesNumber(
|
|
79
|
+
numberValue,
|
|
80
|
+
value,
|
|
81
|
+
decimalPlaces,
|
|
82
|
+
isPasted.current
|
|
83
|
+
);
|
|
84
|
+
isPasted.current = false;
|
|
85
|
+
onChange == null ? void 0 : onChange(formattedValue);
|
|
86
|
+
};
|
|
87
|
+
return /* @__PURE__ */ jsxs("div", { className: classNames(styles["input-slider"], className), children: [
|
|
88
|
+
/* @__PURE__ */ jsx(
|
|
89
|
+
Slider,
|
|
90
|
+
{
|
|
91
|
+
disabled,
|
|
92
|
+
value,
|
|
93
|
+
max,
|
|
94
|
+
min,
|
|
95
|
+
step,
|
|
96
|
+
marks,
|
|
97
|
+
onChange: (v) => {
|
|
98
|
+
if (typeof v === "number") {
|
|
99
|
+
onChange == null ? void 0 : onChange(v);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
`${min}-${max}`
|
|
104
|
+
),
|
|
105
|
+
/* @__PURE__ */ jsx(
|
|
106
|
+
CozInputNumber,
|
|
107
|
+
{
|
|
108
|
+
className: styles["input-number"],
|
|
109
|
+
value,
|
|
110
|
+
disabled,
|
|
111
|
+
formatter: (inputValue) => formateDecimalPlacesString(inputValue, value),
|
|
112
|
+
onNumberChange,
|
|
113
|
+
max,
|
|
114
|
+
min,
|
|
115
|
+
step,
|
|
116
|
+
onPaste: () => isPasted.current = true
|
|
117
|
+
}
|
|
118
|
+
)
|
|
119
|
+
] });
|
|
120
|
+
};
|
|
121
|
+
export {
|
|
122
|
+
InputSlider
|
|
123
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* stylelint-disable declaration-no-important */
|
|
2
|
+
.input-slider_e1e72 {
|
|
3
|
+
display: flex;
|
|
4
|
+
column-gap: 8px;
|
|
5
|
+
align-items: center;
|
|
6
|
+
}
|
|
7
|
+
.input-slider_e1e72 .semi-slider {
|
|
8
|
+
flex: 1 1;
|
|
9
|
+
padding-left: 14px;
|
|
10
|
+
}
|
|
11
|
+
.input-slider_e1e72 .semi-slider-handle {
|
|
12
|
+
width: 12px !important;
|
|
13
|
+
height: 12px !important;
|
|
14
|
+
margin-top: 10px !important;
|
|
15
|
+
}
|
|
16
|
+
.input-slider_e1e72 .input-number_e1e72 {
|
|
17
|
+
width: 90px;
|
|
18
|
+
}
|
|
19
|
+
.input-slider_e1e72 .input-number_e1e72 .semi-input-number-suffix-btns {
|
|
20
|
+
height: auto !important;
|
|
21
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useRef } from "react";
|
|
3
|
+
import { useInfiniteScroll } from "ahooks";
|
|
4
|
+
const PER_PRE_MAX_LENGTH = 25e3;
|
|
5
|
+
const LargeTxtRender = (props) => {
|
|
6
|
+
const { text } = props;
|
|
7
|
+
const ref = useRef(null);
|
|
8
|
+
const getMoreTextChunk = (startIndex) => {
|
|
9
|
+
const endIndex = startIndex + PER_PRE_MAX_LENGTH;
|
|
10
|
+
const chunk = text.slice(startIndex, endIndex);
|
|
11
|
+
const hasMore = endIndex < text.length;
|
|
12
|
+
return {
|
|
13
|
+
list: [chunk],
|
|
14
|
+
nextId: hasMore ? endIndex.toString() : void 0
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
const { data } = useInfiniteScroll(
|
|
18
|
+
(d) => {
|
|
19
|
+
const startIndex = d ? parseInt(d.nextId) : 0;
|
|
20
|
+
return Promise.resolve(getMoreTextChunk(startIndex));
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
target: ref,
|
|
24
|
+
isNoMore: (d) => (d == null ? void 0 : d.nextId) === void 0
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
return /* @__PURE__ */ jsx(
|
|
28
|
+
"pre",
|
|
29
|
+
{
|
|
30
|
+
ref,
|
|
31
|
+
className: "m-0 break-words whitespace-pre-wrap max-h-full overflow-y-auto text-[13px] leading-4 text-[var(--coz-fg-primary)] font-normal",
|
|
32
|
+
dangerouslySetInnerHTML: { __html: (data == null ? void 0 : data.list.join("")) || "" }
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
export {
|
|
37
|
+
LargeTxtRender
|
|
38
|
+
};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
var __objRest = (source, exclude) => {
|
|
18
|
+
var target = {};
|
|
19
|
+
for (var prop in source)
|
|
20
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
21
|
+
target[prop] = source[prop];
|
|
22
|
+
if (source != null && __getOwnPropSymbols)
|
|
23
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
24
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
25
|
+
target[prop] = source[prop];
|
|
26
|
+
}
|
|
27
|
+
return target;
|
|
28
|
+
};
|
|
29
|
+
import { jsx } from "react/jsx-runtime";
|
|
30
|
+
import classNames from "classnames";
|
|
31
|
+
import {
|
|
32
|
+
IconCozIllus404Dark,
|
|
33
|
+
IconCozIllus404,
|
|
34
|
+
IconCozIllusErrorDark,
|
|
35
|
+
IconCozIllusError,
|
|
36
|
+
IconCozIllusLock,
|
|
37
|
+
IconCozIllusLockDark,
|
|
38
|
+
IconCozIllusEmpty,
|
|
39
|
+
IconCozIllusEmptyDark
|
|
40
|
+
} from "@coze-arch/coze-design/illustrations";
|
|
41
|
+
import { Empty, Spin } from "@coze-arch/coze-design";
|
|
42
|
+
function FullPage({ children, className, style }) {
|
|
43
|
+
return /* @__PURE__ */ jsx(
|
|
44
|
+
"div",
|
|
45
|
+
{
|
|
46
|
+
className: classNames(
|
|
47
|
+
"w-full h-full flex items-center justify-center bg-semi-bg-1 z-10",
|
|
48
|
+
className
|
|
49
|
+
),
|
|
50
|
+
style,
|
|
51
|
+
children
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
function PageLoading(props) {
|
|
56
|
+
return /* @__PURE__ */ jsx(FullPage, { className: props.className, style: props.style, children: /* @__PURE__ */ jsx(Spin, { wrapperClassName: "w-full h-full", spinning: true, tip: props.tip }) });
|
|
57
|
+
}
|
|
58
|
+
function PageNotFound(_a) {
|
|
59
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
60
|
+
return /* @__PURE__ */ jsx(FullPage, { className, children: /* @__PURE__ */ jsx(
|
|
61
|
+
Empty,
|
|
62
|
+
__spreadValues({
|
|
63
|
+
image: /* @__PURE__ */ jsx(IconCozIllus404, { className: "text-[160px]" }),
|
|
64
|
+
darkModeImage: /* @__PURE__ */ jsx(IconCozIllus404Dark, { className: "text-[160px]" }),
|
|
65
|
+
description: "页面丢失了"
|
|
66
|
+
}, props)
|
|
67
|
+
) });
|
|
68
|
+
}
|
|
69
|
+
function PageError(_c) {
|
|
70
|
+
var _d = _c, { className } = _d, props = __objRest(_d, ["className"]);
|
|
71
|
+
return /* @__PURE__ */ jsx(FullPage, { className, children: /* @__PURE__ */ jsx(
|
|
72
|
+
Empty,
|
|
73
|
+
__spreadValues({
|
|
74
|
+
image: /* @__PURE__ */ jsx(IconCozIllusError, { className: "text-[160px]" }),
|
|
75
|
+
darkModeImage: /* @__PURE__ */ jsx(IconCozIllusErrorDark, { className: "text-[160px]" }),
|
|
76
|
+
description: "页面加载失败"
|
|
77
|
+
}, props)
|
|
78
|
+
) });
|
|
79
|
+
}
|
|
80
|
+
function PageNoAuth(_e) {
|
|
81
|
+
var _f = _e, { className } = _f, props = __objRest(_f, ["className"]);
|
|
82
|
+
return /* @__PURE__ */ jsx(FullPage, { className, children: /* @__PURE__ */ jsx(
|
|
83
|
+
Empty,
|
|
84
|
+
__spreadValues({
|
|
85
|
+
image: /* @__PURE__ */ jsx(IconCozIllusLock, { className: "text-[160px]" }),
|
|
86
|
+
darkModeImage: /* @__PURE__ */ jsx(IconCozIllusLockDark, { className: "text-[160px]" }),
|
|
87
|
+
description: "暂无权限"
|
|
88
|
+
}, props)
|
|
89
|
+
) });
|
|
90
|
+
}
|
|
91
|
+
function PageNoContent(_g) {
|
|
92
|
+
var _h = _g, { className } = _h, props = __objRest(_h, ["className"]);
|
|
93
|
+
return /* @__PURE__ */ jsx(FullPage, { className, children: /* @__PURE__ */ jsx(
|
|
94
|
+
Empty,
|
|
95
|
+
__spreadValues({
|
|
96
|
+
image: /* @__PURE__ */ jsx(IconCozIllusEmpty, { className: "text-[160px]" }),
|
|
97
|
+
darkModeImage: /* @__PURE__ */ jsx(IconCozIllusEmptyDark, { className: "text-[160px]" })
|
|
98
|
+
}, props)
|
|
99
|
+
) });
|
|
100
|
+
}
|
|
101
|
+
export {
|
|
102
|
+
FullPage,
|
|
103
|
+
PageError,
|
|
104
|
+
PageLoading,
|
|
105
|
+
PageNoAuth,
|
|
106
|
+
PageNoContent,
|
|
107
|
+
PageNotFound
|
|
108
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
const PrimaryPage = ({
|
|
4
|
+
pageTitle,
|
|
5
|
+
filterSlot,
|
|
6
|
+
children,
|
|
7
|
+
contentClassName,
|
|
8
|
+
className,
|
|
9
|
+
titleSlot
|
|
10
|
+
}) => /* @__PURE__ */ jsxs(
|
|
11
|
+
"div",
|
|
12
|
+
{
|
|
13
|
+
className: classNames(
|
|
14
|
+
"pt-2 pb-3 h-full max-h-full flex flex-col",
|
|
15
|
+
className
|
|
16
|
+
),
|
|
17
|
+
children: [
|
|
18
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between py-4 px-6", children: [
|
|
19
|
+
/* @__PURE__ */ jsx("div", { className: "text-[20px] font-medium leading-6 coz-fg-plus ", children: pageTitle }),
|
|
20
|
+
/* @__PURE__ */ jsx("div", { children: titleSlot })
|
|
21
|
+
] }),
|
|
22
|
+
filterSlot ? /* @__PURE__ */ jsx("div", { className: "box-border coz-fg-secondary pt-1 pb-3 px-6", children: filterSlot }) : null,
|
|
23
|
+
/* @__PURE__ */ jsx(
|
|
24
|
+
"div",
|
|
25
|
+
{
|
|
26
|
+
className: classNames(
|
|
27
|
+
"flex-1 h-full max-h-full overflow-hidden px-6",
|
|
28
|
+
contentClassName
|
|
29
|
+
),
|
|
30
|
+
children
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
export {
|
|
37
|
+
PrimaryPage
|
|
38
|
+
};
|
|
@@ -0,0 +1,100 @@
|
|
|
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 cn from "classnames";
|
|
34
|
+
import { IconCozCrossFill } from "@coze-arch/coze-design/icons";
|
|
35
|
+
import {
|
|
36
|
+
Divider,
|
|
37
|
+
SideSheet
|
|
38
|
+
} from "@coze-arch/coze-design";
|
|
39
|
+
import { Button } from "@coze-arch/coze-design";
|
|
40
|
+
import { useDrag } from "./use-drag";
|
|
41
|
+
import styles from "./index.module";
|
|
42
|
+
const ResizeSidesheet = (props) => {
|
|
43
|
+
const _a = props, {
|
|
44
|
+
children,
|
|
45
|
+
dragOptions,
|
|
46
|
+
title,
|
|
47
|
+
onCancel,
|
|
48
|
+
className,
|
|
49
|
+
showDivider
|
|
50
|
+
} = _a, rest = __objRest(_a, [
|
|
51
|
+
"children",
|
|
52
|
+
"dragOptions",
|
|
53
|
+
"title",
|
|
54
|
+
"onCancel",
|
|
55
|
+
"className",
|
|
56
|
+
"showDivider"
|
|
57
|
+
]);
|
|
58
|
+
const { containerRef, isActive, sidePaneWidth } = useDrag(dragOptions);
|
|
59
|
+
return /* @__PURE__ */ jsxs(
|
|
60
|
+
SideSheet,
|
|
61
|
+
__spreadProps(__spreadValues({
|
|
62
|
+
title: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
63
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1", children: title }),
|
|
64
|
+
showDivider ? /* @__PURE__ */ jsx(Divider, { layout: "vertical", className: "h-[12px]" }) : null,
|
|
65
|
+
/* @__PURE__ */ jsx(
|
|
66
|
+
Button,
|
|
67
|
+
{
|
|
68
|
+
type: "primary",
|
|
69
|
+
color: "secondary",
|
|
70
|
+
icon: /* @__PURE__ */ jsx(IconCozCrossFill, { className: "w-[16px] h-[16px]" }),
|
|
71
|
+
onClick: onCancel
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
] }),
|
|
75
|
+
width: sidePaneWidth,
|
|
76
|
+
className: cn(styles.sheet, className)
|
|
77
|
+
}, rest), {
|
|
78
|
+
onCancel,
|
|
79
|
+
closable: false,
|
|
80
|
+
children: [
|
|
81
|
+
/* @__PURE__ */ jsx(
|
|
82
|
+
"div",
|
|
83
|
+
{
|
|
84
|
+
ref: containerRef,
|
|
85
|
+
className: cn(
|
|
86
|
+
"absolute h-full w-[2px] z-[20000] bg-transparent top-0 left-0 hover:cursor-col-resize hover:bg-[rgb(var(--coze-up-brand-9))] transition ",
|
|
87
|
+
{
|
|
88
|
+
"bg-[rgb(var(--coze-up-brand-9))] cursor-col-resize": isActive
|
|
89
|
+
}
|
|
90
|
+
)
|
|
91
|
+
}
|
|
92
|
+
),
|
|
93
|
+
props.children
|
|
94
|
+
]
|
|
95
|
+
})
|
|
96
|
+
);
|
|
97
|
+
};
|
|
98
|
+
export {
|
|
99
|
+
ResizeSidesheet
|
|
100
|
+
};
|