@spacego/fe-components 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/README.md +37 -37
  2. package/lib/fe-layouts/basics-layout/components/utils/index.js +8 -8
  3. package/lib/router/utils.js +31 -30
  4. package/lib/types/fe-auto-complete/auto-complete.d.ts +3 -1
  5. package/lib/types/fe-button/button.d.ts +15 -13
  6. package/lib/types/fe-cascader/cascader.d.ts +8 -6
  7. package/lib/types/fe-checkbox/checkbox.d.ts +6 -4
  8. package/lib/types/fe-checkbox-group/checkbox-group.d.ts +6 -4
  9. package/lib/types/fe-date-picker/date-picker.d.ts +4 -2
  10. package/lib/types/fe-description-render/description-render.d.ts +32 -30
  11. package/lib/types/fe-descriptions/descriptions.d.ts +3 -1
  12. package/lib/types/fe-empty/empty.d.ts +3 -1
  13. package/lib/types/fe-error-block/error-block.d.ts +7 -5
  14. package/lib/types/fe-form/fe-form/form.d.ts +338 -336
  15. package/lib/types/fe-form/fe-form-item/form-item.d.ts +66 -64
  16. package/lib/types/fe-form/fe-form-label/form-label.d.ts +44 -42
  17. package/lib/types/fe-input/input.d.ts +12 -10
  18. package/lib/types/fe-input-number/input-number.d.ts +3 -1
  19. package/lib/types/fe-layouts/basics-layout/components/utils/index.d.ts +7 -6
  20. package/lib/types/fe-layouts/context/global-context.d.ts +240 -238
  21. package/lib/types/fe-link/link.d.ts +6 -4
  22. package/lib/types/fe-map/map.d.ts +73 -73
  23. package/lib/types/fe-modal/modal.d.ts +20 -18
  24. package/lib/types/fe-pagination/pagination.d.ts +3 -1
  25. package/lib/types/fe-panel/panel-toolbar.d.ts +5 -3
  26. package/lib/types/fe-panel/panel.d.ts +60 -58
  27. package/lib/types/fe-permission/permission.d.ts +11 -9
  28. package/lib/types/fe-permission-provider/permission-provider.d.ts +8 -6
  29. package/lib/types/fe-radio/radio.d.ts +3 -1
  30. package/lib/types/fe-radio-group/radio-group.d.ts +3 -1
  31. package/lib/types/fe-rich-text/rich-text.d.ts +167 -165
  32. package/lib/types/fe-select/select.d.ts +9 -7
  33. package/lib/types/fe-switch/switch.d.ts +3 -1
  34. package/lib/types/fe-table/fe-table-link/table-link.d.ts +10 -8
  35. package/lib/types/fe-table/fe-table-render/table-render.d.ts +12 -10
  36. package/lib/types/fe-table/fe-table-toolbar/table-toolbar.d.ts +16 -14
  37. package/lib/types/fe-table/type/table-context.d.ts +60 -60
  38. package/lib/types/fe-table/type/table.d.ts +789 -787
  39. package/lib/types/fe-text-area/text-area.d.ts +5 -3
  40. package/lib/types/fe-time-picker/time-picker.d.ts +4 -2
  41. package/lib/types/fe-upload/upload.d.ts +83 -81
  42. package/lib/types/fe-upload-atomic/upload-atomic.d.ts +3 -1
  43. package/lib/types/hooks/use-descriptions.hook/use-descriptions.d.ts +151 -149
  44. package/lib/types/hooks/use-form.hook/use-form.d.ts +13 -11
  45. package/lib/types/hooks/use-permission.hook/use-permission.d.ts +10 -10
  46. package/lib/types/router/utils.d.ts +2 -1
  47. package/lib/types/typings/index.d.ts +98 -98
  48. package/lib/types/typings/shims-axios.d.ts +38 -38
  49. package/package.json +3 -3
@@ -1,20 +1,22 @@
1
1
  import { ModalProps } from 'antd';
