@ahoo-wang/fetcher-viewer 2.12.8 → 2.13.0
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 +12 -0
- package/dist/components/NumberRange.d.ts.map +1 -0
- package/dist/components/TagInput.d.ts +15 -3
- package/dist/components/TagInput.d.ts.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/filter/AssemblyFilter.d.ts +12 -0
- package/dist/filter/AssemblyFilter.d.ts.map +1 -0
- package/dist/filter/FallbackFilter.d.ts +6 -0
- package/dist/filter/FallbackFilter.d.ts.map +1 -0
- package/dist/filter/IdFilter.d.ts +7 -0
- package/dist/filter/IdFilter.d.ts.map +1 -0
- package/dist/filter/NumberFilter.d.ts +7 -0
- package/dist/filter/NumberFilter.d.ts.map +1 -0
- package/dist/filter/TextFilter.d.ts +7 -0
- package/dist/filter/TextFilter.d.ts.map +1 -0
- package/dist/filter/TypedFilter.d.ts +10 -0
- package/dist/filter/TypedFilter.d.ts.map +1 -0
- package/dist/filter/filterRegistry.d.ts +50 -0
- package/dist/filter/filterRegistry.d.ts.map +1 -0
- package/dist/filter/index.d.ts +9 -5
- package/dist/filter/index.d.ts.map +1 -1
- package/dist/filter/types.d.ts +17 -17
- package/dist/filter/types.d.ts.map +1 -1
- package/dist/filter/useFilterState.d.ts +19 -0
- package/dist/filter/useFilterState.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +328 -164
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/types.d.ts +7 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +7 -5
- package/dist/filter/ConditionFilter.d.ts +0 -7
- package/dist/filter/ConditionFilter.d.ts.map +0 -1
- package/dist/filter/FallbackConditionFilter.d.ts +0 -8
- package/dist/filter/FallbackConditionFilter.d.ts.map +0 -1
- package/dist/filter/IdConditionFilter.d.ts +0 -7
- package/dist/filter/IdConditionFilter.d.ts.map +0 -1
- package/dist/filter/conditionFilterRegistry.d.ts +0 -51
- package/dist/filter/conditionFilterRegistry.d.ts.map +0 -1
- package/dist/filter/friendlyCondition.d.ts +0 -3
- package/dist/filter/friendlyCondition.d.ts.map +0 -1
package/dist/index.es.js
CHANGED
|
@@ -1,106 +1,18 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
import {
|
|
4
|
-
import { c as
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import { Operator as
|
|
8
|
-
const
|
|
9
|
-
constructor() {
|
|
10
|
-
this.filters = /* @__PURE__ */ new Map();
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Registers a condition filter component for a specific type.
|
|
14
|
-
*
|
|
15
|
-
* @param type - The unique identifier for the filter type
|
|
16
|
-
* @param filter - The condition filter component to register
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```typescript
|
|
20
|
-
* const registry = new ConditionFilterRegistry();
|
|
21
|
-
* registry.register('text', TextConditionFilter);
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
register(e, n) {
|
|
25
|
-
this.filters.set(e, n);
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Unregisters a condition filter component for a specific type.
|
|
29
|
-
*
|
|
30
|
-
* @param type - The unique identifier for the filter type to remove
|
|
31
|
-
* @returns true if the filter was successfully removed, false otherwise
|
|
32
|
-
*
|
|
33
|
-
* @example
|
|
34
|
-
* ```typescript
|
|
35
|
-
* const registry = new ConditionFilterRegistry();
|
|
36
|
-
* const wasRemoved = registry.unregister('text');
|
|
37
|
-
* ```
|
|
38
|
-
*/
|
|
39
|
-
unregister(e) {
|
|
40
|
-
return this.filters.delete(e);
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Retrieves a condition filter component for a specific type.
|
|
44
|
-
*
|
|
45
|
-
* @param type - The unique identifier for the filter type
|
|
46
|
-
* @returns The condition filter component, or undefined if not found
|
|
47
|
-
*
|
|
48
|
-
* @example
|
|
49
|
-
* ```typescript
|
|
50
|
-
* const registry = new ConditionFilterRegistry();
|
|
51
|
-
* const TextFilter = registry.get('text');
|
|
52
|
-
* ```
|
|
53
|
-
*/
|
|
54
|
-
get(e) {
|
|
55
|
-
return this.filters.get(e);
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
r(F, "ConditionFilterRegistry");
|
|
59
|
-
let v = F;
|
|
60
|
-
const G = new v();
|
|
61
|
-
function w(t) {
|
|
62
|
-
const e = m(2), n = `Unsupported filter type:[${t.type}]`;
|
|
63
|
-
let l;
|
|
64
|
-
return e[0] !== n ? (l = /* @__PURE__ */ u(j, { message: n, type: "warning", showIcon: !0 }), e[0] = n, e[1] = l) : l = e[1], l;
|
|
65
|
-
}
|
|
66
|
-
r(w, "FallbackConditionFilter");
|
|
67
|
-
w.displayName = "FallbackConditionFilter";
|
|
68
|
-
const P = $.memo((t) => {
|
|
69
|
-
const e = m(7);
|
|
70
|
-
let n;
|
|
71
|
-
e[0] !== t.type ? (n = G.get(t.type), e[0] = t.type, e[1] = n) : n = e[1];
|
|
72
|
-
const l = n;
|
|
73
|
-
if (!l) {
|
|
74
|
-
let a;
|
|
75
|
-
return e[2] !== t.type ? (a = /* @__PURE__ */ u(w, { type: t.type }), e[2] = t.type, e[3] = a) : a = e[3], a;
|
|
76
|
-
}
|
|
77
|
-
let i;
|
|
78
|
-
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;
|
|
79
|
-
});
|
|
80
|
-
P.displayName = "ConditionFilter";
|
|
81
|
-
const Y = [",", ",", ";", ";", " "];
|
|
82
|
-
function H(t) {
|
|
83
|
-
const e = m(8);
|
|
84
|
-
let n, l, i;
|
|
85
|
-
e[0] !== t ? ({
|
|
86
|
-
tokenSeparators: l,
|
|
87
|
-
allowClear: i,
|
|
88
|
-
...n
|
|
89
|
-
} = t, e[0] = t, e[1] = n, e[2] = l, e[3] = i) : (n = e[1], l = e[2], i = e[3]);
|
|
90
|
-
const a = l === void 0 ? Y : l, A = i === void 0 ? !0 : i;
|
|
91
|
-
let o;
|
|
92
|
-
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;
|
|
93
|
-
}
|
|
94
|
-
r(H, "TagInput");
|
|
95
|
-
H.displayName = "TagInput";
|
|
96
|
-
const B = {
|
|
1
|
+
var B = Object.defineProperty;
|
|
2
|
+
var u = (t, e) => B(t, "name", { value: e, configurable: !0 });
|
|
3
|
+
import { jsxs as D, jsx as E } from "react/jsx-runtime";
|
|
4
|
+
import { c as g } from "react/compiler-runtime";
|
|
5
|
+
import { useState as S, useImperativeHandle as x } from "react";
|
|
6
|
+
import { Space as z, Button as P, Select as W, Alert as U, InputNumber as V, Input as w } from "antd";
|
|
7
|
+
import { Operator as s } from "@ahoo-wang/fetcher-wow";
|
|
8
|
+
const k = {
|
|
97
9
|
AND: "与",
|
|
98
10
|
OR: "或",
|
|
99
11
|
NOR: "非或",
|
|
100
12
|
ID: "等于",
|
|
101
|
-
IDS: "
|
|
13
|
+
IDS: "包含任一",
|
|
102
14
|
AGGREGATE_ID: "等于",
|
|
103
|
-
AGGREGATE_IDS: "
|
|
15
|
+
AGGREGATE_IDS: "包含任一",
|
|
104
16
|
TENANT_ID: "等于",
|
|
105
17
|
OWNER_ID: "等于",
|
|
106
18
|
DELETED: "已删除",
|
|
@@ -112,9 +24,9 @@ const B = {
|
|
|
112
24
|
GTE: "大于等于",
|
|
113
25
|
LTE: "小于等于",
|
|
114
26
|
CONTAINS: "包含",
|
|
115
|
-
IN: "
|
|
116
|
-
NOT_IN: "
|
|
117
|
-
BETWEEN: "
|
|
27
|
+
IN: "包含任一",
|
|
28
|
+
NOT_IN: "不包含任一",
|
|
29
|
+
BETWEEN: "介于",
|
|
118
30
|
ALL_IN: "全部包含",
|
|
119
31
|
STARTS_WITH: "以...开头",
|
|
120
32
|
ENDS_WITH: "以...结尾",
|
|
@@ -135,75 +47,327 @@ const B = {
|
|
|
135
47
|
RECENT_DAYS: "最近几天",
|
|
136
48
|
EARLIER_DAYS: "几天前",
|
|
137
49
|
RAW: "原始查询"
|
|
138
|
-
};
|
|
139
|
-
function
|
|
140
|
-
const l = [];
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
50
|
+
}, K = /* @__PURE__ */ u((t, e) => !t || !e ? !1 : !(Array.isArray(e) && e.length === 0), "defaultValueValidate");
|
|
51
|
+
function Y(t) {
|
|
52
|
+
const e = g(19), [l, n] = S(t.operator), [r, a] = S(t.value), o = t.validate ?? K;
|
|
53
|
+
let i;
|
|
54
|
+
e[0] !== t.field || e[1] !== o ? (i = /* @__PURE__ */ u((c, m) => o(c, m) ? {
|
|
55
|
+
condition: {
|
|
56
|
+
field: t.field,
|
|
57
|
+
operator: c,
|
|
58
|
+
value: m
|
|
59
|
+
}
|
|
60
|
+
} : void 0, "t0"), e[0] = t.field, e[1] = o, e[2] = i) : i = e[2];
|
|
61
|
+
const d = i;
|
|
62
|
+
let v;
|
|
63
|
+
e[3] !== t || e[4] !== d ? (v = /* @__PURE__ */ u((c) => {
|
|
64
|
+
n(c), a(void 0);
|
|
65
|
+
const m = d(c, void 0);
|
|
66
|
+
t.onChange?.(m);
|
|
67
|
+
}, "t1"), e[3] = t, e[4] = d, e[5] = v) : v = e[5];
|
|
68
|
+
const f = v;
|
|
69
|
+
let N;
|
|
70
|
+
e[6] !== l || e[7] !== t || e[8] !== d ? (N = /* @__PURE__ */ u((c) => {
|
|
71
|
+
a(c);
|
|
72
|
+
const m = d(l, c);
|
|
73
|
+
t.onChange?.(m);
|
|
74
|
+
}, "t2"), e[6] = l, e[7] = t, e[8] = d, e[9] = N) : N = e[9];
|
|
75
|
+
const h = N;
|
|
76
|
+
let T;
|
|
77
|
+
e[10] !== l || e[11] !== d || e[12] !== r ? (T = /* @__PURE__ */ u(() => ({
|
|
78
|
+
getValue() {
|
|
79
|
+
return d(l, r);
|
|
80
|
+
}
|
|
81
|
+
}), "t3"), e[10] = l, e[11] = d, e[12] = r, e[13] = T) : T = e[13], x(t.ref, T);
|
|
82
|
+
let I;
|
|
83
|
+
return e[14] !== l || e[15] !== f || e[16] !== h || e[17] !== r ? (I = {
|
|
84
|
+
operator: l,
|
|
85
|
+
value: r,
|
|
86
|
+
setOperator: f,
|
|
87
|
+
setValue: h
|
|
88
|
+
}, e[14] = l, e[15] = f, e[16] = h, e[17] = r, e[18] = I) : I = e[18], I;
|
|
144
89
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
90
|
+
u(Y, "useFilterState");
|
|
91
|
+
function R(t) {
|
|
92
|
+
if (!t.supportedOperators || t.supportedOperators.length === 0)
|
|
93
|
+
throw new Error("supportedOperators must be a non-empty array");
|
|
94
|
+
const e = t.operator.locale ?? k;
|
|
95
|
+
let l = t.operator.defaultValue;
|
|
96
|
+
(!l || !t.supportedOperators.includes(l)) && (l = t.supportedOperators[0]);
|
|
97
|
+
const n = Y({
|
|
98
|
+
field: t.field.name,
|
|
99
|
+
operator: l,
|
|
100
|
+
value: t.value.defaultValue,
|
|
101
|
+
ref: t.ref,
|
|
102
|
+
validate: t.validate,
|
|
103
|
+
onChange: t.onChange
|
|
104
|
+
}), r = t.valueInputSupplier(n), a = t.supportedOperators.map((o) => ({
|
|
105
|
+
value: o,
|
|
106
|
+
label: e[o]
|
|
107
|
+
}));
|
|
108
|
+
return /* @__PURE__ */ D(z.Compact, { children: [
|
|
109
|
+
/* @__PURE__ */ E(P, { ...t.label, children: t.field.label }),
|
|
110
|
+
/* @__PURE__ */ E(W, { onChange: n.setOperator, ...t.operator, value: n.operator, options: a }),
|
|
111
|
+
r
|
|
112
|
+
] });
|
|
113
|
+
}
|
|
114
|
+
u(R, "AssemblyFilter");
|
|
115
|
+
function H(t) {
|
|
116
|
+
return x(t.ref, () => ({
|
|
117
|
+
getValue() {
|
|
118
|
+
}
|
|
119
|
+
})), /* @__PURE__ */ E(U, { message: `Unsupported filter type:[${t.type}]`, type: "warning", showIcon: !0 });
|
|
120
|
+
}
|
|
121
|
+
u(H, "FallbackFilter");
|
|
122
|
+
H.displayName = "FallbackFilter";
|
|
123
|
+
const Q = {
|
|
124
|
+
serialize(t) {
|
|
125
|
+
return t;
|
|
126
|
+
},
|
|
127
|
+
deserialize(t) {
|
|
128
|
+
return t;
|
|
129
|
+
}
|
|
130
|
+
}, X = {
|
|
131
|
+
serialize(t) {
|
|
132
|
+
return t.map((e) => e.toString());
|
|
133
|
+
},
|
|
134
|
+
deserialize(t) {
|
|
135
|
+
return t.map((e) => parseFloat(e));
|
|
136
|
+
}
|
|
137
|
+
}, j = [",", ",", ";", ";", " "];
|
|
138
|
+
function y(t) {
|
|
139
|
+
const e = g(22);
|
|
140
|
+
let l, n, r, a, o, i;
|
|
141
|
+
e[0] !== t ? ({
|
|
142
|
+
tokenSeparators: r,
|
|
143
|
+
allowClear: a,
|
|
144
|
+
serializer: o,
|
|
145
|
+
value: i,
|
|
146
|
+
onChange: l,
|
|
147
|
+
...n
|
|
148
|
+
} = t, e[0] = t, e[1] = l, e[2] = n, e[3] = r, e[4] = a, e[5] = o, e[6] = i) : (l = e[1], n = e[2], r = e[3], a = e[4], o = e[5], i = e[6]);
|
|
149
|
+
const d = r === void 0 ? j : r, v = a === void 0 ? !0 : a, f = o === void 0 ? Q : o;
|
|
149
150
|
let N;
|
|
150
|
-
e[
|
|
151
|
-
if (!l
|
|
151
|
+
e[7] !== l || e[8] !== f ? (N = /* @__PURE__ */ u((c) => {
|
|
152
|
+
if (!l)
|
|
152
153
|
return;
|
|
153
|
-
const
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}, "t1"), e[5] = f, e[6] = t, e[7] = O) : O = e[7];
|
|
167
|
-
const y = O;
|
|
168
|
-
let h;
|
|
169
|
-
e[8] !== f || e[9] !== t ? (h = /* @__PURE__ */ r((s) => {
|
|
170
|
-
A(s), t.onChange?.(f());
|
|
171
|
-
}, "t2"), e[8] = f, e[9] = t, e[10] = h) : h = e[10];
|
|
172
|
-
const D = h;
|
|
173
|
-
let S;
|
|
174
|
-
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];
|
|
175
|
-
const g = S;
|
|
176
|
-
let E;
|
|
177
|
-
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];
|
|
178
|
-
const L = o[c.ID];
|
|
179
|
-
let d;
|
|
180
|
-
e[19] !== L ? (d = /* @__PURE__ */ u(_.Option, { value: c.ID, children: L }), e[19] = L, e[20] = d) : d = e[20];
|
|
181
|
-
const R = o[c.IDS];
|
|
182
|
-
let T;
|
|
183
|
-
e[21] !== R ? (T = /* @__PURE__ */ u(_.Option, { value: c.IDS, children: R }), e[21] = R, e[22] = T) : T = e[22];
|
|
154
|
+
const m = f.deserialize(c);
|
|
155
|
+
l(m);
|
|
156
|
+
}, "t3"), e[7] = l, e[8] = f, e[9] = N) : N = e[9];
|
|
157
|
+
const h = N;
|
|
158
|
+
let T = null;
|
|
159
|
+
if (i)
|
|
160
|
+
if (Array.isArray(i)) {
|
|
161
|
+
let c;
|
|
162
|
+
e[10] !== f || e[11] !== i ? (c = f.serialize(i), e[10] = f, e[11] = i, e[12] = c) : c = e[12], T = c;
|
|
163
|
+
} else {
|
|
164
|
+
let c;
|
|
165
|
+
e[13] !== f || e[14] !== i ? (c = f.serialize([i]), e[13] = f, e[14] = i, e[15] = c) : c = e[15], T = c;
|
|
166
|
+
}
|
|
184
167
|
let I;
|
|
185
|
-
e[
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
168
|
+
return e[16] !== v || e[17] !== h || e[18] !== n || e[19] !== T || e[20] !== d ? (I = /* @__PURE__ */ E(W, { ...n, mode: "tags", open: !1, suffixIcon: null, allowClear: v, tokenSeparators: d, value: T, onChange: h }), e[16] = v, e[17] = h, e[18] = n, e[19] = T, e[20] = d, e[21] = I) : I = e[21], I;
|
|
169
|
+
}
|
|
170
|
+
u(y, "TagInput");
|
|
171
|
+
y.displayName = "TagInput";
|
|
172
|
+
function q(t) {
|
|
173
|
+
const e = g(25);
|
|
174
|
+
let l;
|
|
175
|
+
e[0] !== t.defaultValue ? (l = t.defaultValue || [], e[0] = t.defaultValue, e[1] = l) : l = e[1];
|
|
176
|
+
const [n, r] = l, [a, o] = S(n), [i, d] = S(r), v = i !== void 0 ? i : t.max, f = a !== void 0 ? a : t.min;
|
|
177
|
+
let N;
|
|
178
|
+
e[2] !== i || e[3] !== t ? (N = /* @__PURE__ */ u((F) => {
|
|
179
|
+
const C = F ?? void 0;
|
|
180
|
+
o(C), t.onChange?.([C, i]);
|
|
181
|
+
}, "t1"), e[2] = i, e[3] = t, e[4] = N) : N = e[4];
|
|
182
|
+
const h = N;
|
|
183
|
+
let T;
|
|
184
|
+
e[5] !== t || e[6] !== a ? (T = /* @__PURE__ */ u((F) => {
|
|
185
|
+
const C = F ?? void 0;
|
|
186
|
+
d(C), t.onChange?.([a, C]);
|
|
187
|
+
}, "t2"), e[5] = t, e[6] = a, e[7] = T) : T = e[7];
|
|
188
|
+
const I = T, c = t.placeholder?.[0] || "最小值";
|
|
189
|
+
let m;
|
|
190
|
+
e[8] !== h || e[9] !== t.min || e[10] !== t.precision || e[11] !== a || e[12] !== v || e[13] !== c ? (m = /* @__PURE__ */ E(V, { value: a, min: t.min, max: v, precision: t.precision, placeholder: c, onChange: h }), e[8] = h, e[9] = t.min, e[10] = t.precision, e[11] = a, e[12] = v, e[13] = c, e[14] = m) : m = e[14];
|
|
191
|
+
const A = t.placeholder?.[1] || "最大值";
|
|
192
|
+
let _;
|
|
193
|
+
e[15] !== i || e[16] !== f || e[17] !== I || e[18] !== t.max || e[19] !== t.precision || e[20] !== A ? (_ = /* @__PURE__ */ E(V, { value: i, min: f, max: t.max, precision: t.precision, placeholder: A, onChange: I }), e[15] = i, e[16] = f, e[17] = I, e[18] = t.max, e[19] = t.precision, e[20] = A, e[21] = _) : _ = e[21];
|
|
194
|
+
let O;
|
|
195
|
+
return e[22] !== m || e[23] !== _ ? (O = /* @__PURE__ */ D(z.Compact, { children: [
|
|
196
|
+
m,
|
|
197
|
+
_
|
|
198
|
+
] }), e[22] = m, e[23] = _, e[24] = O) : O = e[24], O;
|
|
195
199
|
}
|
|
196
|
-
|
|
200
|
+
u(q, "NumberRange");
|
|
201
|
+
const J = "text";
|
|
202
|
+
function G(t) {
|
|
203
|
+
const e = g(6);
|
|
204
|
+
let l;
|
|
205
|
+
e[0] === Symbol.for("react.memo_cache_sentinel") ? (l = [s.EQ, s.NE, s.CONTAINS, s.STARTS_WITH, s.ENDS_WITH, s.IN, s.NOT_IN], e[0] = l) : l = e[0];
|
|
206
|
+
let n;
|
|
207
|
+
e[1] !== t.value ? (n = /* @__PURE__ */ u((a) => {
|
|
208
|
+
switch (a.operator) {
|
|
209
|
+
case s.IN:
|
|
210
|
+
case s.NOT_IN:
|
|
211
|
+
return /* @__PURE__ */ E(y, { value: a.value, onChange: a.setValue, ...t.value });
|
|
212
|
+
default:
|
|
213
|
+
return /* @__PURE__ */ E(w, { value: a.value, onChange: /* @__PURE__ */ u((o) => a.setValue(o.target.value), "onChange"), allowClear: !0, ...t.value });
|
|
214
|
+
}
|
|
215
|
+
}, "t1"), e[1] = t.value, e[2] = n) : n = e[2];
|
|
216
|
+
let r;
|
|
217
|
+
if (e[3] !== t || e[4] !== n) {
|
|
218
|
+
const a = {
|
|
219
|
+
...t,
|
|
220
|
+
supportedOperators: l,
|
|
221
|
+
valueInputSupplier: n
|
|
222
|
+
};
|
|
223
|
+
r = /* @__PURE__ */ E(R, { ...a }), e[3] = t, e[4] = n, e[5] = r;
|
|
224
|
+
} else
|
|
225
|
+
r = e[5];
|
|
226
|
+
return r;
|
|
227
|
+
}
|
|
228
|
+
u(G, "TextFilter");
|
|
229
|
+
G.displayName = "TextFilter";
|
|
230
|
+
const Z = "id";
|
|
231
|
+
function M(t) {
|
|
232
|
+
const e = g(6);
|
|
233
|
+
let l;
|
|
234
|
+
e[0] === Symbol.for("react.memo_cache_sentinel") ? (l = [s.ID, s.IDS], e[0] = l) : l = e[0];
|
|
235
|
+
let n;
|
|
236
|
+
e[1] !== t.value ? (n = /* @__PURE__ */ u((a) => a.operator === s.ID ? /* @__PURE__ */ E(w, { value: a.value, onChange: /* @__PURE__ */ u((o) => a.setValue(o.target.value), "onChange"), allowClear: !0, ...t.value }) : /* @__PURE__ */ E(y, { value: a.value, onChange: a.setValue, ...t.value }), "t1"), e[1] = t.value, e[2] = n) : n = e[2];
|
|
237
|
+
let r;
|
|
238
|
+
if (e[3] !== t || e[4] !== n) {
|
|
239
|
+
const a = {
|
|
240
|
+
...t,
|
|
241
|
+
supportedOperators: l,
|
|
242
|
+
valueInputSupplier: n
|
|
243
|
+
};
|
|
244
|
+
r = /* @__PURE__ */ E(R, { ...a }), e[3] = t, e[4] = n, e[5] = r;
|
|
245
|
+
} else
|
|
246
|
+
r = e[5];
|
|
247
|
+
return r;
|
|
248
|
+
}
|
|
249
|
+
u(M, "IdFilter");
|
|
197
250
|
M.displayName = "IdConditionFilter";
|
|
198
|
-
|
|
251
|
+
const p = "number";
|
|
252
|
+
function $(t) {
|
|
253
|
+
const e = g(6);
|
|
254
|
+
let l;
|
|
255
|
+
e[0] === Symbol.for("react.memo_cache_sentinel") ? (l = [s.EQ, s.NE, s.GT, s.LT, s.GTE, s.LTE, s.BETWEEN, s.IN, s.NOT_IN], e[0] = l) : l = e[0];
|
|
256
|
+
let n;
|
|
257
|
+
e[1] !== t.value ? (n = /* @__PURE__ */ u((a) => {
|
|
258
|
+
switch (a.operator) {
|
|
259
|
+
case s.IN:
|
|
260
|
+
case s.NOT_IN:
|
|
261
|
+
return /* @__PURE__ */ E(y, { value: a.value, serializer: X, onChange: /* @__PURE__ */ u((o) => a.setValue(o), "onChange"), ...t.value });
|
|
262
|
+
case s.BETWEEN:
|
|
263
|
+
return /* @__PURE__ */ E(q, { onChange: a.setValue });
|
|
264
|
+
default: {
|
|
265
|
+
const {
|
|
266
|
+
defaultValue: o,
|
|
267
|
+
...i
|
|
268
|
+
} = t.value, d = Array.isArray(o) ? o[0] : o;
|
|
269
|
+
return /* @__PURE__ */ E(V, { defaultValue: d, onChange: /* @__PURE__ */ u((v) => {
|
|
270
|
+
a.setValue(v ?? void 0);
|
|
271
|
+
}, "onChange"), ...i });
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}, "t1"), e[1] = t.value, e[2] = n) : n = e[2];
|
|
275
|
+
let r;
|
|
276
|
+
if (e[3] !== t || e[4] !== n) {
|
|
277
|
+
const a = {
|
|
278
|
+
...t,
|
|
279
|
+
supportedOperators: l,
|
|
280
|
+
validate: ee,
|
|
281
|
+
valueInputSupplier: n
|
|
282
|
+
};
|
|
283
|
+
r = /* @__PURE__ */ E(R, { ...a }), e[3] = t, e[4] = n, e[5] = r;
|
|
284
|
+
} else
|
|
285
|
+
r = e[5];
|
|
286
|
+
return r;
|
|
287
|
+
}
|
|
288
|
+
u($, "NumberFilter");
|
|
289
|
+
function ee(t, e) {
|
|
290
|
+
return t === s.BETWEEN ? Array.isArray(e) ? e[0] !== void 0 && e[1] !== void 0 : !1 : e != null;
|
|
291
|
+
}
|
|
292
|
+
u(ee, "_temp");
|
|
293
|
+
$.displayName = "NumberFilter";
|
|
294
|
+
const b = class b {
|
|
295
|
+
constructor() {
|
|
296
|
+
this.filters = /* @__PURE__ */ new Map(), this.register(Z, M), this.register(J, G), this.register(p, $);
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Registers a filter component for a specific type.
|
|
300
|
+
*
|
|
301
|
+
* @param type - The unique identifier for the filter type
|
|
302
|
+
* @param filter - The filter component to register
|
|
303
|
+
*
|
|
304
|
+
* @example
|
|
305
|
+
* ```typescript
|
|
306
|
+
* filterRegistry.register('text', TextFilter);
|
|
307
|
+
* ```
|
|
308
|
+
*/
|
|
309
|
+
register(e, l) {
|
|
310
|
+
this.filters.set(e, l);
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Unregisters a filter component for a specific type.
|
|
314
|
+
*
|
|
315
|
+
* @param type - The unique identifier for the filter type to remove
|
|
316
|
+
* @returns true if the filter was successfully removed, false otherwise
|
|
317
|
+
*
|
|
318
|
+
* @example
|
|
319
|
+
* ```typescript
|
|
320
|
+
* const wasRemoved = filterRegistry.unregister('text');
|
|
321
|
+
* ```
|
|
322
|
+
*/
|
|
323
|
+
unregister(e) {
|
|
324
|
+
return this.filters.delete(e);
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Retrieves a filter component for a specific type.
|
|
328
|
+
*
|
|
329
|
+
* @param type - The unique identifier for the filter type
|
|
330
|
+
* @returns The filter component, or undefined if not found
|
|
331
|
+
*
|
|
332
|
+
* @example
|
|
333
|
+
* ```typescript
|
|
334
|
+
* const TextFilter = filterRegistry.get('text');
|
|
335
|
+
* ```
|
|
336
|
+
*/
|
|
337
|
+
get(e) {
|
|
338
|
+
return this.filters.get(e);
|
|
339
|
+
}
|
|
340
|
+
};
|
|
341
|
+
u(b, "FilterRegistry");
|
|
342
|
+
let L = b;
|
|
343
|
+
const te = new L();
|
|
344
|
+
function le(t) {
|
|
345
|
+
const e = g(5);
|
|
346
|
+
let l;
|
|
347
|
+
e[0] !== t.type ? (l = te.get(t.type) || H, e[0] = t.type, e[1] = l) : l = e[1];
|
|
348
|
+
const n = l;
|
|
349
|
+
let r;
|
|
350
|
+
return e[2] !== n || e[3] !== t ? (r = /* @__PURE__ */ E(n, { ...t }), e[2] = n, e[3] = t, e[4] = r) : r = e[4], r;
|
|
351
|
+
}
|
|
352
|
+
u(le, "TypedFilter");
|
|
353
|
+
le.displayName = "TypedFilter";
|
|
199
354
|
export {
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
M as
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
355
|
+
R as AssemblyFilter,
|
|
356
|
+
H as FallbackFilter,
|
|
357
|
+
L as FilterRegistry,
|
|
358
|
+
Z as ID_FILTER,
|
|
359
|
+
M as IdFilter,
|
|
360
|
+
p as NUMBER_FILTER,
|
|
361
|
+
$ as NumberFilter,
|
|
362
|
+
q as NumberRange,
|
|
363
|
+
X as NumberTagValueItemSerializer,
|
|
364
|
+
k as OPERATOR_zh_CN,
|
|
365
|
+
Q as StringTagValueItemSerializer,
|
|
366
|
+
J as TEXT_FILTER,
|
|
367
|
+
y as TagInput,
|
|
368
|
+
G as TextFilter,
|
|
369
|
+
le as TypedFilter,
|
|
370
|
+
te as filterRegistry,
|
|
371
|
+
Y as useFilterState
|
|
208
372
|
};
|
|
209
373
|
//# sourceMappingURL=index.es.js.map
|