@para-ui/core 3.0.86 → 4.0.0-alpha
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/AutoBox/index.js +18 -19
- package/AutoTips/index.js +5 -4
- package/Breadcrumbs/index.js +5 -4
- package/Button/SplitButton.d.ts +13 -0
- package/Button/index.d.ts +1 -1
- package/Button/index.js +54 -12
- package/ButtonGroup/index.js +6 -5
- package/Carousel/index.d.ts +5 -5
- package/Carousel/index.js +21 -9
- package/Cascader/Cascader.d.ts +99 -0
- package/Cascader/OptionList/CacheContent.d.ts +7 -0
- package/Cascader/OptionList/Column.d.ts +21 -0
- package/Cascader/OptionList/index.d.ts +4 -0
- package/Cascader/OptionList/useActive.d.ts +6 -0
- package/Cascader/context.d.ts +23 -0
- package/Cascader/hooks/useDisplayValues.d.ts +10 -0
- package/Cascader/hooks/useEntities.d.ts +10 -0
- package/Cascader/hooks/useMissingValues.d.ts +3 -0
- package/Cascader/index.d.ts +3 -58
- package/Cascader/index.js +28 -177
- package/Cascader/utils/commonUtil.d.ts +18 -0
- package/Cascader/utils/treeUtil.d.ts +55 -0
- package/Checkbox/index.d.ts +7 -0
- package/Checkbox/index.js +50 -29
- package/CheckboxGroup/index.d.ts +3 -1
- package/CheckboxGroup/index.js +48 -18
- package/Collapse/index.js +2 -2
- package/Collapse/motion.d.ts +0 -2
- package/CollapseBox/index.js +3 -3
- package/CollapseLayout/index.d.ts +5 -0
- package/CollapseLayout/index.js +144 -22
- package/ColorPicker/chromePicker/index.d.ts +9 -0
- package/ColorPicker/compactPicker/index.d.ts +9 -0
- package/ColorPicker/config.d.ts +5 -0
- package/ColorPicker/index.d.ts +4 -1
- package/ColorPicker/index.js +7 -3
- package/ColorPicker/sketchPicker/index.d.ts +11 -0
- package/ColorPicker/swatchesPicker/index.d.ts +9 -0
- package/ComboSelect/index.js +14 -12
- package/Container/index.js +2 -2
- package/CopyText/index.d.ts +33 -0
- package/CopyText/index.js +180 -0
- package/DatePicker/generatePicker/generateRangePicker.d.ts +9 -2
- package/DatePicker/generatePicker/generateSinglePicker.d.ts +8 -8
- package/DatePicker/generatePicker/index.d.ts +32 -26
- package/DatePicker/generatePicker/interface.d.ts +12 -0
- package/DatePicker/index.d.ts +12 -8
- package/DatePicker/index.js +367 -454
- package/DatePicker/util.d.ts +40 -4
- package/Desktop/index.d.ts +16 -3
- package/Desktop/index.js +177 -68
- package/Desktop/lang/en_US.d.ts +6 -0
- package/Desktop/lang/index.d.ts +13 -0
- package/Desktop/lang/zh_CN.d.ts +6 -0
- package/DragVerify/index.js +9 -100
- package/Drawer/index.js +8 -8
- package/Drawer/interface.d.ts +2 -2
- package/Dropdown/index.js +2 -2
- package/DynamicMultiBox/index.js +57 -41
- package/DynamicMultiBox/interface.d.ts +4 -4
- package/Empty/index.js +2 -2
- package/Form/index.d.ts +20 -26
- package/Form/index.js +48 -69
- package/FormItem/index.js +15 -15
- package/FunctionModal/index.js +11 -9
- package/GlobalContext/constant.d.ts +1 -1
- package/GlobalContext/index.js +2 -2
- package/Help/index.js +4 -3
- package/HelperText/index.js +2 -2
- package/InputLang/index.d.ts +5 -0
- package/InputLang/index.js +35 -29
- package/InputNumber/index.d.ts +5 -0
- package/InputNumber/index.js +95 -80
- package/Label/index.js +4 -3
- package/Loading/index.js +2 -2
- package/Menu/index.js +114 -39
- package/Menu/interface.d.ts +8 -0
- package/Message/index.d.ts +4 -4
- package/Message/index.js +13 -11
- package/Modal/index.js +29 -15
- package/MultiBox/index.js +9 -8
- package/Notification/index.d.ts +9 -1
- package/Notification/index.js +29 -15
- package/OperateBtn/index.js +28 -11
- package/PageHeader/index.js +270 -74
- package/PageHeader/interface.d.ts +17 -0
- package/Pagination/index.d.ts +4 -3
- package/Pagination/index.js +117 -95
- package/Pagination/lang/en_US.d.ts +3 -2
- package/Pagination/lang/index.d.ts +6 -4
- package/Pagination/lang/zh_CN.d.ts +3 -2
- package/ParauiProvider/index.js +4 -4
- package/PasswordRules/index.js +5 -5
- package/PopConfirm/index.d.ts +15 -5
- package/PopConfirm/index.js +62 -16
- package/Popover/index.js +4 -3
- package/Progress/index.js +10 -9
- package/Querying/index.js +7 -7
- package/README.md +40 -1120
- package/Radio/index.d.ts +7 -0
- package/Radio/index.js +49 -27
- package/RadioGroup/index.d.ts +3 -1
- package/RadioGroup/index.js +48 -21
- package/Search/index.d.ts +3 -15
- package/Search/index.js +21 -83
- package/Select/index.d.ts +7 -2
- package/Select/index.js +114 -91
- package/Select/lang/en_US.d.ts +1 -1
- package/Select/lang/index.d.ts +2 -2
- package/Select/lang/zh_CN.d.ts +1 -1
- package/SelectInput/index.js +8 -7
- package/Selector/index.js +30 -22
- package/SelectorPicker/index.d.ts +5 -0
- package/SelectorPicker/index.js +47 -32
- package/SelectorPicker/lang/en_US.d.ts +1 -0
- package/SelectorPicker/lang/index.d.ts +2 -0
- package/SelectorPicker/lang/zh_CN.d.ts +1 -0
- package/SingleBox/index.js +8 -7
- package/Slider/index.js +5 -5
- package/Status/index.d.ts +6 -5
- package/Status/index.js +27 -4
- package/Stepper/index.d.ts +9 -10
- package/Stepper/index.js +69 -29
- package/Styles/index.scss +4 -0
- package/Styles/scrollbar.scss +24 -24
- package/Styles/theme.scss +104 -57
- package/Switch/index.d.ts +34 -14
- package/Switch/index.js +97 -30
- package/Table/index.js +33 -27
- package/Table/interface.d.ts +3 -1
- package/Table/tableHeadInterface.d.ts +1 -1
- package/Table/tablePaginationInterface.d.ts +5 -5
- package/Tabs/index.d.ts +11 -1
- package/Tabs/index.js +49 -16
- package/Tag/TagGroup.d.ts +11 -7
- package/Tag/index.d.ts +22 -7
- package/Tag/index.js +1382 -53
- package/TextEditor/index.js +4 -3
- package/TextField/index.d.ts +5 -0
- package/TextField/index.js +50 -32
- package/TimePicker/index.d.ts +5 -0
- package/TimePicker/index.js +39 -23
- package/Timeline/TimelineItem.d.ts +1 -1
- package/Timeline/index.d.ts +5 -5
- package/Timeline/index.js +21 -18
- package/Title/index.d.ts +15 -3
- package/Title/index.js +95 -29
- package/ToggleButton/ToggleButtonGroup.d.ts +1 -0
- package/ToggleButton/index.d.ts +4 -0
- package/ToggleButton/index.js +14 -52
- package/Tooltip/index.js +28 -34
- package/Tooltip/interface.d.ts +4 -10
- package/Tooltip/utils.d.ts +1 -3
- package/Transfer/index.d.ts +3 -3
- package/Transfer/index.js +72 -68
- package/Tree/Tree.d.ts +2 -2
- package/Tree/index.js +10 -9
- package/Tree/utils/treeUtil.d.ts +0 -7
- package/Upload/index.js +16 -14
- package/_verture/{constant-66aa48a1.js → constant-0d9802f7.js} +1 -1
- package/_verture/{defineProperty-62acccfc.js → defineProperty-1d116156.js} +1 -1
- package/_verture/index-5c77417d.js +150 -0
- package/_verture/index-68db2bc3.js +10530 -0
- package/_verture/{index-9738004e.js → index-7ec72724.js} +44 -38
- package/_verture/index-d63bd287.js +327 -0
- package/_verture/{index-fa8a0124.js → index-e6f85fd5.js} +7 -8
- package/_verture/{index-77f9e0fb.js → index-e9007d6a.js} +6 -6
- package/_verture/{intl-4a9f1b44.js → intl-5c1ec055.js} +1 -1
- package/_verture/{modalContext-20780c9a.js → modalContext-c12ca3e8.js} +3 -3
- package/_verture/slicedToArray-a8206399.js +43 -0
- package/_verture/{toConsumableArray-81040c9e.js → toConsumableArray-8f4c9589.js} +1 -1
- package/_verture/typeof-adeedc13.js +11 -0
- package/_verture/typeof-b240b062.js +16 -0
- package/_verture/{utils-c9b9a157.js → utils-f0e81540.js} +8 -8
- package/index.d.ts +2 -2
- package/index.js +32 -27
- package/locale/en-US.d.ts +10 -6
- package/locale/index.d.ts +20 -12
- package/locale/index.js +33 -25
- package/locale/zh-CN.d.ts +10 -6
- package/package.json +25 -11
- package/umd/AutoBox.js +20 -21
- package/umd/AutoTips.js +31 -4
- package/umd/Breadcrumbs.js +7 -7
- package/umd/Button.js +7 -8
- package/umd/ButtonGroup.js +7 -8
- package/umd/Carousel.js +29 -1
- package/umd/Cascader.js +20 -21
- package/umd/Checkbox.js +7 -7
- package/umd/CheckboxGroup.js +7 -7
- package/umd/Collapse.js +19 -21
- package/umd/CollapseBox.js +1 -1
- package/umd/CollapseLayout.js +4 -4
- package/umd/ColorPicker.js +1 -1
- package/umd/ComboSelect.js +7 -7
- package/umd/Container.js +1 -1
- package/umd/CopyText.js +42 -0
- package/umd/DatePicker.js +7 -7
- package/umd/Desktop.js +7 -7
- package/umd/DragVerify.js +4 -4
- package/umd/Drawer.js +7 -8
- package/umd/Dropdown.js +3 -3
- package/umd/DynamicMultiBox.js +7 -7
- package/umd/Empty.js +1 -1
- package/umd/Form.js +6 -6
- package/umd/FormItem.js +6 -6
- package/umd/FunctionModal.js +7 -7
- package/umd/Help.js +7 -7
- package/umd/HelperText.js +1 -1
- package/umd/InputLang.js +7 -7
- package/umd/InputNumber.js +7 -7
- package/umd/Label.js +7 -7
- package/umd/Loading.js +4 -5
- package/umd/Menu.js +4 -4
- package/umd/Message.js +3 -4
- package/umd/Modal.js +7 -7
- package/umd/MultiBox.js +7 -7
- package/umd/Notification.js +5 -6
- package/umd/OperateBtn.js +7 -7
- package/umd/PageHeader.js +7 -7
- package/umd/Pagination.js +7 -7
- package/umd/ParauiProvider.js +1 -1
- package/umd/PasswordRules.js +3 -4
- package/umd/PopConfirm.js +7 -7
- package/umd/Popover.js +31 -4
- package/umd/Progress.js +4 -5
- package/umd/Querying.js +1 -1
- package/umd/Radio.js +7 -7
- package/umd/RadioGroup.js +7 -7
- package/umd/Search.js +7 -7
- package/umd/Select.js +7 -7
- package/umd/SelectInput.js +7 -7
- package/umd/Selector.js +7 -7
- package/umd/SelectorPicker.js +7 -7
- package/umd/SingleBox.js +7 -7
- package/umd/Slider.js +3 -3
- package/umd/Status.js +29 -1
- package/umd/Stepper.js +20 -20
- package/umd/Switch.js +7 -7
- package/umd/Table.js +7 -7
- package/umd/Tabs.js +7 -7
- package/umd/Tag.js +7 -8
- package/umd/TextEditor.js +19 -19
- package/umd/TextField.js +7 -7
- package/umd/TimePicker.js +7 -7
- package/umd/Timeline.js +1 -1
- package/umd/Title.js +42 -1
- package/umd/ToggleButton.js +7 -8
- package/umd/Tooltip.js +31 -4
- package/umd/Transfer.js +8 -8
- package/umd/Tree.js +7 -7
- package/umd/Upload.js +8 -8
- package/umd/locale.js +1 -1
- package/Cascader/lang/en_US.d.ts +0 -4
- package/Cascader/lang/index.d.ts +0 -9
- package/Cascader/lang/zh_CN.d.ts +0 -4
- package/Split/index.d.ts +0 -7
- package/Split/index.js +0 -123
- package/_verture/index-a369ca3f.js +0 -4
- package/_verture/index-beef914f.js +0 -340
- package/_verture/slicedToArray-76060636.js +0 -43
- package/_verture/typeof-498dd2b1.js +0 -11
- package/umd/Split.js +0 -1
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import type { BuildInPlacements } from "@rc-component/trigger/lib/interface";
|
|
2
|
+
import type { BaseSelectPropsWithoutPrivate, BaseSelectRef } from "rc-select";
|
|
3
|
+
import type { Placement } from "rc-select/lib/BaseSelect";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { SHOW_CHILD, SHOW_PARENT } from "./utils/commonUtil";
|
|
6
|
+
import { TooltipProps } from "../../src/Tooltip";
|
|
7
|
+
export interface ShowSearchType<OptionType extends BaseOptionType = DefaultOptionType> {
|
|
8
|
+
filter?: (inputValue: string, options: OptionType[], fieldNames: FieldNames) => boolean;
|
|
9
|
+
render?: (inputValue: string, path: OptionType[], prefixCls: string, fieldNames: FieldNames) => React.ReactNode;
|
|
10
|
+
sort?: (a: OptionType[], b: OptionType[], inputValue: string, fieldNames: FieldNames) => number;
|
|
11
|
+
matchInputWidth?: boolean;
|
|
12
|
+
limit?: number | false;
|
|
13
|
+
}
|
|
14
|
+
export interface FieldNames {
|
|
15
|
+
label?: string;
|
|
16
|
+
value?: string;
|
|
17
|
+
children?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface InternalFieldNames extends Required<FieldNames> {
|
|
20
|
+
key: string;
|
|
21
|
+
}
|
|
22
|
+
export type SingleValueType = (string | number)[];
|
|
23
|
+
export type ValueType = SingleValueType | SingleValueType[];
|
|
24
|
+
export type ShowCheckedStrategy = typeof SHOW_PARENT | typeof SHOW_CHILD;
|
|
25
|
+
export interface BaseOptionType {
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
[name: string]: any;
|
|
28
|
+
}
|
|
29
|
+
export interface DefaultOptionType extends BaseOptionType {
|
|
30
|
+
label: React.ReactNode;
|
|
31
|
+
value?: string | number | null;
|
|
32
|
+
children?: DefaultOptionType[];
|
|
33
|
+
disableCheckbox?: boolean;
|
|
34
|
+
disableTitle?: string;
|
|
35
|
+
}
|
|
36
|
+
interface BaseCascaderProps<OptionType extends BaseOptionType = DefaultOptionType> extends Omit<BaseSelectPropsWithoutPrivate, "tokenSeparators" | "labelInValue" | "mode" | "showSearch"> {
|
|
37
|
+
id?: string;
|
|
38
|
+
prefixCls?: string;
|
|
39
|
+
fieldNames?: FieldNames;
|
|
40
|
+
children?: any;
|
|
41
|
+
value?: ValueType;
|
|
42
|
+
defaultValue?: ValueType;
|
|
43
|
+
changeOnSelect?: boolean;
|
|
44
|
+
displayRender?: (label: string[], selectedOptions?: OptionType[]) => React.ReactNode;
|
|
45
|
+
checkable?: boolean | React.ReactNode;
|
|
46
|
+
showCheckedStrategy?: ShowCheckedStrategy;
|
|
47
|
+
expandTrigger?: "hover" | "click";
|
|
48
|
+
options?: OptionType[];
|
|
49
|
+
optionsTitle?: Array<string | null>;
|
|
50
|
+
/** @private Internal usage. Do not use in your production. */
|
|
51
|
+
dropdownPrefixCls?: string;
|
|
52
|
+
loadData?: (selectOptions: OptionType[]) => void;
|
|
53
|
+
/** @deprecated Use `open` instead */
|
|
54
|
+
popupVisible?: boolean;
|
|
55
|
+
/** @deprecated Use `dropdownClassName` instead */
|
|
56
|
+
popupClassName?: string;
|
|
57
|
+
dropdownClassName?: string;
|
|
58
|
+
dropdownMenuColumnStyle?: React.CSSProperties;
|
|
59
|
+
/** @deprecated Use `placement` instead */
|
|
60
|
+
popupPlacement?: Placement;
|
|
61
|
+
placement?: Placement;
|
|
62
|
+
builtinPlacements?: BuildInPlacements;
|
|
63
|
+
/** @deprecated Use `onDropdownVisibleChange` instead */
|
|
64
|
+
onPopupVisibleChange?: (open: boolean) => void;
|
|
65
|
+
onDropdownVisibleChange?: (open: boolean) => void;
|
|
66
|
+
expandIcon?: React.ReactNode;
|
|
67
|
+
loadingIcon?: React.ReactNode;
|
|
68
|
+
placeholder?: string;
|
|
69
|
+
allClear?: boolean;
|
|
70
|
+
menuMaxHight?: number;
|
|
71
|
+
expandJoin?: string;
|
|
72
|
+
/**
|
|
73
|
+
* 禁用提示
|
|
74
|
+
*/
|
|
75
|
+
disabledTooltip?: TooltipProps;
|
|
76
|
+
}
|
|
77
|
+
type OnSingleChange<OptionType> = (value: SingleValueType, selectOptions: OptionType[]) => void;
|
|
78
|
+
type OnMultipleChange<OptionType> = (value: SingleValueType[], selectOptions: OptionType[][]) => void;
|
|
79
|
+
export interface SingleCascaderProps<OptionType extends BaseOptionType = DefaultOptionType> extends BaseCascaderProps<OptionType> {
|
|
80
|
+
checkable?: false;
|
|
81
|
+
onChange?: OnSingleChange<OptionType>;
|
|
82
|
+
}
|
|
83
|
+
export interface MultipleCascaderProps<OptionType extends BaseOptionType = DefaultOptionType> extends BaseCascaderProps<OptionType> {
|
|
84
|
+
checkable: true | React.ReactNode;
|
|
85
|
+
onChange?: OnMultipleChange<OptionType>;
|
|
86
|
+
}
|
|
87
|
+
export type CascaderProps<OptionType extends BaseOptionType = DefaultOptionType> = SingleCascaderProps<OptionType> | MultipleCascaderProps<OptionType>;
|
|
88
|
+
export type InternalCascaderProps<OptionType extends BaseOptionType = DefaultOptionType> = Omit<SingleCascaderProps<OptionType> | MultipleCascaderProps<OptionType>, "onChange"> & {
|
|
89
|
+
onChange?: (value: SingleValueType | SingleValueType[], selectOptions: OptionType[] | OptionType[][]) => void;
|
|
90
|
+
};
|
|
91
|
+
export type CascaderRef = Omit<BaseSelectRef, "scrollTo">;
|
|
92
|
+
declare const Cascader: (<OptionType extends BaseOptionType | DefaultOptionType = DefaultOptionType>(props: React.PropsWithChildren<CascaderProps<OptionType>> & {
|
|
93
|
+
ref?: React.Ref<BaseSelectRef> | undefined;
|
|
94
|
+
}) => React.ReactElement) & {
|
|
95
|
+
displayName?: string | undefined;
|
|
96
|
+
SHOW_PARENT: typeof SHOW_PARENT;
|
|
97
|
+
SHOW_CHILD: typeof SHOW_CHILD;
|
|
98
|
+
};
|
|
99
|
+
export default Cascader;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface CacheContentProps {
|
|
3
|
+
children?: React.ReactNode;
|
|
4
|
+
open?: boolean;
|
|
5
|
+
}
|
|
6
|
+
declare const CacheContent: React.MemoExoticComponent<({ children }: CacheContentProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>>;
|
|
7
|
+
export default CacheContent;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { DefaultOptionType, SingleValueType } from "../Cascader";
|
|
3
|
+
export declare const FIX_LABEL = "__cascader_fix_label__";
|
|
4
|
+
export interface ColumnProps {
|
|
5
|
+
prefixCls: string;
|
|
6
|
+
multiple?: boolean;
|
|
7
|
+
options: DefaultOptionType[];
|
|
8
|
+
/** Current Column opened item key */
|
|
9
|
+
activeValue?: React.Key;
|
|
10
|
+
/** The value path before current column */
|
|
11
|
+
prevValuePath: React.Key[];
|
|
12
|
+
onToggleOpen: (open: boolean) => void;
|
|
13
|
+
onSelect: (valuePath: SingleValueType, leaf: boolean) => void;
|
|
14
|
+
onActive: (valuePath: SingleValueType) => void;
|
|
15
|
+
checkedSet: Set<React.Key>;
|
|
16
|
+
loadingKeys: React.Key[];
|
|
17
|
+
isSelectable: (option: DefaultOptionType) => boolean;
|
|
18
|
+
searchValue?: string;
|
|
19
|
+
titleIndex?: number;
|
|
20
|
+
}
|
|
21
|
+
export default function Column({ prefixCls, options, multiple, activeValue, prevValuePath, titleIndex, onToggleOpen, onSelect, onActive, checkedSet, loadingKeys, isSelectable, searchValue, }: ColumnProps): JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { CascaderProps, InternalFieldNames, DefaultOptionType, SingleValueType } from './Cascader';
|
|
3
|
+
export interface CascaderContextProps {
|
|
4
|
+
options: CascaderProps['options'];
|
|
5
|
+
optionsTitle: Array<string | null>;
|
|
6
|
+
fieldNames: InternalFieldNames;
|
|
7
|
+
values: SingleValueType[];
|
|
8
|
+
halfValues: SingleValueType[];
|
|
9
|
+
changeOnSelect?: boolean;
|
|
10
|
+
onSelect: (valuePath: SingleValueType) => void;
|
|
11
|
+
checkable?: boolean | React.ReactNode;
|
|
12
|
+
dropdownPrefixCls?: string;
|
|
13
|
+
loadData?: (selectOptions: DefaultOptionType[]) => void;
|
|
14
|
+
expandTrigger?: 'hover' | 'click';
|
|
15
|
+
expandIcon?: React.ReactNode;
|
|
16
|
+
loadingIcon?: React.ReactNode;
|
|
17
|
+
loading?: boolean;
|
|
18
|
+
dropdownMenuColumnStyle?: React.CSSProperties;
|
|
19
|
+
menuWidth?: string | number;
|
|
20
|
+
menuMaxHight?: number;
|
|
21
|
+
}
|
|
22
|
+
declare const CascaderContext: React.Context<CascaderContextProps>;
|
|
23
|
+
export default CascaderContext;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { DefaultOptionType, SingleValueType, CascaderProps, InternalFieldNames } from '../Cascader';
|
|
3
|
+
declare const _default: (rawValues: SingleValueType[], options: DefaultOptionType[], fieldNames: InternalFieldNames, multiple: boolean, displayRender: CascaderProps['displayRender']) => {
|
|
4
|
+
label: React.ReactNode;
|
|
5
|
+
value: string;
|
|
6
|
+
key: string;
|
|
7
|
+
valueCells: SingleValueType;
|
|
8
|
+
disabled: boolean | undefined;
|
|
9
|
+
}[];
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { DefaultOptionType, InternalFieldNames } from '../Cascader';
|
|
2
|
+
import type { DataEntity } from 'rc-tree/lib/interface';
|
|
3
|
+
export interface OptionsInfo {
|
|
4
|
+
keyEntities: Record<string, DataEntity>;
|
|
5
|
+
pathKeyEntities: Record<string, DataEntity>;
|
|
6
|
+
}
|
|
7
|
+
export type GetEntities = () => OptionsInfo['pathKeyEntities'];
|
|
8
|
+
/** Lazy parse options data into conduct-able info to avoid perf issue in single mode */
|
|
9
|
+
declare const _default: (options: DefaultOptionType[], fieldNames: InternalFieldNames) => GetEntities;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { SingleValueType, DefaultOptionType, InternalFieldNames } from '../Cascader';
|
|
2
|
+
declare const _default: (options: DefaultOptionType[], fieldNames: InternalFieldNames) => (rawValues: SingleValueType[]) => [SingleValueType[], SingleValueType[]];
|
|
3
|
+
export default _default;
|
package/Cascader/index.d.ts
CHANGED
|
@@ -1,59 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
* @description: 级联选择器
|
|
5
|
-
* @param value{ string }: 选中的值
|
|
6
|
-
* @param label: { string }: 选项
|
|
7
|
-
* @param disabled: { Boolean }: 是否禁用
|
|
8
|
-
* @param children: { Array }: 子选项
|
|
9
|
-
* @param loading: { Boolean }: 是否加载中
|
|
10
|
-
* @param isLeaf: { Boolean }: 是否叶子节点
|
|
11
|
-
*/
|
|
12
|
-
interface Option {
|
|
13
|
-
label: string;
|
|
14
|
-
value: string;
|
|
15
|
-
disabled?: boolean;
|
|
16
|
-
children?: Option[];
|
|
17
|
-
loading?: boolean;
|
|
18
|
-
isLeaf?: boolean;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* @param data{ Array }: 数据源
|
|
22
|
-
* @param value{array}: 选中的值
|
|
23
|
-
* @param onChange{ Function }: 选中的值改变时的回调
|
|
24
|
-
* @param onDropdownVisibleChange{ Function }: 弹出层显示状态改变时的回调
|
|
25
|
-
* @param changeOnSelect{ Boolean }: 是否在选中时发生改变
|
|
26
|
-
* @param expandTrigger{ String }: 展开时触发的方式
|
|
27
|
-
* @param expandIcon{ React.ReactNode }: 展开图标
|
|
28
|
-
* @param loadingIcon{ React.ReactNode }: 加载图标
|
|
29
|
-
* @param expandJoin{ String }: 展开时的连接符
|
|
30
|
-
* @param fieldNames{ Object }: 字段名称
|
|
31
|
-
* @param disabled{ Boolean }: 是否禁用
|
|
32
|
-
* @param placeholder{ String }: 占位符
|
|
33
|
-
* @param loadData{ Function }: 加载数据的方法
|
|
34
|
-
* @param children{ React.ReactNode }: 子节点
|
|
35
|
-
*/
|
|
36
|
-
interface Props {
|
|
37
|
-
data: Option[];
|
|
38
|
-
expandTrigger?: "click" | "hover";
|
|
39
|
-
value?: string[];
|
|
40
|
-
onChange?: (value: string[], selectedOptions: Option[]) => void;
|
|
41
|
-
onDropdownVisibleChange?: (visible: boolean) => void;
|
|
42
|
-
changeOnSelect?: boolean;
|
|
43
|
-
expandIcon?: React.ReactNode;
|
|
44
|
-
expandJoin?: string;
|
|
45
|
-
fieldNames?: object;
|
|
46
|
-
disabled?: boolean;
|
|
47
|
-
placeholder?: string;
|
|
48
|
-
size?: "small" | "medium" | "large";
|
|
49
|
-
loadData?: (selectedOptions: Option[], setState?: React.Dispatch<React.SetStateAction<Option[]>>) => void;
|
|
50
|
-
loadingIcon?: React.ReactNode;
|
|
51
|
-
children?: React.ReactNode;
|
|
52
|
-
className?: string;
|
|
53
|
-
dropdownClassName?: string;
|
|
54
|
-
}
|
|
55
|
-
export interface CascaderRefProps {
|
|
56
|
-
clearValue: () => void;
|
|
57
|
-
}
|
|
58
|
-
export declare const Cascader: React.ForwardRefExoticComponent<Props & React.RefAttributes<unknown>>;
|
|
1
|
+
import Cascader from './Cascader';
|
|
2
|
+
import './index.scss';
|
|
3
|
+
export type { CascaderProps, FieldNames, ShowSearchType, DefaultOptionType, BaseOptionType, SingleCascaderProps, MultipleCascaderProps, } from './Cascader';
|
|
59
4
|
export default Cascader;
|
package/Cascader/index.js
CHANGED
|
@@ -1,178 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { forwardRef, useState, useCallback, useImperativeHandle } from 'react';
|
|
7
|
-
import RcCascader from 'rc-cascader';
|
|
8
|
-
import Right from '@para-ui/icons/Right';
|
|
9
|
-
import LoadingIcon from '@para-ui/icons/Loading';
|
|
10
|
-
import { u as useFormatMessage } from '../_verture/useFormatMessage-703f8b20.js';
|
|
11
|
-
import { a as $rcPrefixCls, $ as $prefixCls } from '../_verture/constant-66aa48a1.js';
|
|
12
|
-
import clsx from 'clsx';
|
|
13
|
-
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
1
|
+
import { C as Cascader } from '../_verture/index-68db2bc3.js';
|
|
2
|
+
export { C as default } from '../_verture/index-68db2bc3.js';
|
|
3
|
+
import '../_verture/defineProperty-1d116156.js';
|
|
4
|
+
import '../_verture/typeof-adeedc13.js';
|
|
5
|
+
import '../_verture/toConsumableArray-8f4c9589.js';
|
|
14
6
|
import '../_verture/unsupportedIterableToArray-cb478f24.js';
|
|
15
|
-
import '
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
value = _props$value === void 0 ? [] : _props$value,
|
|
39
|
-
onChange = props.onChange,
|
|
40
|
-
onDropdownVisibleChange = props.onDropdownVisibleChange,
|
|
41
|
-
_props$changeOnSelect = props.changeOnSelect,
|
|
42
|
-
changeOnSelect = _props$changeOnSelect === void 0 ? false : _props$changeOnSelect,
|
|
43
|
-
_props$expandIcon = props.expandIcon,
|
|
44
|
-
expandIcon = _props$expandIcon === void 0 ? jsx(Right, {}) : _props$expandIcon,
|
|
45
|
-
_props$expandJoin = props.expandJoin,
|
|
46
|
-
expandJoin = _props$expandJoin === void 0 ? " , " : _props$expandJoin,
|
|
47
|
-
_props$fieldNames = props.fieldNames,
|
|
48
|
-
fieldNames = _props$fieldNames === void 0 ? {
|
|
49
|
-
label: "label",
|
|
50
|
-
value: "value",
|
|
51
|
-
children: "children"
|
|
52
|
-
} : _props$fieldNames,
|
|
53
|
-
_props$disabled = props.disabled,
|
|
54
|
-
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
55
|
-
placeholder = props.placeholder,
|
|
56
|
-
_props$loadData = props.loadData,
|
|
57
|
-
loadData = _props$loadData === void 0 ? function () {
|
|
58
|
-
return __awaiter(void 0, void 0, void 0, /*#__PURE__*/regenerator.mark(function _callee() {
|
|
59
|
-
return regenerator.wrap(function _callee$(_context) {
|
|
60
|
-
while (1) switch (_context.prev = _context.next) {
|
|
61
|
-
case 0:
|
|
62
|
-
case "end":
|
|
63
|
-
return _context.stop();
|
|
64
|
-
}
|
|
65
|
-
}, _callee);
|
|
66
|
-
}));
|
|
67
|
-
} : _props$loadData,
|
|
68
|
-
_props$loadingIcon = props.loadingIcon,
|
|
69
|
-
loadingIcon = _props$loadingIcon === void 0 ? jsx(LoadingIcon, {}) : _props$loadingIcon,
|
|
70
|
-
children = props.children,
|
|
71
|
-
dropdownClassName = props.dropdownClassName,
|
|
72
|
-
className = props.className;
|
|
73
|
-
var intl = useFormatMessage("Cascader", localeJson);
|
|
74
|
-
var _useState = useState(data),
|
|
75
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
76
|
-
option = _useState2[0],
|
|
77
|
-
setOption = _useState2[1];
|
|
78
|
-
var _useState3 = useState(value),
|
|
79
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
80
|
-
inputValue = _useState4[0],
|
|
81
|
-
setValue = _useState4[1];
|
|
82
|
-
var _useState5 = useState(valueToLabel(data, value, expandJoin)),
|
|
83
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
84
|
-
inputLabel = _useState6[0],
|
|
85
|
-
setLabel = _useState6[1];
|
|
86
|
-
var onStateChange = useCallback(function (value, selectedOptions) {
|
|
87
|
-
setValue(value);
|
|
88
|
-
setLabel(selectedOptions.map(function (o) {
|
|
89
|
-
return o.label;
|
|
90
|
-
}).join(expandJoin));
|
|
91
|
-
onChange && onChange(value, selectedOptions);
|
|
92
|
-
}, []);
|
|
93
|
-
var loadingData = function loadingData(opt) {
|
|
94
|
-
return __awaiter(void 0, void 0, void 0, /*#__PURE__*/regenerator.mark(function _callee2() {
|
|
95
|
-
return regenerator.wrap(function _callee2$(_context2) {
|
|
96
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
97
|
-
case 0:
|
|
98
|
-
_context2.next = 2;
|
|
99
|
-
return loadData(opt);
|
|
100
|
-
case 2:
|
|
101
|
-
setOption(_toConsumableArray(data));
|
|
102
|
-
case 3:
|
|
103
|
-
case "end":
|
|
104
|
-
return _context2.stop();
|
|
105
|
-
}
|
|
106
|
-
}, _callee2);
|
|
107
|
-
}));
|
|
108
|
-
};
|
|
109
|
-
var casCls = function casCls() {
|
|
110
|
-
var cls = clsx($prefixCls + "-cascader", className);
|
|
111
|
-
return cls;
|
|
112
|
-
};
|
|
113
|
-
var dropdownCls = function dropdownCls() {
|
|
114
|
-
var cls = clsx($prefixCls + "-cascader", dropdownClassName);
|
|
115
|
-
return cls;
|
|
116
|
-
};
|
|
117
|
-
useImperativeHandle(ref, function () {
|
|
118
|
-
return {
|
|
119
|
-
clearValue: function clearValue() {
|
|
120
|
-
setValue([]);
|
|
121
|
-
setLabel("");
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
});
|
|
125
|
-
return jsx("div", Object.assign({
|
|
126
|
-
className: casCls()
|
|
127
|
-
}, {
|
|
128
|
-
children: jsx(RcCascader, Object.assign({
|
|
129
|
-
options: option,
|
|
130
|
-
onChange: onStateChange,
|
|
131
|
-
changeOnSelect: changeOnSelect,
|
|
132
|
-
expandTrigger: expandTrigger,
|
|
133
|
-
expandIcon: expandIcon,
|
|
134
|
-
fieldNames: fieldNames,
|
|
135
|
-
loadData: loadingData,
|
|
136
|
-
loadingIcon: loadingIcon,
|
|
137
|
-
onDropdownVisibleChange: onDropdownVisibleChange,
|
|
138
|
-
value: inputValue,
|
|
139
|
-
prefixCls: $rcPrefixCls + "-cascader",
|
|
140
|
-
dropdownClassName: dropdownCls()
|
|
141
|
-
}, {
|
|
142
|
-
children: children ? jsx("button", Object.assign({
|
|
143
|
-
disabled: disabled
|
|
144
|
-
}, {
|
|
145
|
-
children: children
|
|
146
|
-
})) : jsx("input", {
|
|
147
|
-
value: inputLabel,
|
|
148
|
-
readOnly: true,
|
|
149
|
-
disabled: disabled,
|
|
150
|
-
placeholder: placeholder || intl({
|
|
151
|
-
id: "placeholder"
|
|
152
|
-
})
|
|
153
|
-
})
|
|
154
|
-
}))
|
|
155
|
-
}));
|
|
156
|
-
});
|
|
157
|
-
function valueToLabel(opt, value, expandJoin) {
|
|
158
|
-
var label = [];
|
|
159
|
-
var count = 0;
|
|
160
|
-
function find(data) {
|
|
161
|
-
for (var i = 0; i < data.length; i++) {
|
|
162
|
-
if (data[i].value === value[count]) {
|
|
163
|
-
if (i === data.length - 1) {
|
|
164
|
-
label.push(data[i].label);
|
|
165
|
-
} else {
|
|
166
|
-
count++;
|
|
167
|
-
label.push(data[i].label);
|
|
168
|
-
find(data[i].children);
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
return label;
|
|
173
|
-
}
|
|
174
|
-
find(opt);
|
|
175
|
-
return label.join(expandJoin);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
export { Cascader, Cascader as default };
|
|
7
|
+
import '../_verture/slicedToArray-a8206399.js';
|
|
8
|
+
import '../_verture/tslib.es6-55ed4bd2.js';
|
|
9
|
+
import 'react/jsx-runtime';
|
|
10
|
+
import 'react';
|
|
11
|
+
import 'react-dom';
|
|
12
|
+
import 'rc-motion';
|
|
13
|
+
import 'clsx';
|
|
14
|
+
import '../_verture/typeof-b240b062.js';
|
|
15
|
+
import 'rc-tree/lib/utils/conductUtil';
|
|
16
|
+
import '@para-ui/icons/Right';
|
|
17
|
+
import '@para-ui/icons/Down';
|
|
18
|
+
import '@para-ui/icons/CloseCircleF';
|
|
19
|
+
import 'rc-tree/lib/utils/treeUtil';
|
|
20
|
+
import '../Tooltip/index.js';
|
|
21
|
+
import 'rc-tooltip';
|
|
22
|
+
import 'rc-tooltip/lib/placements';
|
|
23
|
+
import '../_verture/constant-0d9802f7.js';
|
|
24
|
+
import '@para-ui/icons/Forbid';
|
|
25
|
+
import '../_verture/style-inject.es-300983ab.js';
|
|
26
|
+
import '@para-ui/icons';
|
|
27
|
+
import '@para-ui/icons/LoadingF';
|
|
28
|
+
import '../AutoTips/index.js';
|
|
29
|
+
import '@paraview/lib';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { DefaultOptionType, FieldNames, InternalFieldNames, SingleValueType } from '../Cascader';
|
|
2
|
+
export declare const VALUE_SPLIT = "__RC_CASCADER_SPLIT__";
|
|
3
|
+
export declare const SHOW_PARENT = "SHOW_PARENT";
|
|
4
|
+
export declare const SHOW_CHILD = "SHOW_CHILD";
|
|
5
|
+
export declare const SEARCH_MARK = "__rc_cascader_search_mark__";
|
|
6
|
+
/**
|
|
7
|
+
* Will convert value to string, and join with `VALUE_SPLIT`
|
|
8
|
+
*/
|
|
9
|
+
export declare function toPathKey(value: SingleValueType): string;
|
|
10
|
+
/**
|
|
11
|
+
* Batch convert value to string, and join with `VALUE_SPLIT`
|
|
12
|
+
*/
|
|
13
|
+
export declare function toPathKeys(value: SingleValueType[]): string[];
|
|
14
|
+
export declare function toPathValueStr(pathKey: string): string[];
|
|
15
|
+
export declare function fillFieldNames(fieldNames?: FieldNames): InternalFieldNames;
|
|
16
|
+
export declare function isLeaf(option: DefaultOptionType, fieldNames: FieldNames): any;
|
|
17
|
+
export declare function scrollIntoParentView(element: HTMLElement): void;
|
|
18
|
+
export declare function getFullPathKeys(options: DefaultOptionType[], fieldNames: FieldNames): any[];
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { SingleValueType, DefaultOptionType, InternalFieldNames, ShowCheckedStrategy } from '../Cascader';
|
|
3
|
+
import type { GetEntities } from '../hooks/useEntities';
|
|
4
|
+
declare type Key = string | number;
|
|
5
|
+
export declare type GetKey<RecordType> = (record: RecordType, index?: number) => Key;
|
|
6
|
+
type DataEntity = any;
|
|
7
|
+
type DataNode = any;
|
|
8
|
+
interface TraverseDataNodesConfig {
|
|
9
|
+
childrenPropName?: string;
|
|
10
|
+
externalGetKey?: ExternalGetKey;
|
|
11
|
+
fieldNames?: InternalFieldNames;
|
|
12
|
+
}
|
|
13
|
+
export interface FieldNames {
|
|
14
|
+
title?: string;
|
|
15
|
+
/** @private Internal usage for `rc-tree-select`, safe to remove if no need */
|
|
16
|
+
_title?: string[];
|
|
17
|
+
key?: string;
|
|
18
|
+
children?: string;
|
|
19
|
+
}
|
|
20
|
+
type ExternalGetKey = GetKey<DataNode> | string;
|
|
21
|
+
interface Wrapper {
|
|
22
|
+
posEntities: Record<string, DataEntity>;
|
|
23
|
+
keyEntities: Record<Key, DataEntity>;
|
|
24
|
+
}
|
|
25
|
+
export declare function formatStrategyValues(pathKeys: React.Key[], getKeyPathEntities: GetEntities, showCheckedStrategy: ShowCheckedStrategy): import("react").Key[];
|
|
26
|
+
export declare function toPathOptions(valueCells: SingleValueType, options: DefaultOptionType[], fieldNames: InternalFieldNames, stringMode?: boolean): {
|
|
27
|
+
value: SingleValueType[number];
|
|
28
|
+
index: number;
|
|
29
|
+
option: DefaultOptionType;
|
|
30
|
+
}[];
|
|
31
|
+
export declare function convertDataToEntities(dataNodes: DataNode[], { initWrapper, processEntity, onProcessFinished, externalGetKey, childrenPropName, fieldNames, }?: {
|
|
32
|
+
initWrapper?: (wrapper: any) => Wrapper;
|
|
33
|
+
processEntity?: (entity: DataEntity, wrapper: Wrapper) => void;
|
|
34
|
+
onProcessFinished?: (wrapper: Wrapper) => void;
|
|
35
|
+
externalGetKey?: ExternalGetKey;
|
|
36
|
+
childrenPropName?: string;
|
|
37
|
+
fieldNames?: InternalFieldNames;
|
|
38
|
+
},
|
|
39
|
+
/** @deprecated Use `config.externalGetKey` instead */
|
|
40
|
+
legacyExternalGetKey?: ExternalGetKey): {
|
|
41
|
+
posEntities: any;
|
|
42
|
+
keyEntities: any;
|
|
43
|
+
};
|
|
44
|
+
export declare function traverseDataNodes(dataNodes: DataNode[], callback: (data: {
|
|
45
|
+
node: DataNode;
|
|
46
|
+
index: number;
|
|
47
|
+
pos: string;
|
|
48
|
+
key: Key;
|
|
49
|
+
parentPos: string | number;
|
|
50
|
+
level: number;
|
|
51
|
+
nodes: DataNode[];
|
|
52
|
+
}) => void, config?: TraverseDataNodesConfig | string): void;
|
|
53
|
+
export declare function getPosition(level: string | number, index: number): string;
|
|
54
|
+
export declare function fillFieldNames(fieldNames?: FieldNames): Required<FieldNames>;
|
|
55
|
+
export {};
|
package/Checkbox/index.d.ts
CHANGED
|
@@ -5,12 +5,15 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import React, { FunctionComponent, ReactNode } from 'react';
|
|
7
7
|
import { LabelTooltipProps } from '../Label';
|
|
8
|
+
import { TooltipProps } from "../Tooltip";
|
|
8
9
|
import './index.scss';
|
|
9
10
|
export interface CheckboxProps {
|
|
10
11
|
/** 样式class */
|
|
11
12
|
className?: string;
|
|
12
13
|
/** style */
|
|
13
14
|
style?: React.CSSProperties;
|
|
15
|
+
/** 宽度 */
|
|
16
|
+
width?: string;
|
|
14
17
|
/** 标题 */
|
|
15
18
|
label?: ReactNode;
|
|
16
19
|
/** 帮组提示信息 */
|
|
@@ -23,6 +26,10 @@ export interface CheckboxProps {
|
|
|
23
26
|
checked?: boolean;
|
|
24
27
|
/** 禁用 */
|
|
25
28
|
disabled?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* 禁用提示
|
|
31
|
+
*/
|
|
32
|
+
disabledTooltip?: TooltipProps;
|
|
26
33
|
/** 半选 */
|
|
27
34
|
indeterminate?: boolean;
|
|
28
35
|
/** inputProps */
|