2
2
  import { default as React } from 'react';
3
- export interface FeModalProps extends ModalProps {
4
- /**
5
- * @name 是否可见
6
- */
7
- isVisible: boolean;
8
- /**
9
- * @name 内容区域样式
10
- */
11
- bodyStyle?: React.CSSProperties;
12
- /**
13
- * @name 设置是否可见
14
- */
15
- setIsVisible: (isVisible: boolean) => void;
16
- /**
17
- * @name 关闭回调
18
- */
19
- onClose?: (e: React.MouseEvent<Element, MouseEvent> | React.KeyboardEvent<Element>) => void;
20
- }
3
+
4
+
5
+ export interface FeModalProps extends ModalProps {
6
+ /**
7
+ * @name 是否可见
8
+ */
9
+ isVisible: boolean;
10
+ /**
11
+ * @name 内容区域样式
12
+ */
13
+ bodyStyle?: React.CSSProperties;
14
+ /**
15
+ * @name 设置是否可见
16
+ */
17
+ setIsVisible: (isVisible: boolean) => void;
18
+ /**
19
+ * @name 关闭回调
20
+ */
21
+ onClose?: (e: React.MouseEvent<Element, MouseEvent> | React.KeyboardEvent<Element>) => void;
22
+ }
@@ -1,2 +1,4 @@
1
1
  import { PaginationProps } from 'antd';
2
- export interface FePaginationProps extends PaginationProps {}
2
+
3
+
4
+ export interface FePaginationProps extends PaginationProps {}
@@ -1,4 +1,6 @@
1
1
  import { IToolBarConfig } from './panel.d';
2
- export interface FePanelToolbarProps {
3
- config: IToolBarConfig[];
4
- }
2
+
3
+
4
+ export interface FePanelToolbarProps {
5
+ config: IToolBarConfig[];
6
+ }
@@ -1,61 +1,63 @@
1
1
  import { ButtonProps, TooltipProps } from 'antd';
2
2
  import { default as React } from 'react';
3
3
  import { IPermissionProps } from '../typings';
4
- export interface IToolBarConfig extends Pick<IPermissionProps, 'btnPermission'> {
5
- /**
6
- * @name 按钮类型
7
- * @default primary
8
- */
9
- type?: 'primary' | 'default';
10
- /**
11
- * @name 按钮文案
12
- */
13
- label: string;
14
- /**
15
- * @name 按钮禁用文案
16
- */
17
- disabledText?: string;
18
- /**
19
- * @name 是否需要二次确认
20
- */
21
- needConfirm?: boolean;
22
- /**
23
- * @name 确认文案
24
- * @default 确定{$label}吗?
25
- */
26
- confirmText?: string;
27
- /**
28
- * @name 工具栏属性
29
- */
30
- tooltipAttributes?: Partial<TooltipProps>;
31
- /**
32
- * @name 按钮属性
33
- */
34
- btnAttributes?: Partial<ButtonProps>;
35
- /**
36
- * @name 按钮点击事件
37
- */
38
- onClick: () => void;
39
- /**
40
- * @name 是否禁用
41
- */
42
- disabled?: () => boolean;
43
- /**
44
- * @name 是否隐藏
45
- */
46
- hidden?: () => boolean;
47
- }
48
-
49
- export interface FePanelProps {
50
- isSticky?: boolean;
51
- wrapperClassName?: string;
52
- children?: React.ReactNode;
53
- title?: React.ReactNode;
54
- subTitle?: React.ReactNode;
55
- toolBarRender?: React.ReactNode;
56
- toolBarConfig?: IToolBarConfig[];
57
- wrapperStyle?: React.CSSProperties;
58
- type?: 'default' | 'search';
59
- }
60
-
61
- declare const FePanel: React.ForwardRefExoticComponent<FePanelProps>;
4
+
5
+
6
+ export interface IToolBarConfig extends Pick<IPermissionProps, 'btnPermission'> {
7
+ /**
8
+ * @name 按钮类型
9
+ * @default primary
10
+ */
11
+ type?: 'primary' | 'default';
12
+ /**
13
+ * @name 按钮文案
14
+ */
15
+ label: string;
16
+ /**
17
+ * @name 按钮禁用文案
18
+ */
19
+ disabledText?: string;
20
+ /**
21
+ * @name 是否需要二次确认
22
+ */
23
+ needConfirm?: boolean;
24
+ /**
25
+ * @name 确认文案
26
+ * @default 确定{$label}吗?
27
+ */
28
+ confirmText?: string;
29
+ /**
30
+ * @name 工具栏属性
31
+ */
32
+ tooltipAttributes?: Partial<TooltipProps>;
33
+ /**
34
+ * @name 按钮属性
35
+ */
36
+ btnAttributes?: Partial<ButtonProps>;
37
+ /**
38
+ * @name 按钮点击事件
39
+ */
40
+ onClick: () => void;
41
+ /**
42
+ * @name 是否禁用
43
+ */
44
+ disabled?: () => boolean;
45
+ /**
46
+ * @name 是否隐藏
47
+ */
48
+ hidden?: () => boolean;
49
+ }
50
+
51
+ export interface FePanelProps {
52
+ isSticky?: boolean;
53
+ wrapperClassName?: string;
54
+ children?: React.ReactNode;
55
+ title?: React.ReactNode;
56
+ subTitle?: React.ReactNode;
57
+ toolBarRender?: React.ReactNode;
58
+ toolBarConfig?: IToolBarConfig[];
59
+ wrapperStyle?: React.CSSProperties;
60
+ type?: 'default' | 'search';
61
+ }
62
+
63
+ declare const FePanel: React.ForwardRefExoticComponent<FePanelProps>;
@@ -1,10 +1,12 @@
1
1
  import { IBasicProps, IPermissionProps } from '../typings';
