@flatbiz/antd 3.2.18 → 3.2.19

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/index.d.ts CHANGED
@@ -3,7 +3,8 @@
3
3
 
4
4
  import { API, ModelType } from '@dimjs/model';
5
5
  import { DateFormatType, TAny, TNoopDefine, TPlainObject } from '@flatbiz/utils';
6
- import { ButtonProps, CascaderProps, DrawerProps, DropdownProps, FormInstance, FormItemProps, InputNumberProps, InputProps, ModalProps, PopconfirmProps, RadioGroupProps, RowProps, SelectProps, SpaceProps, SwitchProps, TableProps, TabsProps, TimePickerProps, TimeRangePickerProps, TooltipProps, TreeProps, TreeSelectProps, UploadProps } from 'antd';
6
+ import { IAllProps } from '@tinymce/tinymce-react';
7
+ import { ButtonProps, CascaderProps, DrawerProps, DropdownProps, FormInstance, FormItemProps, InputNumberProps, InputProps, ModalProps, PaginationProps, PopconfirmProps, RadioGroupProps, RowProps, SelectProps, SpaceProps, SwitchProps, TableProps, TabsProps, TimePickerProps, TimeRangePickerProps, TooltipProps, TreeProps, TreeSelectProps, UploadProps } from 'antd';
7
8
  import { CheckboxGroupProps } from 'antd/lib/checkbox';
8
9
  import { ConfigProviderProps } from 'antd/lib/config-provider';
9
10
  import { PickerDateProps, RangePickerDateProps } from 'antd/lib/date-picker/generatePicker';
@@ -13,6 +14,7 @@ import { ColumnsType } from 'antd/lib/table';
13
14
  import { UploadChangeParam } from 'antd/lib/upload';
14
15
  import { UploadFile } from 'antd/lib/upload/interface';
15
16
  import { CSSProperties, DependencyList, Dispatch, EffectCallback, FC, ReactElement, ReactNode, SetStateAction } from 'react';
17
+ import { Editor as TinyMCEEditor } from 'tinymce';
16
18
 
17
19
  export declare const styles: () => void;
