vap1 0.0.6 → 0.0.8

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 (87) hide show
  1. package/components/SearchBar/ActionButtons.d.ts +2 -1
  2. package/components/SearchBar/ByKeyword.js +2 -1
  3. package/components/Tables/ApiTableModal.d.ts +2 -2
  4. package/components/Tables/TopTable.js +3 -3
  5. package/components/Tables/TopTableModal.d.ts +2 -2
  6. package/components/Tables/VTable.js +3 -1
  7. package/components/Trees/ActionTree.d.ts +3 -1
  8. package/components/Trees/ActionTree.js +77 -20
  9. package/components/Trees/BaseTree.d.ts +8 -3
  10. package/components/Trees/BaseTree.js +12 -3
  11. package/components/Trees/FTree.js +0 -1
  12. package/components/Trees/STree.js +6 -7
  13. package/components/Trees/index.d.ts +6 -1
  14. package/components/UForm/UForm.js +41 -9
  15. package/components/UForm/UFormModal.js +4 -1
  16. package/components/UForm/UInfoModal.js +3 -0
  17. package/components/UForm/UModal.js +10 -5
  18. package/components/UForm/index.d.ts +8 -3
  19. package/components/Upload/UploadModal.d.ts +2 -2
  20. package/components/Upload/UploadModal.js +5 -1
  21. package/components/Upload/useUpload.d.ts +2 -2
  22. package/components/_adapt/Alert.d.ts +3 -3
  23. package/components/_adapt/Breadcrumb.d.ts +15 -0
  24. package/components/_adapt/Breadcrumb.js +18 -0
  25. package/components/_adapt/Button.d.ts +5 -5
  26. package/components/_adapt/Button.js +2 -0
  27. package/components/_adapt/Collapse.d.ts +7 -7
  28. package/components/_adapt/ConfigProvider.d.ts +6 -0
  29. package/components/_adapt/ConfigProvider.js +10 -0
  30. package/components/_adapt/Drawer.d.ts +3 -3
  31. package/components/_adapt/Dropdown.d.ts +6 -6
  32. package/components/_adapt/FloatButton.d.ts +3 -3
  33. package/components/_adapt/FloatButton.js +1 -0
  34. package/components/_adapt/Form.d.ts +14 -0
  35. package/components/_adapt/Form.js +48 -0
  36. package/components/_adapt/Input.d.ts +17 -0
  37. package/components/_adapt/Input.js +43 -0
  38. package/components/_adapt/InputNumber.d.ts +8 -0
  39. package/components/_adapt/InputNumber.js +60 -0
  40. package/components/_adapt/Layout.js +6 -0
  41. package/components/_adapt/Menu.d.ts +8 -7
  42. package/components/_adapt/Menu.js +19 -29
  43. package/components/_adapt/Modal.d.ts +9 -7
  44. package/components/_adapt/Modal.js +12 -20
  45. package/components/_adapt/Popconfirm.d.ts +3 -3
  46. package/components/_adapt/Popover.d.ts +3 -3
  47. package/components/_adapt/Progress.d.ts +3 -3
  48. package/components/_adapt/Radio.d.ts +16 -0
  49. package/components/_adapt/Radio.js +24 -0
  50. package/components/_adapt/Row.js +1 -1
  51. package/components/_adapt/Select.d.ts +15 -8
  52. package/components/_adapt/Select.js +134 -13
  53. package/components/_adapt/Slider.d.ts +31 -0
  54. package/components/_adapt/Slider.js +5 -0
  55. package/components/_adapt/Table.d.ts +26 -0
  56. package/components/_adapt/Table.js +43 -0
  57. package/components/_adapt/Tabs.d.ts +4 -4
  58. package/components/_adapt/Tabs.js +1 -1
  59. package/components/_adapt/Tag.d.ts +9 -7
  60. package/components/_adapt/Tag.js +4 -3
  61. package/components/_adapt/Tooltip.d.ts +3 -3
  62. package/components/_adapt/TreeSelect.d.ts +13 -0
  63. package/components/_adapt/TreeSelect.js +46 -0
  64. package/components/_adapt/_Antd5.d.ts +11 -0
  65. package/components/_adapt/_Antd5.js +5 -0
  66. package/components/_adapt/notification.d.ts +22 -0
  67. package/components/_adapt/notification.js +5 -0
  68. package/components/_adapt/todo/Image.d.ts +1 -1
  69. package/components/_adapt/todo/Segmented.d.ts +1 -1
  70. package/components/_adapt/utils.d.ts +1 -1
  71. package/components/_adapt/utils.js +1 -0
  72. package/components/_common/AutoComplete.js +1 -1
  73. package/components/_setup/UForm/UFormTree.js +1 -1
  74. package/deps/SpringCloud.d.ts +1 -1
  75. package/deps/_editor/advance/_Image.js +2 -2
  76. package/hooks/useAjaxQuery.d.ts +5 -8
  77. package/hooks/useAjaxQuery.js +21 -25
  78. package/index.d.ts +43 -30
  79. package/index.js +23 -13
  80. package/package.json +1 -1
  81. package/utils/Const.d.ts +1 -1
  82. package/utils/CustomApp.d.ts +3 -3
  83. package/utils/Global.js +39 -0
  84. package/utils/PageUtil.d.ts +5 -1
  85. package/utils/PageUtil.js +15 -1
  86. package/utils/Renders/StatusRender.d.ts +1 -1
  87. package/utils/TreeUtil.d.ts +9 -0
