@cozeloop/components 0.0.2 → 0.0.3-beta-1769665914778

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.
Files changed (235) hide show
  1. package/README.md +82 -1
  2. package/dist/es/index.css +645 -0
  3. package/dist/es/index.mjs +6089 -0
  4. package/dist/es/loopIcons.mjs +3 -0
  5. package/dist/es/rslib-runtime.mjs +40 -0
  6. package/dist/es/static/svg/select.svg +1 -0
  7. package/dist/lib/base-search-select/base-search-form-select.d.ts +3 -0
  8. package/dist/lib/base-search-select/base-search-select.d.ts +12 -0
  9. package/dist/lib/base-search-select/index.d.ts +3 -0
  10. package/dist/lib/base-search-select/types.d.ts +13 -0
  11. package/dist/lib/base-search-select/utils.d.ts +8 -0
  12. package/dist/lib/basic-card/index.d.ts +7 -0
  13. package/dist/lib/card-pane/index.d.ts +5 -0
  14. package/dist/lib/chip-select/index.d.ts +2 -0
  15. package/dist/lib/code-editor/index.d.ts +3 -0
  16. package/dist/lib/code-editor-with-loading/index.d.ts +10 -0
  17. package/dist/lib/codemirror-editor/code-editor.d.ts +23 -0
  18. package/dist/lib/codemirror-editor/index.d.ts +6 -0
  19. package/dist/lib/codemirror-editor/json-editor.d.ts +19 -0
  20. package/dist/lib/codemirror-editor/raw-code-editor.d.ts +20 -0
  21. package/dist/lib/codemirror-editor/raw-text-editor.d.ts +11 -0
  22. package/dist/lib/codemirror-editor/text-editor.d.ts +23 -0
  23. package/dist/lib/codemirror-editor/themes/coze-dark.d.ts +1 -0
  24. package/dist/lib/codemirror-editor/themes/coze-light.d.ts +1 -0
  25. package/dist/lib/collapse-card/index.d.ts +14 -0
  26. package/dist/lib/collapse-item/index.d.ts +7 -0
  27. package/dist/lib/collapsible-card/index.d.ts +13 -0
  28. package/dist/{types → lib}/column-manage-storage/index.d.ts +6 -6
  29. package/dist/lib/columns-select/index.d.ts +19 -0
  30. package/dist/lib/copyable/index.d.ts +5 -0
  31. package/dist/lib/edit-icon-button/index.d.ts +8 -0
  32. package/dist/lib/footer-actions/index.d.ts +15 -0
  33. package/dist/{types → lib}/hooks/use-infinite-scroll.d.ts +12 -12
  34. package/dist/lib/hooks/use-mouse-down-offset.d.ts +9 -0
  35. package/dist/lib/hooks/use-unsave-leave-warning.d.ts +15 -0
  36. package/dist/lib/id-render/icon-button-container.d.ts +8 -0
  37. package/dist/lib/id-render/index.d.ts +7 -0
  38. package/dist/lib/index-controller/record-navigation.d.ts +6 -0
  39. package/dist/lib/index-controller/use-item-index-controller.d.ts +47 -0
  40. package/dist/lib/index.d.ts +71 -0
  41. package/dist/{types → lib}/infinite-scroll-table/index.d.ts +6 -6
  42. package/dist/lib/info-tooltip/index.d.ts +9 -0
  43. package/dist/lib/input-components/radio-button.d.ts +14 -0
  44. package/dist/lib/input-slider/index.d.ts +15 -0
  45. package/dist/lib/input-with-count/index.d.ts +2 -0
  46. package/dist/lib/jump-button/jump-icon-button.d.ts +4 -0
  47. package/dist/{types → lib}/large-txt-render/index.d.ts +2 -2
  48. package/dist/lib/layout/content.d.ts +7 -0
  49. package/dist/lib/layout/header.d.ts +7 -0
  50. package/dist/lib/layout/index.d.ts +12 -0
  51. package/dist/lib/layout/tabs.d.ts +6 -0
  52. package/dist/lib/lazy-load-component/index.d.ts +5 -0
  53. package/dist/lib/logic-editor/index.d.ts +3 -0
  54. package/dist/lib/logic-editor/logic-editor.d.ts +15 -0
  55. package/dist/lib/logic-editor/logic-left-render.d.ts +3 -0
  56. package/dist/lib/logic-editor/logic-operator-render.d.ts +3 -0
  57. package/dist/lib/logic-editor/logic-right-render.d.ts +3 -0
  58. package/dist/lib/logic-editor/logic-types.d.ts +53 -0
  59. package/dist/lib/logic-editor/utils.d.ts +2 -0
  60. package/dist/lib/logic-expr/consts.d.ts +2 -0
  61. package/dist/lib/logic-expr/expr-group-render.d.ts +2 -0
  62. package/dist/lib/logic-expr/expr-render.d.ts +2 -0
  63. package/dist/lib/logic-expr/index.d.ts +2 -0
  64. package/dist/lib/logic-expr/logic-expr.d.ts +2 -0
  65. package/dist/lib/logic-expr/logic-not.d.ts +10 -0
  66. package/dist/lib/logic-expr/logic-toggle.d.ts +12 -0
  67. package/dist/lib/logic-expr/types.d.ts +79 -0
  68. package/dist/lib/loop-icons/index.d.ts +1 -0
  69. package/dist/lib/loop-radio-group/index.d.ts +2 -0
  70. package/dist/lib/multi-part-editor/components/image-item-renderer.d.ts +14 -0
  71. package/dist/lib/multi-part-editor/components/multipart-item-renderer.d.ts +10 -0
  72. package/dist/lib/multi-part-editor/components/url-input-modal.d.ts +14 -0
  73. package/dist/lib/multi-part-editor/components/video-item-renderer.d.ts +14 -0
  74. package/dist/lib/multi-part-editor/index.d.ts +3 -0
  75. package/dist/lib/multi-part-editor/multi-part-render.d.ts +10 -0
  76. package/dist/lib/multi-part-editor/type.d.ts +81 -0
  77. package/dist/lib/multi-part-editor/upload-button.d.ts +23 -0
  78. package/dist/lib/multi-part-editor/utils.d.ts +16 -0
  79. package/dist/lib/open-detail-button/index.d.ts +6 -0
  80. package/dist/lib/page-content/index.d.ts +20 -0
  81. package/dist/lib/primary-page/index.d.ts +1 -0
  82. package/dist/lib/primary-page/primary-header.d.ts +14 -0
  83. package/dist/lib/primary-title/index.d.ts +6 -0
  84. package/dist/lib/resizable-side-sheet/index.d.ts +10 -0
  85. package/dist/{types → lib}/resize-sidesheet/index.d.ts +4 -3
  86. package/dist/lib/resize-sidesheet/use-drag.d.ts +11 -0
  87. package/dist/lib/schema-editor/index.d.ts +11 -0
  88. package/dist/lib/semi-schema-form/components/tmpls/array-field-item.d.ts +6 -0
  89. package/dist/lib/semi-schema-form/components/tmpls/array-field.d.ts +6 -0
  90. package/dist/lib/semi-schema-form/components/tmpls/base-input.d.ts +8 -0
  91. package/dist/lib/semi-schema-form/components/tmpls/description-field.d.ts +6 -0
  92. package/dist/lib/semi-schema-form/components/tmpls/error-list.d.ts +6 -0
  93. package/dist/lib/semi-schema-form/components/tmpls/field-error.d.ts +6 -0
  94. package/dist/lib/semi-schema-form/components/tmpls/field.d.ts +7 -0
  95. package/dist/lib/semi-schema-form/components/tmpls/icon-button.d.ts +11 -0
  96. package/dist/lib/semi-schema-form/components/tmpls/index.d.ts +2 -0
  97. package/dist/lib/semi-schema-form/components/tmpls/object-field.d.ts +8 -0
  98. package/dist/lib/semi-schema-form/components/tmpls/submit.d.ts +4 -0
  99. package/dist/lib/semi-schema-form/components/tmpls/title-field.d.ts +6 -0
  100. package/dist/lib/semi-schema-form/components/widgets/checkbox.d.ts +7 -0
  101. package/dist/lib/semi-schema-form/components/widgets/checkboxs.d.ts +7 -0
  102. package/dist/lib/semi-schema-form/components/widgets/index.d.ts +2 -0
  103. package/dist/lib/semi-schema-form/components/widgets/radio.d.ts +7 -0
  104. package/dist/lib/semi-schema-form/components/widgets/range.d.ts +7 -0
  105. package/dist/lib/semi-schema-form/components/widgets/select.d.ts +7 -0
  106. package/dist/lib/semi-schema-form/components/widgets/textarea.d.ts +6 -0
  107. package/dist/lib/semi-schema-form/index.d.ts +4 -0
  108. package/dist/lib/sentinel-form/enum.d.ts +8 -0
  109. package/dist/lib/sentinel-form/index.d.ts +20 -0
  110. package/dist/lib/step-nav/index.d.ts +12 -0
  111. package/dist/{types → lib}/table/index.d.ts +1 -1
  112. package/dist/lib/table/sort-icon.d.ts +8 -0
  113. package/dist/lib/table/table-with-pagination.d.ts +21 -0
  114. package/dist/lib/table/table-without-pagniation.d.ts +6 -0
  115. package/dist/lib/table-batch-operate/table-batch-operation.d.ts +9 -0
  116. package/dist/lib/table-batch-operate/use-batch-operate.d.ts +30 -0
  117. package/dist/lib/table-col-actions/index.d.ts +24 -0
  118. package/dist/lib/table-cols-config/index.d.ts +11 -0
  119. package/dist/lib/table-cols-config/type.d.ts +6 -0
  120. package/dist/lib/table-cols-config/use-hidden-col-keys.d.ts +5 -0
  121. package/dist/lib/table-cols-config/util.d.ts +3 -0
  122. package/dist/lib/table-empty/index.d.ts +2 -0
  123. package/dist/lib/table-header/index.d.ts +14 -0
  124. package/dist/{types → lib}/tabs/index.d.ts +1 -1
  125. package/dist/lib/text-area-pro/index.d.ts +6 -0
  126. package/dist/lib/text-with-copy/index.d.ts +14 -0
  127. package/dist/lib/title-with-sub/index.d.ts +7 -0
  128. package/dist/lib/tooltip-when-disabled/index.d.ts +6 -0
  129. package/dist/lib/tooltip-with-disabled/index.d.ts +5 -0
  130. package/dist/lib/upload/index.d.ts +9 -0
  131. package/dist/lib/user-profile/index.d.ts +9 -0
  132. package/dist/lib/utils/basic.d.ts +2 -0
  133. package/dist/lib/version-list/version-descriptions.d.ts +15 -0
  134. package/dist/lib/version-list/version-item.d.ts +9 -0
  135. package/dist/lib/version-list/version-list.d.ts +11 -0
  136. package/dist/lib/version-list/version-switch-panel.d.ts +5 -0
  137. package/package.json +47 -35
  138. package/dist/es/collapsible-card/index.js +0 -45
  139. package/dist/es/collapsible-card/index.module.js +0 -5
  140. package/dist/es/collapsible-card/index_module.css +0 -48
  141. package/dist/es/column-manage-storage/index.js +0 -73
  142. package/dist/es/columns-select/index.js +0 -219
  143. package/dist/es/hooks/use-infinite-scroll.js +0 -178
  144. package/dist/es/hooks/use-mouse-down-offset.js +0 -41
  145. package/dist/es/id-render/icon-button-container.js +0 -61
  146. package/dist/es/id-render/index.js +0 -78
  147. package/dist/es/index.js +0 -66
  148. package/dist/es/infinite-scroll-table/index.js +0 -98
  149. package/dist/es/input-slider/index.js +0 -123
  150. package/dist/es/input-slider/index.module.js +0 -5
  151. package/dist/es/input-slider/index_module.css +0 -21
  152. package/dist/es/large-txt-render/index.js +0 -38
  153. package/dist/es/page-content/index.js +0 -108
  154. package/dist/es/primary-page/index.js +0 -4
  155. package/dist/es/primary-page/primary-header.js +0 -38
  156. package/dist/es/resize-sidesheet/index.js +0 -100
  157. package/dist/es/resize-sidesheet/index.module.js +0 -5
  158. package/dist/es/resize-sidesheet/index_module.css +0 -9
  159. package/dist/es/resize-sidesheet/use-drag.js +0 -31
  160. package/dist/es/table/index.js +0 -56
  161. package/dist/es/table/index.module.js +0 -5
  162. package/dist/es/table/index_module.css +0 -90
  163. package/dist/es/table/sort-icon.js +0 -105
  164. package/dist/es/table/table-with-pagination.js +0 -112
  165. package/dist/es/table/table-without-pagniation.js +0 -74
  166. package/dist/es/table-col-actions/index.js +0 -103
  167. package/dist/es/table-header/index.js +0 -68
  168. package/dist/es/table-header/index.module.js +0 -5
  169. package/dist/es/table-header/index_module.css +0 -3
  170. package/dist/es/tabs/index.js +0 -42
  171. package/dist/es/tabs/index.module.js +0 -5
  172. package/dist/es/tabs/index_module.css +0 -37
  173. package/dist/es/text-with-copy/index.js +0 -71
  174. package/dist/es/tooltip-with-disabled/index.js +0 -49
  175. package/dist/es/utils/basic.js +0 -44
  176. package/dist/es/utils/rect.js +0 -37
  177. package/dist/lib/collapsible-card/index.js +0 -79
  178. package/dist/lib/collapsible-card/index.module.js +0 -25
  179. package/dist/lib/collapsible-card/index_module.css +0 -48
  180. package/dist/lib/column-manage-storage/index.js +0 -98
  181. package/dist/lib/columns-select/index.js +0 -241
  182. package/dist/lib/hooks/use-infinite-scroll.js +0 -195
  183. package/dist/lib/hooks/use-mouse-down-offset.js +0 -65
  184. package/dist/lib/id-render/icon-button-container.js +0 -89
  185. package/dist/lib/id-render/index.js +0 -112
  186. package/dist/lib/index.js +0 -110
  187. package/dist/lib/infinite-scroll-table/index.js +0 -126
  188. package/dist/lib/input-slider/index.js +0 -154
  189. package/dist/lib/input-slider/index.module.js +0 -25
  190. package/dist/lib/input-slider/index_module.css +0 -21
  191. package/dist/lib/large-txt-render/index.js +0 -62
  192. package/dist/lib/page-content/index.js +0 -136
  193. package/dist/lib/primary-page/index.js +0 -28
  194. package/dist/lib/primary-page/primary-header.js +0 -72
  195. package/dist/lib/resize-sidesheet/index.js +0 -129
  196. package/dist/lib/resize-sidesheet/index.module.js +0 -25
  197. package/dist/lib/resize-sidesheet/index_module.css +0 -9
  198. package/dist/lib/resize-sidesheet/use-drag.js +0 -55
  199. package/dist/lib/table/index.js +0 -88
  200. package/dist/lib/table/index.module.js +0 -25
  201. package/dist/lib/table/index_module.css +0 -90
  202. package/dist/lib/table/sort-icon.js +0 -137
  203. package/dist/lib/table/table-with-pagination.js +0 -146
  204. package/dist/lib/table/table-without-pagniation.js +0 -108
  205. package/dist/lib/table-col-actions/index.js +0 -123
  206. package/dist/lib/table-header/index.js +0 -96
  207. package/dist/lib/table-header/index.module.js +0 -25
  208. package/dist/lib/table-header/index_module.css +0 -3
  209. package/dist/lib/tabs/index.js +0 -74
  210. package/dist/lib/tabs/index.module.js +0 -25
  211. package/dist/lib/tabs/index_module.css +0 -37
  212. package/dist/lib/text-with-copy/index.js +0 -105
  213. package/dist/lib/tooltip-with-disabled/index.js +0 -71
  214. package/dist/lib/utils/basic.js +0 -78
  215. package/dist/lib/utils/rect.js +0 -65
  216. package/dist/types/collapsible-card/index.d.ts +0 -22
  217. package/dist/types/columns-select/index.d.ts +0 -29
  218. package/dist/types/hooks/use-mouse-down-offset.d.ts +0 -9
  219. package/dist/types/id-render/icon-button-container.d.ts +0 -12
  220. package/dist/types/id-render/index.d.ts +0 -13
  221. package/dist/types/index.d.ts +0 -19
  222. package/dist/types/input-slider/index.d.ts +0 -14
  223. package/dist/types/page-content/index.d.ts +0 -36
  224. package/dist/types/primary-page/index.d.ts +0 -1
  225. package/dist/types/primary-page/primary-header.d.ts +0 -17
  226. package/dist/types/resize-sidesheet/use-drag.d.ts +0 -10
  227. package/dist/types/table/sort-icon.d.ts +0 -13
  228. package/dist/types/table/table-with-pagination.d.ts +0 -14
  229. package/dist/types/table/table-without-pagniation.d.ts +0 -8
  230. package/dist/types/table-col-actions/index.d.ts +0 -21
  231. package/dist/types/table-header/index.d.ts +0 -20
  232. package/dist/types/text-with-copy/index.d.ts +0 -24
  233. package/dist/types/tooltip-with-disabled/index.d.ts +0 -9
  234. package/dist/types/utils/basic.d.ts +0 -1
  235. package/dist/types/utils/rect.d.ts +0 -10
@@ -1,78 +0,0 @@
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 DELETED
@@ -1,66 +0,0 @@
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
- };
@@ -1,98 +0,0 @@
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
- };
@@ -1,123 +0,0 @@
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
- };
@@ -1,5 +0,0 @@
1
- import "./index_module.css";
2
- var index_module_default = { "input-slider": "input-slider_e1e72", "input-number": "input-number_e1e72" };
3
- export {
4
- index_module_default as default
5
- };
@@ -1,21 +0,0 @@
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
- }
@@ -1,38 +0,0 @@
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
- };
@@ -1,108 +0,0 @@
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
- };
@@ -1,4 +0,0 @@
1
- import { PrimaryPage } from "./primary-header";
2
- export {
3
- PrimaryPage
4
- };
@@ -1,38 +0,0 @@
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
- };
@@ -1,100 +0,0 @@
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
- };
@@ -1,5 +0,0 @@
1
- import "./index_module.css";
2
- var index_module_default = { "sheet": "sheet_935c5" };
3
- export {
4
- index_module_default as default
5
- };