@ahoo-wang/fetcher-viewer 2.13.9 → 2.13.11
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/dist/components/NumberRange.d.ts +1 -0
- package/dist/components/NumberRange.d.ts.map +1 -1
- package/dist/filter/AssemblyFilter.d.ts +6 -6
- package/dist/filter/AssemblyFilter.d.ts.map +1 -1
- package/dist/filter/FallbackFilter.d.ts.map +1 -1
- package/dist/filter/IdFilter.d.ts +2 -0
- package/dist/filter/IdFilter.d.ts.map +1 -1
- package/dist/filter/NumberFilter.d.ts.map +1 -1
- package/dist/filter/SelectFilter.d.ts +11 -0
- package/dist/filter/SelectFilter.d.ts.map +1 -0
- package/dist/filter/filterRegistry.d.ts.map +1 -1
- package/dist/filter/index.d.ts +1 -0
- package/dist/filter/index.d.ts.map +1 -1
- package/dist/filter/panel/FilterPanel.d.ts +6 -5
- package/dist/filter/panel/FilterPanel.d.ts.map +1 -1
- package/dist/filter/types.d.ts +10 -7
- package/dist/filter/types.d.ts.map +1 -1
- package/dist/filter/useFilterState.d.ts +7 -3
- package/dist/filter/useFilterState.d.ts.map +1 -1
- package/dist/index.es.js +883 -814
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +3 -3
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/stories/NumberRange.stories.d.ts +0 -13
- package/dist/components/stories/NumberRange.stories.d.ts.map +0 -1
- package/dist/components/stories/TagInput.stories.d.ts +0 -17
- package/dist/components/stories/TagInput.stories.d.ts.map +0 -1
- package/dist/filter/panel/stories/AvailableFilterSelect.stories.d.ts +0 -8
- package/dist/filter/panel/stories/AvailableFilterSelect.stories.d.ts.map +0 -1
- package/dist/filter/panel/stories/AvailableFilterSelectModal.stories.d.ts +0 -7
- package/dist/filter/panel/stories/AvailableFilterSelectModal.stories.d.ts.map +0 -1
- package/dist/filter/panel/stories/EditableFilterPanel.stories.d.ts +0 -10
- package/dist/filter/panel/stories/EditableFilterPanel.stories.d.ts.map +0 -1
- package/dist/filter/panel/stories/FilterPanel.stories.d.ts +0 -10
- package/dist/filter/panel/stories/FilterPanel.stories.d.ts.map +0 -1
- package/dist/filter/stories/FallbackFilter.stories.d.ts +0 -10
- package/dist/filter/stories/FallbackFilter.stories.d.ts.map +0 -1
- package/dist/filter/stories/IdFilter.stories.d.ts +0 -13
- package/dist/filter/stories/IdFilter.stories.d.ts.map +0 -1
- package/dist/filter/stories/NumberFilter.stories.d.ts +0 -15
- package/dist/filter/stories/NumberFilter.stories.d.ts.map +0 -1
- package/dist/filter/stories/TextFilter.stories.d.ts +0 -14
- package/dist/filter/stories/TextFilter.stories.d.ts.map +0 -1
- package/dist/filter/stories/TypedFilter.stories.d.ts +0 -11
- package/dist/filter/stories/TypedFilter.stories.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberRange.d.ts","sourceRoot":"","sources":["../../src/components/NumberRange.tsx"],"names":[],"mappings":"AAgBA,KAAK,gBAAgB,GAAG,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,CAAC;AAE/C,MAAM,WAAW,gBAAgB;IAC/B,YAAY,CAAC,EAAE,MAAM,GAAG,gBAAgB,CAAC;IACzC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;CAC9C;
|
|
1
|
+
{"version":3,"file":"NumberRange.d.ts","sourceRoot":"","sources":["../../src/components/NumberRange.tsx"],"names":[],"mappings":"AAgBA,KAAK,gBAAgB,GAAG,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,CAAC;AAE/C,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,MAAM,GAAG,gBAAgB,CAAC;IAClC,YAAY,CAAC,EAAE,MAAM,GAAG,gBAAgB,CAAC;IACzC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;CAC9C;AAaD,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,2CA8DlD"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { FilterProps } from './types';
|
|
1
|
+
import { FilterProps, FilterValueProps } from './types';
|
|
2
2
|
import { Operator } from '@ahoo-wang/fetcher-wow';
|
|
3
|
-
import { UseFilterStateReturn } from './useFilterState';
|
|
3
|
+
import { OnOperatorChangeValueConverter, UseFilterStateReturn, ValidateValue } from './useFilterState';
|
|
4
4
|
import { ReactNode } from 'react';
|
|
5
|
-
|
|
6
|
-
export interface AssemblyFilterProps<ValueType = any> extends FilterProps {
|
|
5
|
+
export interface AssemblyFilterProps<ValueType = any, ValuePropsType extends FilterValueProps = FilterValueProps<ValueType>> extends FilterProps<ValueType, ValuePropsType> {
|
|
7
6
|
supportedOperators: Operator[];
|
|
8
|
-
|
|
7
|
+
valueConverter?: OnOperatorChangeValueConverter;
|
|
8
|
+
validate?: ValidateValue<ValueType>;
|
|
9
9
|
valueInputSupplier: (filterState: UseFilterStateReturn<ValueType>) => ReactNode;
|
|
10
10
|
}
|
|
11
|
-
export declare function AssemblyFilter<ValueType = any>(props: AssemblyFilterProps<ValueType>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function AssemblyFilter<ValueType = any>({ ref, ...props }: AssemblyFilterProps<ValueType>): import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
//# sourceMappingURL=AssemblyFilter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssemblyFilter.d.ts","sourceRoot":"","sources":["../../src/filter/AssemblyFilter.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"AssemblyFilter.d.ts","sourceRoot":"","sources":["../../src/filter/AssemblyFilter.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,OAAO,EAAE,8BAA8B,EAAkB,oBAAoB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEvH,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,MAAM,WAAW,mBAAmB,CAAC,SAAS,GAAG,GAAG,EAAE,cAAc,SAAS,gBAAgB,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAE,SAAQ,WAAW,CAAC,SAAS,EAAE,cAAc,CAAC;IACzK,kBAAkB,EAAE,QAAQ,EAAE,CAAC;IAC/B,cAAc,CAAC,EAAE,8BAA8B,CAAC;IAChD,QAAQ,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;IACpC,kBAAkB,EAAE,CAClB,WAAW,EAAE,oBAAoB,CAAC,SAAS,CAAC,KACzC,SAAS,CAAC;CAChB;AAED,wBAAgB,cAAc,CAAC,SAAS,GAAG,GAAG,EAC5C,EAAE,GAAG,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB,CAAC,SAAS,CAAC,2CAgDlD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FallbackFilter.d.ts","sourceRoot":"","sources":["../../src/filter/FallbackFilter.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAGjD,wBAAgB,cAAc,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"FallbackFilter.d.ts","sourceRoot":"","sources":["../../src/filter/FallbackFilter.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAGjD,wBAAgB,cAAc,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,gBAAgB,2CAgB7D;yBAhBe,cAAc"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { FilterProps } from './types';
|
|
2
|
+
import { OnOperatorChangeValueConverter } from './useFilterState';
|
|
2
3
|
export declare const ID_FILTER = "id";
|
|
3
4
|
export type IdFilterValueType = string | string[];
|
|
5
|
+
export declare const IdOnOperatorChangeValueConverter: OnOperatorChangeValueConverter<IdFilterValueType>;
|
|
4
6
|
export declare function IdFilter(props: FilterProps<IdFilterValueType>): import("react/jsx-runtime").JSX.Element;
|
|
5
7
|
export declare namespace IdFilter {
|
|
6
8
|
var displayName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IdFilter.d.ts","sourceRoot":"","sources":["../../src/filter/IdFilter.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"IdFilter.d.ts","sourceRoot":"","sources":["../../src/filter/IdFilter.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAItC,OAAO,EACL,8BAA8B,EAE/B,MAAM,kBAAkB,CAAC;AAG1B,eAAO,MAAM,SAAS,OAAO,CAAC;AAC9B,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC;AAElD,eAAO,MAAM,gCAAgC,EAAE,8BAA8B,CAC3E,iBAAiB,CAmBlB,CAAC;AAEF,wBAAgB,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,iBAAiB,CAAC,2CA6B7D;yBA7Be,QAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberFilter.d.ts","sourceRoot":"","sources":["../../src/filter/NumberFilter.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAQtC,eAAO,MAAM,aAAa,WAAW,CAAC;AACtC,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,CAAC;AAEpE,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,CAAC,qBAAqB,CAAC,
|
|
1
|
+
{"version":3,"file":"NumberFilter.d.ts","sourceRoot":"","sources":["../../src/filter/NumberFilter.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAQtC,eAAO,MAAM,aAAa,WAAW,CAAC;AACtC,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,CAAC;AAEpE,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,CAAC,qBAAqB,CAAC,2CAgErE;yBAhEe,YAAY"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FilterProps, FilterValueProps } from './types';
|
|
2
|
+
import { SelectProps } from 'antd';
|
|
3
|
+
export declare const SELECT_FILTER = "select";
|
|
4
|
+
export type SelectFilterValueType = string[];
|
|
5
|
+
export interface SelectFilterValueProps extends FilterValueProps<SelectFilterValueType>, Omit<SelectProps<SelectFilterValueType>, 'defaultValue' | 'mode' | 'value' | 'allowClear' | 'onChange' | 'placeholder'> {
|
|
6
|
+
}
|
|
7
|
+
export declare function SelectFilter(props: FilterProps<SelectFilterValueType, SelectFilterValueProps>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare namespace SelectFilter {
|
|
9
|
+
var displayName: string;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=SelectFilter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectFilter.d.ts","sourceRoot":"","sources":["../../src/filter/SelectFilter.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAIxD,OAAO,EAAU,WAAW,EAAE,MAAM,MAAM,CAAC;AAE3C,eAAO,MAAM,aAAa,WAAW,CAAC;AACtC,MAAM,MAAM,qBAAqB,GAAG,MAAM,EAAE,CAAC;AAE7C,MAAM,WAAW,sBAAuB,SAAQ,gBAAgB,CAAC,qBAAqB,CAAC,EACrF,IAAI,CAAC,WAAW,CAAC,qBAAqB,CAAC,EAAE,cAAc,GAAG,MAAM,GAAG,OAAO,GAAG,YAAY,GAAG,UAAU,GAAE,aAAa,CAAC;CACvH;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,CAAC,qBAAqB,EAAE,sBAAsB,CAAC,2CAiB7F;yBAjBe,YAAY"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filterRegistry.d.ts","sourceRoot":"","sources":["../../src/filter/filterRegistry.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAI1C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"filterRegistry.d.ts","sourceRoot":"","sources":["../../src/filter/filterRegistry.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAI1C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C;;;;;GAKG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAGpB;;IASJ;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,eAAe;IAIlD;;;;;;;;;;OAUG;IACH,UAAU,CAAC,IAAI,EAAE,UAAU;IAI3B;;;;;;;;;;OAUG;IACH,GAAG,CAAC,IAAI,EAAE,UAAU,GAAG,eAAe,GAAG,SAAS;CAGnD;AAED,eAAO,MAAM,cAAc,gBAAuB,CAAC"}
|
package/dist/filter/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/filter/index.ts"],"names":[],"mappings":"AAaA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/filter/index.ts"],"names":[],"mappings":"AAaA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC"}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { default as React, Key } from 'react';
|
|
2
2
|
import { TypedFilterProps } from '../TypedFilter';
|
|
3
3
|
import { Condition } from '@ahoo-wang/fetcher-wow';
|
|
4
|
-
import { ColProps } from 'antd';
|
|
4
|
+
import { ColProps, ButtonProps } from 'antd';
|
|
5
5
|
import { RowProps } from 'antd/es/grid/row';
|
|
6
6
|
export interface ActiveFilter extends Omit<TypedFilterProps, 'onChange' | 'ref'> {
|
|
7
7
|
key: Key;
|
|
8
8
|
onRemove?: () => void;
|
|
9
9
|
}
|
|
10
10
|
export interface FilterPanelProps {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
row?: RowProps;
|
|
12
|
+
col?: ColProps;
|
|
13
|
+
actionsCol?: ColProps;
|
|
14
14
|
filters: ActiveFilter[];
|
|
15
15
|
actions?: React.ReactNode;
|
|
16
16
|
onSearch?: (condition: Condition) => void;
|
|
17
|
-
|
|
17
|
+
resetButton?: boolean | Omit<ButtonProps, 'onClick'>;
|
|
18
|
+
searchButton?: Omit<ButtonProps, 'onClick'>;
|
|
18
19
|
}
|
|
19
20
|
export declare function FilterPanel(props: FilterPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
20
21
|
//# sourceMappingURL=FilterPanel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterPanel.d.ts","sourceRoot":"","sources":["../../../src/filter/panel/FilterPanel.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,EAAO,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAA2B,QAAQ,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"FilterPanel.d.ts","sourceRoot":"","sources":["../../../src/filter/panel/FilterPanel.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,EAAO,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAA2B,QAAQ,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAItE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,MAAM,WAAW,YACf,SAAQ,IAAI,CAAC,gBAAgB,EAAE,UAAU,GAAG,KAAK,CAAC;IAClD,GAAG,EAAE,GAAG,CAAC;IACT,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,MAAM,WAAW,gBAAgB;IAC/B,GAAG,CAAC,EAAE,QAAQ,CAAC;IACf,GAAG,CAAC,EAAE,QAAQ,CAAC;IACf,UAAU,CAAC,EAAE,QAAQ,CAAC;IACtB,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,IAAI,CAAC;IAC1C,WAAW,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IACrD,YAAY,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;CAC7C;AAoBD,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,2CAwElD"}
|
package/dist/filter/types.d.ts
CHANGED
|
@@ -13,23 +13,26 @@ export interface FilterField extends NamedCapable {
|
|
|
13
13
|
}
|
|
14
14
|
export interface FilterRef {
|
|
15
15
|
getValue(): FilterValue | undefined;
|
|
16
|
+
reset(): void;
|
|
16
17
|
}
|
|
17
|
-
export interface
|
|
18
|
+
export interface FilterLabelProps extends StyleCapable {
|
|
18
19
|
}
|
|
19
|
-
export interface
|
|
20
|
+
export interface FilterOperatorProps extends Omit<SelectProps<Operator>, 'value' | 'options' | 'mode'> {
|
|
20
21
|
locale?: OperatorLocale;
|
|
22
|
+
supportedOperators?: Operator[];
|
|
21
23
|
}
|
|
22
|
-
export interface
|
|
24
|
+
export interface FilterValueProps<ValueType = any> extends StyleCapable {
|
|
23
25
|
defaultValue?: ValueType;
|
|
24
26
|
placeholder?: string;
|
|
27
|
+
[key: string]: any;
|
|
25
28
|
}
|
|
26
29
|
export interface FilterValue extends ConditionCapable {
|
|
27
30
|
}
|
|
28
|
-
export interface FilterProps<ValueType = any
|
|
31
|
+
export interface FilterProps<ValueType = any, ValuePropsType extends FilterValueProps = FilterValueProps<ValueType>> extends AttributesCapable, RefAttributes<FilterRef>, StyleCapable {
|
|
29
32
|
field: FilterField;
|
|
30
|
-
label?:
|
|
31
|
-
operator?:
|
|
32
|
-
value?:
|
|
33
|
+
label?: FilterLabelProps;
|
|
34
|
+
operator?: FilterOperatorProps;
|
|
35
|
+
value?: ValuePropsType;
|
|
33
36
|
onChange?: (value?: FilterValue) => void;
|
|
34
37
|
}
|
|
35
38
|
export type FilterComponent = React.FC<FilterProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/filter/types.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,YAAY;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,SAAS;IACxB,QAAQ,IAAI,WAAW,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/filter/types.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,EAAE,EAAE,aAAa,E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,GAAG,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC"}
|
|
@@ -2,19 +2,23 @@ import { Operator } from '@ahoo-wang/fetcher-wow';
|
|
|
2
2
|
import { RefAttributes } from 'react';
|
|
3
3
|
import { FilterRef, FilterValue } from './types';
|
|
4
4
|
import { Optional } from '../types';
|
|
5
|
+
export type OnOperatorChangeValueConverter<ValueType = any> = (beforeOperator: Operator, afterOperator: Operator, value: Optional<ValueType>) => Optional<ValueType>;
|
|
6
|
+
export type ValidateValue<ValueType = any> = (operator: Operator, value: Optional<ValueType>) => boolean;
|
|
7
|
+
export type OnChange = (condition: Optional<FilterValue>) => void;
|
|
5
8
|
export interface UseFilterStateOptions<ValueType = any> extends RefAttributes<FilterRef> {
|
|
6
9
|
field?: string;
|
|
7
10
|
operator: Operator;
|
|
8
11
|
value: Optional<ValueType>;
|
|
9
|
-
valueConverter?:
|
|
10
|
-
validate?:
|
|
11
|
-
onChange?:
|
|
12
|
+
valueConverter?: OnOperatorChangeValueConverter;
|
|
13
|
+
validate?: ValidateValue<ValueType>;
|
|
14
|
+
onChange?: OnChange;
|
|
12
15
|
}
|
|
13
16
|
export interface UseFilterStateReturn<ValueType = any> {
|
|
14
17
|
operator: Operator;
|
|
15
18
|
value: Optional<ValueType>;
|
|
16
19
|
setOperator: (operator: Operator) => void;
|
|
17
20
|
setValue: (value: Optional<ValueType>) => void;
|
|
21
|
+
reset: () => void;
|
|
18
22
|
}
|
|
19
23
|
export declare function useFilterState<ValueType = any>(options: UseFilterStateOptions<ValueType>): UseFilterStateReturn<ValueType>;
|
|
20
24
|
//# sourceMappingURL=useFilterState.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFilterState.d.ts","sourceRoot":"","sources":["../../src/filter/useFilterState.ts"],"names":[],"mappings":"AAaA,OAAO,EAAa,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAiC,MAAM,OAAO,CAAC;AACr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