@@ -1,15 +1,15 @@
1
1
  import React, { Component } from 'react';
2
- import type { ModalProps } from 'antd/es/modal';
2
+ import type { ModalProps as AntdModalProps } from 'antd/es/modal';
3
3
  import type { PlainObject } from '../../basetype';
4
- export type VModalProps = Omit<ModalProps, 'onOk' | 'onCancel' | 'visible'> & {
4
+ export type ModalProps = Omit<AntdModalProps, 'onOk' | 'onCancel' | 'visible'> & {
5
5
  open?: boolean;
6
6
  onOk?: (data?: PlainObject) => void;
7
7
  onCancel?: () => void;
8
8
  };
9
- export declare class Modal extends Component<VModalProps> {
10
- state: {
11
- open: boolean;
12
- };
9
+ export declare const useDestoryModal: (props: {
10
+ open?: boolean;
11
+ }) => [boolean, () => void];
12
+ export declare class Modal extends Component<ModalProps> {
13
13
  static info: import("antd/lib/modal/Modal").ModalFunc;
14
14
  static success: import("antd/lib/modal/Modal").ModalFunc;
15
15
  static error: import("antd/lib/modal/Modal").ModalFunc;
@@ -17,7 +17,9 @@ export declare class Modal extends Component<VModalProps> {
17
17
  static warning: import("antd/lib/modal/Modal").ModalFunc;
18
18
  static confirm: import("antd/lib/modal/Modal").ModalFunc;
19
19
  static destroyAll: () => void;
20
- componentDidUpdate(prevProps: Readonly<VModalProps>): void;
20
+ static useDestoryModal: (props: {
21
+ open?: boolean;
22
+ }) => [boolean, () => void];
21
23
  renderFooter(): React.ReactNode;
22
24
  render(): React.ReactNode;
23
25
  }
@@ -23,28 +23,21 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.Modal = void 0;
26
+ exports.Modal = exports.useDestoryModal = void 0;
27
27
  const react_1 = __importStar(require("react"));
28
28
  const utils_1 = require("../../utils");
29
29
  const antd_1 = require("antd");
30
30
  const Button_1 = require("./Button");
31
+ const useDestoryModal = (props) => {
32
+ const [open, setOpen] = (0, react_1.useState)(false);
33
+ (0, react_1.useLayoutEffect)(() => {
34
+ if (props.open)
35
+ setOpen(true);
36
+ }, [props.open]);
37
+ return [open, () => setOpen(false)];
38
+ };
39
+ exports.useDestoryModal = useDestoryModal;
31
40
  class Modal extends react_1.Component {
32
- constructor() {
33
- super(...arguments);
34
- this.state = { open: false };
35
- }
36
- componentDidUpdate(prevProps) {
37
- if (prevProps.open) {
38
- // if (this.props.open) {
39
- // } else {
40
- // }
41
- }
42
- else {
43
- if (this.props.open) {
44
- this.setState({ open: true });
45
- }
46
- }
47
- }
48
41
  renderFooter() {
49
42
  const { okText, okType = 'primary', cancelText, confirmLoading, onOk, onCancel, okButtonProps, cancelButtonProps, footer } = this.props;
50
43
  if (footer !== undefined)
@@ -54,9 +47,7 @@ class Modal extends react_1.Component {
54
47
  react_1.default.createElement(Button_1.Button, Object.assign({ onClick: evt => utils_1.PageUtil.stopEvent(evt, () => onCancel()) }, cancelButtonProps), cancelText || utils_1.i18n.ant('Modal.cancelText')));
55
48
  }
56
49
  render() {
57
- if (!this.state.open)
58
- return utils_1.Const.NONE;
59
- return react_1.default.createElement(antd_1.Modal, Object.assign({}, this.props, { afterClose: () => this.setState({ open: false }), visible: this.props.open, footer: () => this.renderFooter() }));
50
+ return react_1.default.createElement(antd_1.Modal, Object.assign({}, this.props, { visible: this.props.open, footer: this.props.footer === null ? null : this.renderFooter() }));
60
51
  }
61
52
  }
62
53
  exports.Modal = Modal;
@@ -67,3 +58,4 @@ Modal.warn = antd_1.Modal.warn;
67
58
  Modal.warning = antd_1.Modal.warning;
68
59
  Modal.confirm = antd_1.Modal.confirm;
69
60
  Modal.destroyAll = antd_1.Modal.destroyAll;
61
+ Modal.useDestoryModal = exports.useDestoryModal;
@@ -1,5 +1,5 @@
1
1
  import type { FC } from 'react';
2
2
  import type { ToOpen } from './utils';
3
- import type { PopconfirmProps } from 'antd/es/popconfirm';
4
- export type OPopconfirmProps = ToOpen<PopconfirmProps>;
5
- export declare const Popconfirm: FC<OPopconfirmProps>;
3
+ import type { PopconfirmProps as AntdPopconfirmProps } from 'antd/es/popconfirm';
4
+ export type PopconfirmProps = ToOpen<AntdPopconfirmProps>;
5
+ export declare const Popconfirm: FC<PopconfirmProps>;
@@ -1,5 +1,5 @@
1
1
  import type { FC } from 'react';
2
2
  import type { ToOpen } from './utils';
3
- import type { PopoverProps } from 'antd/es/popover';
4
- export type OPopoverProps = ToOpen<PopoverProps>;
5
- export declare const Popover: FC<OPopoverProps>;
3
+ import type { PopoverProps as AntdPopoverProps } from 'antd/es/popover';
4
+ export type PopoverProps = ToOpen<AntdPopoverProps>;
5
+ export declare const Popover: FC<PopoverProps>;
@@ -1,14 +1,14 @@
1
1
  import React, { Component } from 'react';
2
- import type { ProgressProps, ProgressSize } from 'antd/es/progress/progress';
2
+ import type { ProgressProps as AntdProgressProps, ProgressSize } from 'antd/es/progress/progress';
3
3
  type SuccessProps = {
4
4
  percent?: number;
5
5
  strokeColor?: string;
6
6
  };
7
- export type OProgressProps = Omit<ProgressProps, 'width' | 'successPercent' | 'size'> & {
7
+ export type ProgressProps = Omit<AntdProgressProps, 'width' | 'successPercent' | 'size'> & {
8
8
  success?: SuccessProps;
9
9
  size?: number | ProgressSize;
10
10
  };
11
- export declare class Progress extends Component<OProgressProps> {
11
+ export declare class Progress extends Component<ProgressProps> {
12
12
  render(): React.ReactNode;
13
13
  }
14
14
  export {};
@@ -0,0 +1,16 @@
1
+ import { Radio as AntdRadio } from 'antd';
2
+ import { RadioProps as AntdRadioProps, RadioGroupProps as AntdRadioGroupProps } from 'antd/es/radio';
3
+ import type { BaseOption } from '../../basetype';
4
+ import type { FC, ExoticComponent, PropsWithChildren } from 'react';
5
+ export type RadioProps = AntdRadioProps;
6
+ export type RadioGroupProps = Omit<AntdRadioGroupProps, 'options'> & {
7
+ options?: BaseOption[];
8
+ optionType?: 'default' | 'button';
9
+ };
10
+ type RadioGroupComponent = FC<PropsWithChildren<RadioGroupProps>>;
11
+ type CompoundedComponent = ExoticComponent<PropsWithChildren<RadioGroupProps>> & {
12
+ Group: RadioGroupComponent;
13
+ Button: typeof AntdRadio.Button;
14
+ };
15
+ export declare const Radio: CompoundedComponent;
16
+ export {};
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Radio = void 0;
7
+ const react_1 = __importDefault(require("react"));
8
+ const antd_1 = require("antd");
9
+ const lodash_1 = __importDefault(require("lodash"));
10
+ const RadioGroupWithOptions = (props) => react_1.default.createElement(exports.Radio.Group, Object.assign({}, lodash_1.default.omit(props, 'children')), props.options.map(item => {
11
+ if (props.optionType == 'button') {
12
+ return react_1.default.createElement(antd_1.Radio.Button, { value: item.value }, item.label);
13
+ }
14
+ return react_1.default.createElement(antd_1.Radio, { value: item.value }, item.label);
15
+ }));
16
+ const RadioGroup = (props) => {
17
+ if (lodash_1.default.isArray(props.options))
18
+ return react_1.default.createElement(RadioGroupWithOptions, Object.assign({}, props));
19
+ return react_1.default.createElement(antd_1.Radio.Group, Object.assign({}, props));
20
+ };
21
+ const _Radio = (props) => react_1.default.createElement(exports.Radio, Object.assign({}, props));
22
+ exports.Radio = _Radio;
23
+ exports.Radio.Group = RadioGroup;
24
+ exports.Radio.Button = antd_1.Radio.Button;
@@ -14,7 +14,7 @@ const Row = (props) => {
14
14
  if (props.wrap)
15
15
  clazz.push('v-row-direction-wrap');
16
16
  if (props.direction != 'column')
17
- return react_1.default.createElement(antd_1.Row, Object.assign({ gutter: Global_1.CONFIG.GRID.GUTTER }, props, { className: clazz.join(' ') }));
17
+ return react_1.default.createElement(antd_1.Row, Object.assign({ type: "flex", gutter: Global_1.CONFIG.GRID.GUTTER }, props, { className: clazz.join(' ') }));
18
18
  clazz.push('v-row-direction-column');
19
19
  return react_1.default.createElement(antd_1.Row, Object.assign({ type: "flex", gutter: Global_1.CONFIG.GRID.GUTTER }, props, {
20
20
  // wrap={props.wrap || false}
@@ -1,14 +1,21 @@
1
- import React from 'react';
2
- import type { SelectProps } from 'antd/es/select';
3
- import type { PropsWithChildren, ExoticComponent } from 'react';
1
+ import { Select as AntdSelect } from 'antd';
2
+ import type { ExoticComponent, PropsWithChildren, ComponentType } from 'react';
3
+ import type { SelectProps as AntdSelectProps, OptionProps as AntdSelectOptionProps } from 'antd/es/select';
4
4
  import type { BaseOption } from '../../basetype';
5
- declare const OptGroup: React.ClassicComponentClass<import("antd/lib/select").OptGroupProps>, Option: React.ClassicComponentClass<import("antd/lib/select").OptionProps>;
6
- export type OSelectProps = SelectProps & {
5
+ export type FilterFunc<OptionType> = (inputValue: string, option?: OptionType) => boolean;
6
+ export type SelectProps<OptionType = any> = Omit<AntdSelectProps, 'mode' | 'onChange' | 'onSelect' | 'filterOption'> & {
7
+ virtual?: boolean;
7
8
  options?: BaseOption[];
9
+ mode?: 'multiple' | 'tags';
10
+ onChange?: (value: OptionType, option: any) => void;
11
+ onSelect?: (value: OptionType, option: any) => void;
12
+ filterOption?: boolean | FilterFunc<OptionType>;
8
13
  };
9
- type SelectComponent = ExoticComponent<PropsWithChildren<OSelectProps>> & {
10
- Option: typeof Option;
11
- OptGroup: typeof OptGroup;
14
+ type SelectComponent = ExoticComponent<PropsWithChildren<SelectProps>> & {
15
+ Option: ComponentType<Omit<AntdSelectOptionProps, 'value'> & {
16
+ value?: number | string | boolean | null;
17
+ }>;
18
+ OptGroup: typeof AntdSelect.OptGroup;
12
19
  };
13
20
  export declare const Select: SelectComponent;
14
21
  export {};
@@ -29,19 +29,140 @@ Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.Select = void 0;
30
30
  const react_1 = __importStar(require("react"));
31
31
  const lodash_1 = __importDefault(require("lodash"));
32
- const PageUtil_1 = require("../../utils/PageUtil");
33
32
  const antd_1 = require("antd");
34
- const { OptGroup, Option } = antd_1.Select;
35
- const _Select = props => {
36
- const [useChildren, options] = (0, react_1.useMemo)(() => {
37
- if (lodash_1.default.isArray(props.options) && props.options.length)
38
- return [false, (0, PageUtil_1.getOptions)(props.options)];
39
- return [true, []];
40
- }, [props.options, props.children]);
41
- if (useChildren)
42
- return react_1.default.createElement(antd_1.Select, Object.assign({}, props));
43
- return react_1.default.createElement(antd_1.Select, Object.assign({}, lodash_1.default.omit(props, 'children')), options.map(item => react_1.default.createElement(Option, { value: item.value }, item.label)));
33
+ const getLabel = (el) => {
34
+ let child = el.props.children;
35
+ if (lodash_1.default.isString(child)) {
36
+ return child;
37
+ }
38
+ if (react_1.default.isValidElement(child)) {
39
+ return getLabel(child);
40
+ }
41
+ else if (lodash_1.default.isArray(child)) {
42
+ let labels = [];
43
+ child.map(item => {
44
+ if (lodash_1.default.isString(item)) {
45
+ labels.push(item);
46
+ }
47
+ else {
48
+ let txt = getLabel(item);
49
+ if (txt) {
50
+ labels.push(txt);
51
+ }
52
+ }
53
+ });
54
+ return labels.join(' ');
55
+ }
56
+ return '';
57
+ };
58
+ const _SelectWithOptions = (props) => {
59
+ const antdSelectProps = (0, react_1.useMemo)(() => {
60
+ const OPTION_MAP = new Map(props.options.map((option => [option.value, option])));
61
+ const select = {};
62
+ if (props.onChange) {
63
+ select.onChange = (value) => {
64
+ if (lodash_1.default.isArray(value)) {
65
+ const opts = [];
66
+ value.map(item => opts.push(OPTION_MAP.get(item)));
67
+ props.onChange(value, opts);
68
+ }
69
+ else {
70
+ props.onChange(value, OPTION_MAP.get(value));
71
+ }
72
+ };
73
+ }
74
+ if (props.onSelect) {
75
+ select.onSelect = (value) => {
76
+ if (lodash_1.default.isArray(value)) {
77
+ const opts = [];
78
+ value.map(item => opts.push(OPTION_MAP.get(item)));
79
+ props.onSelect(value, opts);
80
+ }
81
+ else {
82
+ props.onSelect(value, OPTION_MAP.get(value));
83
+ }
84
+ };
85
+ }
86
+ if (props.filterOption || props.showSearch) {
87
+ if (props.filterOption === true || props.filterOption === undefined) {
88
+ select.showSearch = true;
89
+ select.filterOption = (value, option) => {
90
+ const txt = lodash_1.default.toLower(getLabel(option));
91
+ return txt.indexOf(lodash_1.default.trim(lodash_1.default.toLower(value))) >= 0;
92
+ };
93
+ }
94
+ else if (lodash_1.default.isFunction(props.filterOption)) {
95
+ select.showSearch = true;
96
+ // @ts-ignore
97
+ select.filterOption = (value, option) => props.filterOption(value, { label: getLabel(option), value });
98
+ }
99
+ else {
100
+ select.showSearch = false;
101
+ select.filterOption = false;
102
+ }
103
+ }
104
+ return select;
105
+ }, [props.options]);
106
+ return react_1.default.createElement(antd_1.Select, Object.assign({}, lodash_1.default.omit(props, 'children'), antdSelectProps), props.options.map(item => react_1.default.createElement(antd_1.Select.Option, { value: item.value }, item.label)));
107
+ };
108
+ const _SelectCommon = (props) => {
109
+ const antdSelectProps = (0, react_1.useMemo)(() => {
110
+ const select = {};
111
+ if (props.onChange) {
112
+ select.onChange = (value, option) => {
113
+ if (option == undefined || value === undefined) {
114
+ props.onChange(null, null);
115
+ return;
116
+ }
117
+ if (!lodash_1.default.isArray(option)) {
118
+ props.onChange(value, { label: getLabel(option), value });
119
+ return;
120
+ }
121
+ props.onChange(value, { label: option.map(getLabel).join(' '), value });
122
+ return;
123
+ };
124
+ }
125
+ if (props.onSelect) {
126
+ select.onSelect = (value, option) => {
127
+ if (option == undefined || value === undefined) {
128
+ props.onSelect(null, null);
129
+ return;
130
+ }
131
+ if (!lodash_1.default.isArray(option)) {
132
+ props.onSelect(value, { label: getLabel(option), value });
133
+ return;
134
+ }
135
+ props.onSelect(value, { label: option.map(getLabel).join(' '), value });
136
+ return;
137
+ };
138
+ }
139
+ if (props.filterOption || props.showSearch) {
140
+ if (props.filterOption === true || props.filterOption === undefined) {
141
+ select.showSearch = true;
142
+ select.filterOption = (value, option) => {
143
+ const txt = lodash_1.default.toLower(getLabel(option));
144
+ return txt.indexOf(lodash_1.default.trim(lodash_1.default.toLower(value))) >= 0;
145
+ };
146
+ }
147
+ else if (lodash_1.default.isFunction(props.filterOption)) {
148
+ select.showSearch = true;
149
+ // @ts-ignore
150
+ select.filterOption = (value, option) => props.filterOption(value, { label: getLabel(option), value });
151
+ }
152
+ else {
153
+ select.showSearch = false;
154
+ select.filterOption = false;
155
+ }
156
+ }
157
+ return select;
158
+ }, []);
159
+ return react_1.default.createElement(antd_1.Select, Object.assign({ allowClear: true }, props, antdSelectProps));
160
+ };
161
+ const _Select = (props) => {
162
+ if (lodash_1.default.isArray(props.options))
163
+ return react_1.default.createElement(_SelectWithOptions, Object.assign({}, props));
164
+ return react_1.default.createElement(_SelectCommon, Object.assign({}, props));
44
165
  };
45
166
  exports.Select = _Select;
46
- exports.Select.Option = Option;
47
- exports.Select.OptGroup = OptGroup;
167
+ exports.Select.Option = antd_1.Select.Option;
168
+ exports.Select.OptGroup = antd_1.Select.OptGroup;
@@ -0,0 +1,31 @@
1
+ import { SliderProps as AntdSliderProps } from 'antd/es/slider';
2
+ import type { ComponentType } from 'react';
3
+ export type SliderBaseProps = Omit<AntdSliderProps, 'value' | 'defaultValue' | 'onChange' | 'onAfterChange'>;
4
+ export type SliderSingleProps = SliderBaseProps & {
5
+ range?: false;
6
+ value?: number;
7
+ defaultValue?: number;
8
+ onChange?: (value: number) => void;
9
+ onAfterChange?: (value: number) => void;
10
+ /**
11
+ * 以下为兼容属性 , 仅2.0版本有效
12
+ * */
13
+ handleStyle?: React.CSSProperties;
14
+ trackStyle?: React.CSSProperties;
15
+ railStyle?: React.CSSProperties;
16
+ };
17
+ export type SliderRangeProps = SliderBaseProps & {
18
+ range: true;
19
+ value?: [number, number];
20
+ defaultValue?: [number, number];
21
+ onChange?: (value: [number, number]) => void;
22
+ onAfterChange?: (value: [number, number]) => void;
23
+ /**
24
+ * 以下为兼容属性 , 仅2.0版本有效
25
+ * */
26
+ handleStyle?: React.CSSProperties[];
27
+ trackStyle?: React.CSSProperties[];
28
+ railStyle?: React.CSSProperties;
29
+ };
30
+ export type SliderProps = SliderSingleProps | SliderRangeProps;
31
+ export declare const Slider: ComponentType<SliderProps>;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Slider = void 0;
4
+ const antd_1 = require("antd");
5
+ exports.Slider = antd_1.Slider;
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import type { TableProps as AntdTableProps } from 'antd/es/table/interface';
3
+ export type TriggerEventHandler<RecordType> = (record: RecordType, event: React.MouseEvent<HTMLElement>) => void;
4
+ export interface RenderExpandIconProps<RecordType> {
5
+ prefixCls: string;
6
+ expanded: boolean;
7
+ record: RecordType;
8
+ expandable: boolean;
9
+ onExpand: TriggerEventHandler<RecordType>;
10
+ }
11
+ export type TableProps<T> = Omit<AntdTableProps<T>, 'AntdTableProps' | 'expandedRowKeys' | 'defaultExpandedRowKeys' | 'expandedRowRender' | 'expandIcon' | 'onExpandedRowsChange' | 'onExpand' | 'defaultExpandAllRows' | 'expandRowByClick' | 'indentSize' | 'childrenColumnName'> & {
12
+ expandable?: {
13
+ expandedRowKeys?: string[] | number[];
14
+ defaultExpandedRowKeys?: string[] | number[];
15
+ expandedRowRender?: (record: T, index: number, indent: number, expanded: boolean) => React.ReactNode;
16
+ expandIcon?: (props: RenderExpandIconProps<T>) => React.ReactNode;
17
+ onExpandedRowsChange?: (expandedRowKeys: string[] | number[]) => void;
18
+ onExpand?: (expanded: boolean, record: T) => void;
19
+ defaultExpandAllRows?: boolean;
20
+ expandRowByClick?: boolean;
21
+ indentSize?: number;
22
+ childrenColumnName?: string;
23
+ };
24
+ showSorterTooltip?: any;
25
+ };
26
+ export declare const Table: React.FC<TableProps<any>>;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.Table = void 0;
30
+ const react_1 = __importStar(require("react"));
31
+ const lodash_1 = __importDefault(require("lodash"));
32
+ const antd_1 = require("antd");
33
+ const Table = props => {
34
+ const tableProps = (0, react_1.useMemo)(() => {
35
+ if (props.expandable == null || props.expandable == undefined) {
36
+ return props;
37
+ }
38
+ return Object.assign(Object.assign({}, lodash_1.default.omit(props, 'expandable')), props.expandable);
39
+ }, [props.expandable]);
40
+ return react_1.default.createElement(antd_1.Table, Object.assign({}, tableProps));
41
+ };
42
+ exports.Table = Table;
43
+ // export const Table = AntdTable as ComponentClass<TableProps>;
@@ -1,15 +1,15 @@
1
1
  import React from 'react';
2
2
  import { Tabs as AntdTabs } from 'antd';
3
- import type { TabsProps, TabPaneProps } from 'antd/es/tabs';
3
+ import type { TabsProps as AntdTabsProps, TabPaneProps as AntdTabPaneProps } from 'antd/es/tabs';
4
4
  import type { ExoticComponent, PropsWithChildren } from 'react';
5
- export interface Tab extends Omit<TabPaneProps, 'tab'> {
5
+ export interface Tab extends Omit<AntdTabPaneProps, 'tab'> {
6
6
  key: string;
7
7
  label: React.ReactNode;
8
8
  }
9
- export type OTabsProps = TabsProps & {
9
+ export type TabsProps = AntdTabsProps & {
10
10
  items?: Tab[];
11
11
  };
12
- type TabComponent = ExoticComponent<PropsWithChildren<OTabsProps>> & {
12
+ type TabComponent = ExoticComponent<PropsWithChildren<TabsProps>> & {
13
13
  TabPane: typeof AntdTabs.TabPane;
14
14
  };
15
15
  export declare const Tabs: TabComponent;
@@ -9,7 +9,7 @@ const lodash_1 = __importDefault(require("lodash"));
9
9
  const antd_1 = require("antd");
10
10
  const _Tabs = props => {
11
11
  if (props.children == null && lodash_1.default.isArray(props.items) && props.items.length > 0) {
12
- return react_1.default.createElement(antd_1.Tabs, Object.assign({}, props), props.items.map(item => react_1.default.createElement(antd_1.Tabs.TabPane, Object.assign({}, item), item.label)));
12
+ return react_1.default.createElement(antd_1.Tabs, Object.assign({}, props), props.items.map(item => react_1.default.createElement(antd_1.Tabs.TabPane, Object.assign({}, item, { tab: item.label }))));
13
13
  }
14
14
  return react_1.default.createElement(antd_1.Tabs, Object.assign({}, props));
15
15
  };
@@ -1,14 +1,16 @@
1
- import type { TagProps } from 'antd/es/tag';
2
- import type { FC, PropsWithChildren } from 'react';
1
+ import { Tag as AntdTag } from 'antd';
2
+ import type { TagProps as AntdTagProps } from 'antd/es/tag';
3
+ import type { ForwardRefExoticComponent, PropsWithChildren } from 'react';
3
4
  /**
4
5
  * 说明: 排除 Tag 组件已被 antd 标记为 deprecated 的属性:
5
6
  * 1. `visible` will be removed in next major version.
6
7
  */
7
- export type OTagProps = PropsWithChildren<Omit<TagProps, 'visible'>> & {
8
+ export type TagProps = PropsWithChildren<Omit<AntdTagProps, 'visible'>> & {
8
9
  icon?: string;
9
10
  bordered?: boolean;
10
11
  };
11
- /**
12
- * 不再使用 visible 属性
13
- */
14
- export declare const Tag: FC<OTagProps>;
12
+ interface TagComponent extends ForwardRefExoticComponent<TagProps> {
13
+ CheckableTag: typeof AntdTag.CheckableTag;
14
+ }
15
+ export declare const Tag: TagComponent;
16
+ export {};
@@ -6,12 +6,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.Tag = void 0;
7
7
  const react_1 = __importDefault(require("react"));
8
8
  const antd_1 = require("antd");
9
- const lodash_1 = __importDefault(require("lodash"));
10
9
  const Icon_1 = require("./Icon");
10
+ const lodash_1 = __importDefault(require("lodash"));
11
11
  /**
12
12
  * 不再使用 visible 属性
13
13
  */
14
- const Tag = props => {
14
+ const _Tag = props => {
15
15
  const style = lodash_1.default.assign({}, props.style);
16
16
  if (props.bordered === false) {
17
17
  style.border = 'none';
@@ -22,4 +22,5 @@ const Tag = props => {
22
22
  props.children) : props.children;
23
23
  return react_1.default.createElement(antd_1.Tag, Object.assign({}, props, { style: style }), children);
24
24
  };
25
- exports.Tag = Tag;
25
+ exports.Tag = _Tag;
26
+ exports.Tag.CheckableTag = antd_1.Tag.CheckableTag;
@@ -1,5 +1,5 @@
1
1
  import type { FC } from 'react';
2
2
  import type { ToOpen } from './utils';
3
- import type { TooltipProps } from 'antd/es/tooltip';
4
- export type OTooltipProps = ToOpen<TooltipProps>;
5
- export declare const Tooltip: FC<OTooltipProps>;
3
+ import type { TooltipProps as AntdTooltipProps } from 'antd/es/tooltip';
4
+ export type TooltipProps = ToOpen<AntdTooltipProps>;
5
+ export declare const Tooltip: FC<TooltipProps>;
@@ -0,0 +1,13 @@
1
+ import { TreeSelect as AntdTreeSelect } from 'antd';
2
+ import type { TreeSelectProps as AntdTreeSelectProps } from 'antd/es/tree-select';
3
+ import type { ExoticComponent, PropsWithChildren } from 'react';
4
+ export type TreeSelectProps = Omit<AntdTreeSelectProps<any>, 'dropdownClassName' | 'dropdownMatchSelectWidth' | 'showArrow'> & {
5
+ popupClassName?: string;
6
+ popupMatchSelectWidth?: boolean | number;
7
+ virtual?: boolean;
8
+ };
9
+ type TreeSelectComponent = ExoticComponent<PropsWithChildren<TreeSelectProps>> & {
10
+ TreeNode: typeof AntdTreeSelect.TreeNode;
11
+ };
12
+ export declare const TreeSelect: TreeSelectComponent;
13
+ export {};
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.TreeSelect = void 0;
30
+ const react_1 = __importStar(require("react"));
31
+ const lodash_1 = __importDefault(require("lodash"));
32
+ const antd_1 = require("antd");
33
+ const _TreeSelect = (props) => {
34
+ const treeSelectProps = (0, react_1.useMemo)(() => {
35
+ const treeSelect = {};
36
+ if (props.popupClassName)
37
+ treeSelect.dropdownClassName = props.popupClassName;
38
+ if (props.popupMatchSelectWidth)
39
+ treeSelect.dropdownMatchSelectWidth = props.popupMatchSelectWidth;
40
+ // if (props.searchValue) treeSelect.searchValue = props.searchValue;
41
+ return treeSelect;
42
+ }, []);
43
+ return react_1.default.createElement(antd_1.TreeSelect, Object.assign({}, lodash_1.default.omit(props, ['popupClassName', 'popupMatchSelectWidth', 'searchValue']), treeSelectProps));
44
+ };
45
+ exports.TreeSelect = _TreeSelect;
46
+ exports.TreeSelect.TreeNode = antd_1.TreeSelect.TreeNode;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * 使用 Antd5的属性定义 antd3,兼容多套代码
3
+ */
4
+ /**
5
+ * size Type
6
+ */
7
+ export type SizeType = 'small' | 'middle' | 'large';
8
+ export type PresetStatusColorType = 'success' | 'processing' | 'error' | 'default' | 'warning';
9
+ declare const ButtonTypes: readonly ["default", "primary", "dashed", "link", "text"];
10
+ export type ButtonType = typeof ButtonTypes[number];
11
+ export {};
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * 使用 Antd5的属性定义 antd3,兼容多套代码
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });