@ahoo-wang/fetcher-viewer 2.9.0 → 2.9.2
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/TagInput.d.ts +18 -0
- package/dist/components/TagInput.d.ts.map +1 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/filter/ConditionFilter.d.ts +7 -0
- package/dist/filter/ConditionFilter.d.ts.map +1 -0
- package/dist/filter/FallbackConditionFilter.d.ts +8 -0
- package/dist/filter/FallbackConditionFilter.d.ts.map +1 -0
- package/dist/filter/IdConditionFilter.d.ts +7 -0
- package/dist/filter/IdConditionFilter.d.ts.map +1 -0
- package/dist/filter/conditionFilterRegistry.d.ts.map +1 -1
- package/dist/filter/friendlyCondition.d.ts +3 -0
- package/dist/filter/friendlyCondition.d.ts.map +1 -0
- package/dist/filter/index.d.ts +4 -1
- package/dist/filter/index.d.ts.map +1 -1
- package/dist/filter/locale/index.d.ts +2 -0
- package/dist/filter/locale/index.d.ts.map +1 -0
- package/dist/filter/locale/operator.zh_CN.d.ts +3 -0
- package/dist/filter/locale/operator.zh_CN.d.ts.map +1 -0
- package/dist/filter/types.d.ts +20 -6
- package/dist/filter/types.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +162 -16
- 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 +15 -15
- package/dist/filter/conditionFilter.d.ts +0 -6
- package/dist/filter/conditionFilter.d.ts.map +0 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SelectProps } from 'antd';
|
|
2
|
+
/**
|
|
3
|
+
* Props for the TagInput component.
|
|
4
|
+
* Extends SelectProps from Antd, excluding 'mode', 'open', and 'suffixIcon' as they are fixed.
|
|
5
|
+
*/
|
|
6
|
+
export interface TagInputProps extends Omit<SelectProps, 'mode' | 'open' | 'suffixIcon'> {
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A tag input component based on Antd's Select in tags mode.
|
|
10
|
+
* Allows users to input multiple tags separated by specified token separators.
|
|
11
|
+
* @param props - The props for the TagInput component.
|
|
12
|
+
* @returns The rendered TagInput component.
|
|
13
|
+
*/
|
|
14
|
+
export declare function TagInput(props: TagInputProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare namespace TagInput {
|
|
16
|
+
var displayName: string;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=TagInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TagInput.d.ts","sourceRoot":"","sources":["../../src/components/TagInput.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAU,WAAW,EAAE,MAAM,MAAM,CAAC;AAE3C;;;GAGG;AACH,MAAM,WAAW,aACf,SAAQ,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,CAAC;CAAG;AAQ9D;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,2CAgB5C;yBAhBe,QAAQ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAaA,cAAc,YAAY,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ConditionFilterProps } from './types';
|
|
3
|
+
export interface TypedConditionFilterProps extends ConditionFilterProps {
|
|
4
|
+
type: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const ConditionFilter: React.MemoExoticComponent<(props: TypedConditionFilterProps) => import("react/jsx-runtime").JSX.Element>;
|
|
7
|
+
//# sourceMappingURL=ConditionFilter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConditionFilter.d.ts","sourceRoot":"","sources":["../../src/filter/ConditionFilter.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAI/C,MAAM,WAAW,yBACf,SAAQ,oBAAoB;IAC5B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,eAAe,oCAClB,yBAAyB,6CAOlC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface FallbackConditionFilterProps {
|
|
2
|
+
type: string;
|
|
3
|
+
}
|
|
4
|
+
export declare function FallbackConditionFilter(props: FallbackConditionFilterProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare namespace FallbackConditionFilter {
|
|
6
|
+
var displayName: string;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=FallbackConditionFilter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FallbackConditionFilter.d.ts","sourceRoot":"","sources":["../../src/filter/FallbackConditionFilter.tsx"],"names":[],"mappings":"AAgBA,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,4BAA4B,2CAE1E;yBAFe,uBAAuB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ConditionFilterProps } from './types';
|
|
2
|
+
export declare const ID_CONDITION_FILTER = "id";
|
|
3
|
+
export declare function IdConditionFilter(props: ConditionFilterProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare namespace IdConditionFilter {
|
|
5
|
+
var displayName: string;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=IdConditionFilter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IdConditionFilter.d.ts","sourceRoot":"","sources":["../../src/filter/IdConditionFilter.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,oBAAoB,EAAwB,MAAM,SAAS,CAAC;AASrE,eAAO,MAAM,mBAAmB,OAAO,CAAC;AAExC,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,oBAAoB,2CA0D5D;yBA1De,iBAAiB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conditionFilterRegistry.d.ts","sourceRoot":"","sources":["../../src/filter/conditionFilterRegistry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"conditionFilterRegistry.d.ts","sourceRoot":"","sources":["../../src/filter/conditionFilterRegistry.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAEnD,qBAAa,uBAAuB;IAElC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAsF;IAE9G,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,wBAAwB;IAIvD,UAAU,CAAC,IAAI,EAAE,MAAM;IAIvB,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,wBAAwB,GAAG,SAAS;CAIxD;AAED,eAAO,MAAM,uBAAuB,yBAAgC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"friendlyCondition.d.ts","sourceRoot":"","sources":["../../src/filter/friendlyCondition.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAEnE,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,UAWpG"}
|
package/dist/filter/index.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './ConditionFilter';
|
|
2
2
|
export * from './conditionFilterRegistry';
|
|
3
|
+
export * from './IdConditionFilter';
|
|
3
4
|
export * from './types';
|
|
5
|
+
export * from './FallbackConditionFilter';
|
|
6
|
+
export * from './locale';
|
|
4
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/filter/index.ts"],"names":[],"mappings":"AAaA,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/filter/index.ts"],"names":[],"mappings":"AAaA,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,SAAS,CAAC;AACxB,cAAc,2BAA2B,CAAC;AAC1C,cAAc,UAAU,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/filter/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/locale/operator.zh_CN.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,eAAO,MAAM,cAAc,EAAE,cA0C5B,CAAC"}
|
package/dist/filter/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AttributesCapable, NamedCapable } from '@ahoo-wang/fetcher';
|
|
2
|
-
import { Condition, Operator } from '@ahoo-wang/fetcher-wow';
|
|
3
|
-
import {
|
|
2
|
+
import { Condition, Operator, OperatorLocale } from '@ahoo-wang/fetcher-wow';
|
|
3
|
+
import { SelectProps } from 'antd/es/select';
|
|
4
4
|
/**
|
|
5
5
|
* @see {@link Schema}
|
|
6
6
|
*/
|
|
@@ -10,13 +10,27 @@ export interface ConditionField extends NamedCapable {
|
|
|
10
10
|
format?: string;
|
|
11
11
|
}
|
|
12
12
|
export interface ConditionFilterCallbacks {
|
|
13
|
-
getCondition(): Condition;
|
|
13
|
+
getCondition(): Condition | undefined;
|
|
14
|
+
}
|
|
15
|
+
export interface LabelProps extends NamedCapable {
|
|
16
|
+
}
|
|
17
|
+
export interface OperatorProps extends SelectProps<Operator> {
|
|
18
|
+
locale?: OperatorLocale;
|
|
19
|
+
}
|
|
20
|
+
export interface ValueProps {
|
|
21
|
+
defaultValue?: any;
|
|
22
|
+
placeholder?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface ConditionFilterValue {
|
|
25
|
+
condition: Condition;
|
|
26
|
+
friendly: string;
|
|
14
27
|
}
|
|
15
28
|
export interface ConditionFilterProps extends AttributesCapable {
|
|
16
29
|
field: ConditionField;
|
|
17
|
-
|
|
18
|
-
operator:
|
|
19
|
-
|
|
30
|
+
label: LabelProps;
|
|
31
|
+
operator: OperatorProps;
|
|
32
|
+
value: ValueProps;
|
|
33
|
+
onChange?: (value?: ConditionFilterValue) => void;
|
|
20
34
|
}
|
|
21
35
|
export type ConditionFilterComponent = React.FC<ConditionFilterProps>;
|
|
22
36
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -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,SAAS,EAAE,QAAQ,EAAE,MAAM,wBAAwB,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,SAAS,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,YAAY;IAClD,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,wBAAwB;IACvC,YAAY,IAAI,SAAS,GAAG,SAAS,CAAC;CACvC;AAED,MAAM,WAAW,UAAW,SAAQ,YAAY;CAE/C;AAED,MAAM,WAAW,aAAc,SAAQ,WAAW,CAAC,QAAQ,CAAC;IAC1D,MAAM,CAAC,EAAE,cAAc,CAAC;CACzB;AAED,MAAM,WAAW,UAAU;IACzB,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,SAAS,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,oBAAqB,SAAQ,iBAAiB;IAC7D,KAAK,EAAE,cAAc,CAAC;IACtB,KAAK,EAAE,UAAU,CAAC;IAClB,QAAQ,EAAE,aAAa,CAAC;IACxB,KAAK,EAAE,UAAU,CAAC;IAClB,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,oBAAoB,KAAK,IAAI,CAAC;CACnD;AAED,MAAM,MAAM,wBAAwB,GAAG,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAA"}
|
package/dist/index.es.js
CHANGED
|
@@ -1,27 +1,173 @@
|
|
|
1
|
-
|
|
1
|
+
var U = Object.defineProperty;
|
|
2
|
+
var r = (t, e) => U(t, "name", { value: e, configurable: !0 });
|
|
3
|
+
import { jsx as u, jsxs as b } from "react/jsx-runtime";
|
|
4
|
+
import { c as m } from "react-compiler-runtime";
|
|
5
|
+
import $, { useState as W } from "react";
|
|
6
|
+
import { Alert as j, Select as _, Input as k, Button as x, Space as K } from "antd";
|
|
7
|
+
import { Operator as c } from "@ahoo-wang/fetcher-wow";
|
|
8
|
+
const F = class F {
|
|
2
9
|
constructor() {
|
|
3
10
|
this.filters = /* @__PURE__ */ new Map();
|
|
4
11
|
}
|
|
5
|
-
register(
|
|
6
|
-
this.filters.set(
|
|
12
|
+
register(e, n) {
|
|
13
|
+
this.filters.set(e, n);
|
|
7
14
|
}
|
|
8
|
-
unregister(
|
|
9
|
-
return this.filters.delete(
|
|
15
|
+
unregister(e) {
|
|
16
|
+
return this.filters.delete(e);
|
|
10
17
|
}
|
|
11
|
-
get(
|
|
12
|
-
return this.filters.get(
|
|
18
|
+
get(e) {
|
|
19
|
+
return this.filters.get(e);
|
|
13
20
|
}
|
|
21
|
+
};
|
|
22
|
+
r(F, "ConditionFilterRegistry");
|
|
23
|
+
let v = F;
|
|
24
|
+
const G = new v();
|
|
25
|
+
function w(t) {
|
|
26
|
+
const e = m(2), n = `Unsupported filter type:[${t.type}]`;
|
|
27
|
+
let l;
|
|
28
|
+
return e[0] !== n ? (l = /* @__PURE__ */ u(j, { message: n, type: "warning", showIcon: !0 }), e[0] = n, e[1] = l) : l = e[1], l;
|
|
29
|
+
}
|
|
30
|
+
r(w, "FallbackConditionFilter");
|
|
31
|
+
w.displayName = "FallbackConditionFilter";
|
|
32
|
+
const P = $.memo((t) => {
|
|
33
|
+
const e = m(7);
|
|
34
|
+
let n;
|
|
35
|
+
e[0] !== t.type ? (n = G.get(t.type), e[0] = t.type, e[1] = n) : n = e[1];
|
|
36
|
+
const l = n;
|
|
37
|
+
if (!l) {
|
|
38
|
+
let a;
|
|
39
|
+
return e[2] !== t.type ? (a = /* @__PURE__ */ u(w, { type: t.type }), e[2] = t.type, e[3] = a) : a = e[3], a;
|
|
40
|
+
}
|
|
41
|
+
let i;
|
|
42
|
+
return e[4] !== l || e[5] !== t ? (i = /* @__PURE__ */ u(l, { ...t }), e[4] = l, e[5] = t, e[6] = i) : i = e[6], i;
|
|
43
|
+
});
|
|
44
|
+
P.displayName = "ConditionFilter";
|
|
45
|
+
const Y = [",", ",", ";", ";", " "];
|
|
46
|
+
function H(t) {
|
|
47
|
+
const e = m(8);
|
|
48
|
+
let n, l, i;
|
|
49
|
+
e[0] !== t ? ({
|
|
50
|
+
tokenSeparators: l,
|
|
51
|
+
allowClear: i,
|
|
52
|
+
...n
|
|
53
|
+
} = t, e[0] = t, e[1] = n, e[2] = l, e[3] = i) : (n = e[1], l = e[2], i = e[3]);
|
|
54
|
+
const a = l === void 0 ? Y : l, A = i === void 0 ? !0 : i;
|
|
55
|
+
let o;
|
|
56
|
+
return e[4] !== A || e[5] !== n || e[6] !== a ? (o = /* @__PURE__ */ u(_, { ...n, mode: "tags", open: !1, suffixIcon: null, allowClear: A, tokenSeparators: a }), e[4] = A, e[5] = n, e[6] = a, e[7] = o) : o = e[7], o;
|
|
57
|
+
}
|
|
58
|
+
r(H, "TagInput");
|
|
59
|
+
H.displayName = "TagInput";
|
|
60
|
+
const B = {
|
|
61
|
+
AND: "与",
|
|
62
|
+
OR: "或",
|
|
63
|
+
NOR: "非或",
|
|
64
|
+
ID: "等于",
|
|
65
|
+
IDS: "包含",
|
|
66
|
+
AGGREGATE_ID: "等于",
|
|
67
|
+
AGGREGATE_IDS: "包含",
|
|
68
|
+
TENANT_ID: "等于",
|
|
69
|
+
OWNER_ID: "等于",
|
|
70
|
+
DELETED: "已删除",
|
|
71
|
+
ALL: "全部",
|
|
72
|
+
EQ: "等于",
|
|
73
|
+
NE: "不等于",
|
|
74
|
+
GT: "大于",
|
|
75
|
+
LT: "小于",
|
|
76
|
+
GTE: "大于等于",
|
|
77
|
+
LTE: "小于等于",
|
|
78
|
+
CONTAINS: "包含",
|
|
79
|
+
IN: "包含",
|
|
80
|
+
NOT_IN: "不包含",
|
|
81
|
+
BETWEEN: "在范围内",
|
|
82
|
+
ALL_IN: "全部包含",
|
|
83
|
+
STARTS_WITH: "以...开头",
|
|
84
|
+
ENDS_WITH: "以...结尾",
|
|
85
|
+
ELEM_MATCH: "元素匹配",
|
|
86
|
+
NULL: "为空",
|
|
87
|
+
NOT_NULL: "不为空",
|
|
88
|
+
TRUE: "为真",
|
|
89
|
+
FALSE: "为假",
|
|
90
|
+
EXISTS: "存在",
|
|
91
|
+
TODAY: "今天",
|
|
92
|
+
BEFORE_TODAY: "今天之前",
|
|
93
|
+
TOMORROW: "明天",
|
|
94
|
+
THIS_WEEK: "本周",
|
|
95
|
+
NEXT_WEEK: "下周",
|
|
96
|
+
LAST_WEEK: "上周",
|
|
97
|
+
THIS_MONTH: "本月",
|
|
98
|
+
LAST_MONTH: "上月",
|
|
99
|
+
RECENT_DAYS: "最近几天",
|
|
100
|
+
EARLIER_DAYS: "几天前",
|
|
101
|
+
RAW: "原始查询"
|
|
102
|
+
};
|
|
103
|
+
function X(t, e, n) {
|
|
104
|
+
const l = [];
|
|
105
|
+
l.push(t), l.push(e[n.operator]);
|
|
106
|
+
const i = n.value;
|
|
107
|
+
return Array.isArray(n.value) ? l.push(i.join(", ")) : l.push(i), l.join(" ");
|
|
14
108
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
109
|
+
r(X, "friendlyCondition");
|
|
110
|
+
const z = "id";
|
|
111
|
+
function M(t) {
|
|
112
|
+
const e = m(33), n = t.operator.defaultValue || c.ID, [l, i] = W(n), [a, A] = W(t.value.defaultValue), o = t.operator.locale ?? B;
|
|
113
|
+
let N;
|
|
114
|
+
e[0] !== l || e[1] !== o || e[2] !== t.field.label || e[3] !== a ? (N = /* @__PURE__ */ r(() => {
|
|
115
|
+
if (!l || !a || Array.isArray(a) && a.length === 0)
|
|
116
|
+
return;
|
|
117
|
+
const s = {
|
|
118
|
+
operator: l,
|
|
119
|
+
value: a
|
|
120
|
+
}, V = X(t.field.label, o, s);
|
|
121
|
+
return {
|
|
122
|
+
condition: s,
|
|
123
|
+
friendly: V
|
|
124
|
+
};
|
|
125
|
+
}, "t0"), e[0] = l, e[1] = o, e[2] = t.field.label, e[3] = a, e[4] = N) : N = e[4];
|
|
126
|
+
const f = N;
|
|
127
|
+
let O;
|
|
128
|
+
e[5] !== f || e[6] !== t ? (O = /* @__PURE__ */ r((s) => {
|
|
129
|
+
i(s), t.onChange?.(f());
|
|
130
|
+
}, "t1"), e[5] = f, e[6] = t, e[7] = O) : O = e[7];
|
|
131
|
+
const y = O;
|
|
132
|
+
let h;
|
|
133
|
+
e[8] !== f || e[9] !== t ? (h = /* @__PURE__ */ r((s) => {
|
|
134
|
+
A(s), t.onChange?.(f());
|
|
135
|
+
}, "t2"), e[8] = f, e[9] = t, e[10] = h) : h = e[10];
|
|
136
|
+
const D = h;
|
|
137
|
+
let S;
|
|
138
|
+
e[11] !== D || e[12] !== l || e[13] !== t.value || e[14] !== a ? (S = l === c.ID ? /* @__PURE__ */ u(k, { value: a, onChange: /* @__PURE__ */ r((s) => D(s.target.value), "onChange"), allowClear: !0, ...t.value }) : /* @__PURE__ */ u(H, { value: a, onChange: D, ...t.value }), e[11] = D, e[12] = l, e[13] = t.value, e[14] = a, e[15] = S) : S = e[15];
|
|
139
|
+
const g = S;
|
|
140
|
+
let E;
|
|
141
|
+
e[16] !== t.field.label || e[17] !== t.label ? (E = /* @__PURE__ */ u(x, { ...t.label, children: t.field.label }), e[16] = t.field.label, e[17] = t.label, e[18] = E) : E = e[18];
|
|
142
|
+
const L = o[c.ID];
|
|
143
|
+
let d;
|
|
144
|
+
e[19] !== L ? (d = /* @__PURE__ */ u(_.Option, { value: c.ID, children: L }), e[19] = L, e[20] = d) : d = e[20];
|
|
145
|
+
const R = o[c.IDS];
|
|
146
|
+
let T;
|
|
147
|
+
e[21] !== R ? (T = /* @__PURE__ */ u(_.Option, { value: c.IDS, children: R }), e[21] = R, e[22] = T) : T = e[22];
|
|
148
|
+
let I;
|
|
149
|
+
e[23] !== y || e[24] !== l || e[25] !== t.operator || e[26] !== d || e[27] !== T ? (I = /* @__PURE__ */ b(_, { defaultValue: c.ID, value: l, onChange: y, ...t.operator, children: [
|
|
150
|
+
d,
|
|
151
|
+
T
|
|
152
|
+
] }), e[23] = y, e[24] = l, e[25] = t.operator, e[26] = d, e[27] = T, e[28] = I) : I = e[28];
|
|
153
|
+
let C;
|
|
154
|
+
return e[29] !== E || e[30] !== I || e[31] !== g ? (C = /* @__PURE__ */ b(K.Compact, { children: [
|
|
155
|
+
E,
|
|
156
|
+
I,
|
|
157
|
+
g
|
|
158
|
+
] }), e[29] = E, e[30] = I, e[31] = g, e[32] = C) : C = e[32], C;
|
|
21
159
|
}
|
|
160
|
+
r(M, "IdConditionFilter");
|
|
161
|
+
M.displayName = "IdConditionFilter";
|
|
162
|
+
G.register(z, M);
|
|
22
163
|
export {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
164
|
+
P as ConditionFilter,
|
|
165
|
+
v as ConditionFilterRegistry,
|
|
166
|
+
w as FallbackConditionFilter,
|
|
167
|
+
z as ID_CONDITION_FILTER,
|
|
168
|
+
M as IdConditionFilter,
|
|
169
|
+
B as OPERATOR_zh_CN,
|
|
170
|
+
H as TagInput,
|
|
171
|
+
G as conditionFilterRegistry
|
|
26
172
|
};
|
|
27
173
|
//# sourceMappingURL=index.es.js.map
|
package/dist/index.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../src/filter/conditionFilterRegistry.ts","../src/filter/conditionFilter.tsx"],"sourcesContent":["/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nimport { ConditionFilterComponent } from './types';\n\nexport class ConditionFilterRegistry {\n\n private readonly filters: Map<string, ConditionFilterComponent> = new Map<string, ConditionFilterComponent>();\n\n register(type: string, filter: ConditionFilterComponent) {\n this.filters.set(type, filter);\n }\n\n unregister(type: string) {\n return this.filters.delete(type);\n }\n\n get(type: string): ConditionFilterComponent | undefined {\n return this.filters.get(type);\n }\n\n}\n\nexport const conditionFilterRegistry = new ConditionFilterRegistry();","/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ConditionFilterProps } from './types';\nimport { conditionFilterRegistry } from './conditionFilterRegistry';\n\nexport interface TypedConditionFilterProps extends ConditionFilterProps {\n type: string;\n}\n\nexport function ConditionFilter(props: TypedConditionFilterProps) {\n const filter = conditionFilterRegistry.get(props.type);\n if (!filter) {\n throw new Error(`ConditionFilter type ${props.type} not found.`);\n }\n return filter(props);\n}"],"names":["ConditionFilterRegistry","type","filter","conditionFilterRegistry","ConditionFilter","props"],"mappings":"AAgBO,MAAMA,EAAwB;AAAA,EAA9B,cAAA;AAEL,SAAiB,8BAAqD,IAAA;AAAA,EAAsC;AAAA,EAE5G,SAASC,GAAcC,GAAkC;AACvD,SAAK,QAAQ,IAAID,GAAMC,CAAM;AAAA,EAC/B;AAAA,EAEA,WAAWD,GAAc;AACvB,WAAO,KAAK,QAAQ,OAAOA,CAAI;AAAA,EACjC;AAAA,EAEA,IAAIA,GAAoD;AACtD,WAAO,KAAK,QAAQ,IAAIA,CAAI;AAAA,EAC9B;AAEF;AAEO,MAAME,IAA0B,IAAIH,EAAA;ACdpC,SAASI,EAAgBC,GAAkC;AAChE,QAAMH,IAASC,EAAwB,IAAIE,EAAM,IAAI;AACrD,MAAI,CAACH;AACH,UAAM,IAAI,MAAM,wBAAwBG,EAAM,IAAI,aAAa;AAEjE,SAAOH,EAAOG,CAAK;AACrB;"}
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../src/filter/conditionFilterRegistry.ts","../src/filter/FallbackConditionFilter.tsx","../src/filter/ConditionFilter.tsx","../src/components/TagInput.tsx","../src/filter/locale/operator.zh_CN.ts","../src/filter/friendlyCondition.ts","../src/filter/IdConditionFilter.tsx"],"sourcesContent":["/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ConditionFilterComponent } from './types';\n\nexport class ConditionFilterRegistry {\n\n private readonly filters: Map<string, ConditionFilterComponent> = new Map<string, ConditionFilterComponent>();\n\n register(type: string, filter: ConditionFilterComponent) {\n this.filters.set(type, filter);\n }\n\n unregister(type: string) {\n return this.filters.delete(type);\n }\n\n get(type: string): ConditionFilterComponent | undefined {\n return this.filters.get(type);\n }\n\n}\n\nexport const conditionFilterRegistry = new ConditionFilterRegistry();","/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Alert } from 'antd';\nimport React from 'react';\n\nexport interface FallbackConditionFilterProps {\n type: string;\n}\n\nexport function FallbackConditionFilter(props: FallbackConditionFilterProps) {\n return <Alert message={`Unsupported filter type:[${props.type}]`} type=\"warning\" showIcon />;\n}\n\nFallbackConditionFilter.displayName = 'FallbackConditionFilter';","/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { ConditionFilterProps } from './types';\nimport { conditionFilterRegistry } from './conditionFilterRegistry';\nimport { FallbackConditionFilter } from './FallbackConditionFilter';\n\nexport interface TypedConditionFilterProps\n extends ConditionFilterProps {\n type: string;\n}\n\nexport const ConditionFilter = React.memo(\n (props: TypedConditionFilterProps) => {\n const FilterComponent = conditionFilterRegistry.get(props.type);\n if (!FilterComponent) {\n return <FallbackConditionFilter type={props.type} />;\n }\n return <FilterComponent {...props} />;\n },\n);\n\nConditionFilter.displayName = 'ConditionFilter';","/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Select, SelectProps } from 'antd';\n\n/**\n * Props for the TagInput component.\n * Extends SelectProps from Antd, excluding 'mode', 'open', and 'suffixIcon' as they are fixed.\n */\nexport interface TagInputProps\n extends Omit<SelectProps, 'mode' | 'open' | 'suffixIcon'> {}\n\n/**\n * Default token separators for splitting input into tags.\n * Includes common separators like comma, semicolon, and space.\n */\nconst DEFAULT_TOKEN_SEPARATORS = [',', ',', ';', ';', ' '];\n\n/**\n * A tag input component based on Antd's Select in tags mode.\n * Allows users to input multiple tags separated by specified token separators.\n * @param props - The props for the TagInput component.\n * @returns The rendered TagInput component.\n */\nexport function TagInput(props: TagInputProps) {\n const {\n tokenSeparators = DEFAULT_TOKEN_SEPARATORS,\n allowClear = true,\n ...restProps\n } = props;\n return (\n <Select\n {...restProps}\n mode={'tags'}\n open={false}\n suffixIcon={null}\n allowClear={allowClear}\n tokenSeparators={tokenSeparators}\n />\n );\n}\n\nTagInput.displayName = 'TagInput';\n","/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nimport { OperatorLocale } from '@ahoo-wang/fetcher-wow';\n\nexport const OPERATOR_zh_CN: OperatorLocale = {\n AND: '与',\n OR: '或',\n NOR: '非或',\n ID: '等于',\n IDS: '包含',\n AGGREGATE_ID: '等于',\n AGGREGATE_IDS: '包含',\n TENANT_ID: '等于',\n OWNER_ID: '等于',\n DELETED: '已删除',\n ALL: '全部',\n EQ: '等于',\n NE: '不等于',\n GT: '大于',\n LT: '小于',\n GTE: '大于等于',\n LTE: '小于等于',\n CONTAINS: '包含',\n IN: '包含',\n NOT_IN: '不包含',\n BETWEEN: '在范围内',\n ALL_IN: '全部包含',\n STARTS_WITH: '以...开头',\n ENDS_WITH: '以...结尾',\n ELEM_MATCH: '元素匹配',\n NULL: '为空',\n NOT_NULL: '不为空',\n TRUE: '为真',\n FALSE: '为假',\n EXISTS: '存在',\n TODAY: '今天',\n BEFORE_TODAY: '今天之前',\n TOMORROW: '明天',\n THIS_WEEK: '本周',\n NEXT_WEEK: '下周',\n LAST_WEEK: '上周',\n THIS_MONTH: '本月',\n LAST_MONTH: '上月',\n RECENT_DAYS: '最近几天',\n EARLIER_DAYS: '几天前',\n RAW: '原始查询',\n};","/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Condition, OperatorLocale } from '@ahoo-wang/fetcher-wow';\n\nexport function friendlyCondition(label: string, operatorLocale: OperatorLocale, condition: Condition) {\n const friendlyParts = [];\n friendlyParts.push(label);\n friendlyParts.push(operatorLocale[condition.operator!]);\n const value = condition.value;\n if (Array.isArray(condition.value)) {\n friendlyParts.push(value.join(', '));\n } else {\n friendlyParts.push(value);\n }\n return friendlyParts.join(' ');\n}","/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ConditionFilterProps, ConditionFilterValue } from './types';\nimport { conditionFilterRegistry } from './conditionFilterRegistry';\nimport { Button, Input, Select, Space } from 'antd';\nimport { Operator, Condition } from '@ahoo-wang/fetcher-wow';\nimport { useState } from 'react';\nimport { TagInput } from '../components';\nimport { OPERATOR_zh_CN } from './locale';\nimport { friendlyCondition } from './friendlyCondition';\n\nexport const ID_CONDITION_FILTER = 'id';\n\nexport function IdConditionFilter(props: ConditionFilterProps) {\n const defaultOperator = props.operator.defaultValue || Operator.ID;\n const [operator, setOperator] = useState<Operator>(defaultOperator);\n const [value, setValue] = useState(props.value.defaultValue);\n\n const operatorLocale = props.operator.locale ?? OPERATOR_zh_CN;\n\n const buildConditionFilterValue = (): ConditionFilterValue | undefined => {\n if (!operator || !value || (Array.isArray(value) && value.length === 0)) {\n return undefined;\n }\n const condition: Condition = {\n operator,\n value,\n };\n const friendly = friendlyCondition(props.field.label, operatorLocale, condition);\n return { condition, friendly };\n };\n\n const handleOperatorChange = (newOperator: Operator) => {\n setOperator(newOperator);\n props.onChange?.(buildConditionFilterValue());\n };\n\n const handleValueChange = (newValue: any) => {\n setValue(newValue);\n props.onChange?.(buildConditionFilterValue());\n };\n const valueInput =\n operator === Operator.ID ? (\n <Input\n value={value}\n onChange={e => handleValueChange(e.target.value)}\n allowClear\n {...props.value}\n />\n ) : (\n <TagInput value={value} onChange={handleValueChange} {...props.value} />\n );\n return (\n <Space.Compact>\n <Button {...props.label}>{props.field.label}</Button>\n <Select\n defaultValue={Operator.ID}\n value={operator}\n onChange={handleOperatorChange}\n {...props.operator}\n >\n <Select.Option value={Operator.ID}>\n {operatorLocale[Operator.ID]}\n </Select.Option>\n <Select.Option value={Operator.IDS}>\n {operatorLocale[Operator.IDS]}\n </Select.Option>\n </Select>\n {valueInput}\n </Space.Compact>\n );\n}\n\nIdConditionFilter.displayName = 'IdConditionFilter';\n\nconditionFilterRegistry.register(ID_CONDITION_FILTER, IdConditionFilter);\n"],"names":["ConditionFilterRegistry","filters","Map","register","type","filter","set","unregister","delete","get","__name","_ConditionFilterRegistry","conditionFilterRegistry","FallbackConditionFilter","props","$","_c","t0","t1","Alert","displayName","ConditionFilter","React","memo","FilterComponent","jsx","DEFAULT_TOKEN_SEPARATORS","TagInput","restProps","tokenSeparators","allowClear","undefined","t2","Select","OPERATOR_zh_CN","AND","OR","NOR","ID","IDS","AGGREGATE_ID","AGGREGATE_IDS","TENANT_ID","OWNER_ID","DELETED","ALL","EQ","NE","GT","LT","GTE","LTE","CONTAINS","IN","NOT_IN","BETWEEN","ALL_IN","STARTS_WITH","ENDS_WITH","ELEM_MATCH","NULL","NOT_NULL","TRUE","FALSE","EXISTS","TODAY","BEFORE_TODAY","TOMORROW","THIS_WEEK","NEXT_WEEK","LAST_WEEK","THIS_MONTH","LAST_MONTH","RECENT_DAYS","EARLIER_DAYS","RAW","friendlyCondition","label","operatorLocale","condition","friendlyParts","push","operator","value","Array","isArray","join","ID_CONDITION_FILTER","IdConditionFilter","defaultOperator","defaultValue","Operator","setOperator","useState","setValue","locale","field","length","friendly","buildConditionFilterValue","newOperator","onChange","handleOperatorChange","newValue","handleValueChange","t3","Input","e","target","valueInput","t4","Button","t5","t6","t7","t8","t9","jsxs","t10","Space"],"mappings":";;;;;;;AAeO,MAAMA,IAAN,MAAMA,EAAwB;AAAA,EAA9B,cAAA;AAEL,SAAiBC,8BAAqDC,IAAAA;AAAAA,EAAsC;AAAA,EAE5GC,SAASC,GAAcC,GAAkC;AACvD,SAAKJ,QAAQK,IAAIF,GAAMC,CAAM;AAAA,EAC/B;AAAA,EAEAE,WAAWH,GAAc;AACvB,WAAO,KAAKH,QAAQO,OAAOJ,CAAI;AAAA,EACjC;AAAA,EAE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AAAoG,KAXlBC,IAAA,gBAAAC,EAACpF,GAAA,EACe,cAAA0D,EAAQrD,IACf4C,UACGoB,UAAAA,GAAoB,GAC1BxF,EAAKoE,UAET+B,UAAAA;AAAAA,IAAAA;AAAAA,IAGAE;AAAAA,EAAAA,GAGF,GAASpG,QAAAuF,GAAAvF,QAAAmE,GAAAnE,EAAA,EAAA,IAAAD,EAAAoE,UAAAnE,QAAAkG,GAAAlG,QAAAoG,GAAApG,QAAAqG,KAAAA,IAAArG,EAAA,EAAA;AAAA,MAAAuG;AAAA,SAAAvG,EAAA,EAAA,MAAA+F,KAAA/F,UAAAqG,KAAArG,EAAA,EAAA,MAAA8F,KAdXS,IAAA,gBAAAD,EAAAE,EAAA,SAAA,EACET,UAAAA;AAAAA,IAAAA;AAAAA,IACAM;AAAAA,IAaCP;AAAAA,EAAAA,GACH,GAAgB9F,QAAA+F,GAAA/F,QAAAqG,GAAArG,QAAA8F,GAAA9F,QAAAuG,KAAAA,IAAAvG,EAAA,EAAA,GAhBhBuG;AAgBgB;AAxDb9B,EAAAA,GAAAA;AA4DPA,EAAkBpE,cAAc;AAEhCR,EAAwBT,SAASoF,GAAqBC,CAAiB;"}
|
package/dist/index.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(i,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("react/jsx-runtime"),require("react-compiler-runtime"),require("react"),require("antd"),require("@ahoo-wang/fetcher-wow")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react-compiler-runtime","react","antd","@ahoo-wang/fetcher-wow"],r):(i=typeof globalThis<"u"?globalThis:i||self,r(i.FetcherReact={},i.ReactJSXRuntime,i.ReactCompilerRuntime,i.React,i.Antd,i.FetcherWow))})(this,(function(i,r,S,L,s,f){"use strict";var K=Object.defineProperty;var u=(i,r)=>K(i,"name",{value:r,configurable:!0});const G=class G{constructor(){this.filters=new Map}register(e,n){this.filters.set(e,n)}unregister(e){return this.filters.delete(e)}get(e){return this.filters.get(e)}};u(G,"ConditionFilterRegistry");let h=G;const v=new h;function R(t){const e=S.c(2),n=`Unsupported filter type:[${t.type}]`;let l;return e[0]!==n?(l=r.jsx(s.Alert,{message:n,type:"warning",showIcon:!0}),e[0]=n,e[1]=l):l=e[1],l}u(R,"FallbackConditionFilter"),R.displayName="FallbackConditionFilter";const P=L.memo(t=>{const e=S.c(7);let n;e[0]!==t.type?(n=v.get(t.type),e[0]=t.type,e[1]=n):n=e[1];const l=n;if(!l){let a;return e[2]!==t.type?(a=r.jsx(R,{type:t.type}),e[2]=t.type,e[3]=a):a=e[3],a}let o;return e[4]!==l||e[5]!==t?(o=r.jsx(l,{...t}),e[4]=l,e[5]=t,e[6]=o):o=e[6],o});P.displayName="ConditionFilter";const q=[",",",",";",";"," "];function b(t){const e=S.c(8);let n,l,o;e[0]!==t?({tokenSeparators:l,allowClear:o,...n}=t,e[0]=t,e[1]=n,e[2]=l,e[3]=o):(n=e[1],l=e[2],o=e[3]);const a=l===void 0?q:l,A=o===void 0?!0:o;let c;return e[4]!==A||e[5]!==n||e[6]!==a?(c=r.jsx(s.Select,{...n,mode:"tags",open:!1,suffixIcon:null,allowClear:A,tokenSeparators:a}),e[4]=A,e[5]=n,e[6]=a,e[7]=c):c=e[7],c}u(b,"TagInput"),b.displayName="TagInput";const V={AND:"与",OR:"或",NOR:"非或",ID:"等于",IDS:"包含",AGGREGATE_ID:"等于",AGGREGATE_IDS:"包含",TENANT_ID:"等于",OWNER_ID:"等于",DELETED:"已删除",ALL:"全部",EQ:"等于",NE:"不等于",GT:"大于",LT:"小于",GTE:"大于等于",LTE:"小于等于",CONTAINS:"包含",IN:"包含",NOT_IN:"不包含",BETWEEN:"在范围内",ALL_IN:"全部包含",STARTS_WITH:"以...开头",ENDS_WITH:"以...结尾",ELEM_MATCH:"元素匹配",NULL:"为空",NOT_NULL:"不为空",TRUE:"为真",FALSE:"为假",EXISTS:"存在",TODAY:"今天",BEFORE_TODAY:"今天之前",TOMORROW:"明天",THIS_WEEK:"本周",NEXT_WEEK:"下周",LAST_WEEK:"上周",THIS_MONTH:"本月",LAST_MONTH:"上月",RECENT_DAYS:"最近几天",EARLIER_DAYS:"几天前",RAW:"原始查询"};function U(t,e,n){const l=[];l.push(t),l.push(e[n.operator]);const o=n.value;return Array.isArray(n.value)?l.push(o.join(", ")):l.push(o),l.join(" ")}u(U,"friendlyCondition");const k="id";function w(t){const e=S.c(33),n=t.operator.defaultValue||f.Operator.ID,[l,o]=L.useState(n),[a,A]=L.useState(t.value.defaultValue),c=t.operator.locale??V;let C;e[0]!==l||e[1]!==c||e[2]!==t.field.label||e[3]!==a?(C=u(()=>{if(!l||!a||Array.isArray(a)&&a.length===0)return;const d={operator:l,value:a},$=U(t.field.label,c,d);return{condition:d,friendly:$}},"t0"),e[0]=l,e[1]=c,e[2]=t.field.label,e[3]=a,e[4]=C):C=e[4];const T=C;let _;e[5]!==T||e[6]!==t?(_=u(d=>{o(d),t.onChange?.(T())},"t1"),e[5]=T,e[6]=t,e[7]=_):_=e[7];const j=_;let y;e[8]!==T||e[9]!==t?(y=u(d=>{A(d),t.onChange?.(T())},"t2"),e[8]=T,e[9]=t,e[10]=y):y=e[10];const D=y;let F;e[11]!==D||e[12]!==l||e[13]!==t.value||e[14]!==a?(F=l===f.Operator.ID?r.jsx(s.Input,{value:a,onChange:u(d=>D(d.target.value),"onChange"),allowClear:!0,...t.value}):r.jsx(b,{value:a,onChange:D,...t.value}),e[11]=D,e[12]=l,e[13]=t.value,e[14]=a,e[15]=F):F=e[15];const H=F;let E;e[16]!==t.field.label||e[17]!==t.label?(E=r.jsx(s.Button,{...t.label,children:t.field.label}),e[16]=t.field.label,e[17]=t.label,e[18]=E):E=e[18];const M=c[f.Operator.ID];let I;e[19]!==M?(I=r.jsx(s.Select.Option,{value:f.Operator.ID,children:M}),e[19]=M,e[20]=I):I=e[20];const m=c[f.Operator.IDS];let O;e[21]!==m?(O=r.jsx(s.Select.Option,{value:f.Operator.IDS,children:m}),e[21]=m,e[22]=O):O=e[22];let N;e[23]!==j||e[24]!==l||e[25]!==t.operator||e[26]!==I||e[27]!==O?(N=r.jsxs(s.Select,{defaultValue:f.Operator.ID,value:l,onChange:j,...t.operator,children:[I,O]}),e[23]=j,e[24]=l,e[25]=t.operator,e[26]=I,e[27]=O,e[28]=N):N=e[28];let g;return e[29]!==E||e[30]!==N||e[31]!==H?(g=r.jsxs(s.Space.Compact,{children:[E,N,H]}),e[29]=E,e[30]=N,e[31]=H,e[32]=g):g=e[32],g}u(w,"IdConditionFilter"),w.displayName="IdConditionFilter",v.register(k,w),i.ConditionFilter=P,i.ConditionFilterRegistry=h,i.FallbackConditionFilter=R,i.ID_CONDITION_FILTER=k,i.IdConditionFilter=w,i.OPERATOR_zh_CN=V,i.TagInput=b,i.conditionFilterRegistry=v,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})}));
|
|
2
2
|
//# sourceMappingURL=index.umd.js.map
|
package/dist/index.umd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.umd.js","sources":["../src/filter/conditionFilterRegistry.ts","../src/filter/conditionFilter.tsx"],"sourcesContent":["/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nimport { ConditionFilterComponent } from './types';\n\nexport class ConditionFilterRegistry {\n\n private readonly filters: Map<string, ConditionFilterComponent> = new Map<string, ConditionFilterComponent>();\n\n register(type: string, filter: ConditionFilterComponent) {\n this.filters.set(type, filter);\n }\n\n unregister(type: string) {\n return this.filters.delete(type);\n }\n\n get(type: string): ConditionFilterComponent | undefined {\n return this.filters.get(type);\n }\n\n}\n\nexport const conditionFilterRegistry = new ConditionFilterRegistry();","/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ConditionFilterProps } from './types';\nimport { conditionFilterRegistry } from './conditionFilterRegistry';\n\nexport interface TypedConditionFilterProps extends ConditionFilterProps {\n type: string;\n}\n\nexport function ConditionFilter(props: TypedConditionFilterProps) {\n const filter = conditionFilterRegistry.get(props.type);\n if (!filter) {\n throw new Error(`ConditionFilter type ${props.type} not found.`);\n }\n return filter(props);\n}"],"names":["ConditionFilterRegistry","type","filter","conditionFilterRegistry","ConditionFilter","props"],"mappings":"qOAgBO,MAAMA,CAAwB,CAA9B,aAAA,CAEL,KAAiB,YAAqD,GAAsC,CAE5G,SAASC,EAAcC,EAAkC,CACvD,KAAK,QAAQ,IAAID,EAAMC,CAAM,CAC/B,CAEA,WAAWD,EAAc,CACvB,OAAO,KAAK,QAAQ,OAAOA,CAAI,CACjC,CAEA,IAAIA,EAAoD,CACtD,OAAO,KAAK,QAAQ,IAAIA,CAAI,CAC9B,CAEF,CAEO,MAAME,EAA0B,IAAIH,ECdpC,SAASI,EAAgBC,EAAkC,CAChE,MAAMH,EAASC,EAAwB,IAAIE,EAAM,IAAI,EACrD,GAAI,CAACH,EACH,MAAM,IAAI,MAAM,wBAAwBG,EAAM,IAAI,aAAa,EAEjE,OAAOH,EAAOG,CAAK,CACrB"}
|
|
1
|
+
{"version":3,"file":"index.umd.js","sources":["../src/filter/conditionFilterRegistry.ts","../src/filter/FallbackConditionFilter.tsx","../src/filter/ConditionFilter.tsx","../src/components/TagInput.tsx","../src/filter/locale/operator.zh_CN.ts","../src/filter/friendlyCondition.ts","../src/filter/IdConditionFilter.tsx"],"sourcesContent":["/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ConditionFilterComponent } from './types';\n\nexport class ConditionFilterRegistry {\n\n private readonly filters: Map<string, ConditionFilterComponent> = new Map<string, ConditionFilterComponent>();\n\n register(type: string, filter: ConditionFilterComponent) {\n this.filters.set(type, filter);\n }\n\n unregister(type: string) {\n return this.filters.delete(type);\n }\n\n get(type: string): ConditionFilterComponent | undefined {\n return this.filters.get(type);\n }\n\n}\n\nexport const conditionFilterRegistry = new ConditionFilterRegistry();","/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Alert } from 'antd';\nimport React from 'react';\n\nexport interface FallbackConditionFilterProps {\n type: string;\n}\n\nexport function FallbackConditionFilter(props: FallbackConditionFilterProps) {\n return <Alert message={`Unsupported filter type:[${props.type}]`} type=\"warning\" showIcon />;\n}\n\nFallbackConditionFilter.displayName = 'FallbackConditionFilter';","/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { ConditionFilterProps } from './types';\nimport { conditionFilterRegistry } from './conditionFilterRegistry';\nimport { FallbackConditionFilter } from './FallbackConditionFilter';\n\nexport interface TypedConditionFilterProps\n extends ConditionFilterProps {\n type: string;\n}\n\nexport const ConditionFilter = React.memo(\n (props: TypedConditionFilterProps) => {\n const FilterComponent = conditionFilterRegistry.get(props.type);\n if (!FilterComponent) {\n return <FallbackConditionFilter type={props.type} />;\n }\n return <FilterComponent {...props} />;\n },\n);\n\nConditionFilter.displayName = 'ConditionFilter';","/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Select, SelectProps } from 'antd';\n\n/**\n * Props for the TagInput component.\n * Extends SelectProps from Antd, excluding 'mode', 'open', and 'suffixIcon' as they are fixed.\n */\nexport interface TagInputProps\n extends Omit<SelectProps, 'mode' | 'open' | 'suffixIcon'> {}\n\n/**\n * Default token separators for splitting input into tags.\n * Includes common separators like comma, semicolon, and space.\n */\nconst DEFAULT_TOKEN_SEPARATORS = [',', ',', ';', ';', ' '];\n\n/**\n * A tag input component based on Antd's Select in tags mode.\n * Allows users to input multiple tags separated by specified token separators.\n * @param props - The props for the TagInput component.\n * @returns The rendered TagInput component.\n */\nexport function TagInput(props: TagInputProps) {\n const {\n tokenSeparators = DEFAULT_TOKEN_SEPARATORS,\n allowClear = true,\n ...restProps\n } = props;\n return (\n <Select\n {...restProps}\n mode={'tags'}\n open={false}\n suffixIcon={null}\n allowClear={allowClear}\n tokenSeparators={tokenSeparators}\n />\n );\n}\n\nTagInput.displayName = 'TagInput';\n","/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nimport { OperatorLocale } from '@ahoo-wang/fetcher-wow';\n\nexport const OPERATOR_zh_CN: OperatorLocale = {\n AND: '与',\n OR: '或',\n NOR: '非或',\n ID: '等于',\n IDS: '包含',\n AGGREGATE_ID: '等于',\n AGGREGATE_IDS: '包含',\n TENANT_ID: '等于',\n OWNER_ID: '等于',\n DELETED: '已删除',\n ALL: '全部',\n EQ: '等于',\n NE: '不等于',\n GT: '大于',\n LT: '小于',\n GTE: '大于等于',\n LTE: '小于等于',\n CONTAINS: '包含',\n IN: '包含',\n NOT_IN: '不包含',\n BETWEEN: '在范围内',\n ALL_IN: '全部包含',\n STARTS_WITH: '以...开头',\n ENDS_WITH: '以...结尾',\n ELEM_MATCH: '元素匹配',\n NULL: '为空',\n NOT_NULL: '不为空',\n TRUE: '为真',\n FALSE: '为假',\n EXISTS: '存在',\n TODAY: '今天',\n BEFORE_TODAY: '今天之前',\n TOMORROW: '明天',\n THIS_WEEK: '本周',\n NEXT_WEEK: '下周',\n LAST_WEEK: '上周',\n THIS_MONTH: '本月',\n LAST_MONTH: '上月',\n RECENT_DAYS: '最近几天',\n EARLIER_DAYS: '几天前',\n RAW: '原始查询',\n};","/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Condition, OperatorLocale } from '@ahoo-wang/fetcher-wow';\n\nexport function friendlyCondition(label: string, operatorLocale: OperatorLocale, condition: Condition) {\n const friendlyParts = [];\n friendlyParts.push(label);\n friendlyParts.push(operatorLocale[condition.operator!]);\n const value = condition.value;\n if (Array.isArray(condition.value)) {\n friendlyParts.push(value.join(', '));\n } else {\n friendlyParts.push(value);\n }\n return friendlyParts.join(' ');\n}","/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ConditionFilterProps, ConditionFilterValue } from './types';\nimport { conditionFilterRegistry } from './conditionFilterRegistry';\nimport { Button, Input, Select, Space } from 'antd';\nimport { Operator, Condition } from '@ahoo-wang/fetcher-wow';\nimport { useState } from 'react';\nimport { TagInput } from '../components';\nimport { OPERATOR_zh_CN } from './locale';\nimport { friendlyCondition } from './friendlyCondition';\n\nexport const ID_CONDITION_FILTER = 'id';\n\nexport function IdConditionFilter(props: ConditionFilterProps) {\n const defaultOperator = props.operator.defaultValue || Operator.ID;\n const [operator, setOperator] = useState<Operator>(defaultOperator);\n const [value, setValue] = useState(props.value.defaultValue);\n\n const operatorLocale = props.operator.locale ?? OPERATOR_zh_CN;\n\n const buildConditionFilterValue = (): ConditionFilterValue | undefined => {\n if (!operator || !value || (Array.isArray(value) && value.length === 0)) {\n return undefined;\n }\n const condition: Condition = {\n operator,\n value,\n };\n const friendly = friendlyCondition(props.field.label, operatorLocale, condition);\n return { condition, friendly };\n };\n\n const handleOperatorChange = (newOperator: Operator) => {\n setOperator(newOperator);\n props.onChange?.(buildConditionFilterValue());\n };\n\n const handleValueChange = (newValue: any) => {\n setValue(newValue);\n props.onChange?.(buildConditionFilterValue());\n };\n const valueInput =\n operator === Operator.ID ? (\n <Input\n value={value}\n onChange={e => handleValueChange(e.target.value)}\n allowClear\n {...props.value}\n />\n ) : (\n <TagInput value={value} onChange={handleValueChange} {...props.value} />\n );\n return (\n <Space.Compact>\n <Button {...props.label}>{props.field.label}</Button>\n <Select\n defaultValue={Operator.ID}\n value={operator}\n onChange={handleOperatorChange}\n {...props.operator}\n >\n <Select.Option value={Operator.ID}>\n {operatorLocale[Operator.ID]}\n </Select.Option>\n <Select.Option value={Operator.IDS}>\n {operatorLocale[Operator.IDS]}\n </Select.Option>\n </Select>\n {valueInput}\n </Space.Compact>\n );\n}\n\nIdConditionFilter.displayName = 'IdConditionFilter';\n\nconditionFilterRegistry.register(ID_CONDITION_FILTER, IdConditionFilter);\n"],"names":["ConditionFilterRegistry","filters","Map","register","type","filter","set","unregister","delete","get","__name","_ConditionFilterRegistry","conditionFilterRegistry","FallbackConditionFilter","props","$","_c","t0","t1","Alert","displayName","ConditionFilter","React","memo","FilterComponent","jsx","DEFAULT_TOKEN_SEPARATORS","TagInput","restProps","tokenSeparators","allowClear","undefined","t2","Select","OPERATOR_zh_CN","AND","OR","NOR","ID","IDS","AGGREGATE_ID","AGGREGATE_IDS","TENANT_ID","OWNER_ID","DELETED","ALL","EQ","NE","GT","LT","GTE","LTE","CONTAINS","IN","NOT_IN","BETWEEN","ALL_IN","STARTS_WITH","ENDS_WITH","ELEM_MATCH","NULL","NOT_NULL","TRUE","FALSE","EXISTS","TODAY","BEFORE_TODAY","TOMORROW","THIS_WEEK","NEXT_WEEK","LAST_WEEK","THIS_MONTH","LAST_MONTH","RECENT_DAYS","EARLIER_DAYS","RAW","friendlyCondition","label","operatorLocale","condition","friendlyParts","push","operator","value","Array","isArray","join","ID_CONDITION_FILTER","IdConditionFilter","defaultOperator","defaultValue","Operator","setOperator","useState","setValue","locale","field","length","friendly","buildConditionFilterValue","newOperator","onChange","handleOperatorChange","newValue","handleValueChange","t3","Input","e","target","valueInput","t4","Button","t5","t6","t7","t8","t9","jsxs","t10","Space"],"mappings":"0lBAeO,MAAMA,EAAN,MAAMA,CAAwB,CAA9B,aAAA,CAEL,KAAiBC,YAAqDC,GAAsC,CAE5GC,SAASC,EAAcC,EAAkC,CACvD,KAAKJ,QAAQK,IAAIF,EAAMC,CAAM,CAC/B,CAEAE,WAAWH,EAAc,CACvB,OAAO,KAAKH,QAAQO,OAAOJ,CAAI,CACjC,CAEAK,IAAIL,EAAoD,CACtD,OAAO,KAAKH,QAAQQ,IAAIL,CAAI,CAC9B,CAEF,EAhBqCM,EAAAC,EAAA,2BAA9B,IAAMX,EAANW,EAkBA,MAAMC,EAA0B,IAAIZ,ECbpC,SAAAa,EAAAC,EAAA,CAAA,MAAAC,EAAAC,EAAAA,EAAA,CAAA,EACkBC,EAAA,4BAA4BH,EAAKV,IAAK,IAAG,IAAAc,EAAA,OAAAH,OAAAE,GAAzDC,QAACC,EAAAA,MAAA,CAAe,QAAAF,EAAgD,KAAA,UAAU,SAAA,GAAQ,EAAGF,KAAAE,EAAAF,KAAAG,GAAAA,EAAAH,EAAA,CAAA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/fetcher-viewer",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fetch",
|
|
@@ -40,36 +40,36 @@
|
|
|
40
40
|
"react-use": "^17.6.0"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"react": ">=18.0.0",
|
|
44
|
-
"react-dom": ">=18.0.0",
|
|
45
|
-
"antd": "5.27.4",
|
|
46
43
|
"@ahoo-wang/fetcher": "^2.3.4",
|
|
44
|
+
"@ahoo-wang/fetcher-openapi": "^2.3.4",
|
|
45
|
+
"@ahoo-wang/fetcher-react": "^2.8.0",
|
|
47
46
|
"@ahoo-wang/fetcher-storage": "^2.3.4",
|
|
48
47
|
"@ahoo-wang/fetcher-wow": "^2.3.4",
|
|
49
|
-
"
|
|
50
|
-
"
|
|
48
|
+
"antd": "5.27.4",
|
|
49
|
+
"react": ">=18.0.0",
|
|
50
|
+
"react-dom": ">=18.0.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@eslint/js": "^9.37.0",
|
|
54
|
+
"@testing-library/react": "^16.0.0",
|
|
55
|
+
"@types/react": "^18.3.26",
|
|
56
|
+
"@types/react-dom": "^18.3.7",
|
|
57
|
+
"@vitejs/plugin-react": "^5.0.4",
|
|
54
58
|
"@vitest/coverage-v8": "^3.2.4",
|
|
55
59
|
"@vitest/ui": "^3.2.4",
|
|
60
|
+
"babel-plugin-react-compiler": "1.0.0",
|
|
56
61
|
"eslint": "^9.37.0",
|
|
62
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
57
63
|
"globals": "^16.4.0",
|
|
64
|
+
"jsdom": "^27.0.0",
|
|
58
65
|
"prettier": "^3.6.2",
|
|
66
|
+
"react-compiler-runtime": "1.0.0",
|
|
59
67
|
"typescript": "^5.9.3",
|
|
60
68
|
"typescript-eslint": "^8.46.0",
|
|
61
|
-
"eslint-plugin-react-hooks": "^5.2.0",
|
|
62
69
|
"unplugin-dts": "1.0.0-beta.6",
|
|
63
70
|
"vite": "^7.1.9",
|
|
64
71
|
"vite-bundle-analyzer": "^1.2.3",
|
|
65
|
-
"vitest": "^3.2.4"
|
|
66
|
-
"@testing-library/react": "^16.0.0",
|
|
67
|
-
"@types/react": "^18.3.26",
|
|
68
|
-
"@types/react-dom": "^18.3.7",
|
|
69
|
-
"jsdom": "^27.0.0",
|
|
70
|
-
"react": "^18.3.1",
|
|
71
|
-
"react-dom": "^18.3.1",
|
|
72
|
-
"@vitejs/plugin-react": "^5.0.4"
|
|
72
|
+
"vitest": "^3.2.4"
|
|
73
73
|
},
|
|
74
74
|
"scripts": {
|
|
75
75
|
"build": "vite build",
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ConditionFilterProps } from './types';
|
|
2
|
-
export interface TypedConditionFilterProps extends ConditionFilterProps {
|
|
3
|
-
type: string;
|
|
4
|
-
}
|
|
5
|
-
export declare function ConditionFilter(props: TypedConditionFilterProps): import('react').ReactNode;
|
|
6
|
-
//# sourceMappingURL=conditionFilter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"conditionFilter.d.ts","sourceRoot":"","sources":["../../src/filter/conditionFilter.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAG/C,MAAM,WAAW,yBAA0B,SAAQ,oBAAoB;IACrE,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,yBAAyB,6BAM/D"}
|