@cozeloop/components 0.0.0-beta-1766561124625
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 +84 -0
- package/dist/es/index.css +645 -0
- package/dist/es/index.mjs +6091 -0
- package/dist/es/static/svg/select.svg +1 -0
- package/dist/lib/base-search-select/base-search-form-select.d.ts +3 -0
- package/dist/lib/base-search-select/base-search-select.d.ts +9 -0
- package/dist/lib/base-search-select/index.d.ts +3 -0
- package/dist/lib/base-search-select/types.d.ts +13 -0
- package/dist/lib/base-search-select/utils.d.ts +8 -0
- package/dist/lib/basic-card/index.d.ts +7 -0
- package/dist/lib/card-pane/index.d.ts +5 -0
- package/dist/lib/chip-select/index.d.ts +2 -0
- package/dist/lib/code-editor/index.d.ts +3 -0
- package/dist/lib/code-editor-with-loading/index.d.ts +10 -0
- package/dist/lib/codemirror-editor/code-editor.d.ts +23 -0
- package/dist/lib/codemirror-editor/index.d.ts +6 -0
- package/dist/lib/codemirror-editor/json-editor.d.ts +19 -0
- package/dist/lib/codemirror-editor/raw-code-editor.d.ts +20 -0
- package/dist/lib/codemirror-editor/raw-text-editor.d.ts +11 -0
- package/dist/lib/codemirror-editor/text-editor.d.ts +23 -0
- package/dist/lib/codemirror-editor/themes/coze-dark.d.ts +1 -0
- package/dist/lib/codemirror-editor/themes/coze-light.d.ts +1 -0
- package/dist/lib/collapse-card/index.d.ts +14 -0
- package/dist/lib/collapsible-card/index.d.ts +13 -0
- package/dist/lib/column-manage-storage/index.d.ts +11 -0
- package/dist/lib/columns-select/index.d.ts +19 -0
- package/dist/lib/copyable/index.d.ts +5 -0
- package/dist/lib/edit-icon-button/index.d.ts +8 -0
- package/dist/lib/footer-actions/index.d.ts +15 -0
- package/dist/lib/hooks/use-infinite-scroll.d.ts +23 -0
- package/dist/lib/hooks/use-mouse-down-offset.d.ts +9 -0
- package/dist/lib/hooks/use-unsave-leave-warning.d.ts +15 -0
- package/dist/lib/id-render/icon-button-container.d.ts +8 -0
- package/dist/lib/id-render/index.d.ts +7 -0
- package/dist/lib/index-controller/record-navigation.d.ts +6 -0
- package/dist/lib/index-controller/use-item-index-controller.d.ts +47 -0
- package/dist/lib/index.d.ts +70 -0
- package/dist/lib/infinite-scroll-table/index.d.ts +19 -0
- package/dist/lib/info-tooltip/index.d.ts +9 -0
- package/dist/lib/input-components/radio-button.d.ts +14 -0
- package/dist/lib/input-slider/index.d.ts +15 -0
- package/dist/lib/input-with-count/index.d.ts +2 -0
- package/dist/lib/jump-button/jump-icon-button.d.ts +4 -0
- package/dist/lib/large-txt-render/index.d.ts +4 -0
- package/dist/lib/layout/content.d.ts +7 -0
- package/dist/lib/layout/header.d.ts +7 -0
- package/dist/lib/layout/index.d.ts +12 -0
- package/dist/lib/layout/tabs.d.ts +6 -0
- package/dist/lib/lazy-load-component/index.d.ts +5 -0
- package/dist/lib/logic-editor/index.d.ts +3 -0
- package/dist/lib/logic-editor/logic-editor.d.ts +15 -0
- package/dist/lib/logic-editor/logic-left-render.d.ts +3 -0
- package/dist/lib/logic-editor/logic-operator-render.d.ts +3 -0
- package/dist/lib/logic-editor/logic-right-render.d.ts +3 -0
- package/dist/lib/logic-editor/logic-types.d.ts +53 -0
- package/dist/lib/logic-editor/utils.d.ts +2 -0
- package/dist/lib/logic-expr/consts.d.ts +2 -0
- package/dist/lib/logic-expr/expr-group-render.d.ts +2 -0
- package/dist/lib/logic-expr/expr-render.d.ts +2 -0
- package/dist/lib/logic-expr/index.d.ts +2 -0
- package/dist/lib/logic-expr/logic-expr.d.ts +2 -0
- package/dist/lib/logic-expr/logic-not.d.ts +10 -0
- package/dist/lib/logic-expr/logic-toggle.d.ts +12 -0
- package/dist/lib/logic-expr/types.d.ts +79 -0
- package/dist/lib/loop-icons/index.d.ts +1 -0
- package/dist/lib/loop-radio-group/index.d.ts +2 -0
- package/dist/lib/multi-part-editor/components/image-item-renderer.d.ts +14 -0
- package/dist/lib/multi-part-editor/components/multipart-item-renderer.d.ts +10 -0
- package/dist/lib/multi-part-editor/components/url-input-modal.d.ts +14 -0
- package/dist/lib/multi-part-editor/components/video-item-renderer.d.ts +14 -0
- package/dist/lib/multi-part-editor/index.d.ts +3 -0
- package/dist/lib/multi-part-editor/multi-part-render.d.ts +10 -0
- package/dist/lib/multi-part-editor/type.d.ts +81 -0
- package/dist/lib/multi-part-editor/upload-button.d.ts +23 -0
- package/dist/lib/multi-part-editor/utils.d.ts +16 -0
- package/dist/lib/open-detail-button/index.d.ts +6 -0
- package/dist/lib/page-content/index.d.ts +20 -0
- package/dist/lib/primary-page/index.d.ts +1 -0
- package/dist/lib/primary-page/primary-header.d.ts +13 -0
- package/dist/lib/primary-title/index.d.ts +6 -0
- package/dist/lib/provider/index.d.ts +19 -0
- package/dist/lib/resizable-side-sheet/index.d.ts +10 -0
- package/dist/lib/resize-sidesheet/index.d.ts +7 -0
- package/dist/lib/resize-sidesheet/use-drag.d.ts +11 -0
- package/dist/lib/schema-editor/index.d.ts +11 -0
- package/dist/lib/semi-schema-form/components/tmpls/array-field-item.d.ts +6 -0
- package/dist/lib/semi-schema-form/components/tmpls/array-field.d.ts +6 -0
- package/dist/lib/semi-schema-form/components/tmpls/base-input.d.ts +8 -0
- package/dist/lib/semi-schema-form/components/tmpls/description-field.d.ts +6 -0
- package/dist/lib/semi-schema-form/components/tmpls/error-list.d.ts +6 -0
- package/dist/lib/semi-schema-form/components/tmpls/field-error.d.ts +6 -0
- package/dist/lib/semi-schema-form/components/tmpls/field.d.ts +7 -0
- package/dist/lib/semi-schema-form/components/tmpls/icon-button.d.ts +11 -0
- package/dist/lib/semi-schema-form/components/tmpls/index.d.ts +2 -0
- package/dist/lib/semi-schema-form/components/tmpls/object-field.d.ts +8 -0
- package/dist/lib/semi-schema-form/components/tmpls/submit.d.ts +4 -0
- package/dist/lib/semi-schema-form/components/tmpls/title-field.d.ts +6 -0
- package/dist/lib/semi-schema-form/components/widgets/checkbox.d.ts +7 -0
- package/dist/lib/semi-schema-form/components/widgets/checkboxs.d.ts +7 -0
- package/dist/lib/semi-schema-form/components/widgets/index.d.ts +2 -0
- package/dist/lib/semi-schema-form/components/widgets/radio.d.ts +7 -0
- package/dist/lib/semi-schema-form/components/widgets/range.d.ts +7 -0
- package/dist/lib/semi-schema-form/components/widgets/select.d.ts +7 -0
- package/dist/lib/semi-schema-form/components/widgets/textarea.d.ts +6 -0
- package/dist/lib/semi-schema-form/index.d.ts +4 -0
- package/dist/lib/sentinel-form/enum.d.ts +8 -0
- package/dist/lib/sentinel-form/index.d.ts +20 -0
- package/dist/lib/step-nav/index.d.ts +12 -0
- package/dist/lib/table/index.d.ts +2 -0
- package/dist/lib/table/sort-icon.d.ts +8 -0
- package/dist/lib/table/table-with-pagination.d.ts +21 -0
- package/dist/lib/table/table-without-pagniation.d.ts +6 -0
- package/dist/lib/table-batch-operate/table-batch-operation.d.ts +9 -0
- package/dist/lib/table-batch-operate/use-batch-operate.d.ts +30 -0
- package/dist/lib/table-col-actions/index.d.ts +22 -0
- package/dist/lib/table-cols-config/index.d.ts +11 -0
- package/dist/lib/table-cols-config/type.d.ts +6 -0
- package/dist/lib/table-cols-config/use-hidden-col-keys.d.ts +5 -0
- package/dist/lib/table-cols-config/util.d.ts +3 -0
- package/dist/lib/table-empty/index.d.ts +2 -0
- package/dist/lib/table-header/index.d.ts +14 -0
- package/dist/lib/tabs/index.d.ts +2 -0
- package/dist/lib/text-area-pro/index.d.ts +6 -0
- package/dist/lib/text-with-copy/index.d.ts +14 -0
- package/dist/lib/title-with-sub/index.d.ts +7 -0
- package/dist/lib/tooltip-when-disabled/index.d.ts +6 -0
- package/dist/lib/tooltip-with-disabled/index.d.ts +5 -0
- package/dist/lib/upload/index.d.ts +9 -0
- package/dist/lib/user-profile/index.d.ts +9 -0
- package/dist/lib/utils/basic.d.ts +2 -0
- package/dist/lib/version-list/version-descriptions.d.ts +15 -0
- package/dist/lib/version-list/version-item.d.ts +9 -0
- package/dist/lib/version-list/version-list.d.ts +11 -0
- package/dist/lib/version-list/version-switch-panel.d.ts +5 -0
- package/package.json +64 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type FormContextType, type ObjectFieldTemplateProps, type RJSFSchema, type StrictRJSFSchema } from '@rjsf/utils';
|
|
2
|
+
/** The `ObjectFieldTemplate` is the template to use to render all the inner properties of an object along with the
|
|
3
|
+
* title and description if available. If the object is expandable, then an `AddButton` is also rendered after all
|
|
4
|
+
* the properties.
|
|
5
|
+
*
|
|
6
|
+
* @param props - The `ObjectFieldTemplateProps` for this component
|
|
7
|
+
*/
|
|
8
|
+
export default function ObjectFieldTemplate<T = unknown, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = object>(props: ObjectFieldTemplateProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type FormContextType, type RJSFSchema, type StrictRJSFSchema, type SubmitButtonProps } from '@rjsf/utils';
|
|
2
|
+
/** The `SubmitButton` renders a button that represent the `Submit` action on a form
|
|
3
|
+
*/
|
|
4
|
+
export default function SubmitButton<T = unknown, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = object>({ uiSchema }: SubmitButtonProps<T, S, F>): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type FormContextType, type TitleFieldProps, type RJSFSchema, type StrictRJSFSchema } from '@rjsf/utils';
|
|
2
|
+
/** The `TitleField` is the template to use to render the title of a field
|
|
3
|
+
*
|
|
4
|
+
* @param props - The `TitleFieldProps` for this component
|
|
5
|
+
*/
|
|
6
|
+
export default function TitleField<T = unknown, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = object>({ id, uiSchema, title }: TitleFieldProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type FormContextType, type RJSFSchema, type StrictRJSFSchema, type WidgetProps } from '@rjsf/utils';
|
|
2
|
+
/** The `CheckBoxWidget` is a widget for rendering boolean properties.
|
|
3
|
+
* It is typically used to represent a boolean.
|
|
4
|
+
*
|
|
5
|
+
* @param props - The `WidgetProps` for this component
|
|
6
|
+
*/
|
|
7
|
+
export default function CheckboxWidget<T = unknown, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = object>(props: WidgetProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type FormContextType, type WidgetProps, type RJSFSchema, type StrictRJSFSchema } from '@rjsf/utils';
|
|
2
|
+
/** The `CheckboxesWidget` is a widget for rendering checkbox groups.
|
|
3
|
+
* It is typically used to represent an array of enums.
|
|
4
|
+
*
|
|
5
|
+
* @param props - The `WidgetProps` for this component
|
|
6
|
+
*/
|
|
7
|
+
export default function CheckboxesWidget<T = unknown, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = object>({ autofocus, disabled, formContext, id, onBlur, onChange, onFocus, options, readonly, value, }: WidgetProps<T, S, F>): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type FormContextType, type RJSFSchema, type StrictRJSFSchema, type WidgetProps } from '@rjsf/utils';
|
|
2
|
+
/** The `RadioWidget` is a widget for rendering a radio group.
|
|
3
|
+
* It is typically used with a string property constrained with enum options.
|
|
4
|
+
*
|
|
5
|
+
* @param props - The `WidgetProps` for this component
|
|
6
|
+
*/
|
|
7
|
+
export default function RadioWidget<T = unknown, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = object>({ autofocus, disabled, formContext, id, onBlur, onChange, onFocus, options, readonly, value, }: WidgetProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type FormContextType, type RJSFSchema, type StrictRJSFSchema, type WidgetProps } from '@rjsf/utils';
|
|
2
|
+
/** The `RangeWidget` component uses the `BaseInputTemplate` changing the type to `range` and wrapping the result
|
|
3
|
+
* in a div, with the value along side it.
|
|
4
|
+
*
|
|
5
|
+
* @param props - The `WidgetProps` for this component
|
|
6
|
+
*/
|
|
7
|
+
export default function RangeWidget<T = unknown, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = object>(props: WidgetProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type FormContextType, type RJSFSchema, type StrictRJSFSchema, type WidgetProps } from '@rjsf/utils';
|
|
2
|
+
/** The `SelectWidget` is a widget for rendering dropdowns.
|
|
3
|
+
* It is typically used with string properties constrained with enum options.
|
|
4
|
+
*
|
|
5
|
+
* @param props - The `WidgetProps` for this component
|
|
6
|
+
*/
|
|
7
|
+
export default function SelectWidget<T = unknown, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = object>({ autofocus, disabled, formContext, id, multiple, onBlur, onChange, onFocus, options, placeholder, readonly, value, }: WidgetProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type FormContextType, type RJSFSchema, type StrictRJSFSchema, type WidgetProps } from '@rjsf/utils';
|
|
2
|
+
/** The `TextareaWidget` is a widget for rendering input fields as textarea.
|
|
3
|
+
*
|
|
4
|
+
* @param props - The `WidgetProps` for this component
|
|
5
|
+
*/
|
|
6
|
+
export default function TextareaWidget<T = unknown, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = object>({ disabled, formContext, id, onBlur, onChange, onFocus, options, placeholder, readonly, value, }: WidgetProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type Form from '@rjsf/core';
|
|
2
|
+
export { default as schemaValidators } from '@rjsf/validator-ajv8';
|
|
3
|
+
export declare const SemiSchemaForm: import("react").ComponentType<import("@rjsf/core").FormProps<any, import("@rjsf/utils").RJSFSchema, any>>;
|
|
4
|
+
export type SemiSchemaFormInstance = Form;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare enum EventNames {
|
|
2
|
+
INIT_LOOP_FORM = "init_loop_form",
|
|
3
|
+
LOOP_FORM_FIELD_VALIDATE_ERROR = "loop_form_field_validate_error",// 表单项报错次数
|
|
4
|
+
LOOP_FORM_SUBMIT_INTERFACE_ERROR = "loop_form_submit_interface_error",// 提交接口报错次数
|
|
5
|
+
LOOP_FORM_SUBMIT_SUCCESS = "loop_form_submit_success",// 提交成功
|
|
6
|
+
LOOP_FORM_FIELD_CHANGE_TIMELINE = "loop_form_field_change_timeline",// 表单项变更时间轴
|
|
7
|
+
LOOP_FORM_CLOSE = "loop_form_close"
|
|
8
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Ref } from 'react';
|
|
2
|
+
import { type BaseFormProps, Form, type FormApi } from '@coze-arch/coze-design';
|
|
3
|
+
export interface SentinelFormProps<T extends Record<string, any>> extends BaseFormProps<any> {
|
|
4
|
+
/**
|
|
5
|
+
* 表单ID,用于快速定位该表单的用户,命名规范:[业务模块]-[业务名称]-[表单名称]
|
|
6
|
+
* 示例:数据引擎-AIDP-表单创建
|
|
7
|
+
*/
|
|
8
|
+
formID: string;
|
|
9
|
+
onSubmit?: (values: T, e?: React.FormEvent<HTMLFormElement>) => void;
|
|
10
|
+
onValueChange?: (values: T, changed: Partial<T>) => void;
|
|
11
|
+
}
|
|
12
|
+
export type SentinelFormRef<T extends Record<string, any>> = Form<T> & {
|
|
13
|
+
submitLog?: (isInterfaceError?: boolean, error?: any) => Promise<void>;
|
|
14
|
+
};
|
|
15
|
+
export type SentinelFormApi<T extends Record<string, any>> = FormApi<T> & {
|
|
16
|
+
submitLog?: (isInterfaceError?: boolean, error?: any) => Promise<void>;
|
|
17
|
+
};
|
|
18
|
+
export declare const SentinelForm: <T extends Record<string, any>>(props: SentinelFormProps<T> & {
|
|
19
|
+
ref?: Ref<SentinelFormRef<T>>;
|
|
20
|
+
}) => JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface StepNavProps {
|
|
2
|
+
currentStep: string;
|
|
3
|
+
stepItems: {
|
|
4
|
+
key: string;
|
|
5
|
+
label: string;
|
|
6
|
+
icon?: React.ReactNode;
|
|
7
|
+
}[];
|
|
8
|
+
onStepChange?: (step: string) => void;
|
|
9
|
+
clickToChange?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function StepNav({ currentStep, stepItems, onStepChange, clickToChange, }: StepNavProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type SVGAttributes } from 'react';
|
|
2
|
+
export declare const IconSortArrow: ({ sortOrder, ...rest }: {
|
|
3
|
+
sortOrder?: "ascend" | "descend" | boolean;
|
|
4
|
+
} & SVGAttributes<HTMLOrSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
/** 表格排序专用图标 */
|
|
6
|
+
export declare const createLoopTableSortIcon: () => ({ sortOrder }: {
|
|
7
|
+
sortOrder?: "ascend" | "descend" | boolean;
|
|
8
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type Params, type PaginationResult } from 'ahooks/lib/usePagination/types';
|
|
2
|
+
import { type TableProps } from '@coze-arch/coze-design';
|
|
3
|
+
/** 获取本地存储的表格分页数量 */
|
|
4
|
+
export declare function getStoragePageSize(pageSizeStorageKey: string | undefined): number | undefined;
|
|
5
|
+
export declare const PAGE_SIZE_OPTIONS: number[];
|
|
6
|
+
export declare const DEFAULT_PAGE_SIZE = 20;
|
|
7
|
+
export type TableWithPaginationProps<RecordItem> = TableProps & {
|
|
8
|
+
heightFull?: boolean;
|
|
9
|
+
service: Pick<PaginationResult<{
|
|
10
|
+
total: number;
|
|
11
|
+
list: RecordItem[];
|
|
12
|
+
}, Params>, 'data' | 'pagination' | 'loading'>;
|
|
13
|
+
pageSizeOpts?: number[];
|
|
14
|
+
header?: React.ReactNode;
|
|
15
|
+
/** 该参数将插入到分页器左侧,共同作为 footer 的一部分 */
|
|
16
|
+
footerWithPagination?: React.ReactNode;
|
|
17
|
+
pageSizeStorageKey?: string;
|
|
18
|
+
showSizeChanger?: boolean;
|
|
19
|
+
footerClassName?: string;
|
|
20
|
+
};
|
|
21
|
+
export declare function TableWithPagination<RecordItem>(props: TableWithPaginationProps<RecordItem>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type TableProps } from '@coze-arch/coze-design';
|
|
2
|
+
export type TableWithoutPaginationProps = TableProps & {
|
|
3
|
+
heightFull?: boolean;
|
|
4
|
+
header?: React.ReactNode;
|
|
5
|
+
};
|
|
6
|
+
export declare function TableWithoutPagination(props: TableWithoutPaginationProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type BatchOperateStore } from './use-batch-operate';
|
|
2
|
+
export interface BatchOperateProps<RecordItem> {
|
|
3
|
+
/** 批量操作接口 */
|
|
4
|
+
batchOperateStore: BatchOperateStore<RecordItem>;
|
|
5
|
+
/** 自定义批量操作按钮 */
|
|
6
|
+
actions?: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
/** 表格批量操作 */
|
|
9
|
+
export declare function TableBatchOperate<RecordItem>({ actions, batchOperateStore, }: BatchOperateProps<RecordItem>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type RowSelection } from '@coze-arch/coze-design';
|
|
2
|
+
/** 批量操作接口 */
|
|
3
|
+
export interface BatchOperateStore<RecordItem> {
|
|
4
|
+
/** 表格行选择器 */
|
|
5
|
+
rowSelection: RowSelection<RecordItem>;
|
|
6
|
+
/** 已选择的表格行记录数据 */
|
|
7
|
+
selectedItems: RecordItem[];
|
|
8
|
+
/** 设置已选择的表格行记录数据 */
|
|
9
|
+
setSelectedItems: (items: RecordItem[]) => void;
|
|
10
|
+
/** 批量操作状态 */
|
|
11
|
+
enableBatchOperate: boolean;
|
|
12
|
+
/** 设置批量操作状态 */
|
|
13
|
+
setEnableBatchOperate: (enable: boolean) => void;
|
|
14
|
+
/** 取消批量操作 */
|
|
15
|
+
onCancelBatchOperate: () => void;
|
|
16
|
+
}
|
|
17
|
+
/** 批量操作配置 */
|
|
18
|
+
export interface BatchOperateOptions<RecordItem> {
|
|
19
|
+
/** 表格行记录数据的唯一ID字段,默认 `id` */
|
|
20
|
+
recordKey?: keyof RecordItem;
|
|
21
|
+
/** 最大可选数量,默认不限制 */
|
|
22
|
+
maxSelectionCount?: number;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* 表格批量操作状态管理。
|
|
26
|
+
* 支持跨分页选择数据。
|
|
27
|
+
* @param recordKey 表格行记录数据的唯一ID字段,默认 `id`
|
|
28
|
+
* @returns 批量操作接口
|
|
29
|
+
*/
|
|
30
|
+
export declare function useBatchOperate<RecordItem>({ recordKey, maxSelectionCount, }?: BatchOperateOptions<RecordItem>): BatchOperateStore<RecordItem>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type SpaceProps, type TypographyProps } from '@coze-arch/coze-design';
|
|
3
|
+
export interface TableColAction {
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
icon?: ReactNode;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
hide?: boolean;
|
|
8
|
+
type?: TypographyProps['type'];
|
|
9
|
+
disabledTooltip?: string;
|
|
10
|
+
onClick?: () => void;
|
|
11
|
+
tooltip?: string;
|
|
12
|
+
}
|
|
13
|
+
interface Props {
|
|
14
|
+
actions: TableColAction[];
|
|
15
|
+
maxCount?: number;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
spaceProps?: SpaceProps;
|
|
18
|
+
wrapperClassName?: string;
|
|
19
|
+
textClassName?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare function TableColActions({ actions, maxCount, disabled, spaceProps, wrapperClassName, textClassName, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ColumnPropsPro, type ColKey } from './type';
|
|
2
|
+
export { type ColumnPropsPro, type ColKey };
|
|
3
|
+
export interface TableColsConfigProps<T extends Record<string, any> = any> {
|
|
4
|
+
className?: string;
|
|
5
|
+
defaultHiddenColKeys?: ColKey[];
|
|
6
|
+
localStorageKey?: string;
|
|
7
|
+
columns?: ColumnPropsPro<T>[];
|
|
8
|
+
onChangeConfig?: (newColumns: ColumnPropsPro<T>[]) => void;
|
|
9
|
+
onClose?: () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function TableColsConfig<T extends Record<string, any> = any>({ className, localStorageKey, defaultHiddenColKeys, columns, onChangeConfig, onClose, }: TableColsConfigProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type ColKey } from './type';
|
|
2
|
+
export declare function useHiddenColKeys({ localStorageKey, defaultHiddenColKeys, }: {
|
|
3
|
+
localStorageKey?: string;
|
|
4
|
+
defaultHiddenColKeys?: ColKey[];
|
|
5
|
+
}): readonly [ColKey[], import("react").Dispatch<import("react").SetStateAction<ColKey[]>>];
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type ColumnPropsPro, type ColKey } from './type';
|
|
2
|
+
export declare function generateColumnsWithKey<T extends Record<string, any> = any>(cols?: ColumnPropsPro<T>[], hiddenColKeys?: ColKey[]): ColumnPropsPro<T>[] | undefined;
|
|
3
|
+
export declare function generateConfigColumns<T extends Record<string, any> = any>(cols?: ColumnPropsPro<T>[], hiddenColKeys?: ColKey[]): ColumnPropsPro<T>[] | undefined;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ButtonProps } from '@coze-arch/coze-design';
|
|
2
|
+
import { type ColumnSelectorProps } from '../columns-select';
|
|
3
|
+
import { type TableColsConfigProps } from '../table-cols-config';
|
|
4
|
+
export interface TableHeaderProps {
|
|
5
|
+
columnSelectorConfigProps?: ColumnSelectorProps;
|
|
6
|
+
tableColsConfigProps?: TableColsConfigProps;
|
|
7
|
+
filterForm?: React.ReactNode;
|
|
8
|
+
actions?: React.ReactNode;
|
|
9
|
+
className?: string;
|
|
10
|
+
style?: React.CSSProperties;
|
|
11
|
+
spaceProps?: Record<string, unknown>;
|
|
12
|
+
refreshButtonPros?: ButtonProps;
|
|
13
|
+
}
|
|
14
|
+
export declare function TableHeader({ columnSelectorConfigProps, tableColsConfigProps, filterForm, actions, className, style, spaceProps, refreshButtonPros, }: TableHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type TextAreaProps } from '@coze-arch/coze-design';
|
|
3
|
+
export interface Props extends TextAreaProps {
|
|
4
|
+
bottomExtra?: React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export declare function TextAreaPro({ bottomExtra, ...props }: Props): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type CSSProperties } from 'react';
|
|
2
|
+
interface TextWithCopyProps {
|
|
3
|
+
content?: string;
|
|
4
|
+
displayText?: string;
|
|
5
|
+
copyTooltipText?: string;
|
|
6
|
+
maxWidth?: number | string;
|
|
7
|
+
className?: string;
|
|
8
|
+
style?: CSSProperties;
|
|
9
|
+
textClassName?: string;
|
|
10
|
+
textType?: 'success' | 'secondary' | 'primary' | 'danger' | 'warning' | 'tertiary' | 'quaternary';
|
|
11
|
+
onlyIconCopy?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function TextWithCopy({ displayText, copyTooltipText, content, className, maxWidth, style, textClassName, textType, onlyIconCopy, }: TextWithCopyProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type TooltipProps } from '@coze-arch/coze-design';
|
|
2
|
+
export interface TooltipWhenDisabledProps extends TooltipProps {
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
needWrap?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function TooltipWhenDisabled({ children, disabled, needWrap, ...rest }: TooltipWhenDisabledProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type TooltipProps } from '@coze-arch/coze-design';
|
|
2
|
+
export interface TooltipWithDisabledProps extends TooltipProps {
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare function TooltipWithDisabled({ children, disabled, ...rest }: TooltipWithDisabledProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type customRequestArgs } from '@coze-arch/coze-design';
|
|
2
|
+
export declare function uploadFile({ file, fileType, onProgress, onSuccess, onError, spaceID, }: {
|
|
3
|
+
file: File;
|
|
4
|
+
fileType?: 'image' | 'object';
|
|
5
|
+
onProgress?: customRequestArgs['onProgress'];
|
|
6
|
+
onSuccess?: customRequestArgs['onSuccess'];
|
|
7
|
+
onError?: customRequestArgs['onError'];
|
|
8
|
+
spaceID: string;
|
|
9
|
+
}): Promise<string>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface UserInfoProps {
|
|
2
|
+
avatarUrl?: string;
|
|
3
|
+
name?: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
avatarClassName?: string;
|
|
6
|
+
userNameClassName?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const UserProfile: ({ avatarUrl, name, className, avatarClassName, userNameClassName, }: UserInfoProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type UserInfo } from '@cozeloop/api-schema/evaluation';
|
|
2
|
+
export type Integer64 = string;
|
|
3
|
+
export interface Version {
|
|
4
|
+
id: Integer64;
|
|
5
|
+
version?: string;
|
|
6
|
+
submitTime?: Integer64;
|
|
7
|
+
submitter?: UserInfo;
|
|
8
|
+
description?: string;
|
|
9
|
+
isDraft?: boolean;
|
|
10
|
+
draftSubmitText?: string;
|
|
11
|
+
}
|
|
12
|
+
export default function VersionDescriptions({ version, className, }: {
|
|
13
|
+
version: Version | undefined;
|
|
14
|
+
className?: string;
|
|
15
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type Version } from './version-descriptions';
|
|
2
|
+
interface Props {
|
|
3
|
+
version: Version | undefined;
|
|
4
|
+
active?: boolean;
|
|
5
|
+
className?: string;
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
}
|
|
8
|
+
export default function VersionItem({ version, active, className, onClick, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Integer64, type Version } from './version-descriptions';
|
|
2
|
+
export interface VersionListProps {
|
|
3
|
+
versions: Version[] | undefined;
|
|
4
|
+
activeVersionId?: Integer64;
|
|
5
|
+
loadMoreLoading?: boolean;
|
|
6
|
+
enableLoadMore?: boolean;
|
|
7
|
+
noMore?: boolean;
|
|
8
|
+
onActiveChange?: (versionId: Integer64, version: Version) => void;
|
|
9
|
+
onLoadMore?: () => void;
|
|
10
|
+
}
|
|
11
|
+
export default function VersionList({ versions, loadMoreLoading, enableLoadMore, noMore, activeVersionId, onActiveChange, onLoadMore, }: VersionListProps): import("react/jsx-runtime").JSX.Element;
|
package/package.json
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@cozeloop/components",
|
|
3
|
+
"version": "0.0.0-beta-1766561124625",
|
|
4
|
+
"description": "common components for cozeloop",
|
|
5
|
+
"author": "houtao.zzj@bytedance.com",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": "./src/index.ts",
|
|
8
|
+
"./loop-icons": "./src/loop-icons/index.ts"
|
|
9
|
+
},
|
|
10
|
+
"main": "dist/es/index.js",
|
|
11
|
+
"typesVersions": {
|
|
12
|
+
"*": {
|
|
13
|
+
"loop-icons": [
|
|
14
|
+
"./src/loop-icons/index.ts"
|
|
15
|
+
]
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "exit 0",
|
|
20
|
+
"build:sdk": "npm run clean && rslib build && npx tsc -b tsconfig.build.json",
|
|
21
|
+
"clean": "rm -rf ./dist && rm -rf ./.rslib",
|
|
22
|
+
"lint": "eslint ./ --cache",
|
|
23
|
+
"test": "exit 0",
|
|
24
|
+
"test:cov": "exit 0"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@arco-iconbox/react-cozeloop-icons": "0.0.3",
|
|
28
|
+
"@codemirror/commands": "^6.3.3",
|
|
29
|
+
"@codemirror/lang-go": "^6.0.1",
|
|
30
|
+
"@codemirror/state": "^6.4.1",
|
|
31
|
+
"@codemirror/view": "^6.34.1",
|
|
32
|
+
"@coze-arch/coze-design": "0.0.7-alpha.985c0d",
|
|
33
|
+
"@coze-editor/editor": "0.1.0-alpha.577152",
|
|
34
|
+
"@cozeloop/api-schema": "^0.1.5",
|
|
35
|
+
"@cozeloop/hooks": "^0.0.1",
|
|
36
|
+
"@cozeloop/i18n": "latest",
|
|
37
|
+
"@cozeloop/toolkit": "^0.0.4",
|
|
38
|
+
"@monaco-editor/react": "^4.5.2",
|
|
39
|
+
"@rjsf/core": "~5.24.9",
|
|
40
|
+
"@rjsf/utils": "~5.24.9",
|
|
41
|
+
"@rjsf/validator-ajv8": "~5.24.9",
|
|
42
|
+
"ahooks": "^3.7.8",
|
|
43
|
+
"classnames": "^2.3.2",
|
|
44
|
+
"copy-to-clipboard": "^3.3.3",
|
|
45
|
+
"dayjs": "^1.11.7",
|
|
46
|
+
"immer": "^10.0.3",
|
|
47
|
+
"lodash-es": "^4.17.21",
|
|
48
|
+
"monaco-editor": "^0.45.0",
|
|
49
|
+
"nanoid": "^4.0.2",
|
|
50
|
+
"react": "~18.2.0",
|
|
51
|
+
"react-sortable-hoc": "2.0.0",
|
|
52
|
+
"sortablejs": "~1.15.2"
|
|
53
|
+
},
|
|
54
|
+
"peerDependencies": {},
|
|
55
|
+
"publishRegistries": [
|
|
56
|
+
"npm"
|
|
57
|
+
],
|
|
58
|
+
"module": "dist/es/index.js",
|
|
59
|
+
"types": "dist/lib/index.d.ts",
|
|
60
|
+
"files": [
|
|
61
|
+
"dist",
|
|
62
|
+
"README.md"
|
|
63
|
+
]
|
|
64
|
+
}
|