2
- /**
3
- * 权限控制组件属性
4
- */
5
- export interface FePermissionProps extends IPermissionProps, Pick<IBasicProps, 'children'> {
6
- /**
7
- * @name 权限字符串
8
- */
9
- permission?: string;
10
- }
2
+
3
+
4
+ /**
5
+ * 权限控制组件属性
6
+ */
7
+ export interface FePermissionProps extends IPermissionProps, Pick<IBasicProps, 'children'> {
8
+ /**
9
+ * @name 权限字符串
10
+ */
11
+ permission?: string;
12
+ }
@@ -1,8 +1,10 @@
1
1
  import { IPermissionStore } from '../hooks/use-permission.hook/use-permission.d';
2
2
  import { IBasicProps } from '../typings';
3
- export interface FePermissionProviderProps extends Pick<IBasicProps, 'children'> {
4
- /**
5
- * @name 按钮权限字符串
6
- */
7
- btnPermissionList?: IPermissionStore['btnPermissionList'];
8
- }
3
+
4
+
5
+ export interface FePermissionProviderProps extends Pick<IBasicProps, 'children'> {
6
+ /**
7
+ * @name 按钮权限字符串
8
+ */
9
+ btnPermissionList?: IPermissionStore['btnPermissionList'];
10
+ }
@@ -1,2 +1,4 @@
1
1
  import { RadioProps } from 'antd';
2
- export interface FeRadioProps extends RadioProps {}
2
+
3
+
4
+ export interface FeRadioProps extends RadioProps {}
@@ -1,2 +1,4 @@
1
1
  import { RadioGroupProps } from 'antd';
2
- export interface FeRadioGroupProps extends RadioGroupProps {}
2
+
3
+
4
+ export interface FeRadioGroupProps extends RadioGroupProps {}
@@ -1,167 +1,169 @@
1
1
  import { default as Quill, BoundsStatic, DeltaStatic, RangeStatic, Sources } from 'quill';
2
2
  import { CSSProperties, ReactElement } from 'react';