18
20
  export type ButtonWrapperProps = Omit<ButtonProps, "onClick" | "loading" | "hidden" | "color"> & {
@@ -573,6 +575,7 @@ export type EasyTableServiceConfig = {
573
575
  };
574
576
  export type EasyTableProps = {
575
577
  children: ReactElement | ReactElement[];
578
+ /** EasyTable唯一值,可用于缓存查询条件 */
576
579
  modelKey: string;
577
580
  /** 接口数据配置 */
578
581
  serviceConfig: EasyTableServiceConfig;
@@ -603,18 +606,73 @@ export type EasyTableProps = {
603
606
  onDataSourceChange?: (dataSource: TAny) => void;
604
607
  /** 如果自定义查询按钮,可设置 Form onFinish */
605
608
  onFormFinish?: (values?: TPlainObject) => void;
609
+ /** 在父节点高度下,上下铺满;默认值:true */
610
+ isFull?: boolean;
611
+ /** 查询条件固定,不随滚动条滚动 */
612
+ filterFixed?: boolean;
613
+ /** 分页区域固定,不随滚动条滚动 */
614
+ paginationFixed?: boolean;
615
+ /**
616
+ * 1. 配合paginationFixed=true一起使用有效果
617
+ * 2. 当使用Table内的pagination时,在EasyTable.Table中配置分页属性
618
+ */
619
+ pagination?: PaginationProps;
620
+ /**
621
+ * 查询条件展开、收起,被收起key数组;数组内容为EasyTable.Filter 子节点key值
622
+ */
623
+ foldKeys?: string[];
606
624
  };
607
625
  /**
608
626
  * 对 查询条件+表格数据 进行深度封装,内置数据交互处理
609
627
  * ```
610
- * 1. 需要获取查询条件、主动发起请求等可通过ref操作
628
+ * 1. 需要获取查询条件、主动发起请求等可通过ref、useEasyTable操作
611
629
  * 2. 可通过属性 initRequest 设置初始化是否请求数据
612
630
  * 3. 可通过属性 fieldNames 来设置自定义变量,默认值为:list、total、pageNo、pageSize
631
+ * 4. isFull=true,设置【在父节点高度下,上下铺满】(默认值:true)
632
+ * 5. filterFixed=true,设置查询条件固定,不随滚动条滚动
633
+ * 6. paginationFixed=true,可设置分页条件在底部固定,不随滚动条滚动
634
+ * 7. foldKeys=string[],查询条件展开、收起,被收起数组内容为EasyTable.Filter 子节点key值
635
+ * 8. windows环境下,会在EasyTable.Table外部包装一下 TableScrollbar,提示高windows下table左右滚动体验
613
636
  *
614
637
  * Demo https://fex.qa.tcshuke.com/docs/admin/main/crud/easy-table
615
638
  * ```
616
639
  */
617
640
  export declare const EasyTable: import("react").ForwardRefExoticComponent<EasyTableProps & import("react").RefAttributes<EasyTableRefApi>>;
641
+ export type FormColProps = {
642
+ span?: number;
643
+ /** 屏幕 < 576px */
644
+ xs?: number;
645
+ /** 屏幕 ≥ 576px */
646
+ sm?: number;
647
+ /** 屏幕 ≥ 768px */
648
+ md?: number;
649
+ /** 屏幕 ≥ 992px */
650
+ lg?: number;
651
+ /** 屏幕 ≥ 1200px */
652
+ xl?: number;
653
+ /** 屏幕 ≥ 1600px */
654
+ xxl?: number;
655
+ /** 强制单独一行 */
656
+ forceAloneRow?: boolean;
657
+ children?: ReactNode | ReactNode[];
658
+ };
659
+ /**
660
+ * 网格响应式布局,默认值:{ xs: 24, sm: 12, md: 12, lg: 8, xl: 8, xxl: 6 }
661
+ *```
662
+ * 1. 设置 span 栅格占位格数,不考虑响应式
663
+ * 2. grid 自定义响应式网格布局
664
+ * xs: 屏幕 < 576px
665
+ * sm: 屏幕 ≥ 576px
666
+ * md: 屏幕 ≥ 768px
667
+ * lg: 屏幕 ≥ 992px
668
+ * xl: 屏幕 ≥ 1200px
669
+ * xxl: 屏幕 ≥ 1600px
670
+ * ```
671
+ */
672
+ export declare const FormCol: {
673
+ (props: FormColProps): JSX.Element;
674
+ domTypeName: string;
675
+ };
618
676
  export type FormOperateColProps = {
619
677
  className?: string;
620
678
  leftList?: Array<ReactElement | null>;
@@ -636,6 +694,17 @@ export declare const FormOperateCol: {
636
694
  (props: FormOperateColProps): JSX.Element;
637
695
  domTypeName: string;
638
696
  };
697
+ export type FormRowProps = RowProps & {
698
+ children?: ReactNode | ReactNode[];
699
+ };
700
+ /**
701
+ * FormItem网格响应式布局
702
+ *```
703
+ * 1. 应用场景:Form条件布局
704
+ * 2. 子元素只能是 FormCol、FormOperateCol,其他会被忽略
705
+ * 3. 所有子元素中只能存在一个 FormOperateCol
706
+ */
707
+ export declare const FormRow: (props: FormRowProps) => JSX.Element;
639
708
  export type EasyTableFilterProps = {
640
709
  children: ReactElement | ReactElement[] | ((form: FormInstance) => ReactElement);
641
710
  /** isPure = true时无效 */
@@ -679,8 +748,19 @@ export type EasyTableFilterProps = {
679
748
  *```
680
749
  */
681
750
  export declare const EasyTableFilter: (props: EasyTableFilterProps) => JSX.Element;
751
+ /**
752
+ * 在 EasyTable子组件内才可使用
753
+ * @returns
754
+ */
755
+ export declare const useEasyTable: () => EasyTableRefApi;
756
+ /**
757
+ *
758
+ * @deprecated 已过去,请使用 useEasyTable
759
+ * @returns
760
+ */
761
+ export declare const useEasyTablRef: () => import("react").MutableRefObject<EasyTableRefApi>;
682
762
  export type EasyTableTableProps = Omit<TableProps<TAny>, "dataSource" | "loading" | "rowKey"> & {
683
- children?: ReactElement;
763
+ children?: ReactElement | ReactElement[];
684
764
  /** 表格行 key 的取值 */
685
765
  rowKey: string;
686
766
  };
@@ -692,7 +772,6 @@ export type EasyTableTableProps = Omit<TableProps<TAny>, "dataSource" | "loading
692
772
  * ```
693
773
  */
694
774
  export declare const EasyTableTable: (props: EasyTableTableProps) => JSX.Element;
695
- export declare const useEasyTablRef: () => import("react").MutableRefObject<EasyTableRefApi>;
696
775
  export interface EditableFieldProps {
697
776
  className?: string;
698
777
  editRender: ReactElement | ((data: {
@@ -1057,21 +1136,34 @@ export type EditableTableProps = {
1057
1136
  rules?: FormListProps["rules"];
1058
1137
  };
1059
1138
  export declare const EditableTable: (props: EditableTableProps) => JSX.Element;
1060
- export type varStyles = "--fa-color-primary" | "--fa-color-secondary" | "--fa-color-warning" | "--fa-color-danger" | "--fa-color-success" | "--editor-card-bgcolor";
1061
1139
  export type EditorWrapperProps = {
1062
- onChange: (data?: string) => void;
1140
+ onChange?: (data?: string) => void;
1063
1141
  value?: string;
1064
1142
  editorInitParams?: TPlainObject;
1065
- editorProps?: TPlainObject;
1066
- varStyle?: Record<varStyles, CSSProperties["color"]>;
1143
+ editorProps?: {
1144
+ disabled?: boolean;
1145
+ onKeyDown?: (event: any) => void;
1146
+ };
1067
1147
  height?: number | string;
1148
+ /** 上传图片服务 */
1149
+ onUploadImage?: (file: File) => Promise<string>;
1150
+ className?: string;
1068
1151
  };
1069
1152
  /**
1070
1153
  * 富文本编辑器,配置参考tinymce
1154
+ * @deprecated 已过时,请使用 RichTextEditor 组件
1071
1155
  * @param props
1072
1156
  * @returns
1157
+ * ```
1158
+ * 1. 如果需要粘贴上传图片服务,需要提供 onUploadImage 上传图片接口
1159
+ * 2. 如果不需要粘贴上传图片,可配置 editorInitParams.paste_data_images = false
1160
+ * 3. 获取富文本实例,通过editorInitParams.setup(editor)函数获取
1161
+ * 4. 可在 editorInitParams 中自定义 plugins、toolbar
1162
+ * 5. 预览富文本数据,使用 EditorViewer 组件
1163
+ *
1164
+ * ```
1073
1165
  */
1074
- export declare const EditorWrapper: (props: any) => JSX.Element;
1166
+ export declare const EditorWrapper: (props: EditorWrapperProps) => JSX.Element;
1075
1167
  export type FileImportProps = {
1076
1168
  onImportFinish: (data?: any) => void;
1077
1169
  buttonName?: string | ReactElement;
@@ -1156,52 +1248,6 @@ export type FlexLayoutProps = {
1156
1248
  * @returns
1157
1249
  */
1158
1250
  export declare const FlexLayout: (props: FlexLayoutProps) => JSX.Element;
1159
- export type FormColProps = {
1160
- span?: number;
1161
- /** 屏幕 < 576px */
1162
- xs?: number;
1163
- /** 屏幕 ≥ 576px */
1164
- sm?: number;
1165
- /** 屏幕 ≥ 768px */
1166
- md?: number;
1167
- /** 屏幕 ≥ 992px */
1168
- lg?: number;
1169
- /** 屏幕 ≥ 1200px */
1170
- xl?: number;
1171
- /** 屏幕 ≥ 1600px */
1172
- xxl?: number;
1173
- /** 强制单独一行 */
1174
- forceAloneRow?: boolean;
1175
- children?: ReactNode | ReactNode[];
1176
- };
1177
- /**
1178
- * 网格响应式布局,默认值:{ xs: 24, sm: 12, md: 12, lg: 8, xl: 8, xxl: 6 }
1179
- *```
1180
- * 1. 设置 span 栅格占位格数,不考虑响应式
1181
- * 2. grid 自定义响应式网格布局
1182
- * xs: 屏幕 < 576px
1183
- * sm: 屏幕 ≥ 576px
1184
- * md: 屏幕 ≥ 768px
1185
- * lg: 屏幕 ≥ 992px
1186
- * xl: 屏幕 ≥ 1200px
1187
- * xxl: 屏幕 ≥ 1600px
1188
- * ```
1189
- */
1190
- export declare const FormCol: {
1191
- (props: FormColProps): JSX.Element;
1192
- domTypeName: string;
1193
- };
1194
- export type FormRowProps = RowProps & {
1195
- children?: ReactNode | ReactNode[];
1196
- };
1197
- /**
1198
- * FormItem网格响应式布局
1199
- *```
1200
- * 1. 应用场景:Form条件布局
1201
- * 2. 子元素只能是 FormCol、FormOperateCol,其他会被忽略
1202
- * 3. 所有子元素中只能存在一个 FormOperateCol
1203
- */
1204
- export declare const FormRow: (props: FormRowProps) => JSX.Element;
1205
1251
  export type FormItemHorizontalUnionProps = {
1206
1252
  className?: string;
1207
1253
  style?: CSSProperties;
@@ -1653,6 +1699,43 @@ export type TRelationTreeOperate = {
1653
1699
  onChange: (name: string, value: any) => void;
1654
1700
  };
1655
1701
  export declare const RelationTree: (props: RelationTreeProps) => JSX.Element;
1702
+ export interface RichTextEditorProps extends Omit<IAllProps, "onChange"> {
1703
+ onChange?: (data?: string) => void;
1704
+ /** 上传图片服务 */
1705
+ onUploadImage?: (file: File) => Promise<string>;
1706
+ className?: string;
1707
+ /** 图片点击预览 */
1708
+ imgPreview?: boolean;
1709
+ }
1710
+ /**
1711
+ * 富文本编辑器,配置参考tinymce
1712
+ * @param props
1713
+ * @returns
1714
+ * ```
1715
+ * 1. 如果需要粘贴上传图片服务,需要提供 onUploadImage 上传图片接口
1716
+ * 2. 如果不需要粘贴上传图片,可配置 editorInitParams.paste_data_images = false
1717
+ * 3. 获取富文本实例,通过editorInitParams.setup(editor)函数获取
1718
+ * 4. 可在 editorInitParams 中自定义 plugins、toolbar
1719
+ * 5. 预览富文本数据,使用 EditorViewer 组件
1720
+ *
1721
+ * ```
1722
+ */
1723
+ export declare const RichTextEditor: (props: RichTextEditorProps) => JSX.Element;
1724
+ export type RichTextViewerProps = {
1725
+ data: string;
1726
+ className?: string;
1727
+ fullscreen?: boolean;
1728
+ onInit?: (editor: TinyMCEEditor) => void;
1729
+ children?: ReactElement;
1730
+ style?: CSSProperties;
1731
+ fullscreenIconTips?: string;
1732
+ };
1733
+ /**
1734
+ * 预览 RichTextEditor 生成的富文本数据
1735
+ * @param props
1736
+ * @returns
1737
+ */
1738
+ export declare const RichTextViewer: (props: RichTextViewerProps) => JSX.Element;
1656
1739
  export type RuleDataItem = {
1657
1740
  title?: string | ReactElement;
1658
1741
  desc?: string | ReactElement;
@@ -1926,6 +2009,25 @@ export type TableTitleTooltipProps = {
1926
2009
  style?: CSSProperties;
1927
2010
  };
1928
2011
  export declare const TableTitleTooltip: (props: TableTitleTooltipProps) => JSX.Element;
2012
+ export type TableScrollProps = {
2013
+ children: React.ReactNode;
2014
+ /**
2015
+ * y轴的滚动条
2016
+ */
2017
+ target?: HTMLElement;
2018
+ };
2019
+ /**
2020
+ * 表格x轴浮动滚动条
2021
+ * ```
2022
+ * 使用方法
2023
+ * <TableScrollbar>
2024
+ * <Table/>
2025
+ * </TableScrollbar>
2026
+ * ```
2027
+ */
2028
+ export declare const TableScrollbar: ({ children, target, ...props }: TableScrollProps) => import("react").FunctionComponentElement<{
2029
+ summary: (...args: any[]) => JSX.Element;
2030
+ }>;
1929
2031
  export type TabsWrapperProps = TabsProps & {
1930
2032
  /** Tabs Header 提供 Sticky 效果,默认值:true */
1931
2033
  isSticky?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flatbiz/antd",
3
- "version": "3.2.18",
3
+ "version": "3.2.19",
4
4
  "description": "flat-biz oss ui components",
5
5
  "main": "index.js",
6
6
  "typings": "index.d.ts",
@@ -25,18 +25,22 @@
25
25
  "engines": {
26
26
  "node": ">=13.8.0"
27
27
  },
28
+ "dependencies": {
29
+ "@tinymce/tinymce-react": "^4.3.0"
30
+ },
28
31
  "peerDependencies": {
29
32
  "@ant-design/icons": ">=4.7.0",
30
33
  "@dimjs/lang": ">=1.2.23",
31
34
  "@dimjs/model": ">=1.1.8",
32
35
  "@dimjs/model-react": ">=1.1.8",
33
36
  "@dimjs/utils": ">=1.2.23",
34
- "@flatbiz/utils": ">=3.0.15",
35
- "@wove/react": ">=1.2.22",
37
+ "@flatbiz/utils": ">=4.0.6",
38
+ "@wove/react": ">=1.2.23",
36
39
  "antd": ">=4.22.2 < 5.0.0",
37
40
  "moment": ">=2.29.4",
38
41
  "react": ">=18.2.0",
39
- "react-dom": ">=18.2.0"
42
+ "react-dom": ">=18.2.0",
43
+ "ahooks": "^3.7.5"
40
44
  },
41
45
  "devDependencies": {
42
46
  "@ant-design/icons": "^4.7.0",
@@ -44,13 +48,14 @@
44
48
  "@dimjs/model": "^1.1.8",
45
49
  "@dimjs/model-react": "^1.1.8",
46
50
  "@dimjs/utils": "^1.2.23",
47
- "@flatbiz/utils": "^4.0.4",
48
- "@wove/react": "^1.2.21",
51
+ "@flatbiz/utils": "^4.0.6",
52
+ "@wove/react": "^1.2.23",
49
53
  "antd": "4.24.5",
50
54
  "dequal": "^2.0.3",
51
55
  "moment": "^2.29.4",
52
56
  "react": "18.2.0",
53
- "react-dom": "18.2.0"
57
+ "react-dom": "18.2.0",
58
+ "ahooks": "^3.7.5"
54
59
  },
55
60
  "gitHead": "4378d433b73ee28fd7cb4c64bed8571f993eb5a9"
56
61
  }