@react-querybuilder/core 8.24.1 → 8.24.3
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/cjs/react-querybuilder_core.cjs.development.js +0 -4
- package/dist/cjs/react-querybuilder_core.cjs.development.js.map +1 -1
- package/dist/cjs/react-querybuilder_core.cjs.production.js +1 -9
- package/dist/cjs/react-querybuilder_core.cjs.production.js.map +1 -1
- package/dist/derivations.js +1 -1
- package/dist/derivations.mjs +1 -1
- package/dist/parseCEL.js +2 -2
- package/dist/parseCEL.mjs +2 -2
- package/dist/parseJSONata.js +2 -2
- package/dist/parseJSONata.mjs +2 -2
- package/dist/parseJsonLogic.js +2 -2
- package/dist/parseJsonLogic.mjs +2 -2
- package/dist/parseMongoDB.js +2 -2
- package/dist/parseMongoDB.mjs +2 -2
- package/dist/parseSQL.js +2 -2
- package/dist/parseSQL.mjs +2 -2
- package/dist/parseSpEL.js +2 -2
- package/dist/parseSpEL.mjs +2 -2
- package/dist/{parserUtils-2VtG7m8L.js → parserUtils-B7lyuS2W.js} +2 -2
- package/dist/{parserUtils-2VtG7m8L.js.map → parserUtils-B7lyuS2W.js.map} +1 -1
- package/dist/{parserUtils-BlafvoFb.mjs → parserUtils-CvYzw5dp.mjs} +2 -2
- package/dist/{parserUtils-BlafvoFb.mjs.map → parserUtils-CvYzw5dp.mjs.map} +1 -1
- package/dist/{prepareQueryObjects-DawsH4e3.mjs → prepareQueryObjects-7w8QOgIX.mjs} +1 -5
- package/dist/prepareQueryObjects-7w8QOgIX.mjs.map +1 -0
- package/dist/{prepareQueryObjects-DJ_VjOLb.js → prepareQueryObjects-Bh8SmGZH.js} +1 -5
- package/dist/prepareQueryObjects-Bh8SmGZH.js.map +1 -0
- package/dist/react-querybuilder_core.legacy-esm.js +7 -11
- package/dist/react-querybuilder_core.legacy-esm.js.map +1 -1
- package/dist/react-querybuilder_core.mjs +0 -4
- package/dist/react-querybuilder_core.mjs.map +1 -1
- package/dist/react-querybuilder_core.production.mjs +1 -9
- package/dist/react-querybuilder_core.production.mjs.map +1 -1
- package/package.json +11 -11
- package/dist/prepareQueryObjects-DJ_VjOLb.js.map +0 -1
- package/dist/prepareQueryObjects-DawsH4e3.mjs.map +0 -1
package/dist/derivations.js
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_utils = require("./utils-B4E1-ZvU.js");
|
|
3
3
|
const require_objectUtils = require("./objectUtils-DfnEmDSV.js");
|
|
4
4
|
const require_convertQuery = require("./convertQuery-BLT0GIhM.js");
|
|
5
|
-
const require_prepareQueryObjects = require("./prepareQueryObjects-
|
|
5
|
+
const require_prepareQueryObjects = require("./prepareQueryObjects-Bh8SmGZH.js");
|
|
6
6
|
const require_isRuleOrGroupValid = require("./isRuleOrGroupValid-CtUf4_4x.js");
|
|
7
7
|
const require_transformQuery = require("./transformQuery.js");
|
|
8
8
|
let immer = require("immer");
|
package/dist/derivations.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { $ as defaultCombinators, A as isFlexibleOptionGroupArray, B as uniqByName, Ct as queryBuilderFlagDefaults, D as getFirstOption, Dt as substringOperators, E as parseNumber, Et as standardClassnames, F as toFlatOptionArray, G as splitBy, H as uniqOptList, I as toFullOption, J as LogType, K as toArray, L as toFullOptionList, M as isFullOptionGroupArray, N as isOptionGroupArray, O as getOption, P as prepareOptionList, Q as defaultCombinatorLabelMap, R as toFullOptionMap, St as nullOperators, T as getParseNumberMethod, Tt as rootPath, U as joinWith, V as uniqOptGroups, W as nullFreeArray, X as betweenOperators, Y as TestID, Z as defaultCoalesceMs, _t as defaultPlaceholderValueLabel, at as defaultOperatorLabelMap, bt as groupInvalidReasons, ct as defaultPlaceholderFieldGroupLabel, dt as defaultPlaceholderLabel, et as defaultCombinatorsExtended, ft as defaultPlaceholderName, gt as defaultPlaceholderValueGroupLabel, ht as defaultPlaceholderOperatorName, it as defaultMaxHistory, j as isFullOptionArray, k as isFlexibleOptionArray, lt as defaultPlaceholderFieldLabel, mt as defaultPlaceholderOperatorLabel, nt as defaultJoinChar, ot as defaultOperatorNegationMap, pt as defaultPlaceholderOperatorGroupLabel, q as trimIfString, rt as defaultMatchModes, st as defaultOperators, tt as defaultControlClassnames, ut as defaultPlaceholderFieldName, vt as defaultPlaceholderValueName, wt as relationalOperators, xt as inOperators, yt as defaultTranslations, z as uniqByIdentifier } from "./utils-DLZCoyAh.mjs";
|
|
2
2
|
import { a as isRuleGroupType, c as isPojo, d as numericRegex, i as isRuleGroup, l as lc, n as objectEntries, o as isRuleGroupTypeIC, r as objectKeys, s as isRuleType, t as isUnsafeKey, u as nullOrUndefinedOrEmpty } from "./objectUtils-DDZ-KhV5.mjs";
|
|
3
3
|
import { n as convertQuery, r as convertToIC, t as convertFromIC } from "./convertQuery-DaXv3h7S.mjs";
|
|
4
|
-
import { a as getValueSourcesUtil, c as filterFieldsByComparator, i as resolveCandidateQuery, n as prepareRuleGroup, o as generateID, r as prepareRuleOrGroup, s as uuidV4regex, t as prepareRule } from "./prepareQueryObjects-
|
|
4
|
+
import { a as getValueSourcesUtil, c as filterFieldsByComparator, i as resolveCandidateQuery, n as prepareRuleGroup, o as generateID, r as prepareRuleOrGroup, s as uuidV4regex, t as prepareRule } from "./prepareQueryObjects-7w8QOgIX.mjs";
|
|
5
5
|
import { n as isValidationResult, t as isRuleOrGroupValid } from "./isRuleOrGroupValid-CIMZNkt4.mjs";
|
|
6
6
|
import { transformQuery } from "./transformQuery.mjs";
|
|
7
7
|
import { Immer, current, isDraft, produce, setAutoFreeze as setAutoFreeze$1 } from "immer";
|
package/dist/parseCEL.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_utils = require("./utils-B4E1-ZvU.js");
|
|
3
3
|
const require_objectUtils = require("./objectUtils-DfnEmDSV.js");
|
|
4
|
-
const require_prepareQueryObjects = require("./prepareQueryObjects-
|
|
5
|
-
const require_parserUtils = require("./parserUtils-
|
|
4
|
+
const require_prepareQueryObjects = require("./prepareQueryObjects-Bh8SmGZH.js");
|
|
5
|
+
const require_parserUtils = require("./parserUtils-B7lyuS2W.js");
|
|
6
6
|
let _ts_jison_parser = require("@ts-jison/parser");
|
|
7
7
|
let _ts_jison_lexer = require("@ts-jison/lexer");
|
|
8
8
|
//#region src/utils/parseCEL/celParser.ts
|
package/dist/parseCEL.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { U as joinWith, ot as defaultOperatorNegationMap } from "./utils-DLZCoyAh.mjs";
|
|
2
2
|
import { i as isRuleGroup } from "./objectUtils-DDZ-KhV5.mjs";
|
|
3
|
-
import { n as prepareRuleGroup } from "./prepareQueryObjects-
|
|
4
|
-
import { n as getFieldsArray, t as fieldIsValidUtil } from "./parserUtils-
|
|
3
|
+
import { n as prepareRuleGroup } from "./prepareQueryObjects-7w8QOgIX.mjs";
|
|
4
|
+
import { n as getFieldsArray, t as fieldIsValidUtil } from "./parserUtils-CvYzw5dp.mjs";
|
|
5
5
|
import { JisonParser } from "@ts-jison/parser";
|
|
6
6
|
import { JisonLexer } from "@ts-jison/lexer";
|
|
7
7
|
//#region src/utils/parseCEL/celParser.ts
|
package/dist/parseJSONata.js
CHANGED
|
@@ -22,8 +22,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
22
22
|
}) : target, mod));
|
|
23
23
|
//#endregion
|
|
24
24
|
const require_objectUtils = require("./objectUtils-DfnEmDSV.js");
|
|
25
|
-
const require_prepareQueryObjects = require("./prepareQueryObjects-
|
|
26
|
-
const require_parserUtils = require("./parserUtils-
|
|
25
|
+
const require_prepareQueryObjects = require("./prepareQueryObjects-Bh8SmGZH.js");
|
|
26
|
+
const require_parserUtils = require("./parserUtils-B7lyuS2W.js");
|
|
27
27
|
let jsonata = require("jsonata");
|
|
28
28
|
jsonata = __toESM(jsonata);
|
|
29
29
|
//#region src/utils/parseJSONata/utils.ts
|
package/dist/parseJSONata.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as isRuleGroup } from "./objectUtils-DDZ-KhV5.mjs";
|
|
2
|
-
import { n as prepareRuleGroup } from "./prepareQueryObjects-
|
|
3
|
-
import { n as getFieldsArray, t as fieldIsValidUtil } from "./parserUtils-
|
|
2
|
+
import { n as prepareRuleGroup } from "./prepareQueryObjects-7w8QOgIX.mjs";
|
|
3
|
+
import { n as getFieldsArray, t as fieldIsValidUtil } from "./parserUtils-CvYzw5dp.mjs";
|
|
4
4
|
import jsonata from "jsonata";
|
|
5
5
|
//#region src/utils/parseJSONata/utils.ts
|
|
6
6
|
const isJSONataExprNode = (expr) => {
|
package/dist/parseJsonLogic.js
CHANGED
|
@@ -2,8 +2,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_utils = require("./utils-B4E1-ZvU.js");
|
|
3
3
|
const require_objectUtils = require("./objectUtils-DfnEmDSV.js");
|
|
4
4
|
const require_convertQuery = require("./convertQuery-BLT0GIhM.js");
|
|
5
|
-
const require_prepareQueryObjects = require("./prepareQueryObjects-
|
|
6
|
-
const require_parserUtils = require("./parserUtils-
|
|
5
|
+
const require_prepareQueryObjects = require("./prepareQueryObjects-Bh8SmGZH.js");
|
|
6
|
+
const require_parserUtils = require("./parserUtils-B7lyuS2W.js");
|
|
7
7
|
//#region src/utils/parseJsonLogic/utils.ts
|
|
8
8
|
const isJsonLogicVar = (logic) => require_objectUtils.isPojo(logic) && "var" in logic;
|
|
9
9
|
const isRQBJsonLogicVar = (logic) => isJsonLogicVar(logic) && typeof logic.var === "string";
|
package/dist/parseJsonLogic.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { U as joinWith, ot as defaultOperatorNegationMap } from "./utils-DLZCoyAh.mjs";
|
|
2
2
|
import { a as isRuleGroupType, c as isPojo, i as isRuleGroup, r as objectKeys } from "./objectUtils-DDZ-KhV5.mjs";
|
|
3
3
|
import { r as convertToIC } from "./convertQuery-DaXv3h7S.mjs";
|
|
4
|
-
import { n as prepareRuleGroup } from "./prepareQueryObjects-
|
|
5
|
-
import { n as getFieldsArray, t as fieldIsValidUtil } from "./parserUtils-
|
|
4
|
+
import { n as prepareRuleGroup } from "./prepareQueryObjects-7w8QOgIX.mjs";
|
|
5
|
+
import { n as getFieldsArray, t as fieldIsValidUtil } from "./parserUtils-CvYzw5dp.mjs";
|
|
6
6
|
//#region src/utils/parseJsonLogic/utils.ts
|
|
7
7
|
const isJsonLogicVar = (logic) => isPojo(logic) && "var" in logic;
|
|
8
8
|
const isRQBJsonLogicVar = (logic) => isJsonLogicVar(logic) && typeof logic.var === "string";
|
package/dist/parseMongoDB.js
CHANGED
|
@@ -2,8 +2,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_utils = require("./utils-B4E1-ZvU.js");
|
|
3
3
|
const require_objectUtils = require("./objectUtils-DfnEmDSV.js");
|
|
4
4
|
const require_convertQuery = require("./convertQuery-BLT0GIhM.js");
|
|
5
|
-
const require_prepareQueryObjects = require("./prepareQueryObjects-
|
|
6
|
-
const require_parserUtils = require("./parserUtils-
|
|
5
|
+
const require_prepareQueryObjects = require("./prepareQueryObjects-Bh8SmGZH.js");
|
|
6
|
+
const require_parserUtils = require("./parserUtils-B7lyuS2W.js");
|
|
7
7
|
//#region src/utils/parseMongoDB/utils.ts
|
|
8
8
|
const getRegExStr = (re) => typeof re === "string" ? re : re.source;
|
|
9
9
|
const isPrimitive = (v) => typeof v === "string" || typeof v === "number" || typeof v === "boolean";
|
package/dist/parseMongoDB.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { U as joinWith, ot as defaultOperatorNegationMap } from "./utils-DLZCoyAh.mjs";
|
|
2
2
|
import { a as isRuleGroupType, c as isPojo, r as objectKeys } from "./objectUtils-DDZ-KhV5.mjs";
|
|
3
3
|
import { r as convertToIC } from "./convertQuery-DaXv3h7S.mjs";
|
|
4
|
-
import { n as prepareRuleGroup } from "./prepareQueryObjects-
|
|
5
|
-
import { n as getFieldsArray, t as fieldIsValidUtil } from "./parserUtils-
|
|
4
|
+
import { n as prepareRuleGroup } from "./prepareQueryObjects-7w8QOgIX.mjs";
|
|
5
|
+
import { n as getFieldsArray, t as fieldIsValidUtil } from "./parserUtils-CvYzw5dp.mjs";
|
|
6
6
|
//#region src/utils/parseMongoDB/utils.ts
|
|
7
7
|
const getRegExStr = (re) => typeof re === "string" ? re : re.source;
|
|
8
8
|
const isPrimitive = (v) => typeof v === "string" || typeof v === "number" || typeof v === "boolean";
|
package/dist/parseSQL.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_utils = require("./utils-B4E1-ZvU.js");
|
|
3
3
|
const require_objectUtils = require("./objectUtils-DfnEmDSV.js");
|
|
4
|
-
const require_prepareQueryObjects = require("./prepareQueryObjects-
|
|
5
|
-
const require_parserUtils = require("./parserUtils-
|
|
4
|
+
const require_prepareQueryObjects = require("./prepareQueryObjects-Bh8SmGZH.js");
|
|
5
|
+
const require_parserUtils = require("./parserUtils-B7lyuS2W.js");
|
|
6
6
|
let _ts_jison_parser = require("@ts-jison/parser");
|
|
7
7
|
let _ts_jison_lexer = require("@ts-jison/lexer");
|
|
8
8
|
//#region src/utils/parseSQL/sqlParser.ts
|
package/dist/parseSQL.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { E as parseNumber, U as joinWith } from "./utils-DLZCoyAh.mjs";
|
|
2
2
|
import { i as isRuleGroup, l as lc } from "./objectUtils-DDZ-KhV5.mjs";
|
|
3
|
-
import { n as prepareRuleGroup } from "./prepareQueryObjects-
|
|
4
|
-
import { n as getFieldsArray, t as fieldIsValidUtil } from "./parserUtils-
|
|
3
|
+
import { n as prepareRuleGroup } from "./prepareQueryObjects-7w8QOgIX.mjs";
|
|
4
|
+
import { n as getFieldsArray, t as fieldIsValidUtil } from "./parserUtils-CvYzw5dp.mjs";
|
|
5
5
|
import { JisonParser } from "@ts-jison/parser";
|
|
6
6
|
import { JisonLexer } from "@ts-jison/lexer";
|
|
7
7
|
//#region src/utils/parseSQL/sqlParser.ts
|
package/dist/parseSpEL.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_utils = require("./utils-B4E1-ZvU.js");
|
|
3
3
|
const require_objectUtils = require("./objectUtils-DfnEmDSV.js");
|
|
4
|
-
const require_prepareQueryObjects = require("./prepareQueryObjects-
|
|
5
|
-
const require_parserUtils = require("./parserUtils-
|
|
4
|
+
const require_prepareQueryObjects = require("./prepareQueryObjects-Bh8SmGZH.js");
|
|
5
|
+
const require_parserUtils = require("./parserUtils-B7lyuS2W.js");
|
|
6
6
|
let spel2js = require("spel2js");
|
|
7
7
|
//#region src/utils/parseSpEL/utils.ts
|
|
8
8
|
const isSpELPropertyNode = (expr) => {
|
package/dist/parseSpEL.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { U as joinWith } from "./utils-DLZCoyAh.mjs";
|
|
2
2
|
import { i as isRuleGroup } from "./objectUtils-DDZ-KhV5.mjs";
|
|
3
|
-
import { n as prepareRuleGroup } from "./prepareQueryObjects-
|
|
4
|
-
import { n as getFieldsArray, t as fieldIsValidUtil } from "./parserUtils-
|
|
3
|
+
import { n as prepareRuleGroup } from "./prepareQueryObjects-7w8QOgIX.mjs";
|
|
4
|
+
import { n as getFieldsArray, t as fieldIsValidUtil } from "./parserUtils-CvYzw5dp.mjs";
|
|
5
5
|
import { SpelExpressionEvaluator } from "spel2js";
|
|
6
6
|
//#region src/utils/parseSpEL/utils.ts
|
|
7
7
|
const isSpELPropertyNode = (expr) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_utils = require("./utils-B4E1-ZvU.js");
|
|
2
|
-
const require_prepareQueryObjects = require("./prepareQueryObjects-
|
|
2
|
+
const require_prepareQueryObjects = require("./prepareQueryObjects-Bh8SmGZH.js");
|
|
3
3
|
//#region src/utils/parserUtils.ts
|
|
4
4
|
const getFieldsArray = (fields) => {
|
|
5
5
|
const fieldsArray = fields ? Array.isArray(fields) ? fields : Object.keys(fields).map((fld) => Object.assign({}, fields[fld], { name: fld })).sort((a, b) => a.label.localeCompare(b.label)) : [];
|
|
@@ -38,4 +38,4 @@ Object.defineProperty(exports, "getFieldsArray", {
|
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
40
|
|
|
41
|
-
//# sourceMappingURL=parserUtils-
|
|
41
|
+
//# sourceMappingURL=parserUtils-B7lyuS2W.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parserUtils-
|
|
1
|
+
{"version":3,"file":"parserUtils-B7lyuS2W.js","names":["toFlatOptionArray","getValueSourcesUtil","isFlexibleOptionArray","toFullOption","filterFieldsByComparator"],"sources":["../src/utils/parserUtils.ts"],"sourcesContent":["import type {\n DefaultOperatorName,\n FullField,\n FullOption,\n OptionList,\n ValueSource,\n ValueSourceFlexibleOptions,\n ValueSources,\n} from '../types';\nimport { filterFieldsByComparator } from './filterFieldsByComparator';\nimport { getValueSourcesUtil } from './getValueSourcesUtil';\nimport { isFlexibleOptionArray, toFlatOptionArray, toFullOption } from './optGroupUtils';\n\nexport const getFieldsArray = (\n fields?: OptionList<FullField> | Record<string, FullField>\n): FullOption[] => {\n const fieldsArray = fields\n ? Array.isArray(fields)\n ? fields\n : Object.keys(fields)\n .map(fld => Object.assign({}, fields[fld], { name: fld }))\n // oxlint-disable-next-line no-array-sort\n .sort((a, b) => a.label.localeCompare(b.label))\n : [];\n return toFlatOptionArray(fieldsArray);\n};\n\nexport function fieldIsValidUtil(params: {\n fieldsFlat: FullField[];\n getValueSources?: (field: string, operator: string) => ValueSources | ValueSourceFlexibleOptions;\n fieldName: string;\n operator: DefaultOperatorName;\n subordinateFieldName?: string;\n}): boolean {\n const { fieldsFlat, fieldName, operator, subordinateFieldName, getValueSources } = params;\n\n const vsIncludes = (vs: ValueSource) => {\n const vss = getValueSourcesUtil(primaryField, operator, getValueSources);\n return isFlexibleOptionArray(vss) && vss.some(vso => vso.value === vs || vso.name === vs);\n };\n\n // If fields option was an empty array or undefined, then all identifiers\n // are considered valid.\n if (fieldsFlat.length === 0) return true;\n\n let valid = false;\n\n const primaryField = toFullOption(fieldsFlat.find(ff => ff.name === fieldName)!);\n if (primaryField) {\n valid = !(\n !subordinateFieldName &&\n operator !== 'notNull' &&\n operator !== 'null' &&\n !vsIncludes('value')\n );\n\n if (valid && !!subordinateFieldName) {\n if (vsIncludes('field') && fieldName !== subordinateFieldName) {\n const validSubordinateFields = filterFieldsByComparator(\n primaryField,\n fieldsFlat,\n operator\n ) as FullField[];\n if (!validSubordinateFields.some(vsf => vsf.name === subordinateFieldName)) {\n valid = false;\n }\n } else {\n valid = false;\n }\n }\n }\n\n return valid;\n}\n"],"mappings":";;;AAaA,MAAa,kBACX,WACiB;CACjB,MAAM,cAAc,SAChB,MAAM,QAAQ,MAAM,IAClB,SACA,OAAO,KAAK,MAAM,CAAC,CAChB,KAAI,QAAO,OAAO,OAAO,CAAC,GAAG,OAAO,MAAM,EAAE,MAAM,IAAI,CAAC,CAAC,CAAC,CAEzD,MAAM,GAAG,MAAM,EAAE,MAAM,cAAc,EAAE,KAAK,CAAC,IAClD,CAAC;CACL,OAAOA,cAAAA,kBAAkB,WAAW;AACtC;AAEA,SAAgB,iBAAiB,QAMrB;CACV,MAAM,EAAE,YAAY,WAAW,UAAU,sBAAsB,oBAAoB;CAEnF,MAAM,cAAc,OAAoB;EACtC,MAAM,MAAMC,4BAAAA,oBAAoB,cAAc,UAAU,eAAe;EACvE,OAAOC,cAAAA,sBAAsB,GAAG,KAAK,IAAI,MAAK,QAAO,IAAI,UAAU,MAAM,IAAI,SAAS,EAAE;CAC1F;CAIA,IAAI,WAAW,WAAW,GAAG,OAAO;CAEpC,IAAI,QAAQ;CAEZ,MAAM,eAAeC,cAAAA,aAAa,WAAW,MAAK,OAAM,GAAG,SAAS,SAAS,CAAE;CAC/E,IAAI,cAAc;EAChB,QAAQ,EACN,CAAC,wBACD,aAAa,aACb,aAAa,UACb,CAAC,WAAW,OAAO;EAGrB,IAAI,SAAS,CAAC,CAAC,sBAAsB;GACnC,IAAI,WAAW,OAAO,KAAK,cAAc,sBAMnC;QAAA,CAL2BC,4BAAAA,yBAC7B,cACA,YACA,QAEwB,CAAC,CAAC,MAAK,QAAO,IAAI,SAAS,oBAAoB,GACvE,QAAQ;GAAA,OAGV,QAAQ;EAEZ;CACF;CAEA,OAAO;AACT"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { F as toFlatOptionArray, I as toFullOption, k as isFlexibleOptionArray } from "./utils-DLZCoyAh.mjs";
|
|
2
|
-
import { a as getValueSourcesUtil, c as filterFieldsByComparator } from "./prepareQueryObjects-
|
|
2
|
+
import { a as getValueSourcesUtil, c as filterFieldsByComparator } from "./prepareQueryObjects-7w8QOgIX.mjs";
|
|
3
3
|
//#region src/utils/parserUtils.ts
|
|
4
4
|
const getFieldsArray = (fields) => {
|
|
5
5
|
const fieldsArray = fields ? Array.isArray(fields) ? fields : Object.keys(fields).map((fld) => Object.assign({}, fields[fld], { name: fld })).sort((a, b) => a.label.localeCompare(b.label)) : [];
|
|
@@ -27,4 +27,4 @@ function fieldIsValidUtil(params) {
|
|
|
27
27
|
//#endregion
|
|
28
28
|
export { getFieldsArray as n, fieldIsValidUtil as t };
|
|
29
29
|
|
|
30
|
-
//# sourceMappingURL=parserUtils-
|
|
30
|
+
//# sourceMappingURL=parserUtils-CvYzw5dp.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parserUtils-
|
|
1
|
+
{"version":3,"file":"parserUtils-CvYzw5dp.mjs","names":[],"sources":["../src/utils/parserUtils.ts"],"sourcesContent":["import type {\n DefaultOperatorName,\n FullField,\n FullOption,\n OptionList,\n ValueSource,\n ValueSourceFlexibleOptions,\n ValueSources,\n} from '../types';\nimport { filterFieldsByComparator } from './filterFieldsByComparator';\nimport { getValueSourcesUtil } from './getValueSourcesUtil';\nimport { isFlexibleOptionArray, toFlatOptionArray, toFullOption } from './optGroupUtils';\n\nexport const getFieldsArray = (\n fields?: OptionList<FullField> | Record<string, FullField>\n): FullOption[] => {\n const fieldsArray = fields\n ? Array.isArray(fields)\n ? fields\n : Object.keys(fields)\n .map(fld => Object.assign({}, fields[fld], { name: fld }))\n // oxlint-disable-next-line no-array-sort\n .sort((a, b) => a.label.localeCompare(b.label))\n : [];\n return toFlatOptionArray(fieldsArray);\n};\n\nexport function fieldIsValidUtil(params: {\n fieldsFlat: FullField[];\n getValueSources?: (field: string, operator: string) => ValueSources | ValueSourceFlexibleOptions;\n fieldName: string;\n operator: DefaultOperatorName;\n subordinateFieldName?: string;\n}): boolean {\n const { fieldsFlat, fieldName, operator, subordinateFieldName, getValueSources } = params;\n\n const vsIncludes = (vs: ValueSource) => {\n const vss = getValueSourcesUtil(primaryField, operator, getValueSources);\n return isFlexibleOptionArray(vss) && vss.some(vso => vso.value === vs || vso.name === vs);\n };\n\n // If fields option was an empty array or undefined, then all identifiers\n // are considered valid.\n if (fieldsFlat.length === 0) return true;\n\n let valid = false;\n\n const primaryField = toFullOption(fieldsFlat.find(ff => ff.name === fieldName)!);\n if (primaryField) {\n valid = !(\n !subordinateFieldName &&\n operator !== 'notNull' &&\n operator !== 'null' &&\n !vsIncludes('value')\n );\n\n if (valid && !!subordinateFieldName) {\n if (vsIncludes('field') && fieldName !== subordinateFieldName) {\n const validSubordinateFields = filterFieldsByComparator(\n primaryField,\n fieldsFlat,\n operator\n ) as FullField[];\n if (!validSubordinateFields.some(vsf => vsf.name === subordinateFieldName)) {\n valid = false;\n }\n } else {\n valid = false;\n }\n }\n }\n\n return valid;\n}\n"],"mappings":";;;AAaA,MAAa,kBACX,WACiB;CACjB,MAAM,cAAc,SAChB,MAAM,QAAQ,MAAM,IAClB,SACA,OAAO,KAAK,MAAM,CAAC,CAChB,KAAI,QAAO,OAAO,OAAO,CAAC,GAAG,OAAO,MAAM,EAAE,MAAM,IAAI,CAAC,CAAC,CAAC,CAEzD,MAAM,GAAG,MAAM,EAAE,MAAM,cAAc,EAAE,KAAK,CAAC,IAClD,CAAC;CACL,OAAO,kBAAkB,WAAW;AACtC;AAEA,SAAgB,iBAAiB,QAMrB;CACV,MAAM,EAAE,YAAY,WAAW,UAAU,sBAAsB,oBAAoB;CAEnF,MAAM,cAAc,OAAoB;EACtC,MAAM,MAAM,oBAAoB,cAAc,UAAU,eAAe;EACvE,OAAO,sBAAsB,GAAG,KAAK,IAAI,MAAK,QAAO,IAAI,UAAU,MAAM,IAAI,SAAS,EAAE;CAC1F;CAIA,IAAI,WAAW,WAAW,GAAG,OAAO;CAEpC,IAAI,QAAQ;CAEZ,MAAM,eAAe,aAAa,WAAW,MAAK,OAAM,GAAG,SAAS,SAAS,CAAE;CAC/E,IAAI,cAAc;EAChB,QAAQ,EACN,CAAC,wBACD,aAAa,aACb,aAAa,UACb,CAAC,WAAW,OAAO;EAGrB,IAAI,SAAS,CAAC,CAAC,sBAAsB;GACnC,IAAI,WAAW,OAAO,KAAK,cAAc,sBAMnC;QAAA,CAL2B,yBAC7B,cACA,YACA,QAEwB,CAAC,CAAC,MAAK,QAAO,IAAI,SAAS,oBAAoB,GACvE,QAAQ;GAAA,OAGV,QAAQ;EAEZ;CACF;CAEA,OAAO;AACT"}
|
|
@@ -38,7 +38,6 @@ const filterFieldsByComparator = (field, fields, operator) => {
|
|
|
38
38
|
};
|
|
39
39
|
//#endregion
|
|
40
40
|
//#region src/utils/generateID.ts
|
|
41
|
-
/* v8 ignore file -- this is fine */
|
|
42
41
|
const cryptoModule = globalThis.crypto;
|
|
43
42
|
const uuidV4regex = /^[\da-f]{8}-[\da-f]{4}-4[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i;
|
|
44
43
|
/**
|
|
@@ -50,11 +49,8 @@ const uuidV4regex = /^[\da-f]{8}-[\da-f]{4}-4[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]
|
|
|
50
49
|
* ```
|
|
51
50
|
* @returns Valid v4 UUID
|
|
52
51
|
*/
|
|
53
|
-
// v8 ignore next
|
|
54
52
|
let generateID = () => "00-0-4-2-000".replaceAll(/[^-]/g, (s) => ((Math.random() + Math.trunc(s)) * 65536 >> Number.parseInt(s)).toString(16).padStart(4, "0"));
|
|
55
|
-
// v8 ignore else
|
|
56
53
|
if (cryptoModule) {
|
|
57
|
-
// v8 ignore else
|
|
58
54
|
if (typeof cryptoModule.randomUUID === "function") generateID = () => cryptoModule.randomUUID();
|
|
59
55
|
else if (typeof cryptoModule.getRandomValues === "function") {
|
|
60
56
|
const position19vals = "89ab";
|
|
@@ -165,4 +161,4 @@ const resolveCandidateQuery = (sources, options) => {
|
|
|
165
161
|
//#endregion
|
|
166
162
|
export { getValueSourcesUtil as a, filterFieldsByComparator as c, resolveCandidateQuery as i, prepareRuleGroup as n, generateID as o, prepareRuleOrGroup as r, uuidV4regex as s, prepareRule as t };
|
|
167
163
|
|
|
168
|
-
//# sourceMappingURL=prepareQueryObjects-
|
|
164
|
+
//# sourceMappingURL=prepareQueryObjects-7w8QOgIX.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prepareQueryObjects-7w8QOgIX.mjs","names":[],"sources":["../src/utils/filterFieldsByComparator.ts","../src/utils/generateID.ts","../src/utils/getValueSourcesUtil.ts","../src/utils/prepareQueryObjects.ts"],"sourcesContent":["import type { FullField, OptionList, WithUnknownIndex } from '../types';\nimport { isFlexibleOptionGroupArray, toFullOption } from './optGroupUtils';\n\nconst filterByComparator = (field: FullField, operator: string, fieldToCompare: FullField) => {\n const fullField = toFullOption(field);\n const fullFieldToCompare = toFullOption(fieldToCompare);\n if (fullField.value === fullFieldToCompare.value) {\n return false;\n }\n if (typeof fullField.comparator === 'string') {\n return fullField[fullField.comparator] === fullFieldToCompare[fullField.comparator];\n }\n return (\n fullField.comparator?.(fullFieldToCompare, operator) ??\n /* v8 ignore start -- @preserve */ false /* v8 ignore stop -- @preserve */\n );\n};\n\n/**\n * For a given {@link FullField}, returns the `fields` list filtered for\n * other fields that match by `comparator`. Only fields *other than the\n * one in question* will ever be included, even if `comparator` is `null`\n * or `undefined`. If `comparator` is a string, fields with the same value\n * for that property will be included. If `comparator` is a function, each\n * field will be passed to the function along with the `operator` and fields\n * for which the function returns `true` will be included.\n *\n * @group Option Lists\n */\nexport const filterFieldsByComparator = (\n /** The field in question. */\n field: FullField,\n /** The full {@link FullField} list to be filtered. */\n fields: OptionList<FullField>,\n operator: string\n):\n | FullField[]\n | {\n options: WithUnknownIndex<FullField>[];\n label: string;\n }[] => {\n if (!field.comparator) {\n const filterOutSameField = (f: FullField) =>\n (f.value ?? /* v8 ignore start -- @preserve */ f.name) /* v8 ignore stop -- @preserve */ !==\n (field.value ??\n /* v8 ignore start -- @preserve */ field.name); /* v8 ignore stop -- @preserve */\n if (isFlexibleOptionGroupArray(fields)) {\n return fields.map(og => ({\n ...og,\n options: og.options.filter(v => filterOutSameField(v)),\n }));\n }\n return fields.filter(v => filterOutSameField(v));\n }\n\n if (isFlexibleOptionGroupArray(fields)) {\n return fields\n .map(og => ({\n ...og,\n options: og.options.filter(f => filterByComparator(field, operator, f)),\n }))\n .filter(og => og.options.length > 0);\n }\n\n return fields.filter(f => filterByComparator(field, operator, f));\n};\n","type UUID = `${string}-${string}-${string}-${string}-${string}`;\n\nconst cryptoModule = globalThis.crypto;\n\nexport const uuidV4regex: RegExp =\n /^[\\da-f]{8}-[\\da-f]{4}-4[\\da-f]{3}-[89ab][\\da-f]{3}-[\\da-f]{12}$/i;\n\n/**\n * Default `id` generator. Generates a valid v4 UUID. Uses `crypto.randomUUID()`\n * when available, otherwise uses an alternate method based on `getRandomValues`.\n * The returned string is guaranteed to match this regex:\n * ```\n * /^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i\n * ```\n * @returns Valid v4 UUID\n */\n// Default implementation adapted from https://stackoverflow.com/a/68141099/217579\nexport let generateID = (): UUID =>\n '00-0-4-2-000'.replaceAll(/[^-]/g, s =>\n (((Math.random() + Math.trunc(s as unknown as number)) * 0x1_00_00) >> Number.parseInt(s))\n .toString(16)\n .padStart(4, '0')\n ) as UUID;\n\n// Improve on the default implementation by using the crypto package if it's available\nif (cryptoModule) {\n if (typeof cryptoModule.randomUUID === 'function') {\n generateID = () => cryptoModule.randomUUID();\n } else if (typeof cryptoModule.getRandomValues === 'function') {\n // `randomUUID` is much simpler and faster, but it's only guaranteed to be\n // available in secure contexts (server-side, https, etc.). `generateID`\n // doesn't really need to be cryptographically secure, it only needs a\n // fairly low chance of collisions. We fall back to the always-available\n // `getRandomValues` here (while still generating a valid v4 UUID) when\n // `randomUUID` is not available.\n const position19vals = '89ab';\n const container = new Uint32Array(32);\n\n generateID = () => {\n cryptoModule.getRandomValues(container);\n let id = (container[0] % 16).toString(16);\n for (let i = 1; i < 32; i++) {\n if (i === 12) {\n id = `${id}${'4'}`;\n } else if (i === 16) {\n id = `${id}${position19vals[container[17] % 4]}`;\n } else {\n id = `${id}${(container[i] % 16).toString(16)}`;\n }\n\n if (i === 7 || i === 11 || i === 15 || i === 19) {\n id = `${id}${'-'}`;\n }\n }\n return id as UUID;\n };\n }\n}\n","import type {\n FullField,\n GetOptionIdentifierType,\n ValueSourceFlexibleOptions,\n ValueSourceFullOptions,\n ValueSources,\n} from '../types';\nimport { lc } from './misc';\nimport { isFlexibleOptionArray, toFullOption, toFullOptionList } from './optGroupUtils';\n\nconst defaultValueSourcesArray: ValueSourceFullOptions = [\n { name: 'value', value: 'value', label: 'value' },\n];\n\nconst dummyFD = {\n name: 'name',\n value: 'name',\n valueSources: null,\n label: 'label',\n};\n\n/**\n * Utility function to get the value sources array for the given\n * field and operator. If the field definition does not define a\n * `valueSources` property, the `getValueSources` prop is used.\n * Returns `[FullOption<\"value\">]` by default.\n */\n// oxlint-disable-next-line typescript/no-unnecessary-type-parameters\nexport const getValueSourcesUtil = <F extends FullField, O extends string>(\n fieldData: F,\n operator: string,\n getValueSources?: (\n field: GetOptionIdentifierType<F>,\n operator: O,\n misc: { fieldData: F }\n ) => ValueSources | ValueSourceFlexibleOptions\n): ValueSourceFullOptions => {\n // TypeScript doesn't allow it directly, but in practice\n // `fieldData` can end up being undefined or null. The nullish\n // coalescing assignment below avoids errors like\n // \"TypeError: Cannot read properties of undefined (reading 'name')\"\n const fd = fieldData ? toFullOption(fieldData) : dummyFD;\n\n let valueSourcesNEW:\n | false\n | ValueSources\n | ValueSourceFlexibleOptions\n | ((operator: string) => ValueSources | ValueSourceFlexibleOptions) = fd.valueSources ?? false;\n\n if (typeof valueSourcesNEW === 'function') {\n valueSourcesNEW = valueSourcesNEW(operator);\n }\n\n if (!valueSourcesNEW && getValueSources) {\n valueSourcesNEW = getValueSources(fd.value as GetOptionIdentifierType<F>, operator as O, {\n fieldData: fd as F,\n });\n }\n\n if (!valueSourcesNEW) {\n return defaultValueSourcesArray;\n }\n\n if (isFlexibleOptionArray(valueSourcesNEW)) {\n return toFullOptionList(valueSourcesNEW as ValueSourceFullOptions) as ValueSourceFullOptions;\n }\n\n return valueSourcesNEW.map(\n vs =>\n defaultValueSourcesArray.find(dmm => dmm.value === lc(vs)) ?? {\n name: vs,\n value: vs,\n label: vs,\n }\n ) as ValueSourceFullOptions;\n};\n","import type {\n RuleGroupArray,\n RuleGroupICArray,\n RuleGroupType,\n RuleGroupTypeAny,\n RuleGroupTypeIC,\n RuleType,\n} from '../types';\nimport { processMatchMode } from './formatQuery/utils';\nimport { generateID } from './generateID';\nimport { isRuleGroup } from './isRuleGroup';\n\n/**\n * Options for {@link prepareRule}/{@link prepareRuleGroup}.\n */\nexport interface PreparerOptions {\n idGenerator?: () => string;\n}\n\n/**\n * Ensures that a rule is valid by adding an `id` property if it does not already exist.\n */\nexport const prepareRule = (\n rule: RuleType,\n { idGenerator = generateID }: PreparerOptions = {}\n): RuleType => {\n const needsId = !rule.id;\n const hasMatchMode = processMatchMode(rule);\n\n if (!needsId && !hasMatchMode) {\n return rule;\n }\n\n return {\n ...rule,\n ...(needsId && { id: idGenerator() }),\n ...(hasMatchMode && { value: prepareRuleGroup(rule.value, { idGenerator }) }),\n };\n};\n\n/**\n * Ensures that a rule group is valid by recursively adding an `id` property to the group itself\n * and all its rules and subgroups where one does not already exist.\n */\nexport const prepareRuleGroup = <RG extends RuleGroupTypeAny>(\n queryObject: RG,\n { idGenerator = generateID }: PreparerOptions = {}\n): RG => {\n const needsId = !queryObject.id;\n let rulesChanged = false;\n const newRules: (RuleGroupTypeAny | RuleType | string)[] = [];\n\n for (let i = 0; i < queryObject.rules.length; i++) {\n const r = queryObject.rules[i];\n if (typeof r === 'string') {\n newRules.push(r);\n } else {\n const prepared = isRuleGroup(r)\n ? prepareRuleGroup(r, { idGenerator })\n : prepareRule(r, { idGenerator });\n newRules.push(prepared);\n if (prepared !== r) {\n rulesChanged = true;\n }\n }\n }\n\n if (!needsId && !rulesChanged) {\n return queryObject;\n }\n\n return {\n ...queryObject,\n ...(needsId && { id: idGenerator() }),\n rules: newRules as RuleGroupArray | RuleGroupICArray,\n };\n};\n\n/**\n * Ensures that a rule or group is valid. See {@link prepareRule} and {@link prepareRuleGroup}.\n */\nexport const prepareRuleOrGroup = (\n rg: RuleGroupTypeAny | RuleType,\n { idGenerator = generateID }: PreparerOptions = {}\n): RuleGroupType | RuleGroupTypeIC | RuleType =>\n isRuleGroup(rg) ? prepareRuleGroup(rg, { idGenerator }) : prepareRule(rg, { idGenerator });\n\n/**\n * Resolves the query a query builder should render from the available sources, in precedence\n * order: the controlled `query`, then whatever is already in the store, then the uncontrolled\n * `defaultQuery`, then a freshly created empty group.\n *\n * The result is prepared with {@link prepareRuleGroup} unless it already has an `id`, which is\n * taken to mean it has been prepared before—most often because the caller is passing back the\n * object it received from `onQueryChange`.\n *\n * @group Query Tools\n */\nexport const resolveCandidateQuery = <RG extends RuleGroupTypeAny>(\n sources: {\n query?: RG;\n storeQuery?: RG;\n defaultQuery?: RG;\n fallbackQuery: RG;\n },\n options?: { idGenerator?: () => string }\n): RG => {\n const candidateQuery =\n sources.query ?? sources.storeQuery ?? sources.defaultQuery ?? sources.fallbackQuery;\n\n return candidateQuery.id ? candidateQuery : prepareRuleGroup(candidateQuery, options);\n};\n"],"mappings":";;;AAGA,MAAM,sBAAsB,OAAkB,UAAkB,mBAA8B;CAC5F,MAAM,YAAY,aAAa,KAAK;CACpC,MAAM,qBAAqB,aAAa,cAAc;CACtD,IAAI,UAAU,UAAU,mBAAmB,OACzC,OAAO;CAET,IAAI,OAAO,UAAU,eAAe,UAClC,OAAO,UAAU,UAAU,gBAAgB,mBAAmB,UAAU;CAE1E,OACE,UAAU,aAAa,oBAAoB,QAAQ;oCAChB;AAEvC;;;;;;;;;;;;AAaA,MAAa,4BAEX,OAEA,QACA,aAMS;CACT,IAAI,CAAC,MAAM,YAAY;EACrB,MAAM,sBAAsB,OACzB,EAAE,4CAA4C,EAAE,WAChD,MAAM;qCAC8B,MAAM;EAC7C,IAAI,2BAA2B,MAAM,GACnC,OAAO,OAAO,KAAI,QAAO;GACvB,GAAG;GACH,SAAS,GAAG,QAAQ,QAAO,MAAK,mBAAmB,CAAC,CAAC;EACvD,EAAE;EAEJ,OAAO,OAAO,QAAO,MAAK,mBAAmB,CAAC,CAAC;CACjD;CAEA,IAAI,2BAA2B,MAAM,GACnC,OAAO,OACJ,KAAI,QAAO;EACV,GAAG;EACH,SAAS,GAAG,QAAQ,QAAO,MAAK,mBAAmB,OAAO,UAAU,CAAC,CAAC;CACxE,EAAE,CAAC,CACF,QAAO,OAAM,GAAG,QAAQ,SAAS,CAAC;CAGvC,OAAO,OAAO,QAAO,MAAK,mBAAmB,OAAO,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IAAI,EAAE,YAAY,CAAC,IAAI,YAAY,IAAI,EAAE,YAAY,CAAC;;;;;;;;;;;;AAa3F,MAAa,yBACX,SAMA,YACO;CACP,MAAM,iBACJ,QAAQ,SAAS,QAAQ,cAAc,QAAQ,gBAAgB,QAAQ;CAEzE,OAAO,eAAe,KAAK,iBAAiB,iBAAiB,gBAAgB,OAAO;AACtF"}
|
|
@@ -38,7 +38,6 @@ const filterFieldsByComparator = (field, fields, operator) => {
|
|
|
38
38
|
};
|
|
39
39
|
//#endregion
|
|
40
40
|
//#region src/utils/generateID.ts
|
|
41
|
-
/* v8 ignore file -- this is fine */
|
|
42
41
|
const cryptoModule = globalThis.crypto;
|
|
43
42
|
const uuidV4regex = /^[\da-f]{8}-[\da-f]{4}-4[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i;
|
|
44
43
|
/**
|
|
@@ -50,11 +49,8 @@ const uuidV4regex = /^[\da-f]{8}-[\da-f]{4}-4[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]
|
|
|
50
49
|
* ```
|
|
51
50
|
* @returns Valid v4 UUID
|
|
52
51
|
*/
|
|
53
|
-
// v8 ignore next
|
|
54
52
|
let generateID = () => "00-0-4-2-000".replaceAll(/[^-]/g, (s) => ((Math.random() + Math.trunc(s)) * 65536 >> Number.parseInt(s)).toString(16).padStart(4, "0"));
|
|
55
|
-
// v8 ignore else
|
|
56
53
|
if (cryptoModule) {
|
|
57
|
-
// v8 ignore else
|
|
58
54
|
if (typeof cryptoModule.randomUUID === "function") generateID = () => cryptoModule.randomUUID();
|
|
59
55
|
else if (typeof cryptoModule.getRandomValues === "function") {
|
|
60
56
|
const position19vals = "89ab";
|
|
@@ -212,4 +208,4 @@ Object.defineProperty(exports, "uuidV4regex", {
|
|
|
212
208
|
}
|
|
213
209
|
});
|
|
214
210
|
|
|
215
|
-
//# sourceMappingURL=prepareQueryObjects-
|
|
211
|
+
//# sourceMappingURL=prepareQueryObjects-Bh8SmGZH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prepareQueryObjects-Bh8SmGZH.js","names":["toFullOption","isFlexibleOptionGroupArray","toFullOption","isFlexibleOptionArray","toFullOptionList","lc","processMatchMode","isRuleGroup"],"sources":["../src/utils/filterFieldsByComparator.ts","../src/utils/generateID.ts","../src/utils/getValueSourcesUtil.ts","../src/utils/prepareQueryObjects.ts"],"sourcesContent":["import type { FullField, OptionList, WithUnknownIndex } from '../types';\nimport { isFlexibleOptionGroupArray, toFullOption } from './optGroupUtils';\n\nconst filterByComparator = (field: FullField, operator: string, fieldToCompare: FullField) => {\n const fullField = toFullOption(field);\n const fullFieldToCompare = toFullOption(fieldToCompare);\n if (fullField.value === fullFieldToCompare.value) {\n return false;\n }\n if (typeof fullField.comparator === 'string') {\n return fullField[fullField.comparator] === fullFieldToCompare[fullField.comparator];\n }\n return (\n fullField.comparator?.(fullFieldToCompare, operator) ??\n /* v8 ignore start -- @preserve */ false /* v8 ignore stop -- @preserve */\n );\n};\n\n/**\n * For a given {@link FullField}, returns the `fields` list filtered for\n * other fields that match by `comparator`. Only fields *other than the\n * one in question* will ever be included, even if `comparator` is `null`\n * or `undefined`. If `comparator` is a string, fields with the same value\n * for that property will be included. If `comparator` is a function, each\n * field will be passed to the function along with the `operator` and fields\n * for which the function returns `true` will be included.\n *\n * @group Option Lists\n */\nexport const filterFieldsByComparator = (\n /** The field in question. */\n field: FullField,\n /** The full {@link FullField} list to be filtered. */\n fields: OptionList<FullField>,\n operator: string\n):\n | FullField[]\n | {\n options: WithUnknownIndex<FullField>[];\n label: string;\n }[] => {\n if (!field.comparator) {\n const filterOutSameField = (f: FullField) =>\n (f.value ?? /* v8 ignore start -- @preserve */ f.name) /* v8 ignore stop -- @preserve */ !==\n (field.value ??\n /* v8 ignore start -- @preserve */ field.name); /* v8 ignore stop -- @preserve */\n if (isFlexibleOptionGroupArray(fields)) {\n return fields.map(og => ({\n ...og,\n options: og.options.filter(v => filterOutSameField(v)),\n }));\n }\n return fields.filter(v => filterOutSameField(v));\n }\n\n if (isFlexibleOptionGroupArray(fields)) {\n return fields\n .map(og => ({\n ...og,\n options: og.options.filter(f => filterByComparator(field, operator, f)),\n }))\n .filter(og => og.options.length > 0);\n }\n\n return fields.filter(f => filterByComparator(field, operator, f));\n};\n","type UUID = `${string}-${string}-${string}-${string}-${string}`;\n\nconst cryptoModule = globalThis.crypto;\n\nexport const uuidV4regex: RegExp =\n /^[\\da-f]{8}-[\\da-f]{4}-4[\\da-f]{3}-[89ab][\\da-f]{3}-[\\da-f]{12}$/i;\n\n/**\n * Default `id` generator. Generates a valid v4 UUID. Uses `crypto.randomUUID()`\n * when available, otherwise uses an alternate method based on `getRandomValues`.\n * The returned string is guaranteed to match this regex:\n * ```\n * /^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i\n * ```\n * @returns Valid v4 UUID\n */\n// Default implementation adapted from https://stackoverflow.com/a/68141099/217579\nexport let generateID = (): UUID =>\n '00-0-4-2-000'.replaceAll(/[^-]/g, s =>\n (((Math.random() + Math.trunc(s as unknown as number)) * 0x1_00_00) >> Number.parseInt(s))\n .toString(16)\n .padStart(4, '0')\n ) as UUID;\n\n// Improve on the default implementation by using the crypto package if it's available\nif (cryptoModule) {\n if (typeof cryptoModule.randomUUID === 'function') {\n generateID = () => cryptoModule.randomUUID();\n } else if (typeof cryptoModule.getRandomValues === 'function') {\n // `randomUUID` is much simpler and faster, but it's only guaranteed to be\n // available in secure contexts (server-side, https, etc.). `generateID`\n // doesn't really need to be cryptographically secure, it only needs a\n // fairly low chance of collisions. We fall back to the always-available\n // `getRandomValues` here (while still generating a valid v4 UUID) when\n // `randomUUID` is not available.\n const position19vals = '89ab';\n const container = new Uint32Array(32);\n\n generateID = () => {\n cryptoModule.getRandomValues(container);\n let id = (container[0] % 16).toString(16);\n for (let i = 1; i < 32; i++) {\n if (i === 12) {\n id = `${id}${'4'}`;\n } else if (i === 16) {\n id = `${id}${position19vals[container[17] % 4]}`;\n } else {\n id = `${id}${(container[i] % 16).toString(16)}`;\n }\n\n if (i === 7 || i === 11 || i === 15 || i === 19) {\n id = `${id}${'-'}`;\n }\n }\n return id as UUID;\n };\n }\n}\n","import type {\n FullField,\n GetOptionIdentifierType,\n ValueSourceFlexibleOptions,\n ValueSourceFullOptions,\n ValueSources,\n} from '../types';\nimport { lc } from './misc';\nimport { isFlexibleOptionArray, toFullOption, toFullOptionList } from './optGroupUtils';\n\nconst defaultValueSourcesArray: ValueSourceFullOptions = [\n { name: 'value', value: 'value', label: 'value' },\n];\n\nconst dummyFD = {\n name: 'name',\n value: 'name',\n valueSources: null,\n label: 'label',\n};\n\n/**\n * Utility function to get the value sources array for the given\n * field and operator. If the field definition does not define a\n * `valueSources` property, the `getValueSources` prop is used.\n * Returns `[FullOption<\"value\">]` by default.\n */\n// oxlint-disable-next-line typescript/no-unnecessary-type-parameters\nexport const getValueSourcesUtil = <F extends FullField, O extends string>(\n fieldData: F,\n operator: string,\n getValueSources?: (\n field: GetOptionIdentifierType<F>,\n operator: O,\n misc: { fieldData: F }\n ) => ValueSources | ValueSourceFlexibleOptions\n): ValueSourceFullOptions => {\n // TypeScript doesn't allow it directly, but in practice\n // `fieldData` can end up being undefined or null. The nullish\n // coalescing assignment below avoids errors like\n // \"TypeError: Cannot read properties of undefined (reading 'name')\"\n const fd = fieldData ? toFullOption(fieldData) : dummyFD;\n\n let valueSourcesNEW:\n | false\n | ValueSources\n | ValueSourceFlexibleOptions\n | ((operator: string) => ValueSources | ValueSourceFlexibleOptions) = fd.valueSources ?? false;\n\n if (typeof valueSourcesNEW === 'function') {\n valueSourcesNEW = valueSourcesNEW(operator);\n }\n\n if (!valueSourcesNEW && getValueSources) {\n valueSourcesNEW = getValueSources(fd.value as GetOptionIdentifierType<F>, operator as O, {\n fieldData: fd as F,\n });\n }\n\n if (!valueSourcesNEW) {\n return defaultValueSourcesArray;\n }\n\n if (isFlexibleOptionArray(valueSourcesNEW)) {\n return toFullOptionList(valueSourcesNEW as ValueSourceFullOptions) as ValueSourceFullOptions;\n }\n\n return valueSourcesNEW.map(\n vs =>\n defaultValueSourcesArray.find(dmm => dmm.value === lc(vs)) ?? {\n name: vs,\n value: vs,\n label: vs,\n }\n ) as ValueSourceFullOptions;\n};\n","import type {\n RuleGroupArray,\n RuleGroupICArray,\n RuleGroupType,\n RuleGroupTypeAny,\n RuleGroupTypeIC,\n RuleType,\n} from '../types';\nimport { processMatchMode } from './formatQuery/utils';\nimport { generateID } from './generateID';\nimport { isRuleGroup } from './isRuleGroup';\n\n/**\n * Options for {@link prepareRule}/{@link prepareRuleGroup}.\n */\nexport interface PreparerOptions {\n idGenerator?: () => string;\n}\n\n/**\n * Ensures that a rule is valid by adding an `id` property if it does not already exist.\n */\nexport const prepareRule = (\n rule: RuleType,\n { idGenerator = generateID }: PreparerOptions = {}\n): RuleType => {\n const needsId = !rule.id;\n const hasMatchMode = processMatchMode(rule);\n\n if (!needsId && !hasMatchMode) {\n return rule;\n }\n\n return {\n ...rule,\n ...(needsId && { id: idGenerator() }),\n ...(hasMatchMode && { value: prepareRuleGroup(rule.value, { idGenerator }) }),\n };\n};\n\n/**\n * Ensures that a rule group is valid by recursively adding an `id` property to the group itself\n * and all its rules and subgroups where one does not already exist.\n */\nexport const prepareRuleGroup = <RG extends RuleGroupTypeAny>(\n queryObject: RG,\n { idGenerator = generateID }: PreparerOptions = {}\n): RG => {\n const needsId = !queryObject.id;\n let rulesChanged = false;\n const newRules: (RuleGroupTypeAny | RuleType | string)[] = [];\n\n for (let i = 0; i < queryObject.rules.length; i++) {\n const r = queryObject.rules[i];\n if (typeof r === 'string') {\n newRules.push(r);\n } else {\n const prepared = isRuleGroup(r)\n ? prepareRuleGroup(r, { idGenerator })\n : prepareRule(r, { idGenerator });\n newRules.push(prepared);\n if (prepared !== r) {\n rulesChanged = true;\n }\n }\n }\n\n if (!needsId && !rulesChanged) {\n return queryObject;\n }\n\n return {\n ...queryObject,\n ...(needsId && { id: idGenerator() }),\n rules: newRules as RuleGroupArray | RuleGroupICArray,\n };\n};\n\n/**\n * Ensures that a rule or group is valid. See {@link prepareRule} and {@link prepareRuleGroup}.\n */\nexport const prepareRuleOrGroup = (\n rg: RuleGroupTypeAny | RuleType,\n { idGenerator = generateID }: PreparerOptions = {}\n): RuleGroupType | RuleGroupTypeIC | RuleType =>\n isRuleGroup(rg) ? prepareRuleGroup(rg, { idGenerator }) : prepareRule(rg, { idGenerator });\n\n/**\n * Resolves the query a query builder should render from the available sources, in precedence\n * order: the controlled `query`, then whatever is already in the store, then the uncontrolled\n * `defaultQuery`, then a freshly created empty group.\n *\n * The result is prepared with {@link prepareRuleGroup} unless it already has an `id`, which is\n * taken to mean it has been prepared before—most often because the caller is passing back the\n * object it received from `onQueryChange`.\n *\n * @group Query Tools\n */\nexport const resolveCandidateQuery = <RG extends RuleGroupTypeAny>(\n sources: {\n query?: RG;\n storeQuery?: RG;\n defaultQuery?: RG;\n fallbackQuery: RG;\n },\n options?: { idGenerator?: () => string }\n): RG => {\n const candidateQuery =\n sources.query ?? sources.storeQuery ?? sources.defaultQuery ?? sources.fallbackQuery;\n\n return candidateQuery.id ? candidateQuery : prepareRuleGroup(candidateQuery, options);\n};\n"],"mappings":";;;AAGA,MAAM,sBAAsB,OAAkB,UAAkB,mBAA8B;CAC5F,MAAM,YAAYA,cAAAA,aAAa,KAAK;CACpC,MAAM,qBAAqBA,cAAAA,aAAa,cAAc;CACtD,IAAI,UAAU,UAAU,mBAAmB,OACzC,OAAO;CAET,IAAI,OAAO,UAAU,eAAe,UAClC,OAAO,UAAU,UAAU,gBAAgB,mBAAmB,UAAU;CAE1E,OACE,UAAU,aAAa,oBAAoB,QAAQ;oCAChB;AAEvC;;;;;;;;;;;;AAaA,MAAa,4BAEX,OAEA,QACA,aAMS;CACT,IAAI,CAAC,MAAM,YAAY;EACrB,MAAM,sBAAsB,OACzB,EAAE,4CAA4C,EAAE,WAChD,MAAM;qCA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IAAI,GAAG,IAAI,YAAY,MAAM,QAAQ,KAAK;EACjD,MAAM,IAAI,YAAY,MAAM;EAC5B,IAAI,OAAO,MAAM,UACf,SAAS,KAAK,CAAC;OACV;GACL,MAAM,WAAWC,oBAAAA,YAAY,CAAC,IAC1B,iBAAiB,GAAG,EAAE,YAAY,CAAC,IACnC,YAAY,GAAG,EAAE,YAAY,CAAC;GAClC,SAAS,KAAK,QAAQ;GACtB,IAAI,aAAa,GACf,eAAe;EAEnB;CACF;CAEA,IAAI,CAAC,WAAW,CAAC,cACf,OAAO;CAGT,OAAO;EACL,GAAG;EACH,GAAI,WAAW,EAAE,IAAI,YAAY,EAAE;EACnC,OAAO;CACT;AACF;;;;AAKA,MAAa,sBACX,IACA,EAAE,cAAc,eAAgC,CAAC,MAEjDA,oBAAAA,YAAY,EAAE,IAAI,iBAAiB,IAAI,EAAE,YAAY,CAAC,IAAI,YAAY,IAAI,EAAE,YAAY,CAAC;;;;;;;;;;;;AAa3F,MAAa,yBACX,SAMA,YACO;CACP,MAAM,iBACJ,QAAQ,SAAS,QAAQ,cAAc,QAAQ,gBAAgB,QAAQ;CAEzE,OAAO,eAAe,KAAK,iBAAiB,iBAAiB,gBAAgB,OAAO;AACtF"}
|
|
@@ -1540,7 +1540,7 @@ const signatureOf = (prev, next) => signatureOfNode(prev, next, "", -1);
|
|
|
1540
1540
|
*/
|
|
1541
1541
|
const shouldCoalesce = (prevSig, nextSig, prevAt, now, coalesceMs = 500) => nextSig !== "~structural" && nextSig === prevSig && now >= prevAt && now - prevAt < coalesceMs;
|
|
1542
1542
|
//#endregion
|
|
1543
|
-
//#region \0@oxc-project+runtime@0.
|
|
1543
|
+
//#region \0@oxc-project+runtime@0.151.0/helpers/esm/typeof.js
|
|
1544
1544
|
function _typeof(o) {
|
|
1545
1545
|
"@babel/helpers - typeof";
|
|
1546
1546
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -1550,7 +1550,7 @@ function _typeof(o) {
|
|
|
1550
1550
|
}, _typeof(o);
|
|
1551
1551
|
}
|
|
1552
1552
|
//#endregion
|
|
1553
|
-
//#region \0@oxc-project+runtime@0.
|
|
1553
|
+
//#region \0@oxc-project+runtime@0.151.0/helpers/esm/toPrimitive.js
|
|
1554
1554
|
function toPrimitive(t, r) {
|
|
1555
1555
|
if ("object" != _typeof(t) || !t) return t;
|
|
1556
1556
|
var e = t[Symbol.toPrimitive];
|
|
@@ -1562,13 +1562,13 @@ function toPrimitive(t, r) {
|
|
|
1562
1562
|
return ("string" === r ? String : Number)(t);
|
|
1563
1563
|
}
|
|
1564
1564
|
//#endregion
|
|
1565
|
-
//#region \0@oxc-project+runtime@0.
|
|
1565
|
+
//#region \0@oxc-project+runtime@0.151.0/helpers/esm/toPropertyKey.js
|
|
1566
1566
|
function toPropertyKey(t) {
|
|
1567
1567
|
var i = toPrimitive(t, "string");
|
|
1568
1568
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
1569
1569
|
}
|
|
1570
1570
|
//#endregion
|
|
1571
|
-
//#region \0@oxc-project+runtime@0.
|
|
1571
|
+
//#region \0@oxc-project+runtime@0.151.0/helpers/esm/defineProperty.js
|
|
1572
1572
|
function _defineProperty(e, r, t) {
|
|
1573
1573
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
1574
1574
|
value: t,
|
|
@@ -1578,7 +1578,7 @@ function _defineProperty(e, r, t) {
|
|
|
1578
1578
|
}) : e[r] = t, e;
|
|
1579
1579
|
}
|
|
1580
1580
|
//#endregion
|
|
1581
|
-
//#region \0@oxc-project+runtime@0.
|
|
1581
|
+
//#region \0@oxc-project+runtime@0.151.0/helpers/esm/objectSpread2.js
|
|
1582
1582
|
function ownKeys(e, r) {
|
|
1583
1583
|
var t = Object.keys(e);
|
|
1584
1584
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -1601,7 +1601,7 @@ function _objectSpread2(e) {
|
|
|
1601
1601
|
return e;
|
|
1602
1602
|
}
|
|
1603
1603
|
//#endregion
|
|
1604
|
-
//#region \0@oxc-project+runtime@0.
|
|
1604
|
+
//#region \0@oxc-project+runtime@0.151.0/helpers/esm/objectWithoutPropertiesLoose.js
|
|
1605
1605
|
function _objectWithoutPropertiesLoose(r, e) {
|
|
1606
1606
|
if (null == r) return {};
|
|
1607
1607
|
var t = {};
|
|
@@ -1612,7 +1612,7 @@ function _objectWithoutPropertiesLoose(r, e) {
|
|
|
1612
1612
|
return t;
|
|
1613
1613
|
}
|
|
1614
1614
|
//#endregion
|
|
1615
|
-
//#region \0@oxc-project+runtime@0.
|
|
1615
|
+
//#region \0@oxc-project+runtime@0.151.0/helpers/esm/objectWithoutProperties.js
|
|
1616
1616
|
function _objectWithoutProperties(e, t) {
|
|
1617
1617
|
if (null == e) return {};
|
|
1618
1618
|
var o, r, i = _objectWithoutPropertiesLoose(e, t);
|
|
@@ -6172,7 +6172,6 @@ const derivePathInfo = (path, childCount, { disabled = false, disabledPaths = []
|
|
|
6172
6172
|
const generateAccessibleDescription = (params) => pathsAreEqual([], params.path) ? `Query builder` : `Rule group at path ${params.path.join("-")}`;
|
|
6173
6173
|
//#endregion
|
|
6174
6174
|
//#region src/utils/generateID.ts
|
|
6175
|
-
/* v8 ignore file -- this is fine */
|
|
6176
6175
|
const cryptoModule = globalThis.crypto;
|
|
6177
6176
|
const uuidV4regex = /^[\da-f]{8}-[\da-f]{4}-4[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i;
|
|
6178
6177
|
/**
|
|
@@ -6184,11 +6183,8 @@ const uuidV4regex = /^[\da-f]{8}-[\da-f]{4}-4[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]
|
|
|
6184
6183
|
* ```
|
|
6185
6184
|
* @returns Valid v4 UUID
|
|
6186
6185
|
*/
|
|
6187
|
-
// v8 ignore next
|
|
6188
6186
|
let generateID = () => "00-0-4-2-000".replaceAll(/[^-]/g, (s) => ((Math.random() + Math.trunc(s)) * 65536 >> Number.parseInt(s)).toString(16).padStart(4, "0"));
|
|
6189
|
-
// v8 ignore else
|
|
6190
6187
|
if (cryptoModule) {
|
|
6191
|
-
// v8 ignore else
|
|
6192
6188
|
if (typeof cryptoModule.randomUUID === "function") generateID = () => cryptoModule.randomUUID();
|
|
6193
6189
|
else if (typeof cryptoModule.getRandomValues === "function") {
|
|
6194
6190
|
const position19vals = "89ab";
|