@ahoo-wang/fetcher-viewer 3.0.3 → 3.0.5
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/filter/AssemblyFilter.d.ts +4 -3
- package/dist/filter/AssemblyFilter.d.ts.map +1 -1
- package/dist/filter/BoolFilter.d.ts +7 -0
- package/dist/filter/BoolFilter.d.ts.map +1 -0
- package/dist/filter/filterRegistry.d.ts.map +1 -1
- package/dist/filter/index.d.ts +2 -1
- package/dist/filter/index.d.ts.map +1 -1
- package/dist/filter/operator/index.d.ts +3 -0
- package/dist/filter/operator/index.d.ts.map +1 -0
- package/dist/filter/operator/locale/index.d.ts.map +1 -0
- package/dist/filter/operator/locale/operator.zh_CN.d.ts +3 -0
- package/dist/filter/operator/locale/operator.zh_CN.d.ts.map +1 -0
- package/dist/filter/operator/types.d.ts +11 -0
- package/dist/filter/operator/types.d.ts.map +1 -0
- package/dist/filter/types.d.ts +5 -4
- package/dist/filter/types.d.ts.map +1 -1
- package/dist/filter/useFilterState.d.ts +6 -4
- package/dist/filter/useFilterState.d.ts.map +1 -1
- package/dist/index.es.js +341 -315
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/dist/filter/locale/index.d.ts.map +0 -1
- package/dist/filter/locale/operator.zh_CN.d.ts +0 -3
- package/dist/filter/locale/operator.zh_CN.d.ts.map +0 -1
- /package/dist/filter/{locale → operator/locale}/index.d.ts +0 -0
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { FilterProps, FilterValueProps } from './types';
|
|
2
|
-
import { Operator } from '@ahoo-wang/fetcher-wow';
|
|
3
2
|
import { OnOperatorChangeValueConverter, UseFilterStateReturn, ValidateValue } from './useFilterState';
|
|
4
3
|
import { ReactNode } from 'react';
|
|
4
|
+
import { SelectOperator } from './operator';
|
|
5
|
+
export type ValueInputRender<ValueType = any> = (filterState: UseFilterStateReturn<ValueType>) => ReactNode | null;
|
|
5
6
|
export interface AssemblyFilterProps<ValueType = any, ValuePropsType extends FilterValueProps = FilterValueProps<ValueType>> extends FilterProps<ValueType, ValuePropsType> {
|
|
6
|
-
supportedOperators:
|
|
7
|
+
supportedOperators: SelectOperator[];
|
|
7
8
|
valueConverter?: OnOperatorChangeValueConverter;
|
|
8
9
|
validate?: ValidateValue<ValueType>;
|
|
9
|
-
|
|
10
|
+
valueInputRender?: ValueInputRender<ValueType>;
|
|
10
11
|
}
|
|
11
12
|
export declare function AssemblyFilter<ValueType = any>({ ref, ...props }: AssemblyFilterProps<ValueType>): import("react/jsx-runtime").JSX.Element;
|
|
12
13
|
//# 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,gBAAgB,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;AAExD,OAAO,EAAE,8BAA8B,EAAkB,oBAAoB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEvH,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,MAAM,gBAAgB,CAAC,SAAS,GAAG,GAAG,IAAI,CAC9C,WAAW,EAAE,oBAAoB,CAAC,SAAS,CAAC,KACzC,SAAS,GAAG,IAAI,CAAC;AAEtB,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,cAAc,EAAE,CAAC;IACrC,cAAc,CAAC,EAAE,8BAA8B,CAAC;IAChD,QAAQ,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;IACpC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,SAAS,CAAC,CAAC;CAChD;AAED,wBAAgB,cAAc,CAAC,SAAS,GAAG,GAAG,EAC5C,EAAE,GAAG,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB,CAAC,SAAS,CAAC,2CAgDlD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FilterProps } from './types';
|
|
2
|
+
export declare const BOOL_FILTER = "bool";
|
|
3
|
+
export declare function BoolFilter(props: FilterProps<undefined>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare namespace BoolFilter {
|
|
5
|
+
var displayName: string;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=BoolFilter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BoolFilter.d.ts","sourceRoot":"","sources":["../../src/filter/BoolFilter.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAMtC,eAAO,MAAM,WAAW,SAAS,CAAC;AAElC,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,CAAC,SAAS,CAAC,2CAOvD;yBAPe,UAAU"}
|
|
@@ -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;AAI3C;;;;;GAKG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAGpB;;IAUJ;;;;;;;;;;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,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/filter/index.ts"],"names":[],"mappings":"AAaA,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/filter/operator/index.ts"],"names":[],"mappings":"AAaA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/filter/operator/locale/index.ts"],"names":[],"mappings":"AAaA,cAAc,kBAAkB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operator.zh_CN.d.ts","sourceRoot":"","sources":["../../../../src/filter/operator/locale/operator.zh_CN.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEhD,eAAO,MAAM,cAAc,EAAE,oBA2C5B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Operator } from '@ahoo-wang/fetcher-wow';
|
|
2
|
+
export declare enum ExtendedOperator {
|
|
3
|
+
UNDEFINED = "UNDEFINED"
|
|
4
|
+
}
|
|
5
|
+
export type SelectOperator = ExtendedOperator | Operator;
|
|
6
|
+
export type SelectOperatorLocale = {
|
|
7
|
+
[K in Operator]: string;
|
|
8
|
+
} & {
|
|
9
|
+
[K in ExtendedOperator]: string;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/filter/operator/types.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,oBAAY,gBAAgB;IAC1B,SAAS,cAAc;CACxB;AAED,MAAM,MAAM,cAAc,GAAG,gBAAgB,GAAG,QAAQ,CAAC;AAEzD,MAAM,MAAM,oBAAoB,GAAG;KAChC,CAAC,IAAI,QAAQ,GAAG,MAAM;CACxB,GAAG;KACD,CAAC,IAAI,gBAAgB,GAAG,MAAM;CAChC,CAAC"}
|
package/dist/filter/types.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { AttributesCapable, NamedCapable } from '@ahoo-wang/fetcher';
|
|
2
|
-
import { ConditionCapable
|
|
2
|
+
import { ConditionCapable } from '@ahoo-wang/fetcher-wow';
|
|
3
3
|
import { SelectProps } from 'antd/es/select';
|
|
4
4
|
import { default as React, RefAttributes } from 'react';
|
|
5
5
|
import { StyleCapable } from '../types';
|
|
6
|
+
import { SelectOperator, SelectOperatorLocale } from './operator';
|
|
6
7
|
/**
|
|
7
8
|
* @see {@link Schema}
|
|
8
9
|
*/
|
|
@@ -17,9 +18,9 @@ export interface FilterRef {
|
|
|
17
18
|
}
|
|
18
19
|
export interface FilterLabelProps extends StyleCapable {
|
|
19
20
|
}
|
|
20
|
-
export interface FilterOperatorProps extends Omit<SelectProps<
|
|
21
|
-
locale?:
|
|
22
|
-
supportedOperators?:
|
|
21
|
+
export interface FilterOperatorProps extends Omit<SelectProps<SelectOperator>, 'value' | 'options' | 'mode'> {
|
|
22
|
+
locale?: SelectOperatorLocale;
|
|
23
|
+
supportedOperators?: SelectOperator[];
|
|
23
24
|
}
|
|
24
25
|
export interface FilterValueProps<ValueType = any> extends StyleCapable {
|
|
25
26
|
defaultValue?: ValueType;
|
|
@@ -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,
|
|
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,MAAM,wBAAwB,CAAC;AAC1D,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;AACxC,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAElE;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,YAAY;IAC/C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efAttributes } from 'react';
|
|
3
3
|
import { FilterRef, FilterValue } from './types';
|
|
4
4
|
import { Optional } from '../types';
|
|
5
|
-
|
|
5
|
+
import { SelectOperator } from './operator';
|
|
6
|
+
export type OnOperatorChangeValueConverter<ValueType = any> = (beforeOperator: SelectOperator, afterOperator: SelectOperator, value: Optional<ValueType>) => Optional<ValueType>;
|
|
6
7
|
export type ValidateValue<ValueType = any> = (operator: Operator, value: Optional<ValueType>) => boolean;
|
|
7
8
|
export type OnChange = (condition: Optional<FilterValue>) => void;
|
|
9
|
+
export declare const TrueValidateValue: ValidateValue;
|
|
8
10
|
export interface UseFilterStateOptions<ValueType = any> extends RefAttributes<FilterRef> {
|
|
9
11
|
field?: string;
|
|
10
|
-
operator:
|
|
12
|
+
operator: SelectOperator;
|
|
11
13
|
value: Optional<ValueType>;
|
|
12
14
|
valueConverter?: OnOperatorChangeValueConverter;
|
|
13
15
|
validate?: ValidateValue<ValueType>;
|
|
14
16
|
onChange?: OnChange;
|
|
15
17
|
}
|
|
16
18
|
export interface UseFilterStateReturn<ValueType = any> {
|
|
17
|
-
operator:
|
|
19
|
+
operator: SelectOperator;
|
|
18
20
|
value: Optional<ValueType>;
|
|
19
|
-
setOperator: (operator:
|
|
21
|
+
setOperator: (operator: SelectOperator) => void;
|
|
20
22
|
setValue: (value: Optional<ValueType>) => void;
|
|
21
23
|
reset: () => void;
|
|
22
24
|
}
|
|
@@ -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;AACrE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"useFilterState.d.ts","source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