3
- export type Value = string | DeltaStatic;
4
- export type Range = RangeStatic | null;
5
-
6
- export interface FeRichTextRef {
7
- focus: () => void;
8
- blur: () => void;
9
- getEditor: () => Quill | null;
10
- getUnprivilegedEditor: () => UnprivilegedEditor | null;
11
- }
12
-
13
- export interface UnprivilegedEditor {
14
- getLength(): number;
15
- getText(index?: number, length?: number): string;
16
- getHTML(): string;
17
- getDisplayHTML(): string;
18
- getBounds(index: number, length?: number): BoundsStatic;
19
- getSelection(focus?: boolean): RangeStatic;
20
- getContents(index?: number, length?: number): DeltaStatic;
21
- }
22
-
23
- type uploadToolConfig = {
24
- imageConfig?: any;
25
- uploadFn: any;
26
- };
27
-
28
- export interface FeRichTextProps {
29
- /**
30
- * 编辑器的内容
31
- */
32
- value?: Value;
33
-
34
- /**
35
- * 非受控模式的默认值
36
- */
37
- defaultValue?: Value;
38
-
39
- /**
40
- * 内容变化时的回调函数
41
- */
42
- onChange?: (value: string, delta: DeltaStatic, source: Sources, editor: UnprivilegedEditor) => void;
43
-
44
- /**
45
- * 选择变化时的回调函数
46
- */
47
- onChangeSelection?: (selection: Range, source: Sources, editor: UnprivilegedEditor) => void;
48
-
49
- /**
50
- * 编辑器获取焦点回调
51
- */
52
- onFocus?: (selection: Range, source: Sources, editor: UnprivilegedEditor) => void;
53
-
54
- /**
55
- * 编辑器失去焦点回调
56
- */
57
- onBlur?: (previousSelection: Range, source: Sources, editor: UnprivilegedEditor) => void;
58
-
59
- /**
60
- * 编辑器高度
61
- */
62
- height?: number | string;
63
-
64
- /**
65
- * 是否只读
66
- */
67
- readOnly?: boolean;
68
-
69
- /**
70
- * 占位符文本
71
- */
72
- placeholder?: string;
73
-
74
- /**
75
- * 编辑区域边界
76
- */
77
- bounds?: string | HTMLElement;
78
-
79
- /**
80
- * 格式白名单
81
- */
82
- formats?: string[];
83
-
84
- /**
85
- * 自定义模块配置
86
- */
87
- modules?: Record<string, any>;
88
-
89
- /**
90
- * 自定义样式
91
- */
92
- style?: CSSProperties;
93
-
94
- /**
95
- * 自定义类名
96
- */
97
- className?: string;
98
-
99
- /**
100
- * HTML ID
101
- */
102
- id?: string;
103
-
104
- /**
105
- * Tab索引
106
- */
107
- tabIndex?: number;
108
-
109
- /**
110
- * Tab键对应的空格数量
111
- */
112
- tabSize?: number;
113
-
114
- /**
115
- * 自定义主题
116
- */
117
- theme?: 'snow' | 'bubble' | string;
118
-
119
- /**
120
- * 滚动容器
121
- */
122
- scrollingContainer?: string | HTMLElement;
123
-
124
- /**
125
- * 键盘事件
126
- */
127
- onKeyPress?: React.KeyboardEventHandler;
128
- onKeyDown?: React.KeyboardEventHandler;
129
- onKeyUp?: React.KeyboardEventHandler;
130
-
131
- /**
132
- * 保留空白符
133
- */
134
- preserveWhitespace?: boolean;
135
-
136
- /**
137
- * 自定义子元素
138
- */
139
- children?: ReactElement;
140
-
141
- /**
142
- * 上传配置
143
- */
144
- uploadToolConfig?: uploadToolConfig;
145
- }
146
-
147
- /**
148
- * Quill Delta格式类型
149
- */
150
- export interface Delta {
151
- ops?: {
152
- insert?: any;
153
- delete?: number;
154
- retain?: number;
155
- attributes?: Record<string, any>;
156
- }[];
157
- }
158
-
159
- /**
160
- * 工具栏配置选项
161
- */
162
- export interface ToolbarOptions {
163
- container?: string | string[][] | HTMLElement;
164
- handlers?: Record<string, any>;
165
- }
166
-
167
- declare const FeRichText: React.FC<FeRichTextProps>;
3
+
4
+
5
+ export type Value = string | DeltaStatic;
6
+ export type Range = RangeStatic | null;
7
+
8
+ export interface FeRichTextRef {
9
+ focus: () => void;
10
+ blur: () => void;
11
+ getEditor: () => Quill | null;
12
+ getUnprivilegedEditor: () => UnprivilegedEditor | null;
13
+ }
14
+
15
+ export interface UnprivilegedEditor {
16
+ getLength(): number;
17
+ getText(index?: number, length?: number): string;
18
+ getHTML(): string;
19
+ getDisplayHTML(): string;
20
+ getBounds(index: number, length?: number): BoundsStatic;
21
+ getSelection(focus?: boolean): RangeStatic;
22
+ getContents(index?: number, length?: number): DeltaStatic;
23
+ }
24
+
25
+ type uploadToolConfig = {
26
+ imageConfig?: any;
27
+ uploadFn: any;
28
+ };
29
+
30
+ export interface FeRichTextProps {
31
+ /**
32
+ * 编辑器的内容
33
+ */
34
+ value?: Value;
35
+
36
+ /**
37
+ * 非受控模式的默认值
38
+ */
39
+ defaultValue?: Value;
40
+
41
+ /**
42
+ * 内容变化时的回调函数
43
+ */
44
+ onChange?: (value: string, delta: DeltaStatic, source: Sources, editor: UnprivilegedEditor) => void;
45
+
46
+ /**
47
+ * 选择变化时的回调函数
48
+ */
49
+ onChangeSelection?: (selection: Range, source: Sources, editor: UnprivilegedEditor) => void;
50
+
51
+ /**
52
+ * 编辑器获取焦点回调
53
+ */
54
+ onFocus?: (selection: Range, source: Sources, editor: UnprivilegedEditor) => void;
55
+
56
+ /**
57
+ * 编辑器失去焦点回调
58
+ */
59
+ onBlur?: (previousSelection: Range, source: Sources, editor: UnprivilegedEditor) => void;
60
+
61
+ /**
62
+ * 编辑器高度
63
+ */
64
+ height?: number | string;
65
+
66
+ /**
67
+ * 是否只读
68
+ */
69
+ readOnly?: boolean;
70
+
71
+ /**
72
+ * 占位符文本
73
+ */
74
+ placeholder?: string;
75
+
76
+ /**
77
+ * 编辑区域边界
78
+ */
79
+ bounds?: string | HTMLElement;
80
+
81
+ /**
82
+ * 格式白名单
83
+ */
84
+ formats?: string[];
85
+
86
+ /**
87
+ * 自定义模块配置
88
+ */
89
+ modules?: Record<string, any>;
90
+
91
+ /**
92
+ * 自定义样式
93
+ */
94
+ style?: CSSProperties;
95
+
96
+ /**
97
+ * 自定义类名
98
+ */
99
+ className?: string;
100
+
101
+ /**
102
+ * HTML ID
103
+ */
104
+ id?: string;
105
+
106
+ /**
107
+ * Tab索引
108
+ */
109
+ tabIndex?: number;
110
+
111
+ /**
112
+ * Tab键对应的空格数量
113
+ */
114
+ tabSize?: number;
115
+
116
+ /**
117
+ * 自定义主题
118
+ */
119
+ theme?: 'snow' | 'bubble' | string;
120
+
121
+ /**
122
+ * 滚动容器
123
+ */
124
+ scrollingContainer?: string | HTMLElement;
125
+
126
+ /**
127
+ * 键盘事件
128
+ */
129
+ onKeyPress?: React.KeyboardEventHandler;
130
+ onKeyDown?: React.KeyboardEventHandler;
131
+ onKeyUp?: React.KeyboardEventHandler;
132
+
133
+ /**
134
+ * 保留空白符
135
+ */
136
+ preserveWhitespace?: boolean;
137
+
138
+ /**
139
+ * 自定义子元素
140
+ */
141
+ children?: ReactElement;
142
+
143
+ /**
144
+ * 上传配置
145
+ */
146
+ uploadToolConfig?: uploadToolConfig;
147
+ }
148
+
149
+ /**
150
+ * Quill Delta格式类型
151
+ */
152
+ export interface Delta {
153
+ ops?: {
154
+ insert?: any;
155
+ delete?: number;
156
+ retain?: number;
157
+ attributes?: Record<string, any>;
158
+ }[];
159
+ }
160
+
161
+ /**
162
+ * 工具栏配置选项
163
+ */
164
+ export interface ToolbarOptions {
165
+ container?: string | string[][] | HTMLElement;
166
+ handlers?: Record<string, any>;
167
+ }
168
+
169
+ declare const FeRichText: React.FC<FeRichTextProps>;
@@ -1,8 +1,10 @@
1
1
  import { SelectProps } from 'antd';
