@cozeloop/components 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/index.js +1 -1
- package/dist/lib/code-editor/index.js +3 -1
- package/dist/lib/code-editor/index.js.map +1 -1
- package/dist/lib/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +9 -3
- package/.eslintcache +0 -1
- package/.rush/temp/shrinkwrap-deps.json +0 -770
- package/OWNERS +0 -5
- package/config/rush-project.json +0 -8
- package/eslint.config.js +0 -7
- package/rslib.config.js +0 -7
- package/script/publish.js +0 -146
- package/src/base-search-select/base-search-form-select.tsx +0 -10
- package/src/base-search-select/base-search-select.tsx +0 -200
- package/src/base-search-select/index.module.less +0 -16
- package/src/base-search-select/index.tsx +0 -3
- package/src/base-search-select/types.ts +0 -16
- package/src/base-search-select/utils.ts +0 -78
- package/src/basic-card/index.tsx +0 -23
- package/src/card-pane/index.module.less +0 -14
- package/src/card-pane/index.tsx +0 -25
- package/src/chip-select/index.module.less +0 -17
- package/src/chip-select/index.tsx +0 -7
- package/src/code-editor/index.tsx +0 -9
- package/src/code-usage/code-item.module.less +0 -32
- package/src/code-usage/index.tsx +0 -91
- package/src/codemirror-editor/code-editor.tsx +0 -139
- package/src/codemirror-editor/index.ts +0 -4
- package/src/codemirror-editor/json-editor.tsx +0 -183
- package/src/codemirror-editor/raw-text-editor.tsx +0 -68
- package/src/codemirror-editor/text-editor.tsx +0 -58
- package/src/codemirror-editor/themes/coze-dark.ts +0 -116
- package/src/codemirror-editor/themes/coze-light.ts +0 -122
- package/src/collapse-card/index.module.less +0 -27
- package/src/collapse-card/index.tsx +0 -93
- package/src/collapsible-card/index.module.less +0 -63
- package/src/collapsible-card/index.tsx +0 -57
- package/src/column-manage-storage/index.tsx +0 -64
- package/src/columns-select/index.tsx +0 -244
- package/src/edit-icon-button/index.tsx +0 -36
- package/src/footer-actions/index.tsx +0 -33
- package/src/hooks/use-infinite-scroll.ts +0 -183
- package/src/hooks/use-mouse-down-offset.ts +0 -50
- package/src/hooks/use-unsave-leave-warning.ts +0 -49
- package/src/id-render/icon-button-container.tsx +0 -37
- package/src/id-render/index.tsx +0 -64
- package/src/index-controller/record-navigation.tsx +0 -57
- package/src/index-controller/use-item-index-controller.ts +0 -197
- package/src/index.ts +0 -208
- package/src/infinite-scroll-table/index.tsx +0 -99
- package/src/info-tooltip/index.tsx +0 -41
- package/src/input-components/radio-button.tsx +0 -63
- package/src/input-slider/index.module.less +0 -30
- package/src/input-slider/index.tsx +0 -161
- package/src/input-with-count/index.tsx +0 -31
- package/src/jump-button/jump-icon-button.tsx +0 -12
- package/src/large-txt-render/index.tsx +0 -46
- package/src/layout/content.tsx +0 -28
- package/src/layout/header.tsx +0 -15
- package/src/layout/index.module.less +0 -28
- package/src/layout/index.tsx +0 -9
- package/src/layout/tabs.tsx +0 -11
- package/src/lazy-load-component/index.tsx +0 -55
- package/src/logic-editor/index.ts +0 -3
- package/src/logic-editor/logic-editor.module.less +0 -13
- package/src/logic-editor/logic-editor.tsx +0 -200
- package/src/logic-editor/logic-left-render.tsx +0 -100
- package/src/logic-editor/logic-operator-render.tsx +0 -54
- package/src/logic-editor/logic-right-render.tsx +0 -51
- package/src/logic-editor/logic-types.tsx +0 -238
- package/src/logic-editor/utils.ts +0 -22
- package/src/logic-expr/assets/select.svg +0 -1
- package/src/logic-expr/consts.ts +0 -6
- package/src/logic-expr/expr-group-render.tsx +0 -238
- package/src/logic-expr/expr-render.tsx +0 -226
- package/src/logic-expr/index.module.less +0 -252
- package/src/logic-expr/index.ts +0 -13
- package/src/logic-expr/logic-expr.tsx +0 -261
- package/src/logic-expr/logic-not.tsx +0 -46
- package/src/logic-expr/logic-toggle.tsx +0 -96
- package/src/logic-expr/types.ts +0 -95
- package/src/loop-radio-group/index.tsx +0 -16
- package/src/multi-part-editor/components/image-item-renderer.tsx +0 -134
- package/src/multi-part-editor/components/index.module.less +0 -21
- package/src/multi-part-editor/components/multipart-item-renderer.tsx +0 -74
- package/src/multi-part-editor/components/url-input-modal.tsx +0 -317
- package/src/multi-part-editor/components/video-item-renderer.tsx +0 -145
- package/src/multi-part-editor/index.module.less +0 -8
- package/src/multi-part-editor/index.tsx +0 -571
- package/src/multi-part-editor/multi-part-render.tsx +0 -87
- package/src/multi-part-editor/type.tsx +0 -103
- package/src/multi-part-editor/upload-button.tsx +0 -256
- package/src/multi-part-editor/utils.ts +0 -64
- package/src/open-detail-button/index.tsx +0 -30
- package/src/page-content/index.tsx +0 -99
- package/src/primary-page/index.tsx +0 -1
- package/src/primary-page/primary-header.tsx +0 -64
- package/src/primary-title/index.module.less +0 -14
- package/src/primary-title/index.tsx +0 -18
- package/src/provider/index.tsx +0 -89
- package/src/resizable-side-sheet/index.tsx +0 -69
- package/src/resize-sidesheet/index.module.less +0 -14
- package/src/resize-sidesheet/index.tsx +0 -68
- package/src/resize-sidesheet/use-drag.ts +0 -43
- package/src/schema-editor/index.tsx +0 -52
- package/src/search-form/index.tsx +0 -134
- package/src/semi-schema-form/components/tmpls/array-field-item.tsx +0 -97
- package/src/semi-schema-form/components/tmpls/array-field.tsx +0 -127
- package/src/semi-schema-form/components/tmpls/base-input.tsx +0 -126
- package/src/semi-schema-form/components/tmpls/description-field.tsx +0 -23
- package/src/semi-schema-form/components/tmpls/error-list.tsx +0 -44
- package/src/semi-schema-form/components/tmpls/field-error.tsx +0 -33
- package/src/semi-schema-form/components/tmpls/field.tsx +0 -54
- package/src/semi-schema-form/components/tmpls/icon-button.tsx +0 -112
- package/src/semi-schema-form/components/tmpls/index.ts +0 -39
- package/src/semi-schema-form/components/tmpls/object-field.tsx +0 -173
- package/src/semi-schema-form/components/tmpls/submit.tsx +0 -31
- package/src/semi-schema-form/components/tmpls/title-field.tsx +0 -30
- package/src/semi-schema-form/components/widgets/checkbox.tsx +0 -67
- package/src/semi-schema-form/components/widgets/checkboxs.tsx +0 -100
- package/src/semi-schema-form/components/widgets/index.ts +0 -17
- package/src/semi-schema-form/components/widgets/radio.tsx +0 -105
- package/src/semi-schema-form/components/widgets/range.tsx +0 -73
- package/src/semi-schema-form/components/widgets/select.tsx +0 -108
- package/src/semi-schema-form/components/widgets/textarea.tsx +0 -63
- package/src/semi-schema-form/index.tsx +0 -14
- package/src/sentinel-form/enum.ts +0 -16
- package/src/sentinel-form/index.tsx +0 -382
- package/src/step-nav/index.module.less +0 -45
- package/src/step-nav/index.tsx +0 -53
- package/src/table/index.module.less +0 -144
- package/src/table/index.tsx +0 -18
- package/src/table/sort-icon.tsx +0 -73
- package/src/table/table-with-pagination.tsx +0 -150
- package/src/table/table-without-pagniation.tsx +0 -66
- package/src/table-batch-operate/table-batch-operation.tsx +0 -47
- package/src/table-batch-operate/use-batch-operate.ts +0 -111
- package/src/table-col-actions/index.module.less +0 -8
- package/src/table-col-actions/index.tsx +0 -149
- package/src/table-cols-config/index.module.less +0 -34
- package/src/table-cols-config/index.tsx +0 -171
- package/src/table-cols-config/type.ts +0 -12
- package/src/table-cols-config/use-hidden-col-keys.ts +0 -53
- package/src/table-cols-config/util.ts +0 -56
- package/src/table-empty/index.tsx +0 -23
- package/src/table-header/index.module.less +0 -7
- package/src/table-header/index.tsx +0 -70
- package/src/tabs/index.module.less +0 -48
- package/src/tabs/index.tsx +0 -9
- package/src/text-area-pro/index.module.less +0 -5
- package/src/text-area-pro/index.tsx +0 -49
- package/src/text-with-copy/index.tsx +0 -95
- package/src/title-with-sub/index.tsx +0 -27
- package/src/tooltip-when-disabled/index.tsx +0 -23
- package/src/tooltip-with-disabled/index.tsx +0 -17
- package/src/types.d.ts +0 -24
- package/src/upload/index.ts +0 -39
- package/src/user-profile/index.tsx +0 -49
- package/src/utils/basic.ts +0 -29
- package/src/version-list/index.module.less +0 -16
- package/src/version-list/version-descriptions.tsx +0 -80
- package/src/version-list/version-item.tsx +0 -30
- package/src/version-list/version-list.tsx +0 -59
- package/src/version-list/version-switch-panel.tsx +0 -31
- package/tailwind.config.ts +0 -6
- package/tsconfig.build.json +0 -44
- package/tsconfig.json +0 -17
- package/tsconfig.misc.json +0 -28
- package/vitest.config.mts +0 -7
package/src/index.ts
DELETED
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
export { ColumnSelector, type ColumnItem } from './columns-select';
|
|
2
|
-
export {
|
|
3
|
-
TooltipWhenDisabled,
|
|
4
|
-
type TooltipWhenDisabledProps,
|
|
5
|
-
} from './tooltip-when-disabled';
|
|
6
|
-
export { TooltipWithDisabled } from './tooltip-with-disabled';
|
|
7
|
-
|
|
8
|
-
export { LoopTable } from './table';
|
|
9
|
-
export {
|
|
10
|
-
TableWithPagination,
|
|
11
|
-
DEFAULT_PAGE_SIZE,
|
|
12
|
-
PAGE_SIZE_OPTIONS,
|
|
13
|
-
getStoragePageSize,
|
|
14
|
-
type TableWithPaginationProps,
|
|
15
|
-
} from './table/table-with-pagination';
|
|
16
|
-
export {
|
|
17
|
-
PageError,
|
|
18
|
-
PageLoading,
|
|
19
|
-
PageNoAuth,
|
|
20
|
-
PageNoContent,
|
|
21
|
-
PageNotFound,
|
|
22
|
-
FullPage,
|
|
23
|
-
} from './page-content';
|
|
24
|
-
|
|
25
|
-
export { TableColActions, type TableColAction } from './table-col-actions';
|
|
26
|
-
export { LoopTabs } from './tabs';
|
|
27
|
-
|
|
28
|
-
export { LargeTxtRender } from './large-txt-render';
|
|
29
|
-
|
|
30
|
-
export { InputSlider, formateDecimalPlacesString } from './input-slider';
|
|
31
|
-
|
|
32
|
-
export { handleCopy, sleep } from './utils/basic';
|
|
33
|
-
export { uploadFile } from './upload';
|
|
34
|
-
export { default as VersionList } from './version-list/version-list';
|
|
35
|
-
export { default as VersionItem } from './version-list/version-item';
|
|
36
|
-
export { type Version } from './version-list/version-descriptions';
|
|
37
|
-
export { default as VersionSwitchPanel } from './version-list/version-switch-panel';
|
|
38
|
-
export { TextWithCopy } from './text-with-copy';
|
|
39
|
-
export { InfoTooltip } from './info-tooltip';
|
|
40
|
-
export { IDRender } from './id-render';
|
|
41
|
-
export { IconButtonContainer } from './id-render/icon-button-container';
|
|
42
|
-
export { JumpIconButton } from './jump-button/jump-icon-button';
|
|
43
|
-
export { UserProfile } from './user-profile';
|
|
44
|
-
export {
|
|
45
|
-
getColumnManageStorage,
|
|
46
|
-
setColumnsManageStorage,
|
|
47
|
-
dealColumnsWithStorage,
|
|
48
|
-
} from './column-manage-storage';
|
|
49
|
-
|
|
50
|
-
export { PrimaryPage } from './primary-page';
|
|
51
|
-
export { PrimaryTitle } from './primary-title';
|
|
52
|
-
|
|
53
|
-
export { ResizeSidesheet } from './resize-sidesheet';
|
|
54
|
-
|
|
55
|
-
export { useUnsaveLeaveWarning } from './hooks/use-unsave-leave-warning';
|
|
56
|
-
|
|
57
|
-
export {
|
|
58
|
-
InfiniteScrollTable,
|
|
59
|
-
type InfiniteScrollTableRef,
|
|
60
|
-
} from './infinite-scroll-table';
|
|
61
|
-
|
|
62
|
-
export { TableHeader, type TableHeaderProps } from './table-header';
|
|
63
|
-
export {
|
|
64
|
-
TableColsConfig,
|
|
65
|
-
type TableColsConfigProps,
|
|
66
|
-
type ColumnPropsPro,
|
|
67
|
-
type ColKey,
|
|
68
|
-
} from './table-cols-config';
|
|
69
|
-
// import { TableHeaderProps } from './table-header';
|
|
70
|
-
// export const a = {} as unknown as TableHeaderProps;
|
|
71
|
-
|
|
72
|
-
export { TableWithoutPagination } from './table/table-without-pagniation';
|
|
73
|
-
|
|
74
|
-
export { TableBatchOperate } from './table-batch-operate/table-batch-operation';
|
|
75
|
-
export {
|
|
76
|
-
useBatchOperate,
|
|
77
|
-
type BatchOperateStore,
|
|
78
|
-
} from './table-batch-operate/use-batch-operate';
|
|
79
|
-
|
|
80
|
-
export { useItemIndexController } from './index-controller/use-item-index-controller';
|
|
81
|
-
export { IndexControllerView } from './index-controller/record-navigation';
|
|
82
|
-
|
|
83
|
-
export {
|
|
84
|
-
BaseSearchSelect,
|
|
85
|
-
BaseSearchFormSelect,
|
|
86
|
-
type BaseSelectProps,
|
|
87
|
-
type LoadOptionByIds,
|
|
88
|
-
} from './base-search-select';
|
|
89
|
-
|
|
90
|
-
export { OpenDetailButton } from './open-detail-button';
|
|
91
|
-
|
|
92
|
-
export { EditIconButton } from './edit-icon-button';
|
|
93
|
-
|
|
94
|
-
export { CollapseCard } from './collapse-card';
|
|
95
|
-
|
|
96
|
-
export {
|
|
97
|
-
type Expr,
|
|
98
|
-
type ExprGroup,
|
|
99
|
-
type LogicOperator,
|
|
100
|
-
type LogicExprProps,
|
|
101
|
-
type ExprRenderProps,
|
|
102
|
-
type ExprGroupRenderProps,
|
|
103
|
-
type LeftRenderProps,
|
|
104
|
-
type OperatorRenderProps,
|
|
105
|
-
type RightRenderProps,
|
|
106
|
-
type OperatorOption,
|
|
107
|
-
LogicExpr,
|
|
108
|
-
} from './logic-expr';
|
|
109
|
-
|
|
110
|
-
// #region 输入控件
|
|
111
|
-
export {
|
|
112
|
-
RadioButton,
|
|
113
|
-
type RadioButtonProps,
|
|
114
|
-
} from './input-components/radio-button';
|
|
115
|
-
|
|
116
|
-
export {
|
|
117
|
-
LogicEditor,
|
|
118
|
-
type LogicDataType,
|
|
119
|
-
type LogicField,
|
|
120
|
-
type LogicFilter,
|
|
121
|
-
type LogicSetter,
|
|
122
|
-
} from './logic-editor';
|
|
123
|
-
|
|
124
|
-
export {
|
|
125
|
-
CodeEditor,
|
|
126
|
-
DiffEditor,
|
|
127
|
-
type Monaco,
|
|
128
|
-
type MonacoDiffEditor,
|
|
129
|
-
type editor,
|
|
130
|
-
} from './code-editor';
|
|
131
|
-
// #endregion 输入控件
|
|
132
|
-
|
|
133
|
-
export { BasicCard } from './basic-card';
|
|
134
|
-
export { MultipartEditor } from './multi-part-editor';
|
|
135
|
-
|
|
136
|
-
export { ChipSelect } from './chip-select';
|
|
137
|
-
export { ImageItemRenderer } from './multi-part-editor/components/image-item-renderer';
|
|
138
|
-
export { VideoItemRenderer } from './multi-part-editor/components/video-item-renderer';
|
|
139
|
-
export {
|
|
140
|
-
ImageStatus as MultipartRenderStatus,
|
|
141
|
-
type FileItemStatus,
|
|
142
|
-
type ContentPartLoop,
|
|
143
|
-
} from './multi-part-editor/type';
|
|
144
|
-
export {
|
|
145
|
-
DEFAULT_FILE_SIZE,
|
|
146
|
-
DEFAULT_FILE_COUNT,
|
|
147
|
-
DEFAULT_PART_COUNT,
|
|
148
|
-
DEFAULT_SUPPORTED_FORMATS,
|
|
149
|
-
DEFAULT_VIDEO_SUPPORTED_FORMATS,
|
|
150
|
-
} from './multi-part-editor/utils';
|
|
151
|
-
|
|
152
|
-
export {
|
|
153
|
-
UploadButton,
|
|
154
|
-
type UploadButtonRef,
|
|
155
|
-
} from './multi-part-editor/upload-button';
|
|
156
|
-
export { MultiPartRender } from './multi-part-editor/multi-part-render';
|
|
157
|
-
export { StepNav } from './step-nav';
|
|
158
|
-
|
|
159
|
-
export { LazyLoadComponent } from './lazy-load-component';
|
|
160
|
-
export { TextAreaPro, type Props as TextAreaProProps } from './text-area-pro';
|
|
161
|
-
export { InputWithCount } from './input-with-count';
|
|
162
|
-
export { LoopRadioGroup } from './loop-radio-group';
|
|
163
|
-
|
|
164
|
-
// Migrated components from fornax
|
|
165
|
-
export { UsageItem, SupportedLang } from './code-usage';
|
|
166
|
-
export { Layout } from './layout';
|
|
167
|
-
export {
|
|
168
|
-
SearchForm,
|
|
169
|
-
type SearchFormRef,
|
|
170
|
-
type SearchFormFilterRecord,
|
|
171
|
-
} from './search-form';
|
|
172
|
-
export { TitleWithSub } from './title-with-sub';
|
|
173
|
-
|
|
174
|
-
// Provider
|
|
175
|
-
export {
|
|
176
|
-
CozeLoopProvider,
|
|
177
|
-
useI18n,
|
|
178
|
-
useCozeLoopContext,
|
|
179
|
-
useReportEvent,
|
|
180
|
-
type I18nFunction,
|
|
181
|
-
} from './provider';
|
|
182
|
-
|
|
183
|
-
export { FooterActions } from './footer-actions';
|
|
184
|
-
export { TableEmpty } from './table-empty';
|
|
185
|
-
export { CardPane } from './card-pane';
|
|
186
|
-
|
|
187
|
-
export {
|
|
188
|
-
SemiSchemaForm,
|
|
189
|
-
type SemiSchemaFormInstance,
|
|
190
|
-
schemaValidators,
|
|
191
|
-
} from './semi-schema-form';
|
|
192
|
-
|
|
193
|
-
export { ResizableSideSheet } from './resizable-side-sheet';
|
|
194
|
-
|
|
195
|
-
export {
|
|
196
|
-
SentinelForm,
|
|
197
|
-
type SentinelFormRef,
|
|
198
|
-
type SentinelFormApi,
|
|
199
|
-
} from './sentinel-form';
|
|
200
|
-
|
|
201
|
-
export {
|
|
202
|
-
CodeMirrorCodeEditor,
|
|
203
|
-
CodeMirrorTextEditor,
|
|
204
|
-
CodeMirrorJsonEditor,
|
|
205
|
-
CodeMirrorRawTextEditor,
|
|
206
|
-
} from './codemirror-editor';
|
|
207
|
-
|
|
208
|
-
export { SchemaEditor } from './schema-editor';
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type ForwardedRef,
|
|
3
|
-
forwardRef,
|
|
4
|
-
useRef,
|
|
5
|
-
useImperativeHandle,
|
|
6
|
-
} from 'react';
|
|
7
|
-
|
|
8
|
-
import classNames from 'classnames';
|
|
9
|
-
import {
|
|
10
|
-
type Data,
|
|
11
|
-
type InfiniteScrollOptions,
|
|
12
|
-
type Service,
|
|
13
|
-
} from 'ahooks/lib/useInfiniteScroll/types';
|
|
14
|
-
import { useSize, useInfiniteScroll } from 'ahooks';
|
|
15
|
-
import { IconCozIllusEmpty } from '@coze-arch/coze-design/illustrations';
|
|
16
|
-
import { EmptyState, type TableProps } from '@coze-arch/coze-design';
|
|
17
|
-
|
|
18
|
-
import { LoopTable } from '../table';
|
|
19
|
-
|
|
20
|
-
interface ExpandData extends Data {
|
|
21
|
-
hasMore?: boolean;
|
|
22
|
-
}
|
|
23
|
-
interface InfiniteScrollTableProps<TData extends ExpandData> {
|
|
24
|
-
service: Service<TData>;
|
|
25
|
-
options?: InfiniteScrollOptions<TData>;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export interface InfiniteScrollTableRef {
|
|
29
|
-
hookRes: ReturnType<typeof useInfiniteScroll>;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// 定义组件的 Props 类型
|
|
33
|
-
type Props<TData extends ExpandData> = TableProps &
|
|
34
|
-
InfiniteScrollTableProps<TData>;
|
|
35
|
-
|
|
36
|
-
// 显式指定 forwardRef 的类型
|
|
37
|
-
export const InfiniteScrollTable: <TData extends ExpandData>(
|
|
38
|
-
props: Props<TData> & { ref?: ForwardedRef<InfiniteScrollTableRef> },
|
|
39
|
-
) => React.ReactElement | null = forwardRef(
|
|
40
|
-
<TData extends ExpandData>(
|
|
41
|
-
{ service, options, className, ...restTableProps }: Props<TData>,
|
|
42
|
-
ref: ForwardedRef<InfiniteScrollTableRef>,
|
|
43
|
-
): JSX.Element => {
|
|
44
|
-
const containerRef = useRef<HTMLDivElement>(null);
|
|
45
|
-
|
|
46
|
-
const hookRes = useInfiniteScroll(d => service?.(d), {
|
|
47
|
-
isNoMore: d => !d?.hasMore,
|
|
48
|
-
...options,
|
|
49
|
-
reloadDeps: [...(options?.reloadDeps || [])],
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
const { data, loading, loadingMore, noMore, loadMore } = hookRes;
|
|
53
|
-
|
|
54
|
-
const scrollSize = useSize(containerRef);
|
|
55
|
-
const height = scrollSize?.height || 0;
|
|
56
|
-
|
|
57
|
-
useImperativeHandle(ref, () => ({
|
|
58
|
-
// @ts-expect-error type
|
|
59
|
-
hookRes,
|
|
60
|
-
}));
|
|
61
|
-
|
|
62
|
-
return (
|
|
63
|
-
<div
|
|
64
|
-
className={classNames('w-full h-full overflow-hidden', className)}
|
|
65
|
-
ref={containerRef}
|
|
66
|
-
>
|
|
67
|
-
<LoopTable
|
|
68
|
-
tableProps={{
|
|
69
|
-
...restTableProps.tableProps,
|
|
70
|
-
loading: loading || loadingMore,
|
|
71
|
-
pagination: false,
|
|
72
|
-
dataSource: data?.list || [],
|
|
73
|
-
scroll: {
|
|
74
|
-
y: height - 48,
|
|
75
|
-
...restTableProps.tableProps?.scroll,
|
|
76
|
-
},
|
|
77
|
-
}}
|
|
78
|
-
empty={
|
|
79
|
-
restTableProps.empty ?? (
|
|
80
|
-
<EmptyState
|
|
81
|
-
size="full_screen"
|
|
82
|
-
icon={<IconCozIllusEmpty />}
|
|
83
|
-
title="暂无数据"
|
|
84
|
-
/>
|
|
85
|
-
)
|
|
86
|
-
}
|
|
87
|
-
enableLoad={true}
|
|
88
|
-
loadMode="cursor"
|
|
89
|
-
hasMore={!noMore}
|
|
90
|
-
onLoad={loadMore}
|
|
91
|
-
offsetY={0}
|
|
92
|
-
strictDataSourceProp
|
|
93
|
-
/>
|
|
94
|
-
</div>
|
|
95
|
-
);
|
|
96
|
-
},
|
|
97
|
-
) as <TData extends ExpandData>(
|
|
98
|
-
props: Props<TData> & { ref?: ForwardedRef<InfiniteScrollTableRef> },
|
|
99
|
-
) => React.ReactElement | null;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import classNames from 'classnames';
|
|
2
|
-
import {
|
|
3
|
-
IconCozInfoCircle,
|
|
4
|
-
IconCozQuestionMarkCircle,
|
|
5
|
-
} from '@coze-arch/coze-design/icons';
|
|
6
|
-
import { Tooltip } from '@coze-arch/coze-design';
|
|
7
|
-
|
|
8
|
-
interface Props {
|
|
9
|
-
content: string | React.ReactNode;
|
|
10
|
-
className?: string;
|
|
11
|
-
tooltipClassName?: string;
|
|
12
|
-
icon?: React.ReactNode;
|
|
13
|
-
useQuestion?: boolean;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export const InfoTooltip = ({
|
|
17
|
-
content,
|
|
18
|
-
className,
|
|
19
|
-
tooltipClassName,
|
|
20
|
-
icon,
|
|
21
|
-
useQuestion = false,
|
|
22
|
-
}: Props) => {
|
|
23
|
-
const defaultIcon = useQuestion ? (
|
|
24
|
-
<IconCozQuestionMarkCircle className="coz-fg-secondary cursor-pointer hover:coz-fg-primary" />
|
|
25
|
-
) : (
|
|
26
|
-
<IconCozInfoCircle className="coz-fg-secondary cursor-pointer hover:coz-fg-primary" />
|
|
27
|
-
);
|
|
28
|
-
return (
|
|
29
|
-
<Tooltip
|
|
30
|
-
content={
|
|
31
|
-
<div style={{ maxHeight: 300, overflowY: 'auto' }}>{content}</div>
|
|
32
|
-
}
|
|
33
|
-
theme="dark"
|
|
34
|
-
className={tooltipClassName}
|
|
35
|
-
>
|
|
36
|
-
<div className={classNames('h-[17px]', className)}>
|
|
37
|
-
{icon ?? defaultIcon}
|
|
38
|
-
</div>
|
|
39
|
-
</Tooltip>
|
|
40
|
-
);
|
|
41
|
-
};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import cls from 'classnames';
|
|
2
|
-
import { Tooltip } from '@coze-arch/coze-design';
|
|
3
|
-
|
|
4
|
-
export interface RadioButtonProps<T extends string | number> {
|
|
5
|
-
value?: T;
|
|
6
|
-
onChange?: (value: T) => void;
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
options: Array<{
|
|
9
|
-
value: T;
|
|
10
|
-
label: React.ReactNode;
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
tooltip?: string;
|
|
13
|
-
}>;
|
|
14
|
-
className?: string;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/** coze design 的 SegmentTab 和 Radio 的 advanced + pureCard 模式均有样式问题,不得不自行造轮子 */
|
|
18
|
-
export function RadioButton<T extends string | number>({
|
|
19
|
-
value,
|
|
20
|
-
onChange,
|
|
21
|
-
options,
|
|
22
|
-
disabled,
|
|
23
|
-
className,
|
|
24
|
-
}: RadioButtonProps<T>) {
|
|
25
|
-
return (
|
|
26
|
-
<div className={cls('w-full flex items-center gap-[8px]', className)}>
|
|
27
|
-
{options.map(option => {
|
|
28
|
-
const selected = value === option.value;
|
|
29
|
-
const optionDisabled = option.disabled || disabled;
|
|
30
|
-
return (
|
|
31
|
-
<Tooltip
|
|
32
|
-
key={option.value}
|
|
33
|
-
trigger={option.tooltip ? 'hover' : 'custom'}
|
|
34
|
-
content={option.tooltip}
|
|
35
|
-
>
|
|
36
|
-
<div
|
|
37
|
-
className={cls(
|
|
38
|
-
'flex-1 px-[20px] py-[4px] rounded-[6px]',
|
|
39
|
-
'flex items-center justify-center',
|
|
40
|
-
'border border-solid',
|
|
41
|
-
'text-[14px] leading-[20px]',
|
|
42
|
-
selected
|
|
43
|
-
? 'coz-fg-hglt coz-stroke-hglt coz-mg-hglt hover:coz-mg-hglt-hovered active:coz-mg-hglt-pressed'
|
|
44
|
-
: 'coz-stroke-primary coz-bg-max hover:coz-mg-primary-hovered active:coz-mg-primary-pressed',
|
|
45
|
-
optionDisabled
|
|
46
|
-
? 'cursor-not-allowed opacity-60'
|
|
47
|
-
: 'cursor-pointer',
|
|
48
|
-
)}
|
|
49
|
-
onClick={() => {
|
|
50
|
-
if (optionDisabled) {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
onChange?.(option.value);
|
|
54
|
-
}}
|
|
55
|
-
>
|
|
56
|
-
{option.label}
|
|
57
|
-
</div>
|
|
58
|
-
</Tooltip>
|
|
59
|
-
);
|
|
60
|
-
})}
|
|
61
|
-
</div>
|
|
62
|
-
);
|
|
63
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/* stylelint-disable declaration-no-important */
|
|
2
|
-
.input-slider {
|
|
3
|
-
display: flex;
|
|
4
|
-
column-gap: 8px;
|
|
5
|
-
align-items: center;
|
|
6
|
-
|
|
7
|
-
:global {
|
|
8
|
-
.semi-slider {
|
|
9
|
-
flex: 1;
|
|
10
|
-
padding-left: 14px;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.semi-slider-handle{
|
|
14
|
-
width: 12px !important;
|
|
15
|
-
height: 12px !important;
|
|
16
|
-
margin-top: 10px !important;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.input-number {
|
|
21
|
-
width: 90px;
|
|
22
|
-
|
|
23
|
-
:global{
|
|
24
|
-
.semi-input-number-suffix-btns{
|
|
25
|
-
height: auto !important;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
}
|
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
2
|
-
/* eslint-disable @typescript-eslint/no-magic-numbers */
|
|
3
|
-
/* eslint-disable max-params */
|
|
4
|
-
import { useRef } from 'react';
|
|
5
|
-
|
|
6
|
-
import { isInteger, isUndefined } from 'lodash-es';
|
|
7
|
-
import classNames from 'classnames';
|
|
8
|
-
import {
|
|
9
|
-
CozInputNumber,
|
|
10
|
-
Slider,
|
|
11
|
-
type SliderProps,
|
|
12
|
-
} from '@coze-arch/coze-design';
|
|
13
|
-
|
|
14
|
-
import styles from './index.module.less';
|
|
15
|
-
|
|
16
|
-
interface InputSliderProps {
|
|
17
|
-
value?: number;
|
|
18
|
-
onChange?: (v: number) => void;
|
|
19
|
-
max?: number;
|
|
20
|
-
min?: number;
|
|
21
|
-
step?: number;
|
|
22
|
-
disabled?: boolean;
|
|
23
|
-
decimalPlaces?: number;
|
|
24
|
-
marks?: SliderProps['marks'];
|
|
25
|
-
className?: string;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export const formateDecimalPlacesString = (
|
|
29
|
-
value: string | number,
|
|
30
|
-
prevValue?: number,
|
|
31
|
-
decimalPlaces?: number,
|
|
32
|
-
) => {
|
|
33
|
-
if (isUndefined(decimalPlaces)) {
|
|
34
|
-
return value.toString();
|
|
35
|
-
}
|
|
36
|
-
const numberValue = Number(value);
|
|
37
|
-
const stringValue = value.toString();
|
|
38
|
-
if (Number.isNaN(numberValue)) {
|
|
39
|
-
return `${value}`;
|
|
40
|
-
}
|
|
41
|
-
if (decimalPlaces === 0 && !isInteger(Number(value)) && prevValue) {
|
|
42
|
-
return `${prevValue}`;
|
|
43
|
-
}
|
|
44
|
-
const decimalPointIndex = stringValue.indexOf('.');
|
|
45
|
-
|
|
46
|
-
if (decimalPointIndex < 0) {
|
|
47
|
-
return stringValue;
|
|
48
|
-
}
|
|
49
|
-
const formattedValue = stringValue.substring(
|
|
50
|
-
0,
|
|
51
|
-
decimalPointIndex + 1 + decimalPlaces!,
|
|
52
|
-
);
|
|
53
|
-
|
|
54
|
-
if (formattedValue.endsWith('.') && decimalPlaces === 0) {
|
|
55
|
-
return formattedValue.substring(0, formattedValue.length - 1);
|
|
56
|
-
}
|
|
57
|
-
return formattedValue;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
function getDecimalPlaces(num) {
|
|
61
|
-
if (!num) {
|
|
62
|
-
return 0;
|
|
63
|
-
}
|
|
64
|
-
// 将数字转换为字符串
|
|
65
|
-
const numStr = num.toString();
|
|
66
|
-
// 检查是否包含小数点
|
|
67
|
-
if (numStr.includes('.')) {
|
|
68
|
-
// 使用正则表达式匹配小数点后面的数字
|
|
69
|
-
const decimalPart = numStr.split('.')[1];
|
|
70
|
-
return decimalPart.length; // 返回小数位数
|
|
71
|
-
}
|
|
72
|
-
return 0; // 如果没有小数点,返回0
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
const formateDecimalPlacesNumber = (
|
|
76
|
-
value: number,
|
|
77
|
-
prevValue?: number,
|
|
78
|
-
decimalPlaces?: number,
|
|
79
|
-
isPasted?: boolean,
|
|
80
|
-
) => {
|
|
81
|
-
if (isUndefined(decimalPlaces)) {
|
|
82
|
-
if (isPasted) {
|
|
83
|
-
return value;
|
|
84
|
-
}
|
|
85
|
-
const currentDecimalPlaces = getDecimalPlaces(value);
|
|
86
|
-
const prevDecimalPlaces = getDecimalPlaces(prevValue);
|
|
87
|
-
if (
|
|
88
|
-
prevDecimalPlaces === 2 &&
|
|
89
|
-
currentDecimalPlaces > 2 &&
|
|
90
|
-
!isUndefined(prevValue) &&
|
|
91
|
-
Math.abs(prevValue! - value).toFixed(2) === '0.01'
|
|
92
|
-
) {
|
|
93
|
-
const pow2 = Math.pow(10, 2);
|
|
94
|
-
return Math.round(value * pow2) / pow2;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
return value;
|
|
98
|
-
}
|
|
99
|
-
if (decimalPlaces === 0 && !isInteger(value) && prevValue) {
|
|
100
|
-
return prevValue;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
const pow = Math.pow(10, decimalPlaces!);
|
|
104
|
-
return Math.round(value * pow) / pow;
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
export const InputSlider: React.FC<InputSliderProps> = ({
|
|
108
|
-
value,
|
|
109
|
-
onChange,
|
|
110
|
-
max = 1,
|
|
111
|
-
min = 0,
|
|
112
|
-
step = 1,
|
|
113
|
-
disabled,
|
|
114
|
-
decimalPlaces,
|
|
115
|
-
marks,
|
|
116
|
-
className,
|
|
117
|
-
}) => {
|
|
118
|
-
const isPasted = useRef(false);
|
|
119
|
-
const onNumberChange = (numberValue: number) => {
|
|
120
|
-
const formattedValue = formateDecimalPlacesNumber(
|
|
121
|
-
numberValue,
|
|
122
|
-
value,
|
|
123
|
-
decimalPlaces,
|
|
124
|
-
isPasted.current,
|
|
125
|
-
);
|
|
126
|
-
isPasted.current = false;
|
|
127
|
-
onChange?.(formattedValue);
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
return (
|
|
131
|
-
<div className={classNames(styles['input-slider'], className)}>
|
|
132
|
-
<Slider
|
|
133
|
-
key={`${min}-${max}`}
|
|
134
|
-
disabled={disabled}
|
|
135
|
-
value={value}
|
|
136
|
-
max={max}
|
|
137
|
-
min={min}
|
|
138
|
-
step={step}
|
|
139
|
-
marks={marks}
|
|
140
|
-
onChange={v => {
|
|
141
|
-
if (typeof v === 'number') {
|
|
142
|
-
onChange?.(v);
|
|
143
|
-
}
|
|
144
|
-
}}
|
|
145
|
-
/>
|
|
146
|
-
<CozInputNumber
|
|
147
|
-
className={styles['input-number']}
|
|
148
|
-
value={value}
|
|
149
|
-
disabled={disabled}
|
|
150
|
-
formatter={inputValue =>
|
|
151
|
-
formateDecimalPlacesString(inputValue, value, decimalPlaces)
|
|
152
|
-
}
|
|
153
|
-
onNumberChange={onNumberChange}
|
|
154
|
-
max={max}
|
|
155
|
-
min={min}
|
|
156
|
-
step={step}
|
|
157
|
-
onPaste={() => (isPasted.current = true)}
|
|
158
|
-
/>
|
|
159
|
-
</div>
|
|
160
|
-
);
|
|
161
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { Input, type InputProps } from '@coze-arch/coze-design';
|
|
4
|
-
|
|
5
|
-
interface LimitCountProps {
|
|
6
|
-
maxLen: number;
|
|
7
|
-
len: number;
|
|
8
|
-
}
|
|
9
|
-
const LimitCount = ({ maxLen, len }: LimitCountProps) => (
|
|
10
|
-
<span className="pl-2 pr-3 overflow-hidden text-xs coz-fg-secondary">
|
|
11
|
-
<span>{len}</span>
|
|
12
|
-
<span>/</span>
|
|
13
|
-
<span>{maxLen}</span>
|
|
14
|
-
</span>
|
|
15
|
-
);
|
|
16
|
-
|
|
17
|
-
export function InputWithCount(props: InputProps) {
|
|
18
|
-
return (
|
|
19
|
-
<Input
|
|
20
|
-
{...props}
|
|
21
|
-
suffix={
|
|
22
|
-
Boolean(props.maxLength) && (
|
|
23
|
-
<LimitCount
|
|
24
|
-
maxLen={props.maxLength ?? 0}
|
|
25
|
-
len={props.value?.toString().length ?? 0}
|
|
26
|
-
/>
|
|
27
|
-
)
|
|
28
|
-
}
|
|
29
|
-
/>
|
|
30
|
-
);
|
|
31
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { IconCozLongArrowTopRight } from '@coze-arch/coze-design/icons';
|
|
2
|
-
|
|
3
|
-
import { IconButtonContainer } from '../id-render/icon-button-container';
|
|
4
|
-
|
|
5
|
-
export function JumpIconButton(
|
|
6
|
-
props: {
|
|
7
|
-
className?: string;
|
|
8
|
-
style?: React.CSSProperties;
|
|
9
|
-
} & React.DOMAttributes<HTMLDivElement>,
|
|
10
|
-
) {
|
|
11
|
-
return <IconButtonContainer {...props} icon={<IconCozLongArrowTopRight />} />;
|
|
12
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { useRef } from 'react';
|
|
2
|
-
|
|
3
|
-
import { useInfiniteScroll } from 'ahooks';
|
|
4
|
-
|
|
5
|
-
const PER_PRE_MAX_LENGTH = 25000;
|
|
6
|
-
|
|
7
|
-
export interface LargeTxtRenderProps {
|
|
8
|
-
text: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export const LargeTxtRender = (props: LargeTxtRenderProps) => {
|
|
12
|
-
const { text } = props;
|
|
13
|
-
|
|
14
|
-
const ref = useRef<HTMLPreElement>(null);
|
|
15
|
-
|
|
16
|
-
const getMoreTextChunk = (startIndex: number) => {
|
|
17
|
-
const endIndex = startIndex + PER_PRE_MAX_LENGTH;
|
|
18
|
-
const chunk = text.slice(startIndex, endIndex);
|
|
19
|
-
const hasMore = endIndex < text.length;
|
|
20
|
-
|
|
21
|
-
return {
|
|
22
|
-
list: [chunk],
|
|
23
|
-
nextId: hasMore ? endIndex.toString() : undefined,
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
const { data } = useInfiniteScroll(
|
|
28
|
-
d => {
|
|
29
|
-
const startIndex = d ? parseInt(d.nextId) : 0;
|
|
30
|
-
return Promise.resolve(getMoreTextChunk(startIndex));
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
target: ref,
|
|
34
|
-
isNoMore: d => d?.nextId === undefined,
|
|
35
|
-
},
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
return (
|
|
39
|
-
<pre
|
|
40
|
-
ref={ref}
|
|
41
|
-
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"
|
|
42
|
-
>
|
|
43
|
-
{data?.list.join('') || ''}
|
|
44
|
-
</pre>
|
|
45
|
-
);
|
|
46
|
-
};
|