gz-ui-web 1.1.2 → 1.1.4
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/gz-ui-web-lib/{ValuationLogDataChart-DHFwTGcA.cjs → ValuationLogDataChart-Bg1yp4wQ.cjs} +3 -3
- package/gz-ui-web-lib/{ValuationLogDataChart-DiLHOY5m.js → ValuationLogDataChart-Cs_1Jx8P.js} +731 -747
- package/gz-ui-web-lib/business-components/filter-bar/FilterBar.d.ts +22 -0
- package/gz-ui-web-lib/business-components/filter-bar/components/FilterField.d.ts +15 -0
- package/gz-ui-web-lib/business-components/filter-bar/hooks/useRemoteOptions.d.ts +16 -0
- package/gz-ui-web-lib/business-components/filter-bar/index.d.ts +6 -0
- package/gz-ui-web-lib/business-components/filter-bar/theme.d.ts +6 -0
- package/gz-ui-web-lib/business-components/filter-bar/types.d.ts +284 -0
- package/gz-ui-web-lib/business-components/filter-bar/utils.d.ts +5 -0
- package/gz-ui-web-lib/business-components/filter-bar/validator.d.ts +11 -0
- package/gz-ui-web-lib/business-components/pcs/index.cjs +1 -1
- package/gz-ui-web-lib/business-components/pcs/index.js +1 -1
- package/gz-ui-web-lib/gz-ui-web.css +1 -1
- package/gz-ui-web-lib/index.cjs +3 -3
- package/gz-ui-web-lib/index.d.ts +3 -0
- package/gz-ui-web-lib/index.js +2336 -1509
- package/package.json +4 -5
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { FilterBarProps, FilterBarRef, FilterBarResetButtonProps, FilterBarSearchButtonProps, FilterBarToggleButtonProps } from './types';
|
|
3
|
+
export declare const ActionButton: import('react').ForwardRefExoticComponent<import('../..').ButtonProps & import('react').RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
|
|
4
|
+
export declare function SearchButton({ // 「查询」按钮工厂:主色调实心按钮
|
|
5
|
+
text, // 按钮文案,默认「查询」
|
|
6
|
+
loading, // 加载中状态:显示转圈并防重复提交
|
|
7
|
+
disabled, // 禁用状态
|
|
8
|
+
onClick, // 点击回调
|
|
9
|
+
className, }: FilterBarSearchButtonProps): ReactNode;
|
|
10
|
+
export declare function ResetButton({ // 「重置」按钮工厂:默认样式按钮
|
|
11
|
+
text, // 按钮文案,默认「重置」
|
|
12
|
+
disabled, // 禁用状态
|
|
13
|
+
onClick, // 点击回调
|
|
14
|
+
className, }: FilterBarResetButtonProps): ReactNode;
|
|
15
|
+
export declare function ToggleButton({ // 「展开/收起」切换按钮工厂:文字按钮 + CSS 箭头
|
|
16
|
+
expanded, // 当前是否处于展开状态
|
|
17
|
+
expandText, // 收起状态下显示的文案(点击后展开)
|
|
18
|
+
collapseText, // 展开状态下显示的文案(点击后收起)
|
|
19
|
+
onClick, // 点击回调
|
|
20
|
+
className, }: FilterBarToggleButtonProps): ReactNode;
|
|
21
|
+
declare const _default: import('react').ForwardRefExoticComponent<FilterBarProps & import('react').RefAttributes<FilterBarRef>>;
|
|
22
|
+
export default _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { FilterBarFieldConfig, FilterBarFieldValue, FilterBarLabelPosition, FilterBarValues } from '../types';
|
|
3
|
+
interface FilterFieldProps {
|
|
4
|
+
field: FilterBarFieldConfig;
|
|
5
|
+
value: FilterBarFieldValue;
|
|
6
|
+
disabled: boolean;
|
|
7
|
+
controlWidth: number;
|
|
8
|
+
labelPosition: FilterBarLabelPosition;
|
|
9
|
+
values: FilterBarValues;
|
|
10
|
+
error?: string;
|
|
11
|
+
onChange: (name: string, value: FilterBarFieldValue) => void;
|
|
12
|
+
onPressEnter?: () => void;
|
|
13
|
+
}
|
|
14
|
+
export default function FilterField(props: FilterFieldProps): ReactNode;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FilterBarOption, FilterBarValues } from '../types';
|
|
2
|
+
export interface UseRemoteOptionsInput {
|
|
3
|
+
keyword: string;
|
|
4
|
+
values: FilterBarValues;
|
|
5
|
+
options?: readonly FilterBarOption[];
|
|
6
|
+
request?: (search: string, values: FilterBarValues) => Promise<FilterBarOption[] | readonly FilterBarOption[]>;
|
|
7
|
+
debounce?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface UseRemoteOptionsResult {
|
|
10
|
+
options?: readonly FilterBarOption[];
|
|
11
|
+
loading: boolean;
|
|
12
|
+
}
|
|
13
|
+
/** 管理 Select 的远程数据源;内部自己做 debounce + 竞态取消。
|
|
14
|
+
* 无 request 时直接透传静态 options,不走 state。
|
|
15
|
+
*/
|
|
16
|
+
export declare function useRemoteOptions({ keyword, values, options, request, debounce, }: UseRemoteOptionsInput): UseRemoteOptionsResult;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as FilterBar, ActionButton, SearchButton, ResetButton, ToggleButton } from './FilterBar';
|
|
2
|
+
export { useRemoteOptions } from './hooks/useRemoteOptions';
|
|
3
|
+
export type { UseRemoteOptionsInput, UseRemoteOptionsResult } from './hooks/useRemoteOptions';
|
|
4
|
+
export { validateFields, isEmpty } from './validator';
|
|
5
|
+
export type { ValidateFieldsOptions } from './validator';
|
|
6
|
+
export type { FilterBarCheckboxField, FilterBarCustomField, FilterBarDatePickerField, FilterBarInputField, FilterBarRadioField, FilterBarRangePickerField, FilterBarSelectField, FilterBarFieldBase, FilterBarFieldConfig, FilterBarFieldType, FilterBarFieldValue, FilterBarResetButtonProps, FilterBarSearchButtonProps, FilterBarToggleButtonProps, FilterBarValidateItem, FilterBarValidateTrigger, FilterBarValidatorRule, FilterBarCustomRenderContext, FilterBarLabelPosition, FilterBarOption, FilterBarProps, FilterBarRef, FilterBarValues, } from './types';
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { GZCheckboxProps, GZCheckboxGroupProps } from '../../components/checkbox';
|
|
3
|
+
import { GZDatePickerProps } from '../../components/date-picker';
|
|
4
|
+
import { GZRangePickerProps } from '../../components/date-picker/RangePicker';
|
|
5
|
+
import { GZInputProps } from '../../components/input';
|
|
6
|
+
import { GZRadioProps, RadioGroupProps } from '../../components/radio';
|
|
7
|
+
import { GZSelectProps } from '../../components/select';
|
|
8
|
+
/** 支持的筛选项类型。 【联合类型】*/
|
|
9
|
+
export type FilterBarFieldType = "input" | "select" | "datePicker" | "rangePicker" | "checkbox" | "radio" | "custom";
|
|
10
|
+
/** 筛选项值,日期统一以字符串保存,便于直接透传给查询接口。 */
|
|
11
|
+
export type FilterBarFieldValue = string | number | boolean | null | undefined | readonly (string | number | boolean)[];
|
|
12
|
+
/** 筛选栏表单值,key 为字段 name。 */
|
|
13
|
+
export type FilterBarValues = Record<string, FilterBarFieldValue>;
|
|
14
|
+
/** 下拉选项。 */
|
|
15
|
+
export interface FilterBarOption {
|
|
16
|
+
label: ReactNode;
|
|
17
|
+
value: string | number;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/** 组件接管、不允许通过透传属性覆盖的受控属性。 */
|
|
21
|
+
type ControlledProps = "value" | "defaultValue" | "onChange" | "placeholder" | "disabled" | "id" | "allowClear" | "options";
|
|
22
|
+
/** 校验规则,支持异步。 */
|
|
23
|
+
export interface FilterBarValidatorRule {
|
|
24
|
+
/** 触发条件:字段值为 falsy 时是否继续校验后续规则,默认 `false`(required 场景会先兜底)。 */
|
|
25
|
+
validateEmpty?: boolean;
|
|
26
|
+
/** 自定义校验器;返回 string/Promise<string> 视为错误,返回 undefined/void 视为通过。 */
|
|
27
|
+
validator?: (value: FilterBarFieldValue, values: FilterBarValues, field: FilterBarFieldBase) => string | string[] | void | Promise<string | string[] | void>;
|
|
28
|
+
/** 校验失败时的消息,在 validator 返回 void 时可由规则提供兜底。 */
|
|
29
|
+
message?: string;
|
|
30
|
+
}
|
|
31
|
+
/** 校验时机。默认仅在点击查询/按 Enter 时触发;设为 onChange 时字段值每次变化都会重新校验(同文件所有校验)。 */
|
|
32
|
+
export type FilterBarValidateTrigger = "onSearch" | "onChange";
|
|
33
|
+
export interface FilterBarFieldBase {
|
|
34
|
+
/** 字段名,对应 values 的 key,同一筛选栏内必须唯一。 */
|
|
35
|
+
name: string;
|
|
36
|
+
/** 字段标签,为空时不渲染标签。 */
|
|
37
|
+
label?: ReactNode;
|
|
38
|
+
/**
|
|
39
|
+
* 是否在收起模式下展示,默认 `true`。
|
|
40
|
+
* 设为 `false` 时字段只在展开后出现,并会自动触发展开按钮。
|
|
41
|
+
*/
|
|
42
|
+
show?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* 条件隐藏。为 boolean 时固定隐藏;为函数时根据当前 values 动态计算。
|
|
45
|
+
* 隐藏字段不渲染、不参与校验。
|
|
46
|
+
*/
|
|
47
|
+
hidden?: boolean | ((values: FilterBarValues) => boolean);
|
|
48
|
+
/** 字段级禁用,与组件级 `disabled` 取或。 */
|
|
49
|
+
disabled?: boolean;
|
|
50
|
+
/** 字段级控件宽度,默认取组件 `controlWidth`;日期范围默认 240。 */
|
|
51
|
+
controlWidth?: number;
|
|
52
|
+
/** 是否展示清除按钮,默认 `true`。 */
|
|
53
|
+
allowClear?: boolean;
|
|
54
|
+
/** 表单默认渲染必填标记。 */
|
|
55
|
+
required?: boolean | string;
|
|
56
|
+
/** 自定义校验规则,按数组顺序执行。 */
|
|
57
|
+
rules?: readonly FilterBarValidatorRule[];
|
|
58
|
+
/** 追加到筛选项容器的类名。 */
|
|
59
|
+
className?: string;
|
|
60
|
+
/** 追加到筛选项容器的样式。 */
|
|
61
|
+
style?: CSSProperties;
|
|
62
|
+
}
|
|
63
|
+
export interface FilterBarInputField extends FilterBarFieldBase {
|
|
64
|
+
type: "input";
|
|
65
|
+
placeholder?: string;
|
|
66
|
+
/** 透传给 Input 的属性,受控属性由组件接管。 */
|
|
67
|
+
inputProps?: Omit<GZInputProps, ControlledProps | "onPressEnter">;
|
|
68
|
+
}
|
|
69
|
+
export interface FilterBarSelectField extends FilterBarFieldBase {
|
|
70
|
+
type: "select";
|
|
71
|
+
placeholder?: string;
|
|
72
|
+
/** 静态下拉选项,与 `request` 互斥。 */
|
|
73
|
+
options?: readonly FilterBarOption[];
|
|
74
|
+
/**
|
|
75
|
+
* 远程数据源。返回值会覆盖当前 options;配合 `search` 入参实现可搜索。
|
|
76
|
+
* 与静态 `options` 同时提供时,优先使用远程结果;首次 mount 和关键字变化时自动请求。
|
|
77
|
+
*/
|
|
78
|
+
request?: (
|
|
79
|
+
/** 当前 Select 输入框关键字,未开启搜索时为空字符串。 */
|
|
80
|
+
search: string,
|
|
81
|
+
/** 当前筛选栏 values,便于做依赖其他字段的联动请求。 */
|
|
82
|
+
values: FilterBarValues) => Promise<FilterBarOption[] | readonly FilterBarOption[]>;
|
|
83
|
+
/** 开启远程搜索,默认 `false`;开启后 Select 内部会以关键字作为 request 的 search 参数。 */
|
|
84
|
+
remoteSearch?: boolean;
|
|
85
|
+
/** 远程搜索 debounce 毫秒数,默认 `300`。 */
|
|
86
|
+
requestDebounce?: number;
|
|
87
|
+
/** 透传给 Select 的属性,受控属性由组件接管。 */
|
|
88
|
+
selectProps?: Omit<GZSelectProps, ControlledProps>;
|
|
89
|
+
}
|
|
90
|
+
export interface FilterBarDatePickerField extends FilterBarFieldBase {
|
|
91
|
+
type: "datePicker";
|
|
92
|
+
placeholder?: string;
|
|
93
|
+
/** 日期格式,同时用于回填值与时区展示,默认 `YYYY-MM-DD`。 */
|
|
94
|
+
format?: string;
|
|
95
|
+
/** 透传给 DatePicker 的属性,受控属性由组件接管。 */
|
|
96
|
+
datePickerProps?: Omit<GZDatePickerProps, ControlledProps | "format">;
|
|
97
|
+
}
|
|
98
|
+
export interface FilterBarRangePickerField extends FilterBarFieldBase {
|
|
99
|
+
type: "rangePicker";
|
|
100
|
+
/** 起止日期占位文案。 */
|
|
101
|
+
rangePlaceholder?: [string, string];
|
|
102
|
+
/** 日期格式,同时用于回填值,默认 `YYYY-MM-DD`。 */
|
|
103
|
+
format?: string;
|
|
104
|
+
/** 透传给 RangePicker 的属性,受控属性由组件接管。 */
|
|
105
|
+
rangePickerProps?: Omit<GZRangePickerProps, ControlledProps | "format">;
|
|
106
|
+
}
|
|
107
|
+
/** Group 类组件由 FilterBar 接管的受控属性。 */
|
|
108
|
+
type GroupControlledProps = "value" | "defaultValue" | "onChange" | "options" | "disabled";
|
|
109
|
+
export interface FilterBarCheckboxField extends FilterBarFieldBase {
|
|
110
|
+
type: "checkbox";
|
|
111
|
+
/**
|
|
112
|
+
* 提供 options 时渲染 Checkbox.Group,字段值为选中项数组;
|
|
113
|
+
* 不提供时渲染单个复选框,字段值为 boolean。
|
|
114
|
+
*/
|
|
115
|
+
options?: readonly FilterBarOption[];
|
|
116
|
+
/** 单个复选框时显示在复选框右侧的文本。 */
|
|
117
|
+
text?: ReactNode;
|
|
118
|
+
/** 单个复选框透传属性,受控属性由组件接管。 */
|
|
119
|
+
checkboxProps?: Omit<GZCheckboxProps, "checked" | "onChange" | "disabled" | "id" | "children">;
|
|
120
|
+
/** Checkbox.Group 透传属性,受控属性由组件接管。 */
|
|
121
|
+
groupProps?: Omit<GZCheckboxGroupProps, GroupControlledProps>;
|
|
122
|
+
}
|
|
123
|
+
export interface FilterBarRadioField extends FilterBarFieldBase {
|
|
124
|
+
type: "radio";
|
|
125
|
+
/**
|
|
126
|
+
* 提供 options 时渲染 Radio.Group,字段值为当前选中项;
|
|
127
|
+
* 不提供时渲染单个单选框,字段值为 boolean。
|
|
128
|
+
* 可通过 `groupProps.optionType = 'button'` 切换按钮样式。
|
|
129
|
+
*/
|
|
130
|
+
options?: readonly FilterBarOption[];
|
|
131
|
+
/** 单个单选框时显示在右侧的文本。 */
|
|
132
|
+
text?: ReactNode;
|
|
133
|
+
/** 单个单选框透传属性,受控属性由组件接管。 */
|
|
134
|
+
radioProps?: Omit<GZRadioProps, "checked" | "onChange" | "disabled" | "id" | "children">;
|
|
135
|
+
/** Radio.Group 透传属性,受控属性由组件接管。 */
|
|
136
|
+
groupProps?: Omit<RadioGroupProps, GroupControlledProps>;
|
|
137
|
+
}
|
|
138
|
+
export interface FilterBarCustomRenderContext {
|
|
139
|
+
field: FilterBarCustomField;
|
|
140
|
+
value: FilterBarFieldValue;
|
|
141
|
+
/** 更新当前字段值,会触发 onChange / onValuesChange。 */
|
|
142
|
+
setValue: (value: FilterBarFieldValue) => void;
|
|
143
|
+
/** 当前校验错误(如存在)。用于自定义控件自行展示错误文案。 */
|
|
144
|
+
error?: string;
|
|
145
|
+
disabled: boolean;
|
|
146
|
+
}
|
|
147
|
+
export interface FilterBarCustomField extends FilterBarFieldBase {
|
|
148
|
+
type: "custom";
|
|
149
|
+
/**
|
|
150
|
+
* 自定义渲染控件内容;标签、控件宽度、错误提示等外框与其他字段保持一致。
|
|
151
|
+
* 需要固定宽度时可通过 `controlWidth` 覆盖。
|
|
152
|
+
*/
|
|
153
|
+
render: (context: FilterBarCustomRenderContext) => ReactNode;
|
|
154
|
+
}
|
|
155
|
+
export type FilterBarFieldConfig = FilterBarInputField | FilterBarSelectField | FilterBarDatePickerField | FilterBarRangePickerField | FilterBarCheckboxField | FilterBarRadioField | FilterBarCustomField;
|
|
156
|
+
export type FilterBarLabelPosition = "top" | "inline";
|
|
157
|
+
/** 校验结果。 */
|
|
158
|
+
export interface FilterBarValidateItem {
|
|
159
|
+
name: string;
|
|
160
|
+
message: string;
|
|
161
|
+
}
|
|
162
|
+
export interface FilterBarProps {
|
|
163
|
+
/** 配置数组,按数组顺序渲染。 */
|
|
164
|
+
fields: readonly FilterBarFieldConfig[];
|
|
165
|
+
/** 受控值;传入后组件进入受控模式。 */
|
|
166
|
+
value?: FilterBarValues;
|
|
167
|
+
/** 非受控模式下的初始值。 */
|
|
168
|
+
defaultValue?: FilterBarValues;
|
|
169
|
+
/** 任意字段变化后回调,重置也会触发。 */
|
|
170
|
+
onChange?: (values: FilterBarValues) => void;
|
|
171
|
+
/** 单字段变化回调,便于做级联联动。 */
|
|
172
|
+
onValuesChange?: (name: string, value: FilterBarFieldValue, values: FilterBarValues) => void;
|
|
173
|
+
/** 点击查询或按 Enter 时回调。只有校验通过时才会触发。 */
|
|
174
|
+
onSearch?: (values: FilterBarValues) => void;
|
|
175
|
+
/** 点击重置时回调,参数为重置后的值。 */
|
|
176
|
+
onReset?: (values: FilterBarValues) => void;
|
|
177
|
+
/** 校验触发时机,默认 `onSearch`。 */
|
|
178
|
+
validateTrigger?: FilterBarValidateTrigger;
|
|
179
|
+
/** 校验通过/失败时回调。 */
|
|
180
|
+
onValidate?: (errors: FilterBarValidateItem[]) => void;
|
|
181
|
+
/** 查询按钮 loading 态。 */
|
|
182
|
+
loading?: boolean;
|
|
183
|
+
/** 整体禁用。 */
|
|
184
|
+
disabled?: boolean;
|
|
185
|
+
/** 查询按钮文案。 */
|
|
186
|
+
searchText?: ReactNode;
|
|
187
|
+
/** 重置按钮文案。 */
|
|
188
|
+
resetText?: ReactNode;
|
|
189
|
+
/** 展开按钮文案。 */
|
|
190
|
+
expandText?: ReactNode;
|
|
191
|
+
/** 收起按钮文案。 */
|
|
192
|
+
collapseText?: ReactNode;
|
|
193
|
+
/**
|
|
194
|
+
* 在默认的「展开 / 重置 / 查询」之后追加用户自定义按钮。
|
|
195
|
+
* 这些按钮完全由用户控制(onClick、loading 等都自行处理)。
|
|
196
|
+
* 传入后会在重置与查询之间插入一个下拉按钮(hover 触发),
|
|
197
|
+
* 所有 extra 按钮收进下拉菜单里。
|
|
198
|
+
*/
|
|
199
|
+
extraButtons?: ReactNode[];
|
|
200
|
+
/**
|
|
201
|
+
* 追加按钮区域的展示模式:
|
|
202
|
+
* - `"more"`(默认)→ 渲染「更多」下拉按钮,hover 展开,`extraButtons` 全部收进下拉菜单
|
|
203
|
+
* - `"single"` → 只渲染 `extraButtons[0]` 这一个按钮(文案、onClick 由用户元素自带),不走下拉
|
|
204
|
+
*/
|
|
205
|
+
extraButtonTrigger?: "more" | "single";
|
|
206
|
+
/**
|
|
207
|
+
* 完全替换右侧按钮区。传入后默认的「展开 / 重置 / 查询」都不会出现,
|
|
208
|
+
* 适合需要彻底定制按钮组合的场景。
|
|
209
|
+
* 可使用 FilterBar.SearchButton / ResetButton / ToggleButton 作为元素。
|
|
210
|
+
* 同时会把展开状态默认为 `true`(默认的展开/收起按钮已被替换,避免字段被收起无法展开)。
|
|
211
|
+
*/
|
|
212
|
+
customButtons?: ReactNode[];
|
|
213
|
+
/**
|
|
214
|
+
* 自定义按钮组合(已废弃,等价于 customButtons)。
|
|
215
|
+
* @deprecated 请使用 customButtons 或 extraButtons。
|
|
216
|
+
*/
|
|
217
|
+
buttons?: ReactNode[];
|
|
218
|
+
/**
|
|
219
|
+
* 右侧按钮区域的最大宽度,单位 px;实际值会被限制在 300px 以内。
|
|
220
|
+
* 超过最大宽度时按钮会自动换行。
|
|
221
|
+
*/
|
|
222
|
+
actionsMaxWidth?: number;
|
|
223
|
+
/** 是否允许展开/收起,默认 `true`;关闭后所有字段始终展示。 */
|
|
224
|
+
collapsible?: boolean;
|
|
225
|
+
/**
|
|
226
|
+
* 展开状态的初始值,默认 `false`(收起)。
|
|
227
|
+
* 传入 `customButtons` 时默认值为 `true`;显式传入时以传入值为准。
|
|
228
|
+
*/
|
|
229
|
+
defaultExpanded?: boolean;
|
|
230
|
+
/** 收起时保留的行数,默认 `1`。 */
|
|
231
|
+
collapsedRows?: number;
|
|
232
|
+
/** 控件宽度,默认 `160`;日期范围字段未单独配置时为 `240`。 */
|
|
233
|
+
controlWidth?: number;
|
|
234
|
+
/** 筛选项水平间距,默认 `24`。 */
|
|
235
|
+
columnGap?: number;
|
|
236
|
+
/** 筛选项垂直间距(换行间距),默认 `12`。 */
|
|
237
|
+
rowGap?: number;
|
|
238
|
+
/** 标签最大宽度,超出省略,默认 `88`。 */
|
|
239
|
+
labelMaxWidth?: number;
|
|
240
|
+
/** 字段区域与右侧操作按钮之间的间距,默认 `24`。 */
|
|
241
|
+
actionsGap?: number;
|
|
242
|
+
/** 标签位置,默认 `inline`。 */
|
|
243
|
+
labelPosition?: FilterBarLabelPosition;
|
|
244
|
+
className?: string;
|
|
245
|
+
style?: CSSProperties;
|
|
246
|
+
}
|
|
247
|
+
/** 内部给 FilterField 的 action 按钮 Props,仅作为 JSX 工厂。 */
|
|
248
|
+
export interface FilterBarSearchButtonProps {
|
|
249
|
+
text?: ReactNode;
|
|
250
|
+
loading?: boolean;
|
|
251
|
+
disabled?: boolean;
|
|
252
|
+
onClick?: () => void;
|
|
253
|
+
className?: string;
|
|
254
|
+
}
|
|
255
|
+
export interface FilterBarResetButtonProps {
|
|
256
|
+
text?: ReactNode;
|
|
257
|
+
disabled?: boolean;
|
|
258
|
+
onClick?: () => void;
|
|
259
|
+
className?: string;
|
|
260
|
+
}
|
|
261
|
+
export interface FilterBarToggleButtonProps {
|
|
262
|
+
expanded?: boolean;
|
|
263
|
+
expandText?: ReactNode;
|
|
264
|
+
collapseText?: ReactNode;
|
|
265
|
+
onClick?: () => void;
|
|
266
|
+
className?: string;
|
|
267
|
+
}
|
|
268
|
+
/** 通过 ref 暴露的命令式能力。 */
|
|
269
|
+
export interface FilterBarRef {
|
|
270
|
+
getValues: () => FilterBarValues;
|
|
271
|
+
setValues: (values: FilterBarValues) => void;
|
|
272
|
+
setFieldValue: (name: string, value: FilterBarFieldValue) => void;
|
|
273
|
+
/** 手动校验;若不传 name 则校验全部可见字段。返回 Promise。 */
|
|
274
|
+
validate: (name?: string) => Promise<FilterBarValidateItem[]>;
|
|
275
|
+
/** 清空校验错误。 */
|
|
276
|
+
clearErrors: () => void;
|
|
277
|
+
search: () => void;
|
|
278
|
+
reset: () => void;
|
|
279
|
+
expand: () => void;
|
|
280
|
+
collapse: () => void;
|
|
281
|
+
toggle: () => void;
|
|
282
|
+
isExpanded: () => boolean;
|
|
283
|
+
}
|
|
284
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Dayjs } from 'dayjs';
|
|
2
|
+
/** 把字符串、时间戳或 Dayjs 统一转换为 Dayjs,无法解析时返回 null。 */
|
|
3
|
+
export declare function toDayjs(value: unknown): Dayjs | null;
|
|
4
|
+
/** 把日期范围值转换为 RangePicker 需要的 Dayjs 元组。 */
|
|
5
|
+
export declare function toDayjsRange(value: unknown): [Dayjs | null, Dayjs | null] | null;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FilterBarFieldConfig, FilterBarFieldValue, FilterBarValidateItem, FilterBarValues } from './types';
|
|
2
|
+
/** 判断字段值是否为空(null/undefined/空字符串/空数组都视为空)。 */
|
|
3
|
+
export declare function isEmpty(value: FilterBarFieldValue): boolean;
|
|
4
|
+
export interface ValidateFieldsOptions {
|
|
5
|
+
/** 仅校验指定字段;省略时校验全部。 */
|
|
6
|
+
include?: string[];
|
|
7
|
+
/** 排除的字段名;hidden 字段默认会被跳过。 */
|
|
8
|
+
hiddenNames?: readonly string[];
|
|
9
|
+
}
|
|
10
|
+
/** 批量校验,返回全部错误数组(无错误则空数组)。按 fields 顺序聚合。 */
|
|
11
|
+
export declare function validateFields(fields: readonly FilterBarFieldConfig[], values: FilterBarValues, options?: ValidateFieldsOptions): Promise<FilterBarValidateItem[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../ValuationLogDataChart-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../ValuationLogDataChart-Bg1yp4wQ.cjs");exports.IndicativePricingforSelectedContracts=t.IndicativePricingforSelectedContracts;exports.ValuationLogDataChart=t.ValuationLogDataChart;
|