@jskit-ai/kernel 0.1.154 → 0.1.156
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/package.json +1 -4
- package/shared/support/crudFieldContract.js +0 -322
- package/shared/support/crudFieldContract.test.js +0 -67
- package/shared/support/crudListFilters.js +0 -855
- package/shared/support/crudListFilters.test.js +0 -323
- package/shared/support/crudLookup.js +0 -190
- package/shared/support/crudLookup.test.js +0 -256
|
@@ -1,855 +0,0 @@
|
|
|
1
|
-
import { deepFreeze } from "./deepFreeze.js";
|
|
2
|
-
import {
|
|
3
|
-
normalizeBoolean,
|
|
4
|
-
normalizeCanonicalRecordIdText,
|
|
5
|
-
normalizeUniqueTextList,
|
|
6
|
-
normalizeText,
|
|
7
|
-
normalizeObject
|
|
8
|
-
} from "./normalize.js";
|
|
9
|
-
import {
|
|
10
|
-
normalizeCrudLookupApiPath,
|
|
11
|
-
normalizeCrudLookupNamespace,
|
|
12
|
-
resolveCrudLookupApiPathFromNamespace
|
|
13
|
-
} from "./crudLookup.js";
|
|
14
|
-
|
|
15
|
-
const CRUD_LIST_FILTER_TYPE_FLAG = "flag";
|
|
16
|
-
const CRUD_LIST_FILTER_TYPE_ENUM = "enum";
|
|
17
|
-
const CRUD_LIST_FILTER_TYPE_ENUM_MANY = "enumMany";
|
|
18
|
-
const CRUD_LIST_FILTER_TYPE_RECORD_ID = "recordId";
|
|
19
|
-
const CRUD_LIST_FILTER_TYPE_RECORD_ID_MANY = "recordIdMany";
|
|
20
|
-
const CRUD_LIST_FILTER_TYPE_DATE = "date";
|
|
21
|
-
const CRUD_LIST_FILTER_TYPE_DATE_RANGE = "dateRange";
|
|
22
|
-
const CRUD_LIST_FILTER_TYPE_NUMBER_RANGE = "numberRange";
|
|
23
|
-
const CRUD_LIST_FILTER_TYPE_PRESENCE = "presence";
|
|
24
|
-
|
|
25
|
-
const CRUD_LIST_FILTER_TYPES = Object.freeze([
|
|
26
|
-
CRUD_LIST_FILTER_TYPE_FLAG,
|
|
27
|
-
CRUD_LIST_FILTER_TYPE_ENUM,
|
|
28
|
-
CRUD_LIST_FILTER_TYPE_ENUM_MANY,
|
|
29
|
-
CRUD_LIST_FILTER_TYPE_RECORD_ID,
|
|
30
|
-
CRUD_LIST_FILTER_TYPE_RECORD_ID_MANY,
|
|
31
|
-
CRUD_LIST_FILTER_TYPE_DATE,
|
|
32
|
-
CRUD_LIST_FILTER_TYPE_DATE_RANGE,
|
|
33
|
-
CRUD_LIST_FILTER_TYPE_NUMBER_RANGE,
|
|
34
|
-
CRUD_LIST_FILTER_TYPE_PRESENCE
|
|
35
|
-
]);
|
|
36
|
-
|
|
37
|
-
const CRUD_LIST_FILTER_PRESENCE_PRESENT = "present";
|
|
38
|
-
const CRUD_LIST_FILTER_PRESENCE_MISSING = "missing";
|
|
39
|
-
const CRUD_LIST_FILTER_PRESENCE_OPTIONS = Object.freeze([
|
|
40
|
-
Object.freeze({
|
|
41
|
-
value: CRUD_LIST_FILTER_PRESENCE_PRESENT,
|
|
42
|
-
label: "Present"
|
|
43
|
-
}),
|
|
44
|
-
Object.freeze({
|
|
45
|
-
value: CRUD_LIST_FILTER_PRESENCE_MISSING,
|
|
46
|
-
label: "Missing"
|
|
47
|
-
})
|
|
48
|
-
]);
|
|
49
|
-
const CRUD_LIST_FILTER_INVALID_VALUES_REJECT = "reject";
|
|
50
|
-
const CRUD_LIST_FILTER_INVALID_VALUES_DISCARD = "discard";
|
|
51
|
-
const CRUD_LIST_FILTER_INVALID_VALUES_MODES = Object.freeze([
|
|
52
|
-
CRUD_LIST_FILTER_INVALID_VALUES_REJECT,
|
|
53
|
-
CRUD_LIST_FILTER_INVALID_VALUES_DISCARD
|
|
54
|
-
]);
|
|
55
|
-
const INVALID_CRUD_LIST_FILTER_QUERY_VALUE = Symbol("invalidCrudListFilterQueryValue");
|
|
56
|
-
const DATE_FILTER_PATTERN = /^\d{4}-\d{2}-\d{2}$/u;
|
|
57
|
-
|
|
58
|
-
function parseCrudListRangeQueryExpression(value = null) {
|
|
59
|
-
const sourceValue = Array.isArray(value) ? value[0] : value;
|
|
60
|
-
if (sourceValue == null) {
|
|
61
|
-
return null;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
const normalized = typeof sourceValue === "number"
|
|
65
|
-
? String(sourceValue)
|
|
66
|
-
: normalizeText(sourceValue);
|
|
67
|
-
if (!normalized) {
|
|
68
|
-
return null;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
const separatorIndex = normalized.indexOf("..");
|
|
72
|
-
if (separatorIndex < 0) {
|
|
73
|
-
return deepFreeze({
|
|
74
|
-
exact: true,
|
|
75
|
-
start: normalized,
|
|
76
|
-
end: normalized
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
const start = normalizeText(normalized.slice(0, separatorIndex));
|
|
81
|
-
const end = normalizeText(normalized.slice(separatorIndex + 2));
|
|
82
|
-
if (!start && !end) {
|
|
83
|
-
return null;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
return deepFreeze({
|
|
87
|
-
exact: false,
|
|
88
|
-
start,
|
|
89
|
-
end
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
function formatCrudListRangeQueryExpression(startValue = "", endValue = "", { collapseExact = false } = {}) {
|
|
94
|
-
const start = normalizeText(startValue);
|
|
95
|
-
const end = normalizeText(endValue);
|
|
96
|
-
if (!start && !end) {
|
|
97
|
-
return "";
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
if (collapseExact === true && start && end && start === end) {
|
|
101
|
-
return start;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
return `${start}..${end}`;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
function normalizeCrudListFilterInvalidValues(value = "") {
|
|
108
|
-
const normalized = normalizeText(value).toLowerCase();
|
|
109
|
-
if (CRUD_LIST_FILTER_INVALID_VALUES_MODES.includes(normalized)) {
|
|
110
|
-
return normalized;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
throw new TypeError(
|
|
114
|
-
`Unsupported CRUD list filter invalidValues mode "${value}". Expected one of: ${CRUD_LIST_FILTER_INVALID_VALUES_MODES.join(", ")}.`
|
|
115
|
-
);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
function firstCrudListFilterValue(value) {
|
|
119
|
-
return Array.isArray(value) ? value[0] : value;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
function isPrimitiveCrudListFilterInput(value) {
|
|
123
|
-
const valueType = typeof value;
|
|
124
|
-
return valueType === "string" || valueType === "number" || valueType === "boolean";
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
function isPrimitiveOrPrimitiveArrayCrudListFilterInput(value) {
|
|
128
|
-
if (Array.isArray(value)) {
|
|
129
|
-
return value.every((entry) => isPrimitiveCrudListFilterInput(entry));
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
return isPrimitiveCrudListFilterInput(value);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
function normalizeDateFilterText(value) {
|
|
136
|
-
const normalized = normalizeText(firstCrudListFilterValue(value));
|
|
137
|
-
if (!normalized || !DATE_FILTER_PATTERN.test(normalized)) {
|
|
138
|
-
return "";
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
return normalized;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
function normalizeCanonicalRecordIdList(value) {
|
|
145
|
-
return normalizeUniqueTextList(value, {
|
|
146
|
-
acceptSingle: true
|
|
147
|
-
})
|
|
148
|
-
.map((entry) => normalizeCanonicalRecordIdText(entry, { fallback: "" }))
|
|
149
|
-
.filter(Boolean);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
function normalizeFiniteFilterNumber(value) {
|
|
153
|
-
if (value == null || value === "") {
|
|
154
|
-
return null;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
const normalized = typeof value === "number"
|
|
158
|
-
? value
|
|
159
|
-
: Number(normalizeText(firstCrudListFilterValue(value)));
|
|
160
|
-
return Number.isFinite(normalized) ? normalized : null;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
function normalizeAllowedFilterTextValue(value, allowedValues = new Set()) {
|
|
164
|
-
const normalized = normalizeText(firstCrudListFilterValue(value));
|
|
165
|
-
if (!normalized || !allowedValues.has(normalized)) {
|
|
166
|
-
return "";
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
return normalized;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
function normalizeAllowedFilterTextValues(value, allowedValues = new Set()) {
|
|
173
|
-
return normalizeUniqueTextList(value, {
|
|
174
|
-
acceptSingle: true
|
|
175
|
-
}).filter((entry) => allowedValues.has(entry));
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
function resolveCrudListFilterAllowedValues(filter = {}) {
|
|
179
|
-
return new Set(
|
|
180
|
-
(Array.isArray(filter.options) ? filter.options : [])
|
|
181
|
-
.map((entry) => normalizeText(entry?.value))
|
|
182
|
-
.filter(Boolean)
|
|
183
|
-
);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
function normalizeCrudListDateRangeUiValue(rawValue) {
|
|
187
|
-
const source = rawValue && typeof rawValue === "object" && !Array.isArray(rawValue)
|
|
188
|
-
? rawValue
|
|
189
|
-
: null;
|
|
190
|
-
if (source) {
|
|
191
|
-
return {
|
|
192
|
-
from: normalizeDateFilterText(source.from),
|
|
193
|
-
to: normalizeDateFilterText(source.to)
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
const parsed = parseCrudListRangeQueryExpression(rawValue);
|
|
198
|
-
return {
|
|
199
|
-
from: normalizeDateFilterText(parsed?.start),
|
|
200
|
-
to: normalizeDateFilterText(parsed?.end)
|
|
201
|
-
};
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
function normalizeCrudListNumberRangeUiValue(rawValue) {
|
|
205
|
-
const source = rawValue && typeof rawValue === "object" && !Array.isArray(rawValue)
|
|
206
|
-
? rawValue
|
|
207
|
-
: null;
|
|
208
|
-
if (source) {
|
|
209
|
-
return {
|
|
210
|
-
min: normalizeText(source.min),
|
|
211
|
-
max: normalizeText(source.max)
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
const parsed = parseCrudListRangeQueryExpression(rawValue);
|
|
216
|
-
return {
|
|
217
|
-
min: normalizeText(parsed?.start),
|
|
218
|
-
max: normalizeText(parsed?.end)
|
|
219
|
-
};
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
function createCrudListFilterEmptyValue(filter = {}) {
|
|
223
|
-
if (normalizeCrudListFilterType(filter.type) === CRUD_LIST_FILTER_TYPE_FLAG) {
|
|
224
|
-
return false;
|
|
225
|
-
}
|
|
226
|
-
if (isCrudListFilterMultiValue(filter)) {
|
|
227
|
-
return [];
|
|
228
|
-
}
|
|
229
|
-
if (normalizeCrudListFilterType(filter.type) === CRUD_LIST_FILTER_TYPE_DATE_RANGE) {
|
|
230
|
-
return {
|
|
231
|
-
from: "",
|
|
232
|
-
to: ""
|
|
233
|
-
};
|
|
234
|
-
}
|
|
235
|
-
if (normalizeCrudListFilterType(filter.type) === CRUD_LIST_FILTER_TYPE_NUMBER_RANGE) {
|
|
236
|
-
return {
|
|
237
|
-
min: "",
|
|
238
|
-
max: ""
|
|
239
|
-
};
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
return "";
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
function createCrudListFilterInitialValue(filter = {}) {
|
|
246
|
-
if (!Object.hasOwn(filter, "defaultValue")) {
|
|
247
|
-
return createCrudListFilterEmptyValue(filter);
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
return normalizeCrudListFilterUiValue(filter, filter.defaultValue);
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
function isCrudListFilterMultiValue(filter = {}) {
|
|
254
|
-
const type = normalizeCrudListFilterType(filter.type);
|
|
255
|
-
return type === CRUD_LIST_FILTER_TYPE_ENUM_MANY || type === CRUD_LIST_FILTER_TYPE_RECORD_ID_MANY;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
function isCrudListFilterStructuredValue(filter = {}) {
|
|
259
|
-
const type = normalizeCrudListFilterType(filter.type);
|
|
260
|
-
return type === CRUD_LIST_FILTER_TYPE_DATE_RANGE || type === CRUD_LIST_FILTER_TYPE_NUMBER_RANGE;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
function normalizeCrudListFilterUiValue(filter = {}, rawValue) {
|
|
264
|
-
const type = normalizeCrudListFilterType(filter.type);
|
|
265
|
-
|
|
266
|
-
if (type === CRUD_LIST_FILTER_TYPE_FLAG) {
|
|
267
|
-
return rawValue === true;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
if (type === CRUD_LIST_FILTER_TYPE_ENUM) {
|
|
271
|
-
return normalizeAllowedFilterTextValue(rawValue, resolveCrudListFilterAllowedValues(filter));
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
if (type === CRUD_LIST_FILTER_TYPE_PRESENCE) {
|
|
275
|
-
return normalizeAllowedFilterTextValue(rawValue, new Set([
|
|
276
|
-
CRUD_LIST_FILTER_PRESENCE_PRESENT,
|
|
277
|
-
CRUD_LIST_FILTER_PRESENCE_MISSING
|
|
278
|
-
]));
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
if (type === CRUD_LIST_FILTER_TYPE_ENUM_MANY) {
|
|
282
|
-
return normalizeAllowedFilterTextValues(rawValue, resolveCrudListFilterAllowedValues(filter));
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
if (type === CRUD_LIST_FILTER_TYPE_RECORD_ID) {
|
|
286
|
-
return normalizeCanonicalRecordIdText(rawValue, { fallback: "" }) || "";
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
if (type === CRUD_LIST_FILTER_TYPE_RECORD_ID_MANY) {
|
|
290
|
-
return normalizeCanonicalRecordIdList(rawValue);
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
if (type === CRUD_LIST_FILTER_TYPE_DATE) {
|
|
294
|
-
return normalizeDateFilterText(rawValue);
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
if (type === CRUD_LIST_FILTER_TYPE_DATE_RANGE) {
|
|
298
|
-
return normalizeCrudListDateRangeUiValue(rawValue);
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
if (type === CRUD_LIST_FILTER_TYPE_NUMBER_RANGE) {
|
|
302
|
-
return normalizeCrudListNumberRangeUiValue(rawValue);
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
return normalizeText(rawValue);
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
function matchCrudListFilterValues(currentValue, expectedValue) {
|
|
309
|
-
const currentList = Array.isArray(currentValue) ? [...currentValue].sort() : [];
|
|
310
|
-
const expectedList = Array.isArray(expectedValue) ? [...expectedValue].sort() : [];
|
|
311
|
-
if (currentList.length !== expectedList.length) {
|
|
312
|
-
return false;
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
return currentList.every((entry, index) => entry === expectedList[index]);
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
function areCrudListFilterUiValuesEqual(filter = {}, currentValue, expectedValue) {
|
|
319
|
-
const normalizedCurrentValue = normalizeCrudListFilterUiValue(filter, currentValue);
|
|
320
|
-
const normalizedExpectedValue = normalizeCrudListFilterUiValue(filter, expectedValue);
|
|
321
|
-
|
|
322
|
-
if (isCrudListFilterMultiValue(filter)) {
|
|
323
|
-
return matchCrudListFilterValues(normalizedCurrentValue, normalizedExpectedValue);
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
if (normalizeCrudListFilterType(filter.type) === CRUD_LIST_FILTER_TYPE_DATE_RANGE) {
|
|
327
|
-
return (
|
|
328
|
-
normalizeText(normalizedCurrentValue?.from) === normalizeText(normalizedExpectedValue?.from) &&
|
|
329
|
-
normalizeText(normalizedCurrentValue?.to) === normalizeText(normalizedExpectedValue?.to)
|
|
330
|
-
);
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
if (normalizeCrudListFilterType(filter.type) === CRUD_LIST_FILTER_TYPE_NUMBER_RANGE) {
|
|
334
|
-
return (
|
|
335
|
-
normalizeText(normalizedCurrentValue?.min) === normalizeText(normalizedExpectedValue?.min) &&
|
|
336
|
-
normalizeText(normalizedCurrentValue?.max) === normalizeText(normalizedExpectedValue?.max)
|
|
337
|
-
);
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
return normalizedCurrentValue === normalizedExpectedValue;
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
function formatCrudListFilterQueryValue(filter = {}, value) {
|
|
344
|
-
const type = normalizeCrudListFilterType(filter.type);
|
|
345
|
-
|
|
346
|
-
if (type === CRUD_LIST_FILTER_TYPE_DATE_RANGE) {
|
|
347
|
-
return formatCrudListRangeQueryExpression(value?.from, value?.to, {
|
|
348
|
-
collapseExact: true
|
|
349
|
-
});
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
if (type === CRUD_LIST_FILTER_TYPE_NUMBER_RANGE) {
|
|
353
|
-
return formatCrudListRangeQueryExpression(value?.min, value?.max, {
|
|
354
|
-
collapseExact: true
|
|
355
|
-
});
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
return value;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
function rejectInvalidCrudListFilterValue({ invalidValues = CRUD_LIST_FILTER_INVALID_VALUES_REJECT } = {}) {
|
|
362
|
-
return invalidValues === CRUD_LIST_FILTER_INVALID_VALUES_DISCARD
|
|
363
|
-
? null
|
|
364
|
-
: INVALID_CRUD_LIST_FILTER_QUERY_VALUE;
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
function normalizeCrudListDateRangeQueryValue(value) {
|
|
368
|
-
const parsed = parseCrudListRangeQueryExpression(firstCrudListFilterValue(value));
|
|
369
|
-
if (!parsed) {
|
|
370
|
-
return undefined;
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
const from = normalizeDateFilterText(parsed.start);
|
|
374
|
-
const to = normalizeDateFilterText(parsed.end);
|
|
375
|
-
|
|
376
|
-
if (parsed.exact) {
|
|
377
|
-
if (!from) {
|
|
378
|
-
return undefined;
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
return {
|
|
382
|
-
from,
|
|
383
|
-
to: from
|
|
384
|
-
};
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
if (!from && !to) {
|
|
388
|
-
return undefined;
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
return {
|
|
392
|
-
...(from ? { from } : {}),
|
|
393
|
-
...(to ? { to } : {})
|
|
394
|
-
};
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
function normalizeCrudListNumberRangeQueryValue(value) {
|
|
398
|
-
const parsed = parseCrudListRangeQueryExpression(firstCrudListFilterValue(value));
|
|
399
|
-
if (!parsed) {
|
|
400
|
-
return undefined;
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
const min = normalizeFiniteFilterNumber(parsed.start);
|
|
404
|
-
const max = normalizeFiniteFilterNumber(parsed.end);
|
|
405
|
-
|
|
406
|
-
if (parsed.exact) {
|
|
407
|
-
if (min == null) {
|
|
408
|
-
return undefined;
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
return {
|
|
412
|
-
min,
|
|
413
|
-
max: min
|
|
414
|
-
};
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
if (min == null && max == null) {
|
|
418
|
-
return undefined;
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
return {
|
|
422
|
-
...(min != null ? { min } : {}),
|
|
423
|
-
...(max != null ? { max } : {})
|
|
424
|
-
};
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
function parseCrudListFilterQueryValue(
|
|
428
|
-
filter = {},
|
|
429
|
-
value,
|
|
430
|
-
{ invalidValues = CRUD_LIST_FILTER_INVALID_VALUES_REJECT } = {}
|
|
431
|
-
) {
|
|
432
|
-
const type = normalizeCrudListFilterType(filter.type);
|
|
433
|
-
const allowedValues = resolveCrudListFilterAllowedValues(filter);
|
|
434
|
-
|
|
435
|
-
if (type === CRUD_LIST_FILTER_TYPE_FLAG) {
|
|
436
|
-
if (value !== null && value !== "" && !isPrimitiveCrudListFilterInput(value)) {
|
|
437
|
-
return rejectInvalidCrudListFilterValue({ invalidValues });
|
|
438
|
-
}
|
|
439
|
-
} else if (isCrudListFilterMultiValue(filter)) {
|
|
440
|
-
if (!isPrimitiveOrPrimitiveArrayCrudListFilterInput(value)) {
|
|
441
|
-
return rejectInvalidCrudListFilterValue({ invalidValues });
|
|
442
|
-
}
|
|
443
|
-
} else if (!isPrimitiveCrudListFilterInput(value)) {
|
|
444
|
-
return rejectInvalidCrudListFilterValue({ invalidValues });
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
if (type === CRUD_LIST_FILTER_TYPE_FLAG) {
|
|
448
|
-
if (value === null || value === "") {
|
|
449
|
-
return true;
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
try {
|
|
453
|
-
return normalizeBoolean(firstCrudListFilterValue(value));
|
|
454
|
-
} catch {
|
|
455
|
-
return rejectInvalidCrudListFilterValue({ invalidValues });
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
if (type === CRUD_LIST_FILTER_TYPE_ENUM) {
|
|
460
|
-
return normalizeAllowedFilterTextValue(value, allowedValues) || rejectInvalidCrudListFilterValue({ invalidValues });
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
if (type === CRUD_LIST_FILTER_TYPE_PRESENCE) {
|
|
464
|
-
return normalizeAllowedFilterTextValue(value, new Set([
|
|
465
|
-
CRUD_LIST_FILTER_PRESENCE_PRESENT,
|
|
466
|
-
CRUD_LIST_FILTER_PRESENCE_MISSING
|
|
467
|
-
])) || rejectInvalidCrudListFilterValue({ invalidValues });
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
if (type === CRUD_LIST_FILTER_TYPE_ENUM_MANY) {
|
|
471
|
-
const values = Array.isArray(value) ? value : [value];
|
|
472
|
-
const normalizedValues = normalizeAllowedFilterTextValues(value, allowedValues);
|
|
473
|
-
|
|
474
|
-
if (invalidValues === CRUD_LIST_FILTER_INVALID_VALUES_DISCARD) {
|
|
475
|
-
return normalizedValues.length > 0 ? normalizedValues : null;
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
return normalizedValues.length > 0 && normalizedValues.length === values.length
|
|
479
|
-
? normalizedValues
|
|
480
|
-
: INVALID_CRUD_LIST_FILTER_QUERY_VALUE;
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
if (type === CRUD_LIST_FILTER_TYPE_RECORD_ID) {
|
|
484
|
-
return normalizeCanonicalRecordIdText(firstCrudListFilterValue(value), {
|
|
485
|
-
fallback: ""
|
|
486
|
-
}) || rejectInvalidCrudListFilterValue({ invalidValues });
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
if (type === CRUD_LIST_FILTER_TYPE_RECORD_ID_MANY) {
|
|
490
|
-
const values = Array.isArray(value) ? value : [value];
|
|
491
|
-
const normalizedValues = normalizeCanonicalRecordIdList(value);
|
|
492
|
-
|
|
493
|
-
if (invalidValues === CRUD_LIST_FILTER_INVALID_VALUES_DISCARD) {
|
|
494
|
-
return normalizedValues.length > 0 ? normalizedValues : null;
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
return normalizedValues.length > 0 && normalizedValues.length === values.length
|
|
498
|
-
? normalizedValues
|
|
499
|
-
: INVALID_CRUD_LIST_FILTER_QUERY_VALUE;
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
if (type === CRUD_LIST_FILTER_TYPE_DATE) {
|
|
503
|
-
return normalizeDateFilterText(value) || rejectInvalidCrudListFilterValue({ invalidValues });
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
if (type === CRUD_LIST_FILTER_TYPE_DATE_RANGE) {
|
|
507
|
-
const normalized = normalizeCrudListDateRangeQueryValue(value);
|
|
508
|
-
if (invalidValues === CRUD_LIST_FILTER_INVALID_VALUES_DISCARD) {
|
|
509
|
-
return normalized || null;
|
|
510
|
-
}
|
|
511
|
-
return normalized || INVALID_CRUD_LIST_FILTER_QUERY_VALUE;
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
if (type === CRUD_LIST_FILTER_TYPE_NUMBER_RANGE) {
|
|
515
|
-
const normalized = normalizeCrudListNumberRangeQueryValue(value);
|
|
516
|
-
if (invalidValues === CRUD_LIST_FILTER_INVALID_VALUES_DISCARD) {
|
|
517
|
-
return normalized || null;
|
|
518
|
-
}
|
|
519
|
-
return normalized || INVALID_CRUD_LIST_FILTER_QUERY_VALUE;
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
return INVALID_CRUD_LIST_FILTER_QUERY_VALUE;
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
function hasCrudListFilterUiValue(filter = {}, rawValue) {
|
|
526
|
-
const normalizedValue = normalizeCrudListFilterUiValue(filter, rawValue);
|
|
527
|
-
const type = normalizeCrudListFilterType(filter.type);
|
|
528
|
-
|
|
529
|
-
if (type === CRUD_LIST_FILTER_TYPE_FLAG) {
|
|
530
|
-
return normalizedValue === true;
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
if (isCrudListFilterMultiValue(filter)) {
|
|
534
|
-
return Array.isArray(normalizedValue) && normalizedValue.length > 0;
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
if (type === CRUD_LIST_FILTER_TYPE_DATE_RANGE) {
|
|
538
|
-
return Boolean(normalizeText(normalizedValue?.from) || normalizeText(normalizedValue?.to));
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
if (type === CRUD_LIST_FILTER_TYPE_NUMBER_RANGE) {
|
|
542
|
-
return Boolean(normalizeText(normalizedValue?.min) || normalizeText(normalizedValue?.max));
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
return Boolean(normalizeText(normalizedValue));
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
function listCrudListFilterChipValues(filter = {}, rawValue) {
|
|
549
|
-
const normalizedValue = normalizeCrudListFilterUiValue(filter, rawValue);
|
|
550
|
-
|
|
551
|
-
if (!hasCrudListFilterUiValue(filter, normalizedValue)) {
|
|
552
|
-
return [];
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
if (isCrudListFilterMultiValue(filter)) {
|
|
556
|
-
return Array.isArray(normalizedValue) ? normalizedValue : [];
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
return [normalizedValue];
|
|
560
|
-
}
|
|
561
|
-
|
|
562
|
-
function formatCrudListFilterDefaultChipLabel(filter = {}, rawValue, { resolveAtomicValue = null } = {}) {
|
|
563
|
-
const normalizedValue = normalizeCrudListFilterUiValue(filter, rawValue);
|
|
564
|
-
const type = normalizeCrudListFilterType(filter.type);
|
|
565
|
-
const resolveAtomicLabel = typeof resolveAtomicValue === "function"
|
|
566
|
-
? resolveAtomicValue
|
|
567
|
-
: (value) => String(value || "");
|
|
568
|
-
|
|
569
|
-
if (type === CRUD_LIST_FILTER_TYPE_FLAG) {
|
|
570
|
-
return filter.label;
|
|
571
|
-
}
|
|
572
|
-
|
|
573
|
-
if (
|
|
574
|
-
type === CRUD_LIST_FILTER_TYPE_ENUM ||
|
|
575
|
-
type === CRUD_LIST_FILTER_TYPE_PRESENCE ||
|
|
576
|
-
type === CRUD_LIST_FILTER_TYPE_RECORD_ID
|
|
577
|
-
) {
|
|
578
|
-
return `${filter.label}: ${resolveAtomicLabel(normalizedValue, filter)}`;
|
|
579
|
-
}
|
|
580
|
-
|
|
581
|
-
if (type === CRUD_LIST_FILTER_TYPE_ENUM_MANY || type === CRUD_LIST_FILTER_TYPE_RECORD_ID_MANY) {
|
|
582
|
-
const atomicValue = Array.isArray(normalizedValue)
|
|
583
|
-
? normalizedValue[0] || ""
|
|
584
|
-
: normalizeText(normalizedValue);
|
|
585
|
-
return `${filter.label}: ${resolveAtomicLabel(atomicValue, filter)}`;
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
if (type === CRUD_LIST_FILTER_TYPE_DATE) {
|
|
589
|
-
return `${filter.label}: ${normalizedValue}`;
|
|
590
|
-
}
|
|
591
|
-
|
|
592
|
-
if (type === CRUD_LIST_FILTER_TYPE_DATE_RANGE) {
|
|
593
|
-
if (normalizedValue?.from && normalizedValue?.to) {
|
|
594
|
-
return `${filter.label}: ${normalizedValue.from} to ${normalizedValue.to}`;
|
|
595
|
-
}
|
|
596
|
-
if (normalizedValue?.from) {
|
|
597
|
-
return `${filter.label}: from ${normalizedValue.from}`;
|
|
598
|
-
}
|
|
599
|
-
return `${filter.label}: to ${normalizedValue?.to || ""}`;
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
if (type === CRUD_LIST_FILTER_TYPE_NUMBER_RANGE) {
|
|
603
|
-
if (normalizedValue?.min && normalizedValue?.max) {
|
|
604
|
-
return `${filter.label}: ${normalizedValue.min} to ${normalizedValue.max}`;
|
|
605
|
-
}
|
|
606
|
-
if (normalizedValue?.min) {
|
|
607
|
-
return `${filter.label}: min ${normalizedValue.min}`;
|
|
608
|
-
}
|
|
609
|
-
return `${filter.label}: max ${normalizedValue?.max || ""}`;
|
|
610
|
-
}
|
|
611
|
-
|
|
612
|
-
return filter.label;
|
|
613
|
-
}
|
|
614
|
-
|
|
615
|
-
function normalizeCrudListFilterType(value = "") {
|
|
616
|
-
const normalized = normalizeText(value);
|
|
617
|
-
if (CRUD_LIST_FILTER_TYPES.includes(normalized)) {
|
|
618
|
-
return normalized;
|
|
619
|
-
}
|
|
620
|
-
|
|
621
|
-
throw new TypeError(`Unsupported CRUD list filter type "${value}".`);
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
function normalizeCrudListFilterOption(rawOption = null, { context = "filter option" } = {}) {
|
|
625
|
-
const source = typeof rawOption === "string"
|
|
626
|
-
? { value: rawOption }
|
|
627
|
-
: normalizeObject(rawOption);
|
|
628
|
-
const value = normalizeText(source.value);
|
|
629
|
-
if (!value) {
|
|
630
|
-
throw new TypeError(`${context} requires value.`);
|
|
631
|
-
}
|
|
632
|
-
|
|
633
|
-
return Object.freeze({
|
|
634
|
-
value,
|
|
635
|
-
label: normalizeText(source.label) || value
|
|
636
|
-
});
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
function normalizeCrudListFilterOptions(rawOptions = [], { context = "filter options" } = {}) {
|
|
640
|
-
const source = Array.isArray(rawOptions) ? rawOptions : [];
|
|
641
|
-
const options = [];
|
|
642
|
-
const seenValues = new Set();
|
|
643
|
-
|
|
644
|
-
for (const rawOption of source) {
|
|
645
|
-
const option = normalizeCrudListFilterOption(rawOption, { context });
|
|
646
|
-
if (seenValues.has(option.value)) {
|
|
647
|
-
continue;
|
|
648
|
-
}
|
|
649
|
-
|
|
650
|
-
seenValues.add(option.value);
|
|
651
|
-
options.push(option);
|
|
652
|
-
}
|
|
653
|
-
|
|
654
|
-
return Object.freeze(options);
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
function normalizeCrudListFilterPresenceOptions(rawOptions = []) {
|
|
658
|
-
const sourceOptions = normalizeCrudListFilterOptions(rawOptions, {
|
|
659
|
-
context: "presence filter options"
|
|
660
|
-
});
|
|
661
|
-
if (sourceOptions.length < 1) {
|
|
662
|
-
return CRUD_LIST_FILTER_PRESENCE_OPTIONS;
|
|
663
|
-
}
|
|
664
|
-
|
|
665
|
-
const optionMap = new Map(sourceOptions.map((entry) => [entry.value, entry]));
|
|
666
|
-
const presentOption = optionMap.get(CRUD_LIST_FILTER_PRESENCE_PRESENT);
|
|
667
|
-
const missingOption = optionMap.get(CRUD_LIST_FILTER_PRESENCE_MISSING);
|
|
668
|
-
if (!presentOption || !missingOption) {
|
|
669
|
-
throw new TypeError('Presence filter options must contain both "present" and "missing" values.');
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
return Object.freeze([
|
|
673
|
-
presentOption,
|
|
674
|
-
missingOption
|
|
675
|
-
]);
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
function normalizeCrudListFilterLookup(rawLookup = null) {
|
|
679
|
-
if (rawLookup == null) {
|
|
680
|
-
return null;
|
|
681
|
-
}
|
|
682
|
-
if (!rawLookup || typeof rawLookup !== "object" || Array.isArray(rawLookup)) {
|
|
683
|
-
throw new TypeError("CRUD list filter lookup must be an object.");
|
|
684
|
-
}
|
|
685
|
-
const source = normalizeObject(rawLookup);
|
|
686
|
-
|
|
687
|
-
const namespace = normalizeCrudLookupNamespace(source.namespace);
|
|
688
|
-
const explicitApiPath = normalizeCrudLookupApiPath(source.apiSuffix || source.apiPath);
|
|
689
|
-
const apiSuffix = explicitApiPath || resolveCrudLookupApiPathFromNamespace(namespace);
|
|
690
|
-
const labelKey = normalizeText(source.labelKey);
|
|
691
|
-
const valueKey = normalizeText(source.valueKey) || "id";
|
|
692
|
-
|
|
693
|
-
return Object.freeze({
|
|
694
|
-
...(namespace ? { namespace } : {}),
|
|
695
|
-
...(apiSuffix ? { apiSuffix } : {}),
|
|
696
|
-
...(labelKey ? { labelKey } : {}),
|
|
697
|
-
valueKey
|
|
698
|
-
});
|
|
699
|
-
}
|
|
700
|
-
|
|
701
|
-
function resolveCrudListFilterOptionSet(rawDefinition = {}, type = "") {
|
|
702
|
-
if (type === CRUD_LIST_FILTER_TYPE_ENUM || type === CRUD_LIST_FILTER_TYPE_ENUM_MANY) {
|
|
703
|
-
const options = normalizeCrudListFilterOptions(rawDefinition.options, {
|
|
704
|
-
context: `${type} filter options`
|
|
705
|
-
});
|
|
706
|
-
if (options.length < 1) {
|
|
707
|
-
throw new TypeError(`${type} filters require at least one option.`);
|
|
708
|
-
}
|
|
709
|
-
return options;
|
|
710
|
-
}
|
|
711
|
-
|
|
712
|
-
if (type === CRUD_LIST_FILTER_TYPE_PRESENCE) {
|
|
713
|
-
return normalizeCrudListFilterPresenceOptions(rawDefinition.options);
|
|
714
|
-
}
|
|
715
|
-
|
|
716
|
-
return Object.freeze([]);
|
|
717
|
-
}
|
|
718
|
-
|
|
719
|
-
function resolveCrudListFilterQueryKeys(definition = {}) {
|
|
720
|
-
return Object.freeze([normalizeText(definition.queryKey)].filter(Boolean));
|
|
721
|
-
}
|
|
722
|
-
|
|
723
|
-
function resolveCrudListFilterOptionLabel(definition = {}, value = "", { fallback = "" } = {}) {
|
|
724
|
-
const normalizedValue = normalizeText(value);
|
|
725
|
-
if (!normalizedValue) {
|
|
726
|
-
return normalizeText(fallback);
|
|
727
|
-
}
|
|
728
|
-
|
|
729
|
-
const options = Array.isArray(definition?.options) ? definition.options : [];
|
|
730
|
-
const optionLabel = options.find((entry) => entry?.value === normalizedValue)?.label;
|
|
731
|
-
return normalizeText(optionLabel) || normalizeText(fallback) || normalizedValue;
|
|
732
|
-
}
|
|
733
|
-
|
|
734
|
-
function normalizeCrudListFilterDefinition(rawKey = "", rawDefinition = null) {
|
|
735
|
-
const key = normalizeText(rawKey);
|
|
736
|
-
if (!key) {
|
|
737
|
-
throw new TypeError("CRUD list filter definitions require non-empty keys.");
|
|
738
|
-
}
|
|
739
|
-
|
|
740
|
-
if (!rawDefinition || typeof rawDefinition !== "object" || Array.isArray(rawDefinition)) {
|
|
741
|
-
throw new TypeError(`CRUD list filter "${key}" must be an object.`);
|
|
742
|
-
}
|
|
743
|
-
const source = normalizeObject(rawDefinition);
|
|
744
|
-
|
|
745
|
-
const type = normalizeCrudListFilterType(source.type);
|
|
746
|
-
const label = normalizeText(source.label) || key;
|
|
747
|
-
const options = resolveCrudListFilterOptionSet(source, type);
|
|
748
|
-
const lookup = normalizeCrudListFilterLookup(source.lookup);
|
|
749
|
-
const chipLabel = typeof source.chipLabel === "function" ? source.chipLabel : null;
|
|
750
|
-
const ui = source.ui && typeof source.ui === "object" && !Array.isArray(source.ui)
|
|
751
|
-
? deepFreeze({ ...source.ui })
|
|
752
|
-
: null;
|
|
753
|
-
const meta = source.meta && typeof source.meta === "object" && !Array.isArray(source.meta)
|
|
754
|
-
? deepFreeze({ ...source.meta })
|
|
755
|
-
: null;
|
|
756
|
-
const hasDefaultValue = Object.hasOwn(source, "defaultValue");
|
|
757
|
-
const defaultValue = hasDefaultValue
|
|
758
|
-
? deepFreeze(normalizeCrudListFilterUiValue({
|
|
759
|
-
type,
|
|
760
|
-
options
|
|
761
|
-
}, source.defaultValue))
|
|
762
|
-
: undefined;
|
|
763
|
-
|
|
764
|
-
if (type === CRUD_LIST_FILTER_TYPE_DATE_RANGE) {
|
|
765
|
-
if (normalizeText(source.fromKey) || normalizeText(source.toKey)) {
|
|
766
|
-
throw new TypeError(`CRUD list filter "${key}" uses unsupported split range keys. Use queryKey.`);
|
|
767
|
-
}
|
|
768
|
-
}
|
|
769
|
-
|
|
770
|
-
if (type === CRUD_LIST_FILTER_TYPE_NUMBER_RANGE) {
|
|
771
|
-
if (normalizeText(source.minKey) || normalizeText(source.maxKey)) {
|
|
772
|
-
throw new TypeError(`CRUD list filter "${key}" uses unsupported split range keys. Use queryKey.`);
|
|
773
|
-
}
|
|
774
|
-
}
|
|
775
|
-
|
|
776
|
-
return Object.freeze({
|
|
777
|
-
key,
|
|
778
|
-
type,
|
|
779
|
-
label,
|
|
780
|
-
queryKey: normalizeText(source.queryKey) || key,
|
|
781
|
-
options,
|
|
782
|
-
lookup,
|
|
783
|
-
chipLabel,
|
|
784
|
-
ui,
|
|
785
|
-
meta,
|
|
786
|
-
...(hasDefaultValue ? { defaultValue } : {})
|
|
787
|
-
});
|
|
788
|
-
}
|
|
789
|
-
|
|
790
|
-
function defineCrudListFilters(definitions = {}) {
|
|
791
|
-
if (!definitions || typeof definitions !== "object" || Array.isArray(definitions)) {
|
|
792
|
-
throw new TypeError("defineCrudListFilters requires an object.");
|
|
793
|
-
}
|
|
794
|
-
const source = normalizeObject(definitions);
|
|
795
|
-
|
|
796
|
-
const normalized = {};
|
|
797
|
-
const seenFilterKeys = new Set();
|
|
798
|
-
const seenQueryKeys = new Map();
|
|
799
|
-
|
|
800
|
-
for (const [rawKey, rawDefinition] of Object.entries(source)) {
|
|
801
|
-
const filter = normalizeCrudListFilterDefinition(rawKey, rawDefinition);
|
|
802
|
-
if (seenFilterKeys.has(filter.key)) {
|
|
803
|
-
throw new TypeError(`Duplicate CRUD list filter key "${filter.key}".`);
|
|
804
|
-
}
|
|
805
|
-
seenFilterKeys.add(filter.key);
|
|
806
|
-
|
|
807
|
-
for (const queryKey of resolveCrudListFilterQueryKeys(filter)) {
|
|
808
|
-
const seenBy = seenQueryKeys.get(queryKey);
|
|
809
|
-
if (seenBy) {
|
|
810
|
-
throw new TypeError(`CRUD list filters "${seenBy}" and "${filter.key}" both use query key "${queryKey}".`);
|
|
811
|
-
}
|
|
812
|
-
seenQueryKeys.set(queryKey, filter.key);
|
|
813
|
-
}
|
|
814
|
-
|
|
815
|
-
normalized[filter.key] = filter;
|
|
816
|
-
}
|
|
817
|
-
|
|
818
|
-
return deepFreeze(normalized);
|
|
819
|
-
}
|
|
820
|
-
|
|
821
|
-
export {
|
|
822
|
-
CRUD_LIST_FILTER_TYPE_FLAG,
|
|
823
|
-
CRUD_LIST_FILTER_TYPE_ENUM,
|
|
824
|
-
CRUD_LIST_FILTER_TYPE_ENUM_MANY,
|
|
825
|
-
CRUD_LIST_FILTER_TYPE_RECORD_ID,
|
|
826
|
-
CRUD_LIST_FILTER_TYPE_RECORD_ID_MANY,
|
|
827
|
-
CRUD_LIST_FILTER_TYPE_DATE,
|
|
828
|
-
CRUD_LIST_FILTER_TYPE_DATE_RANGE,
|
|
829
|
-
CRUD_LIST_FILTER_TYPE_NUMBER_RANGE,
|
|
830
|
-
CRUD_LIST_FILTER_TYPE_PRESENCE,
|
|
831
|
-
CRUD_LIST_FILTER_TYPES,
|
|
832
|
-
CRUD_LIST_FILTER_PRESENCE_PRESENT,
|
|
833
|
-
CRUD_LIST_FILTER_PRESENCE_MISSING,
|
|
834
|
-
CRUD_LIST_FILTER_PRESENCE_OPTIONS,
|
|
835
|
-
CRUD_LIST_FILTER_INVALID_VALUES_REJECT,
|
|
836
|
-
CRUD_LIST_FILTER_INVALID_VALUES_DISCARD,
|
|
837
|
-
INVALID_CRUD_LIST_FILTER_QUERY_VALUE,
|
|
838
|
-
normalizeCrudListFilterInvalidValues,
|
|
839
|
-
parseCrudListRangeQueryExpression,
|
|
840
|
-
formatCrudListRangeQueryExpression,
|
|
841
|
-
defineCrudListFilters,
|
|
842
|
-
createCrudListFilterEmptyValue,
|
|
843
|
-
createCrudListFilterInitialValue,
|
|
844
|
-
isCrudListFilterMultiValue,
|
|
845
|
-
isCrudListFilterStructuredValue,
|
|
846
|
-
normalizeCrudListFilterUiValue,
|
|
847
|
-
areCrudListFilterUiValuesEqual,
|
|
848
|
-
hasCrudListFilterUiValue,
|
|
849
|
-
listCrudListFilterChipValues,
|
|
850
|
-
formatCrudListFilterDefaultChipLabel,
|
|
851
|
-
formatCrudListFilterQueryValue,
|
|
852
|
-
parseCrudListFilterQueryValue,
|
|
853
|
-
resolveCrudListFilterQueryKeys,
|
|
854
|
-
resolveCrudListFilterOptionLabel
|
|
855
|
-
};
|