2
- export interface FeSelectProps extends SelectProps {
3
- /**
4
- * @name minWidth 最小宽度
5
- * @default `200px`
6
- */
7
- minWidth?: string;
8
- }
2
+
3
+
4
+ export interface FeSelectProps extends SelectProps {
5
+ /**
6
+ * @name minWidth 最小宽度
7
+ * @default `200px`
8
+ */
9
+ minWidth?: string;
10
+ }
@@ -1,2 +1,4 @@
1
1
  import { SwitchProps } from 'antd';
2
- export interface FeSwitchProps extends SwitchProps {}
2
+
3
+
4
+ export interface FeSwitchProps extends SwitchProps {}
@@ -1,10 +1,12 @@
1
1
  import { default as React } from 'react';
2
2
  import { IColumnsHandleConfig } from '../type/table.d';
3
- export type TFeTableLinkConfig<T> = IColumnsHandleConfig & { record: T; index: number };
4
-
5
- export interface FeTableLinkProps<T> {
6
- config: Array<TFeTableLinkConfig<T>>;
7
- modal?: {
8
- confirm: (config: { title?: string; content?: React.ReactNode; onOk?: () => void; onCancel?: () => void }) => void;
9
- };
10
- }
3
+
4
+
5
+ export type TFeTableLinkConfig<T> = IColumnsHandleConfig & { record: T; index: number };
6
+
7
+ export interface FeTableLinkProps<T> {
8
+ config: Array<TFeTableLinkConfig<T>>;
9
+ modal?: {
10
+ confirm: (config: { title?: string; content?: React.ReactNode; onOk?: () => void; onCancel?: () => void }) => void;
11
+ };
12
+ }
@@ -1,11 +1,13 @@
1
1
  import { ITableColumns, TRenderType } from '../type/table.d';
2
- export interface FeTableRenderProps<DataType extends Record<string, any>> {
3
- value: any;
4
- width: ITableColumns<DataType>['width'];
5
- record: DataType;
6
- column: ITableColumns<DataType>;
7
- renderType: TRenderType;
8
- renderParams: ITableColumns<DataType>['renderParams'];
9
- tagRenderParams: ITableColumns<DataType>['tagRenderParams'];
10
- thousandsParams?: ITableColumns<DataType>['thousandsParams'];
11
- }
2
+
3
+
4
+ export interface FeTableRenderProps<DataType extends Record<string, any>> {
5
+ value: any;
6
+ width: ITableColumns<DataType>['width'];
7
+ record: DataType;
8
+ column: ITableColumns<DataType>;
9
+ renderType: TRenderType;
10
+ renderParams: ITableColumns<DataType>['renderParams'];
11
+ tagRenderParams: ITableColumns<DataType>['tagRenderParams'];
12
+ thousandsParams?: ITableColumns<DataType>['thousandsParams'];
13
+ }