@react-querybuilder/datetime 8.15.0 → 8.16.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/date-fns/package.json +1 -1
- package/dayjs/package.json +1 -1
- package/dist/cjs/{getDatetimeRuleProcessorSQL-CkflXcTZ.js → getDatetimeRuleProcessorSQL-DVtRZyr6.js} +125 -3
- package/dist/cjs/getDatetimeRuleProcessorSQL-DVtRZyr6.js.map +1 -0
- package/dist/cjs/getDatetimeRuleProcessorSQL-pAGh4Q0-.js +2 -0
- package/dist/cjs/getDatetimeRuleProcessorSQL-pAGh4Q0-.js.map +1 -0
- package/dist/cjs/react-querybuilder_datetime.cjs.development.d.ts +27 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.development.date-fns.d.ts +9 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.development.date-fns.js +11 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.development.date-fns.js.map +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.development.dayjs.d.ts +9 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.development.dayjs.js +11 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.development.dayjs.js.map +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.development.js +3 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.development.jsdate.d.ts +9 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.development.jsdate.js +11 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.development.jsdate.js.map +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.development.luxon.d.ts +9 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.development.luxon.js +11 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.development.luxon.js.map +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.d.ts +27 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.date-fns.d.ts +9 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.date-fns.js +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.date-fns.js.map +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.dayjs.d.ts +9 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.dayjs.js +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.dayjs.js.map +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.js +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.jsdate.d.ts +9 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.jsdate.js +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.jsdate.js.map +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.luxon.d.ts +9 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.luxon.js +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.luxon.js.map +1 -1
- package/dist/{getDatetimeRuleProcessorSQL-CYJzcuIW.mjs → getDatetimeRuleProcessorSQL-BGTFvbeK.mjs} +115 -5
- package/dist/getDatetimeRuleProcessorSQL-BGTFvbeK.mjs.map +1 -0
- package/dist/{getDatetimeRuleProcessorSQL-CnTp42xr.js → getDatetimeRuleProcessorSQL-Bpt88k6a.js} +120 -10
- package/dist/getDatetimeRuleProcessorSQL-Bpt88k6a.js.map +1 -0
- package/dist/getDatetimeRuleProcessorSQL-CWqAiVwU.mjs +2 -0
- package/dist/getDatetimeRuleProcessorSQL-CWqAiVwU.mjs.map +1 -0
- package/dist/react-querybuilder_datetime.d.mts +27 -1
- package/dist/react-querybuilder_datetime.date-fns.d.mts +9 -1
- package/dist/react-querybuilder_datetime.date-fns.mjs +10 -2
- package/dist/react-querybuilder_datetime.date-fns.mjs.map +1 -1
- package/dist/react-querybuilder_datetime.dayjs.d.mts +9 -1
- package/dist/react-querybuilder_datetime.dayjs.mjs +10 -2
- package/dist/react-querybuilder_datetime.dayjs.mjs.map +1 -1
- package/dist/react-querybuilder_datetime.jsdate.d.mts +9 -1
- package/dist/react-querybuilder_datetime.jsdate.mjs +10 -2
- package/dist/react-querybuilder_datetime.jsdate.mjs.map +1 -1
- package/dist/react-querybuilder_datetime.legacy-esm.d.ts +27 -1
- package/dist/react-querybuilder_datetime.legacy-esm.date-fns.d.ts +9 -1
- package/dist/react-querybuilder_datetime.legacy-esm.date-fns.js +10 -2
- package/dist/react-querybuilder_datetime.legacy-esm.date-fns.js.map +1 -1
- package/dist/react-querybuilder_datetime.legacy-esm.dayjs.d.ts +9 -1
- package/dist/react-querybuilder_datetime.legacy-esm.dayjs.js +10 -2
- package/dist/react-querybuilder_datetime.legacy-esm.dayjs.js.map +1 -1
- package/dist/react-querybuilder_datetime.legacy-esm.js +2 -2
- package/dist/react-querybuilder_datetime.legacy-esm.jsdate.d.ts +9 -1
- package/dist/react-querybuilder_datetime.legacy-esm.jsdate.js +10 -2
- package/dist/react-querybuilder_datetime.legacy-esm.jsdate.js.map +1 -1
- package/dist/react-querybuilder_datetime.legacy-esm.luxon.d.ts +9 -1
- package/dist/react-querybuilder_datetime.legacy-esm.luxon.js +10 -2
- package/dist/react-querybuilder_datetime.legacy-esm.luxon.js.map +1 -1
- package/dist/react-querybuilder_datetime.luxon.d.mts +9 -1
- package/dist/react-querybuilder_datetime.luxon.mjs +10 -2
- package/dist/react-querybuilder_datetime.luxon.mjs.map +1 -1
- package/dist/react-querybuilder_datetime.mjs +2 -2
- package/dist/react-querybuilder_datetime.production.d.mts +27 -1
- package/dist/react-querybuilder_datetime.production.date-fns.d.mts +9 -1
- package/dist/react-querybuilder_datetime.production.date-fns.mjs +1 -1
- package/dist/react-querybuilder_datetime.production.date-fns.mjs.map +1 -1
- package/dist/react-querybuilder_datetime.production.dayjs.d.mts +9 -1
- package/dist/react-querybuilder_datetime.production.dayjs.mjs +1 -1
- package/dist/react-querybuilder_datetime.production.dayjs.mjs.map +1 -1
- package/dist/react-querybuilder_datetime.production.jsdate.d.mts +9 -1
- package/dist/react-querybuilder_datetime.production.jsdate.mjs +1 -1
- package/dist/react-querybuilder_datetime.production.jsdate.mjs.map +1 -1
- package/dist/react-querybuilder_datetime.production.luxon.d.mts +9 -1
- package/dist/react-querybuilder_datetime.production.luxon.mjs +1 -1
- package/dist/react-querybuilder_datetime.production.luxon.mjs.map +1 -1
- package/dist/react-querybuilder_datetime.production.mjs +1 -1
- package/dist/react-querybuilder_datetime.production.mjs.map +1 -1
- package/jsdate/package.json +1 -1
- package/luxon/package.json +1 -1
- package/package.json +8 -8
- package/dist/cjs/getDatetimeRuleProcessorSQL-CkflXcTZ.js.map +0 -1
- package/dist/cjs/getDatetimeRuleProcessorSQL-Cs8MroHp.js +0 -2
- package/dist/cjs/getDatetimeRuleProcessorSQL-Cs8MroHp.js.map +0 -1
- package/dist/getDatetimeRuleProcessorSQL-CYJzcuIW.mjs.map +0 -1
- package/dist/getDatetimeRuleProcessorSQL-Cbq2-tqd.mjs +0 -2
- package/dist/getDatetimeRuleProcessorSQL-Cbq2-tqd.mjs.map +0 -1
- package/dist/getDatetimeRuleProcessorSQL-CnTp42xr.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as getDatetimeValueProcessorOracle, c as
|
|
1
|
+
import { a as getDatetimeValueProcessorOracle, c as datetimeValueProcessorNL, d as getDatetimeRuleProcessorMongoDBQuery, f as getDatetimeRuleProcessorCypher, g as processIsDateField, i as getDatetimeValueProcessorMySQL, l as defaultDateTimeNLOperatorMap, m as getDatetimeJsonLogicOperations, n as getDatetimeValueProcessorANSI, o as getDatetimeValueProcessorPostgreSQL, p as getDatetimeRuleProcessorCEL, r as getDatetimeValueProcessorMSSQL, s as getDatetimeRuleProcessorSPARQL, t as getDatetimeRuleProcessorSQL, u as getDatetimeRuleProcessorNL } from "./getDatetimeRuleProcessorSQL-Bpt88k6a.js";
|
|
2
2
|
import { defaultRuleProcessorJSONata, defaultRuleProcessorJsonLogic, getQuotedFieldName, nullOrUndefinedOrEmpty, toArray } from "react-querybuilder";
|
|
3
3
|
//#region src/datetimeRuleProcessorJsonLogic.ts
|
|
4
4
|
const dateOperationMap = {
|
|
@@ -111,6 +111,6 @@ const getDatetimeRuleProcessorJSONata = (apiFns) => (rule, options) => {
|
|
|
111
111
|
return defaultRuleProcessorJSONata(rule, opts);
|
|
112
112
|
};
|
|
113
113
|
//#endregion
|
|
114
|
-
export { datetimeRuleProcessorJsonLogic, datetimeValueProcessorNL, defaultDateTimeNLOperatorMap, getDatetimeJsonLogicOperations, getDatetimeRuleProcessorCEL, getDatetimeRuleProcessorJSONata, getDatetimeRuleProcessorMongoDBQuery, getDatetimeRuleProcessorNL, getDatetimeRuleProcessorSQL, getDatetimeValueProcessorANSI, getDatetimeValueProcessorMSSQL, getDatetimeValueProcessorMySQL, getDatetimeValueProcessorOracle, getDatetimeValueProcessorPostgreSQL };
|
|
114
|
+
export { datetimeRuleProcessorJsonLogic, datetimeValueProcessorNL, defaultDateTimeNLOperatorMap, getDatetimeJsonLogicOperations, getDatetimeRuleProcessorCEL, getDatetimeRuleProcessorCypher, getDatetimeRuleProcessorJSONata, getDatetimeRuleProcessorMongoDBQuery, getDatetimeRuleProcessorNL, getDatetimeRuleProcessorSPARQL, getDatetimeRuleProcessorSQL, getDatetimeValueProcessorANSI, getDatetimeValueProcessorMSSQL, getDatetimeValueProcessorMySQL, getDatetimeValueProcessorOracle, getDatetimeValueProcessorPostgreSQL };
|
|
115
115
|
|
|
116
116
|
//# sourceMappingURL=react-querybuilder_datetime.legacy-esm.js.map
|
|
@@ -51,6 +51,14 @@ declare const datetimeRuleProcessorMongoDBQuery: RuleProcessor;
|
|
|
51
51
|
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "natural_language" format using JavaScript `Date`
|
|
52
52
|
*/
|
|
53
53
|
declare const datetimeRuleProcessorNL: ValueProcessorByRule;
|
|
54
|
+
/**
|
|
55
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "cypher"/"gql" format using JavaScript `Date`
|
|
56
|
+
*/
|
|
57
|
+
declare const datetimeRuleProcessorCypher: RuleProcessor;
|
|
58
|
+
/**
|
|
59
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "sparql" format using JavaScript `Date`
|
|
60
|
+
*/
|
|
61
|
+
declare const datetimeRuleProcessorSPARQL: RuleProcessor;
|
|
54
62
|
//#endregion
|
|
55
|
-
export { datetimeRuleProcessorCEL, datetimeRuleProcessorMongoDBQuery, datetimeRuleProcessorNL, datetimeRuleProcessorSQL, datetimeValueProcessorANSI, datetimeValueProcessorMSSQL, datetimeValueProcessorMySQL, datetimeValueProcessorOracle, datetimeValueProcessorPostgreSQL, jsonLogicDateTimeOperations, rqbDateTimeLibraryAPI };
|
|
63
|
+
export { datetimeRuleProcessorCEL, datetimeRuleProcessorCypher, datetimeRuleProcessorMongoDBQuery, datetimeRuleProcessorNL, datetimeRuleProcessorSPARQL, datetimeRuleProcessorSQL, datetimeValueProcessorANSI, datetimeValueProcessorMSSQL, datetimeValueProcessorMySQL, datetimeValueProcessorOracle, datetimeValueProcessorPostgreSQL, jsonLogicDateTimeOperations, rqbDateTimeLibraryAPI };
|
|
56
64
|
//# sourceMappingURL=react-querybuilder_datetime.legacy-esm.jsdate.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as getDatetimeValueProcessorOracle, d as
|
|
1
|
+
import { a as getDatetimeValueProcessorOracle, d as getDatetimeRuleProcessorMongoDBQuery, f as getDatetimeRuleProcessorCypher, h as isISOStringDateOnly, i as getDatetimeValueProcessorMySQL, m as getDatetimeJsonLogicOperations, n as getDatetimeValueProcessorANSI, o as getDatetimeValueProcessorPostgreSQL, p as getDatetimeRuleProcessorCEL, r as getDatetimeValueProcessorMSSQL, s as getDatetimeRuleProcessorSPARQL, t as getDatetimeRuleProcessorSQL, u as getDatetimeRuleProcessorNL } from "./getDatetimeRuleProcessorSQL-Bpt88k6a.js";
|
|
2
2
|
//#region src/rqbDateTimeLibraryAPI.jsdate.ts
|
|
3
3
|
const invalidDate = /* @__PURE__ */ new Date(NaN);
|
|
4
4
|
const dateRegExp = /^(\d{4})-(\d{2})-(\d{2})([T ](\d{2}):(\d{2}):(\d{2})(\.(\d{1,3}))?)?/;
|
|
@@ -100,7 +100,15 @@ const datetimeRuleProcessorMongoDBQuery = getDatetimeRuleProcessorMongoDBQuery(r
|
|
|
100
100
|
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "natural_language" format using JavaScript `Date`
|
|
101
101
|
*/
|
|
102
102
|
const datetimeRuleProcessorNL = getDatetimeRuleProcessorNL(rqbDateTimeLibraryAPI);
|
|
103
|
+
/**
|
|
104
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "cypher"/"gql" format using JavaScript `Date`
|
|
105
|
+
*/
|
|
106
|
+
const datetimeRuleProcessorCypher = getDatetimeRuleProcessorCypher(rqbDateTimeLibraryAPI);
|
|
107
|
+
/**
|
|
108
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "sparql" format using JavaScript `Date`
|
|
109
|
+
*/
|
|
110
|
+
const datetimeRuleProcessorSPARQL = getDatetimeRuleProcessorSPARQL(rqbDateTimeLibraryAPI);
|
|
103
111
|
//#endregion
|
|
104
|
-
export { datetimeRuleProcessorCEL, datetimeRuleProcessorMongoDBQuery, datetimeRuleProcessorNL, datetimeRuleProcessorSQL, datetimeValueProcessorANSI, datetimeValueProcessorMSSQL, datetimeValueProcessorMySQL, datetimeValueProcessorOracle, datetimeValueProcessorPostgreSQL, jsonLogicDateTimeOperations, rqbDateTimeLibraryAPI };
|
|
112
|
+
export { datetimeRuleProcessorCEL, datetimeRuleProcessorCypher, datetimeRuleProcessorMongoDBQuery, datetimeRuleProcessorNL, datetimeRuleProcessorSPARQL, datetimeRuleProcessorSQL, datetimeValueProcessorANSI, datetimeValueProcessorMSSQL, datetimeValueProcessorMySQL, datetimeValueProcessorOracle, datetimeValueProcessorPostgreSQL, jsonLogicDateTimeOperations, rqbDateTimeLibraryAPI };
|
|
105
113
|
|
|
106
114
|
//# sourceMappingURL=react-querybuilder_datetime.legacy-esm.jsdate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-querybuilder_datetime.legacy-esm.jsdate.js","names":[],"sources":["../src/rqbDateTimeLibraryAPI.jsdate.ts","../src/index.jsdate.ts"],"sourcesContent":["import type { RQBDateTimeLibraryAPI } from './types';\nimport { isISOStringDateOnly } from './utils';\n\nconst invalidDate = new Date(Number.NaN);\n\nconst dateRegExp = /^(\\d{4})-(\\d{2})-(\\d{2})([T ](\\d{2}):(\\d{2}):(\\d{2})(\\.(\\d{1,3}))?)?/;\n\nconst toDate = (d: string | Date) => {\n if (d instanceof Date) return d;\n\n const reMatch = dateRegExp.exec(d);\n\n if (!reMatch) return invalidDate;\n\n const [_all, yyyy, mm, dd, _time, hh, mi, ss, _decimal, sss] = reMatch;\n const [year, month, day, hours, minutes, seconds, ms] = [yyyy, mm, dd, hh, mi, ss, sss ?? '0']\n .filter(Boolean)\n .map(Number);\n\n const monthIndex = month - 1;\n\n return hh\n ? new Date(Date.UTC(year, monthIndex, day, hours, minutes, seconds, ms))\n : new Date(year, monthIndex, day);\n};\n\nconst isValid = (d: string | Date) => {\n const dToDate = toDate(d);\n return dToDate instanceof Date && !Number.isNaN(dToDate.getTime());\n};\n\nconst toISOStringDateOnly = (d: string | Date) => {\n const dToDate = toDate(d);\n return isValid(dToDate) ? dToDate.toISOString().slice(0, 10) : '';\n};\n\n/**\n * {@link RQBDateTimeLibraryAPI} for JavaScript `Date`\n *\n * @deprecated This API will not be removed, but we recommend using one of the other\n * {@link RQBDateTimeLibraryAPI}s based on a popular library instead.\n */\nexport const rqbDateTimeLibraryAPI: RQBDateTimeLibraryAPI = {\n format: d => toDate(d).toISOString(),\n isAfter: (a, b) => {\n const dateA = toDate(a).getTime();\n const dateB = toDate(b).getTime();\n return !Number.isNaN(dateA) && !Number.isNaN(dateB) && dateA > dateB;\n },\n isBefore: (a, b) => {\n const dateA = toDate(a).getTime();\n const dateB = toDate(b).getTime();\n return !Number.isNaN(dateA) && !Number.isNaN(dateB) && dateA < dateB;\n },\n isSame: (a, b) => {\n const aToDate = toDate(a);\n const bToDate = toDate(b);\n return isISOStringDateOnly(a) || isISOStringDateOnly(b)\n ? toISOStringDateOnly(a) === toISOStringDateOnly(b)\n : aToDate.getTime() === bToDate.getTime();\n },\n isValid,\n toDate,\n toISOString: d => {\n const dToDate = toDate(d);\n return isValid(dToDate) ? dToDate.toISOString() : '';\n },\n toISOStringDateOnly,\n};\n","/**\n * Import from `\"@react-querybuilder/datetime/jsdate\"` for enhanced date/time support using a custom JavaScript `Date`-based library.\n *\n * @module jsdate\n */\n\nimport type { RuleProcessor, ValueProcessorByRule } from 'react-querybuilder';\nimport { getDatetimeJsonLogicOperations } from './getDatetimeJsonLogicOperations';\nimport { getDatetimeRuleProcessorCEL } from './getDatetimeRuleProcessorCEL';\nimport { getDatetimeRuleProcessorMongoDBQuery } from './getDatetimeRuleProcessorMongoDBQuery';\nimport { getDatetimeRuleProcessorNL } from './getDatetimeRuleProcessorNL';\nimport {\n getDatetimeRuleProcessorSQL,\n getDatetimeValueProcessorANSI,\n getDatetimeValueProcessorMSSQL,\n getDatetimeValueProcessorMySQL,\n getDatetimeValueProcessorOracle,\n getDatetimeValueProcessorPostgreSQL,\n} from './getDatetimeRuleProcessorSQL';\nimport { rqbDateTimeLibraryAPI } from './rqbDateTimeLibraryAPI.jsdate';\nimport type { RQBJsonLogicDateTimeOperations } from './types';\n\n/**\n * Custom JsonLogic date/time operations using JavaScript `Date`.\n */\nexport const jsonLogicDateTimeOperations: RQBJsonLogicDateTimeOperations =\n getDatetimeJsonLogicOperations(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"sql\" format using JavaScript `Date`\n */\nexport const datetimeRuleProcessorSQL: RuleProcessor =\n getDatetimeRuleProcessorSQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"ansi\" preset) using JavaScript `Date`\n */\nexport const datetimeValueProcessorANSI: ValueProcessorByRule =\n getDatetimeValueProcessorANSI(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"mssql\" preset) using JavaScript `Date`\n */\nexport const datetimeValueProcessorMSSQL: ValueProcessorByRule =\n getDatetimeValueProcessorMSSQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"mysql\" preset) using JavaScript `Date`\n */\nexport const datetimeValueProcessorMySQL: ValueProcessorByRule =\n getDatetimeValueProcessorMySQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"oracle\" preset) using JavaScript `Date`\n */\nexport const datetimeValueProcessorOracle: ValueProcessorByRule =\n getDatetimeValueProcessorOracle(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"postgresql\" preset) using JavaScript `Date`\n */\nexport const datetimeValueProcessorPostgreSQL: ValueProcessorByRule =\n getDatetimeValueProcessorPostgreSQL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"cel\" format using JavaScript `Date`\n */\nexport const datetimeRuleProcessorCEL: RuleProcessor =\n getDatetimeRuleProcessorCEL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"mongodb_query\" format using JavaScript `Date`\n */\nexport const datetimeRuleProcessorMongoDBQuery: RuleProcessor =\n getDatetimeRuleProcessorMongoDBQuery(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"natural_language\" format using JavaScript `Date`\n */\nexport const datetimeRuleProcessorNL: ValueProcessorByRule =\n getDatetimeRuleProcessorNL(rqbDateTimeLibraryAPI);\n\nexport * from './rqbDateTimeLibraryAPI.jsdate';\n"],"mappings":";;AAGA,MAAM,8BAAc,IAAI,KAAK,IAAW;AAExC,MAAM,aAAa;AAEnB,MAAM,UAAU,MAAqB;AACnC,KAAI,aAAa,KAAM,QAAO;CAE9B,MAAM,UAAU,WAAW,KAAK,EAAE;AAElC,KAAI,CAAC,QAAS,QAAO;CAErB,MAAM,CAAC,MAAM,MAAM,IAAI,IAAI,OAAO,IAAI,IAAI,IAAI,UAAU,OAAO;CAC/D,MAAM,CAAC,MAAM,OAAO,KAAK,OAAO,SAAS,SAAS,MAAM;EAAC;EAAM;EAAI;EAAI;EAAI;EAAI;EAAI,QAAA,QAAA,QAAA,KAAA,IAAA,MAAO;EAAI,CAC3F,OAAO,QAAQ,CACf,IAAI,OAAO;CAEd,MAAM,aAAa,QAAQ;AAE3B,QAAO,KACH,IAAI,KAAK,KAAK,IAAI,MAAM,YAAY,KAAK,OAAO,SAAS,SAAS,GAAG,CAAC,GACtE,IAAI,KAAK,MAAM,YAAY,IAAI;;AAGrC,MAAM,WAAW,MAAqB;CACpC,MAAM,UAAU,OAAO,EAAE;AACzB,QAAO,mBAAmB,QAAQ,CAAC,OAAO,MAAM,QAAQ,SAAS,CAAC;;AAGpE,MAAM,uBAAuB,MAAqB;CAChD,MAAM,UAAU,OAAO,EAAE;AACzB,QAAO,QAAQ,QAAQ,GAAG,QAAQ,aAAa,CAAC,MAAM,GAAG,GAAG,GAAG;;;;;;;;AASjE,MAAa,wBAA+C;CAC1D,SAAQ,MAAK,OAAO,EAAE,CAAC,aAAa;CACpC,UAAU,GAAG,MAAM;EACjB,MAAM,QAAQ,OAAO,EAAE,CAAC,SAAS;EACjC,MAAM,QAAQ,OAAO,EAAE,CAAC,SAAS;AACjC,SAAO,CAAC,OAAO,MAAM,MAAM,IAAI,CAAC,OAAO,MAAM,MAAM,IAAI,QAAQ;;CAEjE,WAAW,GAAG,MAAM;EAClB,MAAM,QAAQ,OAAO,EAAE,CAAC,SAAS;EACjC,MAAM,QAAQ,OAAO,EAAE,CAAC,SAAS;AACjC,SAAO,CAAC,OAAO,MAAM,MAAM,IAAI,CAAC,OAAO,MAAM,MAAM,IAAI,QAAQ;;CAEjE,SAAS,GAAG,MAAM;EAChB,MAAM,UAAU,OAAO,EAAE;EACzB,MAAM,UAAU,OAAO,EAAE;AACzB,SAAO,oBAAoB,EAAE,IAAI,oBAAoB,EAAE,GACnD,oBAAoB,EAAE,KAAK,oBAAoB,EAAE,GACjD,QAAQ,SAAS,KAAK,QAAQ,SAAS;;CAE7C;CACA;CACA,cAAa,MAAK;EAChB,MAAM,UAAU,OAAO,EAAE;AACzB,SAAO,QAAQ,QAAQ,GAAG,QAAQ,aAAa,GAAG;;CAEpD;CACD;;;;;;
|
|
1
|
+
{"version":3,"file":"react-querybuilder_datetime.legacy-esm.jsdate.js","names":[],"sources":["../src/rqbDateTimeLibraryAPI.jsdate.ts","../src/index.jsdate.ts"],"sourcesContent":["import type { RQBDateTimeLibraryAPI } from './types';\nimport { isISOStringDateOnly } from './utils';\n\nconst invalidDate = new Date(Number.NaN);\n\nconst dateRegExp = /^(\\d{4})-(\\d{2})-(\\d{2})([T ](\\d{2}):(\\d{2}):(\\d{2})(\\.(\\d{1,3}))?)?/;\n\nconst toDate = (d: string | Date) => {\n if (d instanceof Date) return d;\n\n const reMatch = dateRegExp.exec(d);\n\n if (!reMatch) return invalidDate;\n\n const [_all, yyyy, mm, dd, _time, hh, mi, ss, _decimal, sss] = reMatch;\n const [year, month, day, hours, minutes, seconds, ms] = [yyyy, mm, dd, hh, mi, ss, sss ?? '0']\n .filter(Boolean)\n .map(Number);\n\n const monthIndex = month - 1;\n\n return hh\n ? new Date(Date.UTC(year, monthIndex, day, hours, minutes, seconds, ms))\n : new Date(year, monthIndex, day);\n};\n\nconst isValid = (d: string | Date) => {\n const dToDate = toDate(d);\n return dToDate instanceof Date && !Number.isNaN(dToDate.getTime());\n};\n\nconst toISOStringDateOnly = (d: string | Date) => {\n const dToDate = toDate(d);\n return isValid(dToDate) ? dToDate.toISOString().slice(0, 10) : '';\n};\n\n/**\n * {@link RQBDateTimeLibraryAPI} for JavaScript `Date`\n *\n * @deprecated This API will not be removed, but we recommend using one of the other\n * {@link RQBDateTimeLibraryAPI}s based on a popular library instead.\n */\nexport const rqbDateTimeLibraryAPI: RQBDateTimeLibraryAPI = {\n format: d => toDate(d).toISOString(),\n isAfter: (a, b) => {\n const dateA = toDate(a).getTime();\n const dateB = toDate(b).getTime();\n return !Number.isNaN(dateA) && !Number.isNaN(dateB) && dateA > dateB;\n },\n isBefore: (a, b) => {\n const dateA = toDate(a).getTime();\n const dateB = toDate(b).getTime();\n return !Number.isNaN(dateA) && !Number.isNaN(dateB) && dateA < dateB;\n },\n isSame: (a, b) => {\n const aToDate = toDate(a);\n const bToDate = toDate(b);\n return isISOStringDateOnly(a) || isISOStringDateOnly(b)\n ? toISOStringDateOnly(a) === toISOStringDateOnly(b)\n : aToDate.getTime() === bToDate.getTime();\n },\n isValid,\n toDate,\n toISOString: d => {\n const dToDate = toDate(d);\n return isValid(dToDate) ? dToDate.toISOString() : '';\n },\n toISOStringDateOnly,\n};\n","/**\n * Import from `\"@react-querybuilder/datetime/jsdate\"` for enhanced date/time support using a custom JavaScript `Date`-based library.\n *\n * @module jsdate\n */\n\nimport type { RuleProcessor, ValueProcessorByRule } from 'react-querybuilder';\nimport { getDatetimeJsonLogicOperations } from './getDatetimeJsonLogicOperations';\nimport { getDatetimeRuleProcessorCEL } from './getDatetimeRuleProcessorCEL';\nimport { getDatetimeRuleProcessorCypher } from './getDatetimeRuleProcessorCypher';\nimport { getDatetimeRuleProcessorMongoDBQuery } from './getDatetimeRuleProcessorMongoDBQuery';\nimport { getDatetimeRuleProcessorNL } from './getDatetimeRuleProcessorNL';\nimport { getDatetimeRuleProcessorSPARQL } from './getDatetimeRuleProcessorSPARQL';\nimport {\n getDatetimeRuleProcessorSQL,\n getDatetimeValueProcessorANSI,\n getDatetimeValueProcessorMSSQL,\n getDatetimeValueProcessorMySQL,\n getDatetimeValueProcessorOracle,\n getDatetimeValueProcessorPostgreSQL,\n} from './getDatetimeRuleProcessorSQL';\nimport { rqbDateTimeLibraryAPI } from './rqbDateTimeLibraryAPI.jsdate';\nimport type { RQBJsonLogicDateTimeOperations } from './types';\n\n/**\n * Custom JsonLogic date/time operations using JavaScript `Date`.\n */\nexport const jsonLogicDateTimeOperations: RQBJsonLogicDateTimeOperations =\n getDatetimeJsonLogicOperations(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"sql\" format using JavaScript `Date`\n */\nexport const datetimeRuleProcessorSQL: RuleProcessor =\n getDatetimeRuleProcessorSQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"ansi\" preset) using JavaScript `Date`\n */\nexport const datetimeValueProcessorANSI: ValueProcessorByRule =\n getDatetimeValueProcessorANSI(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"mssql\" preset) using JavaScript `Date`\n */\nexport const datetimeValueProcessorMSSQL: ValueProcessorByRule =\n getDatetimeValueProcessorMSSQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"mysql\" preset) using JavaScript `Date`\n */\nexport const datetimeValueProcessorMySQL: ValueProcessorByRule =\n getDatetimeValueProcessorMySQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"oracle\" preset) using JavaScript `Date`\n */\nexport const datetimeValueProcessorOracle: ValueProcessorByRule =\n getDatetimeValueProcessorOracle(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"postgresql\" preset) using JavaScript `Date`\n */\nexport const datetimeValueProcessorPostgreSQL: ValueProcessorByRule =\n getDatetimeValueProcessorPostgreSQL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"cel\" format using JavaScript `Date`\n */\nexport const datetimeRuleProcessorCEL: RuleProcessor =\n getDatetimeRuleProcessorCEL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"mongodb_query\" format using JavaScript `Date`\n */\nexport const datetimeRuleProcessorMongoDBQuery: RuleProcessor =\n getDatetimeRuleProcessorMongoDBQuery(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"natural_language\" format using JavaScript `Date`\n */\nexport const datetimeRuleProcessorNL: ValueProcessorByRule =\n getDatetimeRuleProcessorNL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"cypher\"/\"gql\" format using JavaScript `Date`\n */\nexport const datetimeRuleProcessorCypher: RuleProcessor =\n getDatetimeRuleProcessorCypher(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"sparql\" format using JavaScript `Date`\n */\nexport const datetimeRuleProcessorSPARQL: RuleProcessor =\n getDatetimeRuleProcessorSPARQL(rqbDateTimeLibraryAPI);\n\nexport * from './rqbDateTimeLibraryAPI.jsdate';\n"],"mappings":";;AAGA,MAAM,8BAAc,IAAI,KAAK,IAAW;AAExC,MAAM,aAAa;AAEnB,MAAM,UAAU,MAAqB;AACnC,KAAI,aAAa,KAAM,QAAO;CAE9B,MAAM,UAAU,WAAW,KAAK,EAAE;AAElC,KAAI,CAAC,QAAS,QAAO;CAErB,MAAM,CAAC,MAAM,MAAM,IAAI,IAAI,OAAO,IAAI,IAAI,IAAI,UAAU,OAAO;CAC/D,MAAM,CAAC,MAAM,OAAO,KAAK,OAAO,SAAS,SAAS,MAAM;EAAC;EAAM;EAAI;EAAI;EAAI;EAAI;EAAI,QAAA,QAAA,QAAA,KAAA,IAAA,MAAO;EAAI,CAC3F,OAAO,QAAQ,CACf,IAAI,OAAO;CAEd,MAAM,aAAa,QAAQ;AAE3B,QAAO,KACH,IAAI,KAAK,KAAK,IAAI,MAAM,YAAY,KAAK,OAAO,SAAS,SAAS,GAAG,CAAC,GACtE,IAAI,KAAK,MAAM,YAAY,IAAI;;AAGrC,MAAM,WAAW,MAAqB;CACpC,MAAM,UAAU,OAAO,EAAE;AACzB,QAAO,mBAAmB,QAAQ,CAAC,OAAO,MAAM,QAAQ,SAAS,CAAC;;AAGpE,MAAM,uBAAuB,MAAqB;CAChD,MAAM,UAAU,OAAO,EAAE;AACzB,QAAO,QAAQ,QAAQ,GAAG,QAAQ,aAAa,CAAC,MAAM,GAAG,GAAG,GAAG;;;;;;;;AASjE,MAAa,wBAA+C;CAC1D,SAAQ,MAAK,OAAO,EAAE,CAAC,aAAa;CACpC,UAAU,GAAG,MAAM;EACjB,MAAM,QAAQ,OAAO,EAAE,CAAC,SAAS;EACjC,MAAM,QAAQ,OAAO,EAAE,CAAC,SAAS;AACjC,SAAO,CAAC,OAAO,MAAM,MAAM,IAAI,CAAC,OAAO,MAAM,MAAM,IAAI,QAAQ;;CAEjE,WAAW,GAAG,MAAM;EAClB,MAAM,QAAQ,OAAO,EAAE,CAAC,SAAS;EACjC,MAAM,QAAQ,OAAO,EAAE,CAAC,SAAS;AACjC,SAAO,CAAC,OAAO,MAAM,MAAM,IAAI,CAAC,OAAO,MAAM,MAAM,IAAI,QAAQ;;CAEjE,SAAS,GAAG,MAAM;EAChB,MAAM,UAAU,OAAO,EAAE;EACzB,MAAM,UAAU,OAAO,EAAE;AACzB,SAAO,oBAAoB,EAAE,IAAI,oBAAoB,EAAE,GACnD,oBAAoB,EAAE,KAAK,oBAAoB,EAAE,GACjD,QAAQ,SAAS,KAAK,QAAQ,SAAS;;CAE7C;CACA;CACA,cAAa,MAAK;EAChB,MAAM,UAAU,OAAO,EAAE;AACzB,SAAO,QAAQ,QAAQ,GAAG,QAAQ,aAAa,GAAG;;CAEpD;CACD;;;;;;ACzCD,MAAa,8BACX,+BAA+B,sBAAsB;;;;AAKvD,MAAa,2BACX,4BAA4B,sBAAsB;;;;AAIpD,MAAa,6BACX,8BAA8B,sBAAsB;;;;AAItD,MAAa,8BACX,+BAA+B,sBAAsB;;;;AAIvD,MAAa,8BACX,+BAA+B,sBAAsB;;;;AAIvD,MAAa,+BACX,gCAAgC,sBAAsB;;;;AAIxD,MAAa,mCACX,oCAAoC,sBAAsB;;;;AAK5D,MAAa,2BACX,4BAA4B,sBAAsB;;;;AAKpD,MAAa,oCACX,qCAAqC,sBAAsB;;;;AAK7D,MAAa,0BACX,2BAA2B,sBAAsB;;;;AAKnD,MAAa,8BACX,+BAA+B,sBAAsB;;;;AAKvD,MAAa,8BACX,+BAA+B,sBAAsB"}
|
|
@@ -48,6 +48,14 @@ declare const datetimeRuleProcessorMongoDBQuery: ValueProcessorByRule;
|
|
|
48
48
|
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "natural_language" format using Luxon
|
|
49
49
|
*/
|
|
50
50
|
declare const datetimeRuleProcessorNL: ValueProcessorByRule;
|
|
51
|
+
/**
|
|
52
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "cypher"/"gql" format using Luxon
|
|
53
|
+
*/
|
|
54
|
+
declare const datetimeRuleProcessorCypher: ValueProcessorByRule;
|
|
55
|
+
/**
|
|
56
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "sparql" format using Luxon
|
|
57
|
+
*/
|
|
58
|
+
declare const datetimeRuleProcessorSPARQL: ValueProcessorByRule;
|
|
51
59
|
//#endregion
|
|
52
|
-
export { datetimeRuleProcessorCEL, datetimeRuleProcessorMongoDBQuery, datetimeRuleProcessorNL, datetimeRuleProcessorSQL, datetimeValueProcessorANSI, datetimeValueProcessorMSSQL, datetimeValueProcessorMySQL, datetimeValueProcessorOracle, datetimeValueProcessorPostgreSQL, jsonLogicDateTimeOperations, rqbDateTimeLibraryAPI };
|
|
60
|
+
export { datetimeRuleProcessorCEL, datetimeRuleProcessorCypher, datetimeRuleProcessorMongoDBQuery, datetimeRuleProcessorNL, datetimeRuleProcessorSPARQL, datetimeRuleProcessorSQL, datetimeValueProcessorANSI, datetimeValueProcessorMSSQL, datetimeValueProcessorMySQL, datetimeValueProcessorOracle, datetimeValueProcessorPostgreSQL, jsonLogicDateTimeOperations, rqbDateTimeLibraryAPI };
|
|
53
61
|
//# sourceMappingURL=react-querybuilder_datetime.legacy-esm.luxon.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as getDatetimeValueProcessorOracle, d as
|
|
1
|
+
import { a as getDatetimeValueProcessorOracle, d as getDatetimeRuleProcessorMongoDBQuery, f as getDatetimeRuleProcessorCypher, h as isISOStringDateOnly, i as getDatetimeValueProcessorMySQL, m as getDatetimeJsonLogicOperations, n as getDatetimeValueProcessorANSI, o as getDatetimeValueProcessorPostgreSQL, p as getDatetimeRuleProcessorCEL, r as getDatetimeValueProcessorMSSQL, s as getDatetimeRuleProcessorSPARQL, t as getDatetimeRuleProcessorSQL, u as getDatetimeRuleProcessorNL } from "./getDatetimeRuleProcessorSQL-Bpt88k6a.js";
|
|
2
2
|
import { DateTime } from "luxon";
|
|
3
3
|
//#region src/rqbDateTimeLibraryAPI.luxon.ts
|
|
4
4
|
const toDateTime = (a) => typeof a === "string" ? DateTime.fromISO(a) : DateTime.fromJSDate(a);
|
|
@@ -64,7 +64,15 @@ const datetimeRuleProcessorMongoDBQuery = getDatetimeRuleProcessorMongoDBQuery(r
|
|
|
64
64
|
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "natural_language" format using Luxon
|
|
65
65
|
*/
|
|
66
66
|
const datetimeRuleProcessorNL = getDatetimeRuleProcessorNL(rqbDateTimeLibraryAPI);
|
|
67
|
+
/**
|
|
68
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "cypher"/"gql" format using Luxon
|
|
69
|
+
*/
|
|
70
|
+
const datetimeRuleProcessorCypher = getDatetimeRuleProcessorCypher(rqbDateTimeLibraryAPI);
|
|
71
|
+
/**
|
|
72
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "sparql" format using Luxon
|
|
73
|
+
*/
|
|
74
|
+
const datetimeRuleProcessorSPARQL = getDatetimeRuleProcessorSPARQL(rqbDateTimeLibraryAPI);
|
|
67
75
|
//#endregion
|
|
68
|
-
export { datetimeRuleProcessorCEL, datetimeRuleProcessorMongoDBQuery, datetimeRuleProcessorNL, datetimeRuleProcessorSQL, datetimeValueProcessorANSI, datetimeValueProcessorMSSQL, datetimeValueProcessorMySQL, datetimeValueProcessorOracle, datetimeValueProcessorPostgreSQL, jsonLogicDateTimeOperations, rqbDateTimeLibraryAPI };
|
|
76
|
+
export { datetimeRuleProcessorCEL, datetimeRuleProcessorCypher, datetimeRuleProcessorMongoDBQuery, datetimeRuleProcessorNL, datetimeRuleProcessorSPARQL, datetimeRuleProcessorSQL, datetimeValueProcessorANSI, datetimeValueProcessorMSSQL, datetimeValueProcessorMySQL, datetimeValueProcessorOracle, datetimeValueProcessorPostgreSQL, jsonLogicDateTimeOperations, rqbDateTimeLibraryAPI };
|
|
69
77
|
|
|
70
78
|
//# sourceMappingURL=react-querybuilder_datetime.legacy-esm.luxon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-querybuilder_datetime.legacy-esm.luxon.js","names":[],"sources":["../src/rqbDateTimeLibraryAPI.luxon.ts","../src/index.luxon.ts"],"sourcesContent":["import { DateTime } from 'luxon';\nimport type { RQBDateTimeLibraryAPI } from './types';\nimport { isISOStringDateOnly } from './utils';\n\nconst toDateTime = (a: string | Date) =>\n typeof a === 'string' ? DateTime.fromISO(a) : DateTime.fromJSDate(a);\nconst iso8601DateOnly = 'yyyy-MM-dd';\n\n/**\n * {@link RQBDateTimeLibraryAPI} for Luxon\n */\nexport const rqbDateTimeLibraryAPI: RQBDateTimeLibraryAPI = {\n format: (d, fmt) => toDateTime(d).toFormat(fmt.replace('YYYY-MM-DD', iso8601DateOnly)),\n isAfter: (a, b) => toDateTime(a) > toDateTime(b),\n isBefore: (a, b) => toDateTime(a) < toDateTime(b),\n isSame: (a, b) =>\n isISOStringDateOnly(a) || isISOStringDateOnly(b)\n ? toDateTime(a).hasSame(toDateTime(b), 'day')\n : +toDateTime(a) === +toDateTime(b),\n isValid: d => toDateTime(d).isValid,\n toDate: d => toDateTime(d).toJSDate(),\n toISOString: d => {\n const dToDate = toDateTime(d);\n return dToDate.isValid ? dToDate.toJSDate().toISOString() : '';\n },\n toISOStringDateOnly: d => {\n const dToDate = toDateTime(d);\n return dToDate.isValid ? dToDate.toFormat(iso8601DateOnly) : '';\n },\n};\n","/**\n * Import from `\"@react-querybuilder/datetime/luxon\"` for enhanced date/time support using [Luxon](https://moment.github.io/luxon/).\n *\n * @module luxon\n */\n\nimport type { RuleProcessor, ValueProcessorByRule } from 'react-querybuilder';\nimport { getDatetimeJsonLogicOperations } from './getDatetimeJsonLogicOperations';\nimport { getDatetimeRuleProcessorCEL } from './getDatetimeRuleProcessorCEL';\nimport { getDatetimeRuleProcessorMongoDBQuery } from './getDatetimeRuleProcessorMongoDBQuery';\nimport { getDatetimeRuleProcessorNL } from './getDatetimeRuleProcessorNL';\nimport {\n getDatetimeRuleProcessorSQL,\n getDatetimeValueProcessorANSI,\n getDatetimeValueProcessorMSSQL,\n getDatetimeValueProcessorMySQL,\n getDatetimeValueProcessorOracle,\n getDatetimeValueProcessorPostgreSQL,\n} from './getDatetimeRuleProcessorSQL';\nimport { rqbDateTimeLibraryAPI } from './rqbDateTimeLibraryAPI.luxon';\nimport type { RQBJsonLogicDateTimeOperations } from './types';\n\n/**\n * Custom JsonLogic date/time operations using Luxon\n */\nexport const jsonLogicDateTimeOperations: RQBJsonLogicDateTimeOperations =\n getDatetimeJsonLogicOperations(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"sql\" format using Luxon\n */\nexport const datetimeRuleProcessorSQL: RuleProcessor =\n getDatetimeRuleProcessorSQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"ansi\" preset) using Luxon\n */\nexport const datetimeValueProcessorANSI: ValueProcessorByRule =\n getDatetimeValueProcessorANSI(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"mssql\" preset) using Luxon\n */\nexport const datetimeValueProcessorMSSQL: ValueProcessorByRule =\n getDatetimeValueProcessorMSSQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"mysql\" preset) using Luxon\n */\nexport const datetimeValueProcessorMySQL: ValueProcessorByRule =\n getDatetimeValueProcessorMySQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"oracle\" preset) using Luxon\n */\nexport const datetimeValueProcessorOracle: ValueProcessorByRule =\n getDatetimeValueProcessorOracle(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"postgresql\" preset) using Luxon\n */\nexport const datetimeValueProcessorPostgreSQL: ValueProcessorByRule =\n getDatetimeValueProcessorPostgreSQL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"cel\" format using Luxon\n */\nexport const datetimeRuleProcessorCEL: ValueProcessorByRule =\n getDatetimeRuleProcessorCEL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"mongodb_query\" format using Luxon\n */\nexport const datetimeRuleProcessorMongoDBQuery: ValueProcessorByRule =\n getDatetimeRuleProcessorMongoDBQuery(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"natural_language\" format using Luxon\n */\nexport const datetimeRuleProcessorNL: ValueProcessorByRule =\n getDatetimeRuleProcessorNL(rqbDateTimeLibraryAPI);\n\nexport * from './rqbDateTimeLibraryAPI.luxon';\n"],"mappings":";;;AAIA,MAAM,cAAc,MAClB,OAAO,MAAM,WAAW,SAAS,QAAQ,EAAE,GAAG,SAAS,WAAW,EAAE;AACtE,MAAM,kBAAkB;;;;AAKxB,MAAa,wBAA+C;CAC1D,SAAS,GAAG,QAAQ,WAAW,EAAE,CAAC,SAAS,IAAI,QAAQ,cAAc,gBAAgB,CAAC;CACtF,UAAU,GAAG,MAAM,WAAW,EAAE,GAAG,WAAW,EAAE;CAChD,WAAW,GAAG,MAAM,WAAW,EAAE,GAAG,WAAW,EAAE;CACjD,SAAS,GAAG,MACV,oBAAoB,EAAE,IAAI,oBAAoB,EAAE,GAC5C,WAAW,EAAE,CAAC,QAAQ,WAAW,EAAE,EAAE,MAAM,GAC3C,CAAC,WAAW,EAAE,KAAK,CAAC,WAAW,EAAE;CACvC,UAAS,MAAK,WAAW,EAAE,CAAC;CAC5B,SAAQ,MAAK,WAAW,EAAE,CAAC,UAAU;CACrC,cAAa,MAAK;EAChB,MAAM,UAAU,WAAW,EAAE;AAC7B,SAAO,QAAQ,UAAU,QAAQ,UAAU,CAAC,aAAa,GAAG;;CAE9D,sBAAqB,MAAK;EACxB,MAAM,UAAU,WAAW,EAAE;AAC7B,SAAO,QAAQ,UAAU,QAAQ,SAAS,gBAAgB,GAAG;;CAEhE;;;;;;
|
|
1
|
+
{"version":3,"file":"react-querybuilder_datetime.legacy-esm.luxon.js","names":[],"sources":["../src/rqbDateTimeLibraryAPI.luxon.ts","../src/index.luxon.ts"],"sourcesContent":["import { DateTime } from 'luxon';\nimport type { RQBDateTimeLibraryAPI } from './types';\nimport { isISOStringDateOnly } from './utils';\n\nconst toDateTime = (a: string | Date) =>\n typeof a === 'string' ? DateTime.fromISO(a) : DateTime.fromJSDate(a);\nconst iso8601DateOnly = 'yyyy-MM-dd';\n\n/**\n * {@link RQBDateTimeLibraryAPI} for Luxon\n */\nexport const rqbDateTimeLibraryAPI: RQBDateTimeLibraryAPI = {\n format: (d, fmt) => toDateTime(d).toFormat(fmt.replace('YYYY-MM-DD', iso8601DateOnly)),\n isAfter: (a, b) => toDateTime(a) > toDateTime(b),\n isBefore: (a, b) => toDateTime(a) < toDateTime(b),\n isSame: (a, b) =>\n isISOStringDateOnly(a) || isISOStringDateOnly(b)\n ? toDateTime(a).hasSame(toDateTime(b), 'day')\n : +toDateTime(a) === +toDateTime(b),\n isValid: d => toDateTime(d).isValid,\n toDate: d => toDateTime(d).toJSDate(),\n toISOString: d => {\n const dToDate = toDateTime(d);\n return dToDate.isValid ? dToDate.toJSDate().toISOString() : '';\n },\n toISOStringDateOnly: d => {\n const dToDate = toDateTime(d);\n return dToDate.isValid ? dToDate.toFormat(iso8601DateOnly) : '';\n },\n};\n","/**\n * Import from `\"@react-querybuilder/datetime/luxon\"` for enhanced date/time support using [Luxon](https://moment.github.io/luxon/).\n *\n * @module luxon\n */\n\nimport type { RuleProcessor, ValueProcessorByRule } from 'react-querybuilder';\nimport { getDatetimeJsonLogicOperations } from './getDatetimeJsonLogicOperations';\nimport { getDatetimeRuleProcessorCEL } from './getDatetimeRuleProcessorCEL';\nimport { getDatetimeRuleProcessorCypher } from './getDatetimeRuleProcessorCypher';\nimport { getDatetimeRuleProcessorMongoDBQuery } from './getDatetimeRuleProcessorMongoDBQuery';\nimport { getDatetimeRuleProcessorNL } from './getDatetimeRuleProcessorNL';\nimport { getDatetimeRuleProcessorSPARQL } from './getDatetimeRuleProcessorSPARQL';\nimport {\n getDatetimeRuleProcessorSQL,\n getDatetimeValueProcessorANSI,\n getDatetimeValueProcessorMSSQL,\n getDatetimeValueProcessorMySQL,\n getDatetimeValueProcessorOracle,\n getDatetimeValueProcessorPostgreSQL,\n} from './getDatetimeRuleProcessorSQL';\nimport { rqbDateTimeLibraryAPI } from './rqbDateTimeLibraryAPI.luxon';\nimport type { RQBJsonLogicDateTimeOperations } from './types';\n\n/**\n * Custom JsonLogic date/time operations using Luxon\n */\nexport const jsonLogicDateTimeOperations: RQBJsonLogicDateTimeOperations =\n getDatetimeJsonLogicOperations(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"sql\" format using Luxon\n */\nexport const datetimeRuleProcessorSQL: RuleProcessor =\n getDatetimeRuleProcessorSQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"ansi\" preset) using Luxon\n */\nexport const datetimeValueProcessorANSI: ValueProcessorByRule =\n getDatetimeValueProcessorANSI(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"mssql\" preset) using Luxon\n */\nexport const datetimeValueProcessorMSSQL: ValueProcessorByRule =\n getDatetimeValueProcessorMSSQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"mysql\" preset) using Luxon\n */\nexport const datetimeValueProcessorMySQL: ValueProcessorByRule =\n getDatetimeValueProcessorMySQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"oracle\" preset) using Luxon\n */\nexport const datetimeValueProcessorOracle: ValueProcessorByRule =\n getDatetimeValueProcessorOracle(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"postgresql\" preset) using Luxon\n */\nexport const datetimeValueProcessorPostgreSQL: ValueProcessorByRule =\n getDatetimeValueProcessorPostgreSQL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"cel\" format using Luxon\n */\nexport const datetimeRuleProcessorCEL: ValueProcessorByRule =\n getDatetimeRuleProcessorCEL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"mongodb_query\" format using Luxon\n */\nexport const datetimeRuleProcessorMongoDBQuery: ValueProcessorByRule =\n getDatetimeRuleProcessorMongoDBQuery(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"natural_language\" format using Luxon\n */\nexport const datetimeRuleProcessorNL: ValueProcessorByRule =\n getDatetimeRuleProcessorNL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"cypher\"/\"gql\" format using Luxon\n */\nexport const datetimeRuleProcessorCypher: ValueProcessorByRule =\n getDatetimeRuleProcessorCypher(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"sparql\" format using Luxon\n */\nexport const datetimeRuleProcessorSPARQL: ValueProcessorByRule =\n getDatetimeRuleProcessorSPARQL(rqbDateTimeLibraryAPI);\n\nexport * from './rqbDateTimeLibraryAPI.luxon';\n"],"mappings":";;;AAIA,MAAM,cAAc,MAClB,OAAO,MAAM,WAAW,SAAS,QAAQ,EAAE,GAAG,SAAS,WAAW,EAAE;AACtE,MAAM,kBAAkB;;;;AAKxB,MAAa,wBAA+C;CAC1D,SAAS,GAAG,QAAQ,WAAW,EAAE,CAAC,SAAS,IAAI,QAAQ,cAAc,gBAAgB,CAAC;CACtF,UAAU,GAAG,MAAM,WAAW,EAAE,GAAG,WAAW,EAAE;CAChD,WAAW,GAAG,MAAM,WAAW,EAAE,GAAG,WAAW,EAAE;CACjD,SAAS,GAAG,MACV,oBAAoB,EAAE,IAAI,oBAAoB,EAAE,GAC5C,WAAW,EAAE,CAAC,QAAQ,WAAW,EAAE,EAAE,MAAM,GAC3C,CAAC,WAAW,EAAE,KAAK,CAAC,WAAW,EAAE;CACvC,UAAS,MAAK,WAAW,EAAE,CAAC;CAC5B,SAAQ,MAAK,WAAW,EAAE,CAAC,UAAU;CACrC,cAAa,MAAK;EAChB,MAAM,UAAU,WAAW,EAAE;AAC7B,SAAO,QAAQ,UAAU,QAAQ,UAAU,CAAC,aAAa,GAAG;;CAE9D,sBAAqB,MAAK;EACxB,MAAM,UAAU,WAAW,EAAE;AAC7B,SAAO,QAAQ,UAAU,QAAQ,SAAS,gBAAgB,GAAG;;CAEhE;;;;;;ACFD,MAAa,8BACX,+BAA+B,sBAAsB;;;;AAKvD,MAAa,2BACX,4BAA4B,sBAAsB;;;;AAIpD,MAAa,6BACX,8BAA8B,sBAAsB;;;;AAItD,MAAa,8BACX,+BAA+B,sBAAsB;;;;AAIvD,MAAa,8BACX,+BAA+B,sBAAsB;;;;AAIvD,MAAa,+BACX,gCAAgC,sBAAsB;;;;AAIxD,MAAa,mCACX,oCAAoC,sBAAsB;;;;AAK5D,MAAa,2BACX,4BAA4B,sBAAsB;;;;AAKpD,MAAa,oCACX,qCAAqC,sBAAsB;;;;AAK7D,MAAa,0BACX,2BAA2B,sBAAsB;;;;AAKnD,MAAa,8BACX,+BAA+B,sBAAsB;;;;AAKvD,MAAa,8BACX,+BAA+B,sBAAsB"}
|
|
@@ -48,6 +48,14 @@ declare const datetimeRuleProcessorMongoDBQuery: ValueProcessorByRule;
|
|
|
48
48
|
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "natural_language" format using Luxon
|
|
49
49
|
*/
|
|
50
50
|
declare const datetimeRuleProcessorNL: ValueProcessorByRule;
|
|
51
|
+
/**
|
|
52
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "cypher"/"gql" format using Luxon
|
|
53
|
+
*/
|
|
54
|
+
declare const datetimeRuleProcessorCypher: ValueProcessorByRule;
|
|
55
|
+
/**
|
|
56
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "sparql" format using Luxon
|
|
57
|
+
*/
|
|
58
|
+
declare const datetimeRuleProcessorSPARQL: ValueProcessorByRule;
|
|
51
59
|
//#endregion
|
|
52
|
-
export { datetimeRuleProcessorCEL, datetimeRuleProcessorMongoDBQuery, datetimeRuleProcessorNL, datetimeRuleProcessorSQL, datetimeValueProcessorANSI, datetimeValueProcessorMSSQL, datetimeValueProcessorMySQL, datetimeValueProcessorOracle, datetimeValueProcessorPostgreSQL, jsonLogicDateTimeOperations, rqbDateTimeLibraryAPI };
|
|
60
|
+
export { datetimeRuleProcessorCEL, datetimeRuleProcessorCypher, datetimeRuleProcessorMongoDBQuery, datetimeRuleProcessorNL, datetimeRuleProcessorSPARQL, datetimeRuleProcessorSQL, datetimeValueProcessorANSI, datetimeValueProcessorMSSQL, datetimeValueProcessorMySQL, datetimeValueProcessorOracle, datetimeValueProcessorPostgreSQL, jsonLogicDateTimeOperations, rqbDateTimeLibraryAPI };
|
|
53
61
|
//# sourceMappingURL=react-querybuilder_datetime.luxon.d.mts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as getDatetimeValueProcessorOracle, d as
|
|
1
|
+
import { a as getDatetimeValueProcessorOracle, d as getDatetimeRuleProcessorMongoDBQuery, f as getDatetimeRuleProcessorCypher, h as isISOStringDateOnly, i as getDatetimeValueProcessorMySQL, m as getDatetimeJsonLogicOperations, n as getDatetimeValueProcessorANSI, o as getDatetimeValueProcessorPostgreSQL, p as getDatetimeRuleProcessorCEL, r as getDatetimeValueProcessorMSSQL, s as getDatetimeRuleProcessorSPARQL, t as getDatetimeRuleProcessorSQL, u as getDatetimeRuleProcessorNL } from "./getDatetimeRuleProcessorSQL-BGTFvbeK.mjs";
|
|
2
2
|
import { DateTime } from "luxon";
|
|
3
3
|
//#region src/rqbDateTimeLibraryAPI.luxon.ts
|
|
4
4
|
const toDateTime = (a) => typeof a === "string" ? DateTime.fromISO(a) : DateTime.fromJSDate(a);
|
|
@@ -64,7 +64,15 @@ const datetimeRuleProcessorMongoDBQuery = getDatetimeRuleProcessorMongoDBQuery(r
|
|
|
64
64
|
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "natural_language" format using Luxon
|
|
65
65
|
*/
|
|
66
66
|
const datetimeRuleProcessorNL = getDatetimeRuleProcessorNL(rqbDateTimeLibraryAPI);
|
|
67
|
+
/**
|
|
68
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "cypher"/"gql" format using Luxon
|
|
69
|
+
*/
|
|
70
|
+
const datetimeRuleProcessorCypher = getDatetimeRuleProcessorCypher(rqbDateTimeLibraryAPI);
|
|
71
|
+
/**
|
|
72
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "sparql" format using Luxon
|
|
73
|
+
*/
|
|
74
|
+
const datetimeRuleProcessorSPARQL = getDatetimeRuleProcessorSPARQL(rqbDateTimeLibraryAPI);
|
|
67
75
|
//#endregion
|
|
68
|
-
export { datetimeRuleProcessorCEL, datetimeRuleProcessorMongoDBQuery, datetimeRuleProcessorNL, datetimeRuleProcessorSQL, datetimeValueProcessorANSI, datetimeValueProcessorMSSQL, datetimeValueProcessorMySQL, datetimeValueProcessorOracle, datetimeValueProcessorPostgreSQL, jsonLogicDateTimeOperations, rqbDateTimeLibraryAPI };
|
|
76
|
+
export { datetimeRuleProcessorCEL, datetimeRuleProcessorCypher, datetimeRuleProcessorMongoDBQuery, datetimeRuleProcessorNL, datetimeRuleProcessorSPARQL, datetimeRuleProcessorSQL, datetimeValueProcessorANSI, datetimeValueProcessorMSSQL, datetimeValueProcessorMySQL, datetimeValueProcessorOracle, datetimeValueProcessorPostgreSQL, jsonLogicDateTimeOperations, rqbDateTimeLibraryAPI };
|
|
69
77
|
|
|
70
78
|
//# sourceMappingURL=react-querybuilder_datetime.luxon.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-querybuilder_datetime.luxon.mjs","names":[],"sources":["../src/rqbDateTimeLibraryAPI.luxon.ts","../src/index.luxon.ts"],"sourcesContent":["import { DateTime } from 'luxon';\nimport type { RQBDateTimeLibraryAPI } from './types';\nimport { isISOStringDateOnly } from './utils';\n\nconst toDateTime = (a: string | Date) =>\n typeof a === 'string' ? DateTime.fromISO(a) : DateTime.fromJSDate(a);\nconst iso8601DateOnly = 'yyyy-MM-dd';\n\n/**\n * {@link RQBDateTimeLibraryAPI} for Luxon\n */\nexport const rqbDateTimeLibraryAPI: RQBDateTimeLibraryAPI = {\n format: (d, fmt) => toDateTime(d).toFormat(fmt.replace('YYYY-MM-DD', iso8601DateOnly)),\n isAfter: (a, b) => toDateTime(a) > toDateTime(b),\n isBefore: (a, b) => toDateTime(a) < toDateTime(b),\n isSame: (a, b) =>\n isISOStringDateOnly(a) || isISOStringDateOnly(b)\n ? toDateTime(a).hasSame(toDateTime(b), 'day')\n : +toDateTime(a) === +toDateTime(b),\n isValid: d => toDateTime(d).isValid,\n toDate: d => toDateTime(d).toJSDate(),\n toISOString: d => {\n const dToDate = toDateTime(d);\n return dToDate.isValid ? dToDate.toJSDate().toISOString() : '';\n },\n toISOStringDateOnly: d => {\n const dToDate = toDateTime(d);\n return dToDate.isValid ? dToDate.toFormat(iso8601DateOnly) : '';\n },\n};\n","/**\n * Import from `\"@react-querybuilder/datetime/luxon\"` for enhanced date/time support using [Luxon](https://moment.github.io/luxon/).\n *\n * @module luxon\n */\n\nimport type { RuleProcessor, ValueProcessorByRule } from 'react-querybuilder';\nimport { getDatetimeJsonLogicOperations } from './getDatetimeJsonLogicOperations';\nimport { getDatetimeRuleProcessorCEL } from './getDatetimeRuleProcessorCEL';\nimport { getDatetimeRuleProcessorMongoDBQuery } from './getDatetimeRuleProcessorMongoDBQuery';\nimport { getDatetimeRuleProcessorNL } from './getDatetimeRuleProcessorNL';\nimport {\n getDatetimeRuleProcessorSQL,\n getDatetimeValueProcessorANSI,\n getDatetimeValueProcessorMSSQL,\n getDatetimeValueProcessorMySQL,\n getDatetimeValueProcessorOracle,\n getDatetimeValueProcessorPostgreSQL,\n} from './getDatetimeRuleProcessorSQL';\nimport { rqbDateTimeLibraryAPI } from './rqbDateTimeLibraryAPI.luxon';\nimport type { RQBJsonLogicDateTimeOperations } from './types';\n\n/**\n * Custom JsonLogic date/time operations using Luxon\n */\nexport const jsonLogicDateTimeOperations: RQBJsonLogicDateTimeOperations =\n getDatetimeJsonLogicOperations(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"sql\" format using Luxon\n */\nexport const datetimeRuleProcessorSQL: RuleProcessor =\n getDatetimeRuleProcessorSQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"ansi\" preset) using Luxon\n */\nexport const datetimeValueProcessorANSI: ValueProcessorByRule =\n getDatetimeValueProcessorANSI(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"mssql\" preset) using Luxon\n */\nexport const datetimeValueProcessorMSSQL: ValueProcessorByRule =\n getDatetimeValueProcessorMSSQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"mysql\" preset) using Luxon\n */\nexport const datetimeValueProcessorMySQL: ValueProcessorByRule =\n getDatetimeValueProcessorMySQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"oracle\" preset) using Luxon\n */\nexport const datetimeValueProcessorOracle: ValueProcessorByRule =\n getDatetimeValueProcessorOracle(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"postgresql\" preset) using Luxon\n */\nexport const datetimeValueProcessorPostgreSQL: ValueProcessorByRule =\n getDatetimeValueProcessorPostgreSQL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"cel\" format using Luxon\n */\nexport const datetimeRuleProcessorCEL: ValueProcessorByRule =\n getDatetimeRuleProcessorCEL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"mongodb_query\" format using Luxon\n */\nexport const datetimeRuleProcessorMongoDBQuery: ValueProcessorByRule =\n getDatetimeRuleProcessorMongoDBQuery(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"natural_language\" format using Luxon\n */\nexport const datetimeRuleProcessorNL: ValueProcessorByRule =\n getDatetimeRuleProcessorNL(rqbDateTimeLibraryAPI);\n\nexport * from './rqbDateTimeLibraryAPI.luxon';\n"],"mappings":";;;AAIA,MAAM,cAAc,MAClB,OAAO,MAAM,WAAW,SAAS,QAAQ,EAAE,GAAG,SAAS,WAAW,EAAE;AACtE,MAAM,kBAAkB;;;;AAKxB,MAAa,wBAA+C;CAC1D,SAAS,GAAG,QAAQ,WAAW,EAAE,CAAC,SAAS,IAAI,QAAQ,cAAc,gBAAgB,CAAC;CACtF,UAAU,GAAG,MAAM,WAAW,EAAE,GAAG,WAAW,EAAE;CAChD,WAAW,GAAG,MAAM,WAAW,EAAE,GAAG,WAAW,EAAE;CACjD,SAAS,GAAG,MACV,oBAAoB,EAAE,IAAI,oBAAoB,EAAE,GAC5C,WAAW,EAAE,CAAC,QAAQ,WAAW,EAAE,EAAE,MAAM,GAC3C,CAAC,WAAW,EAAE,KAAK,CAAC,WAAW,EAAE;CACvC,UAAS,MAAK,WAAW,EAAE,CAAC;CAC5B,SAAQ,MAAK,WAAW,EAAE,CAAC,UAAU;CACrC,cAAa,MAAK;EAChB,MAAM,UAAU,WAAW,EAAE;AAC7B,SAAO,QAAQ,UAAU,QAAQ,UAAU,CAAC,aAAa,GAAG;;CAE9D,sBAAqB,MAAK;EACxB,MAAM,UAAU,WAAW,EAAE;AAC7B,SAAO,QAAQ,UAAU,QAAQ,SAAS,gBAAgB,GAAG;;CAEhE;;;;;;
|
|
1
|
+
{"version":3,"file":"react-querybuilder_datetime.luxon.mjs","names":[],"sources":["../src/rqbDateTimeLibraryAPI.luxon.ts","../src/index.luxon.ts"],"sourcesContent":["import { DateTime } from 'luxon';\nimport type { RQBDateTimeLibraryAPI } from './types';\nimport { isISOStringDateOnly } from './utils';\n\nconst toDateTime = (a: string | Date) =>\n typeof a === 'string' ? DateTime.fromISO(a) : DateTime.fromJSDate(a);\nconst iso8601DateOnly = 'yyyy-MM-dd';\n\n/**\n * {@link RQBDateTimeLibraryAPI} for Luxon\n */\nexport const rqbDateTimeLibraryAPI: RQBDateTimeLibraryAPI = {\n format: (d, fmt) => toDateTime(d).toFormat(fmt.replace('YYYY-MM-DD', iso8601DateOnly)),\n isAfter: (a, b) => toDateTime(a) > toDateTime(b),\n isBefore: (a, b) => toDateTime(a) < toDateTime(b),\n isSame: (a, b) =>\n isISOStringDateOnly(a) || isISOStringDateOnly(b)\n ? toDateTime(a).hasSame(toDateTime(b), 'day')\n : +toDateTime(a) === +toDateTime(b),\n isValid: d => toDateTime(d).isValid,\n toDate: d => toDateTime(d).toJSDate(),\n toISOString: d => {\n const dToDate = toDateTime(d);\n return dToDate.isValid ? dToDate.toJSDate().toISOString() : '';\n },\n toISOStringDateOnly: d => {\n const dToDate = toDateTime(d);\n return dToDate.isValid ? dToDate.toFormat(iso8601DateOnly) : '';\n },\n};\n","/**\n * Import from `\"@react-querybuilder/datetime/luxon\"` for enhanced date/time support using [Luxon](https://moment.github.io/luxon/).\n *\n * @module luxon\n */\n\nimport type { RuleProcessor, ValueProcessorByRule } from 'react-querybuilder';\nimport { getDatetimeJsonLogicOperations } from './getDatetimeJsonLogicOperations';\nimport { getDatetimeRuleProcessorCEL } from './getDatetimeRuleProcessorCEL';\nimport { getDatetimeRuleProcessorCypher } from './getDatetimeRuleProcessorCypher';\nimport { getDatetimeRuleProcessorMongoDBQuery } from './getDatetimeRuleProcessorMongoDBQuery';\nimport { getDatetimeRuleProcessorNL } from './getDatetimeRuleProcessorNL';\nimport { getDatetimeRuleProcessorSPARQL } from './getDatetimeRuleProcessorSPARQL';\nimport {\n getDatetimeRuleProcessorSQL,\n getDatetimeValueProcessorANSI,\n getDatetimeValueProcessorMSSQL,\n getDatetimeValueProcessorMySQL,\n getDatetimeValueProcessorOracle,\n getDatetimeValueProcessorPostgreSQL,\n} from './getDatetimeRuleProcessorSQL';\nimport { rqbDateTimeLibraryAPI } from './rqbDateTimeLibraryAPI.luxon';\nimport type { RQBJsonLogicDateTimeOperations } from './types';\n\n/**\n * Custom JsonLogic date/time operations using Luxon\n */\nexport const jsonLogicDateTimeOperations: RQBJsonLogicDateTimeOperations =\n getDatetimeJsonLogicOperations(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"sql\" format using Luxon\n */\nexport const datetimeRuleProcessorSQL: RuleProcessor =\n getDatetimeRuleProcessorSQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"ansi\" preset) using Luxon\n */\nexport const datetimeValueProcessorANSI: ValueProcessorByRule =\n getDatetimeValueProcessorANSI(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"mssql\" preset) using Luxon\n */\nexport const datetimeValueProcessorMSSQL: ValueProcessorByRule =\n getDatetimeValueProcessorMSSQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"mysql\" preset) using Luxon\n */\nexport const datetimeValueProcessorMySQL: ValueProcessorByRule =\n getDatetimeValueProcessorMySQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"oracle\" preset) using Luxon\n */\nexport const datetimeValueProcessorOracle: ValueProcessorByRule =\n getDatetimeValueProcessorOracle(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"postgresql\" preset) using Luxon\n */\nexport const datetimeValueProcessorPostgreSQL: ValueProcessorByRule =\n getDatetimeValueProcessorPostgreSQL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"cel\" format using Luxon\n */\nexport const datetimeRuleProcessorCEL: ValueProcessorByRule =\n getDatetimeRuleProcessorCEL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"mongodb_query\" format using Luxon\n */\nexport const datetimeRuleProcessorMongoDBQuery: ValueProcessorByRule =\n getDatetimeRuleProcessorMongoDBQuery(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"natural_language\" format using Luxon\n */\nexport const datetimeRuleProcessorNL: ValueProcessorByRule =\n getDatetimeRuleProcessorNL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"cypher\"/\"gql\" format using Luxon\n */\nexport const datetimeRuleProcessorCypher: ValueProcessorByRule =\n getDatetimeRuleProcessorCypher(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"sparql\" format using Luxon\n */\nexport const datetimeRuleProcessorSPARQL: ValueProcessorByRule =\n getDatetimeRuleProcessorSPARQL(rqbDateTimeLibraryAPI);\n\nexport * from './rqbDateTimeLibraryAPI.luxon';\n"],"mappings":";;;AAIA,MAAM,cAAc,MAClB,OAAO,MAAM,WAAW,SAAS,QAAQ,EAAE,GAAG,SAAS,WAAW,EAAE;AACtE,MAAM,kBAAkB;;;;AAKxB,MAAa,wBAA+C;CAC1D,SAAS,GAAG,QAAQ,WAAW,EAAE,CAAC,SAAS,IAAI,QAAQ,cAAc,gBAAgB,CAAC;CACtF,UAAU,GAAG,MAAM,WAAW,EAAE,GAAG,WAAW,EAAE;CAChD,WAAW,GAAG,MAAM,WAAW,EAAE,GAAG,WAAW,EAAE;CACjD,SAAS,GAAG,MACV,oBAAoB,EAAE,IAAI,oBAAoB,EAAE,GAC5C,WAAW,EAAE,CAAC,QAAQ,WAAW,EAAE,EAAE,MAAM,GAC3C,CAAC,WAAW,EAAE,KAAK,CAAC,WAAW,EAAE;CACvC,UAAS,MAAK,WAAW,EAAE,CAAC;CAC5B,SAAQ,MAAK,WAAW,EAAE,CAAC,UAAU;CACrC,cAAa,MAAK;EAChB,MAAM,UAAU,WAAW,EAAE;AAC7B,SAAO,QAAQ,UAAU,QAAQ,UAAU,CAAC,aAAa,GAAG;;CAE9D,sBAAqB,MAAK;EACxB,MAAM,UAAU,WAAW,EAAE;AAC7B,SAAO,QAAQ,UAAU,QAAQ,SAAS,gBAAgB,GAAG;;CAEhE;;;;;;ACFD,MAAa,8BACX,+BAA+B,sBAAsB;;;;AAKvD,MAAa,2BACX,4BAA4B,sBAAsB;;;;AAIpD,MAAa,6BACX,8BAA8B,sBAAsB;;;;AAItD,MAAa,8BACX,+BAA+B,sBAAsB;;;;AAIvD,MAAa,8BACX,+BAA+B,sBAAsB;;;;AAIvD,MAAa,+BACX,gCAAgC,sBAAsB;;;;AAIxD,MAAa,mCACX,oCAAoC,sBAAsB;;;;AAK5D,MAAa,2BACX,4BAA4B,sBAAsB;;;;AAKpD,MAAa,oCACX,qCAAqC,sBAAsB;;;;AAK7D,MAAa,0BACX,2BAA2B,sBAAsB;;;;AAKnD,MAAa,8BACX,+BAA+B,sBAAsB;;;;AAKvD,MAAa,8BACX,+BAA+B,sBAAsB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as getDatetimeValueProcessorOracle, c as
|
|
1
|
+
import { a as getDatetimeValueProcessorOracle, c as datetimeValueProcessorNL, d as getDatetimeRuleProcessorMongoDBQuery, f as getDatetimeRuleProcessorCypher, g as processIsDateField, i as getDatetimeValueProcessorMySQL, l as defaultDateTimeNLOperatorMap, m as getDatetimeJsonLogicOperations, n as getDatetimeValueProcessorANSI, o as getDatetimeValueProcessorPostgreSQL, p as getDatetimeRuleProcessorCEL, r as getDatetimeValueProcessorMSSQL, s as getDatetimeRuleProcessorSPARQL, t as getDatetimeRuleProcessorSQL, u as getDatetimeRuleProcessorNL } from "./getDatetimeRuleProcessorSQL-BGTFvbeK.mjs";
|
|
2
2
|
import { defaultRuleProcessorJSONata, defaultRuleProcessorJsonLogic, getQuotedFieldName, nullOrUndefinedOrEmpty, toArray } from "react-querybuilder";
|
|
3
3
|
//#region src/datetimeRuleProcessorJsonLogic.ts
|
|
4
4
|
const dateOperationMap = {
|
|
@@ -110,6 +110,6 @@ const getDatetimeRuleProcessorJSONata = (apiFns) => (rule, options) => {
|
|
|
110
110
|
return defaultRuleProcessorJSONata(rule, opts);
|
|
111
111
|
};
|
|
112
112
|
//#endregion
|
|
113
|
-
export { datetimeRuleProcessorJsonLogic, datetimeValueProcessorNL, defaultDateTimeNLOperatorMap, getDatetimeJsonLogicOperations, getDatetimeRuleProcessorCEL, getDatetimeRuleProcessorJSONata, getDatetimeRuleProcessorMongoDBQuery, getDatetimeRuleProcessorNL, getDatetimeRuleProcessorSQL, getDatetimeValueProcessorANSI, getDatetimeValueProcessorMSSQL, getDatetimeValueProcessorMySQL, getDatetimeValueProcessorOracle, getDatetimeValueProcessorPostgreSQL };
|
|
113
|
+
export { datetimeRuleProcessorJsonLogic, datetimeValueProcessorNL, defaultDateTimeNLOperatorMap, getDatetimeJsonLogicOperations, getDatetimeRuleProcessorCEL, getDatetimeRuleProcessorCypher, getDatetimeRuleProcessorJSONata, getDatetimeRuleProcessorMongoDBQuery, getDatetimeRuleProcessorNL, getDatetimeRuleProcessorSPARQL, getDatetimeRuleProcessorSQL, getDatetimeValueProcessorANSI, getDatetimeValueProcessorMSSQL, getDatetimeValueProcessorMySQL, getDatetimeValueProcessorOracle, getDatetimeValueProcessorPostgreSQL };
|
|
114
114
|
|
|
115
115
|
//# sourceMappingURL=react-querybuilder_datetime.mjs.map
|
|
@@ -30,6 +30,19 @@ declare const getDatetimeJsonLogicOperations: ({
|
|
|
30
30
|
*/
|
|
31
31
|
declare const getDatetimeRuleProcessorCEL: (apiFns: RQBDateTimeLibraryAPI) => RuleProcessor;
|
|
32
32
|
//#endregion
|
|
33
|
+
//#region src/getDatetimeRuleProcessorCypher.d.ts
|
|
34
|
+
/**
|
|
35
|
+
* Generates a rule processor with date/time features for use by
|
|
36
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} with the "cypher" or "gql" format.
|
|
37
|
+
*
|
|
38
|
+
* Supports:
|
|
39
|
+
* - Standard comparison operators (`=`, `!=`, `<`, `>`, `<=`, `>=`)
|
|
40
|
+
* - Range operators (between, notBetween, in, notIn)
|
|
41
|
+
* - Duration math via custom operators: `olderThanDuration` and `withinDuration`
|
|
42
|
+
* (e.g., value `"P30D"` → `datetime() - field > duration('P30D')`)
|
|
43
|
+
*/
|
|
44
|
+
declare const getDatetimeRuleProcessorCypher: (apiFns: RQBDateTimeLibraryAPI) => RuleProcessor;
|
|
45
|
+
//#endregion
|
|
33
46
|
//#region src/getDatetimeRuleProcessorJSONata.d.ts
|
|
34
47
|
/**
|
|
35
48
|
* Generates a rule processor with date/time features for use by
|
|
@@ -57,6 +70,19 @@ declare const datetimeValueProcessorNL: ValueProcessorByRule;
|
|
|
57
70
|
*/
|
|
58
71
|
declare const getDatetimeRuleProcessorNL: (apiFns: RQBDateTimeLibraryAPI) => RuleProcessor;
|
|
59
72
|
//#endregion
|
|
73
|
+
//#region src/getDatetimeRuleProcessorSPARQL.d.ts
|
|
74
|
+
/**
|
|
75
|
+
* Generates a rule processor with date/time features for use by
|
|
76
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} with the "sparql" format.
|
|
77
|
+
*
|
|
78
|
+
* Supports:
|
|
79
|
+
* - Standard comparison operators (`=`, `!=`, `<`, `>`, `<=`, `>=`)
|
|
80
|
+
* - Range operators (between, notBetween, in, notIn)
|
|
81
|
+
* - Duration math via custom operators: `olderThanDuration` and `withinDuration`
|
|
82
|
+
* (e.g., value `"P30D"` → `NOW() - ?field > "P30D"^^xsd:duration`)
|
|
83
|
+
*/
|
|
84
|
+
declare const getDatetimeRuleProcessorSPARQL: (apiFns: RQBDateTimeLibraryAPI) => RuleProcessor;
|
|
85
|
+
//#endregion
|
|
60
86
|
//#region src/getDatetimeRuleProcessorSQL.d.ts
|
|
61
87
|
/**
|
|
62
88
|
* Generates a value processor with date/time features for use by
|
|
@@ -104,5 +130,5 @@ declare const getDatetimeValueProcessorPostgreSQL: ({
|
|
|
104
130
|
*/
|
|
105
131
|
declare const getDatetimeRuleProcessorSQL: (apiFns: RQBDateTimeLibraryAPI) => RuleProcessor;
|
|
106
132
|
//#endregion
|
|
107
|
-
export { IsDateField, IsDateFieldFunction, RQBDateTimeJsonLogic, RQBDateTimeLibraryAPI, RQBJsonLogicDateAfter, RQBJsonLogicDateBefore, RQBJsonLogicDateBetween, RQBJsonLogicDateIn, RQBJsonLogicDateNotBetween, RQBJsonLogicDateNotIn, RQBJsonLogicDateNotOn, RQBJsonLogicDateOn, RQBJsonLogicDateOnOrAfter, RQBJsonLogicDateOnOrBefore, RQBJsonLogicDateTimeOperations, datetimeRuleProcessorJsonLogic, datetimeValueProcessorNL, defaultDateTimeNLOperatorMap, getDatetimeJsonLogicOperations, getDatetimeRuleProcessorCEL, getDatetimeRuleProcessorJSONata, getDatetimeRuleProcessorMongoDBQuery, getDatetimeRuleProcessorNL, getDatetimeRuleProcessorSQL, getDatetimeValueProcessorANSI, getDatetimeValueProcessorMSSQL, getDatetimeValueProcessorMySQL, getDatetimeValueProcessorOracle, getDatetimeValueProcessorPostgreSQL };
|
|
133
|
+
export { IsDateField, IsDateFieldFunction, RQBDateTimeJsonLogic, RQBDateTimeLibraryAPI, RQBJsonLogicDateAfter, RQBJsonLogicDateBefore, RQBJsonLogicDateBetween, RQBJsonLogicDateIn, RQBJsonLogicDateNotBetween, RQBJsonLogicDateNotIn, RQBJsonLogicDateNotOn, RQBJsonLogicDateOn, RQBJsonLogicDateOnOrAfter, RQBJsonLogicDateOnOrBefore, RQBJsonLogicDateTimeOperations, datetimeRuleProcessorJsonLogic, datetimeValueProcessorNL, defaultDateTimeNLOperatorMap, getDatetimeJsonLogicOperations, getDatetimeRuleProcessorCEL, getDatetimeRuleProcessorCypher, getDatetimeRuleProcessorJSONata, getDatetimeRuleProcessorMongoDBQuery, getDatetimeRuleProcessorNL, getDatetimeRuleProcessorSPARQL, getDatetimeRuleProcessorSQL, getDatetimeValueProcessorANSI, getDatetimeValueProcessorMSSQL, getDatetimeValueProcessorMySQL, getDatetimeValueProcessorOracle, getDatetimeValueProcessorPostgreSQL };
|
|
108
134
|
//# sourceMappingURL=react-querybuilder_datetime.production.d.mts.map
|
|
@@ -48,6 +48,14 @@ declare const datetimeRuleProcessorMongoDBQuery: ValueProcessorByRule;
|
|
|
48
48
|
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "natural_language" format using date-fns
|
|
49
49
|
*/
|
|
50
50
|
declare const datetimeRuleProcessorNL: ValueProcessorByRule;
|
|
51
|
+
/**
|
|
52
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "cypher"/"gql" format using date-fns
|
|
53
|
+
*/
|
|
54
|
+
declare const datetimeRuleProcessorCypher: ValueProcessorByRule;
|
|
55
|
+
/**
|
|
56
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "sparql" format using date-fns
|
|
57
|
+
*/
|
|
58
|
+
declare const datetimeRuleProcessorSPARQL: ValueProcessorByRule;
|
|
51
59
|
//#endregion
|
|
52
|
-
export { datetimeRuleProcessorCEL, datetimeRuleProcessorMongoDBQuery, datetimeRuleProcessorNL, datetimeRuleProcessorSQL, datetimeValueProcessorANSI, datetimeValueProcessorMSSQL, datetimeValueProcessorMySQL, datetimeValueProcessorOracle, datetimeValueProcessorPostgreSQL, jsonLogicDateTimeOperations, rqbDateTimeLibraryAPI };
|
|
60
|
+
export { datetimeRuleProcessorCEL, datetimeRuleProcessorCypher, datetimeRuleProcessorMongoDBQuery, datetimeRuleProcessorNL, datetimeRuleProcessorSPARQL, datetimeRuleProcessorSQL, datetimeValueProcessorANSI, datetimeValueProcessorMSSQL, datetimeValueProcessorMySQL, datetimeValueProcessorOracle, datetimeValueProcessorPostgreSQL, jsonLogicDateTimeOperations, rqbDateTimeLibraryAPI };
|
|
53
61
|
//# sourceMappingURL=react-querybuilder_datetime.production.date-fns.d.mts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,d as t,f as n,
|
|
1
|
+
import{a as e,d as t,f as n,h as r,i,m as a,n as o,o as s,p as c,r as l,s as u,t as d,u as f}from"./getDatetimeRuleProcessorSQL-CWqAiVwU.mjs";import{format as p,isAfter as m,isBefore as h,isSameDay as g,isValid as _,parseISO as v,toDate as y}from"date-fns";const b=e=>typeof e==`string`?v(e):y(e),x=`yyyy-MM-dd`,S={format:(e,t)=>p(b(e),t.replace(`YYYY-MM-DD`,x)),isAfter:m,isBefore:h,isSame:(e,t)=>{let n=b(e),i=b(t);return r(e)||r(t)?g(n,i):n.getTime()===i.getTime()},isValid:e=>_(b(e)),toDate:b,toISOString:e=>{let t=b(e);return _(t)?t.toISOString():``},toISOStringDateOnly:e=>{let t=b(e);return _(t)?p(t,x):``}},C=a(S),w=d(S),T=o(S),E=l(S),D=i(S),O=e(S),k=s(S),A=c(S),j=t(S),M=f(S),N=n(S),P=u(S);export{A as datetimeRuleProcessorCEL,N as datetimeRuleProcessorCypher,j as datetimeRuleProcessorMongoDBQuery,M as datetimeRuleProcessorNL,P as datetimeRuleProcessorSPARQL,w as datetimeRuleProcessorSQL,T as datetimeValueProcessorANSI,E as datetimeValueProcessorMSSQL,D as datetimeValueProcessorMySQL,O as datetimeValueProcessorOracle,k as datetimeValueProcessorPostgreSQL,C as jsonLogicDateTimeOperations,S as rqbDateTimeLibraryAPI};
|
|
2
2
|
//# sourceMappingURL=react-querybuilder_datetime.production.date-fns.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-querybuilder_datetime.production.date-fns.mjs","names":["toDate","dateFnsToDate"],"sources":["../src/rqbDateTimeLibraryAPI.date-fns.ts","../src/index.date-fns.ts"],"sourcesContent":["import {\n toDate as dateFnsToDate,\n format,\n isAfter,\n isBefore,\n isSameDay,\n isValid,\n parseISO,\n} from 'date-fns';\nimport type { RQBDateTimeLibraryAPI } from './types';\nimport { isISOStringDateOnly } from './utils';\n\nconst toDate: typeof dateFnsToDate = a => (typeof a === 'string' ? parseISO(a) : dateFnsToDate(a));\nconst iso8601DateOnly = 'yyyy-MM-dd';\n\n/**\n * {@link RQBDateTimeLibraryAPI} for date-fns\n */\nexport const rqbDateTimeLibraryAPI: RQBDateTimeLibraryAPI = {\n format: (d, fmt) => format(toDate(d), fmt.replace('YYYY-MM-DD', iso8601DateOnly)),\n isAfter,\n isBefore,\n isSame: (a, b) => {\n const aToDate = toDate(a);\n const bToDate = toDate(b);\n return isISOStringDateOnly(a) || isISOStringDateOnly(b)\n ? isSameDay(aToDate, bToDate)\n : aToDate.getTime() === bToDate.getTime();\n },\n isValid: d => isValid(toDate(d)),\n toDate,\n toISOString: d => {\n const dToDate = toDate(d);\n return isValid(dToDate) ? dToDate.toISOString() : '';\n },\n toISOStringDateOnly: d => {\n const dToDate = toDate(d);\n return isValid(dToDate) ? format(dToDate, iso8601DateOnly) : '';\n },\n};\n","/**\n * Import from `\"@react-querybuilder/datetime/date-fns\"` for enhanced date/time support using [date-fns](https://date-fns.org/).\n *\n * @module date-fns\n */\n\nimport type { RuleProcessor, ValueProcessorByRule } from 'react-querybuilder';\nimport { getDatetimeJsonLogicOperations } from './getDatetimeJsonLogicOperations';\nimport { getDatetimeRuleProcessorCEL } from './getDatetimeRuleProcessorCEL';\nimport { getDatetimeRuleProcessorMongoDBQuery } from './getDatetimeRuleProcessorMongoDBQuery';\nimport { getDatetimeRuleProcessorNL } from './getDatetimeRuleProcessorNL';\nimport {\n getDatetimeRuleProcessorSQL,\n getDatetimeValueProcessorANSI,\n getDatetimeValueProcessorMSSQL,\n getDatetimeValueProcessorMySQL,\n getDatetimeValueProcessorOracle,\n getDatetimeValueProcessorPostgreSQL,\n} from './getDatetimeRuleProcessorSQL';\nimport { rqbDateTimeLibraryAPI } from './rqbDateTimeLibraryAPI.date-fns';\nimport type { RQBJsonLogicDateTimeOperations } from './types';\n\n/**\n * Custom JsonLogic date/time operations using date-fns\n */\nexport const jsonLogicDateTimeOperations: RQBJsonLogicDateTimeOperations =\n getDatetimeJsonLogicOperations(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"sql\" format using date-fns\n */\nexport const datetimeRuleProcessorSQL: RuleProcessor =\n getDatetimeRuleProcessorSQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"ansi\" preset) using date-fns\n */\nexport const datetimeValueProcessorANSI: ValueProcessorByRule =\n getDatetimeValueProcessorANSI(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"mssql\" preset) using date-fns\n */\nexport const datetimeValueProcessorMSSQL: ValueProcessorByRule =\n getDatetimeValueProcessorMSSQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"mysql\" preset) using date-fns\n */\nexport const datetimeValueProcessorMySQL: ValueProcessorByRule =\n getDatetimeValueProcessorMySQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"oracle\" preset) using date-fns\n */\nexport const datetimeValueProcessorOracle: ValueProcessorByRule =\n getDatetimeValueProcessorOracle(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"postgresql\" preset) using date-fns\n */\nexport const datetimeValueProcessorPostgreSQL: ValueProcessorByRule =\n getDatetimeValueProcessorPostgreSQL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"cel\" format using date-fns\n */\nexport const datetimeRuleProcessorCEL: ValueProcessorByRule =\n getDatetimeRuleProcessorCEL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"mongodb_query\" format using date-fns\n */\nexport const datetimeRuleProcessorMongoDBQuery: ValueProcessorByRule =\n getDatetimeRuleProcessorMongoDBQuery(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"natural_language\" format using date-fns\n */\nexport const datetimeRuleProcessorNL: ValueProcessorByRule =\n getDatetimeRuleProcessorNL(rqbDateTimeLibraryAPI);\n\nexport * from './rqbDateTimeLibraryAPI.date-fns';\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"react-querybuilder_datetime.production.date-fns.mjs","names":["toDate","dateFnsToDate"],"sources":["../src/rqbDateTimeLibraryAPI.date-fns.ts","../src/index.date-fns.ts"],"sourcesContent":["import {\n toDate as dateFnsToDate,\n format,\n isAfter,\n isBefore,\n isSameDay,\n isValid,\n parseISO,\n} from 'date-fns';\nimport type { RQBDateTimeLibraryAPI } from './types';\nimport { isISOStringDateOnly } from './utils';\n\nconst toDate: typeof dateFnsToDate = a => (typeof a === 'string' ? parseISO(a) : dateFnsToDate(a));\nconst iso8601DateOnly = 'yyyy-MM-dd';\n\n/**\n * {@link RQBDateTimeLibraryAPI} for date-fns\n */\nexport const rqbDateTimeLibraryAPI: RQBDateTimeLibraryAPI = {\n format: (d, fmt) => format(toDate(d), fmt.replace('YYYY-MM-DD', iso8601DateOnly)),\n isAfter,\n isBefore,\n isSame: (a, b) => {\n const aToDate = toDate(a);\n const bToDate = toDate(b);\n return isISOStringDateOnly(a) || isISOStringDateOnly(b)\n ? isSameDay(aToDate, bToDate)\n : aToDate.getTime() === bToDate.getTime();\n },\n isValid: d => isValid(toDate(d)),\n toDate,\n toISOString: d => {\n const dToDate = toDate(d);\n return isValid(dToDate) ? dToDate.toISOString() : '';\n },\n toISOStringDateOnly: d => {\n const dToDate = toDate(d);\n return isValid(dToDate) ? format(dToDate, iso8601DateOnly) : '';\n },\n};\n","/**\n * Import from `\"@react-querybuilder/datetime/date-fns\"` for enhanced date/time support using [date-fns](https://date-fns.org/).\n *\n * @module date-fns\n */\n\nimport type { RuleProcessor, ValueProcessorByRule } from 'react-querybuilder';\nimport { getDatetimeJsonLogicOperations } from './getDatetimeJsonLogicOperations';\nimport { getDatetimeRuleProcessorCEL } from './getDatetimeRuleProcessorCEL';\nimport { getDatetimeRuleProcessorCypher } from './getDatetimeRuleProcessorCypher';\nimport { getDatetimeRuleProcessorMongoDBQuery } from './getDatetimeRuleProcessorMongoDBQuery';\nimport { getDatetimeRuleProcessorNL } from './getDatetimeRuleProcessorNL';\nimport { getDatetimeRuleProcessorSPARQL } from './getDatetimeRuleProcessorSPARQL';\nimport {\n getDatetimeRuleProcessorSQL,\n getDatetimeValueProcessorANSI,\n getDatetimeValueProcessorMSSQL,\n getDatetimeValueProcessorMySQL,\n getDatetimeValueProcessorOracle,\n getDatetimeValueProcessorPostgreSQL,\n} from './getDatetimeRuleProcessorSQL';\nimport { rqbDateTimeLibraryAPI } from './rqbDateTimeLibraryAPI.date-fns';\nimport type { RQBJsonLogicDateTimeOperations } from './types';\n\n/**\n * Custom JsonLogic date/time operations using date-fns\n */\nexport const jsonLogicDateTimeOperations: RQBJsonLogicDateTimeOperations =\n getDatetimeJsonLogicOperations(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"sql\" format using date-fns\n */\nexport const datetimeRuleProcessorSQL: RuleProcessor =\n getDatetimeRuleProcessorSQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"ansi\" preset) using date-fns\n */\nexport const datetimeValueProcessorANSI: ValueProcessorByRule =\n getDatetimeValueProcessorANSI(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"mssql\" preset) using date-fns\n */\nexport const datetimeValueProcessorMSSQL: ValueProcessorByRule =\n getDatetimeValueProcessorMSSQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"mysql\" preset) using date-fns\n */\nexport const datetimeValueProcessorMySQL: ValueProcessorByRule =\n getDatetimeValueProcessorMySQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"oracle\" preset) using date-fns\n */\nexport const datetimeValueProcessorOracle: ValueProcessorByRule =\n getDatetimeValueProcessorOracle(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"postgresql\" preset) using date-fns\n */\nexport const datetimeValueProcessorPostgreSQL: ValueProcessorByRule =\n getDatetimeValueProcessorPostgreSQL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"cel\" format using date-fns\n */\nexport const datetimeRuleProcessorCEL: ValueProcessorByRule =\n getDatetimeRuleProcessorCEL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"mongodb_query\" format using date-fns\n */\nexport const datetimeRuleProcessorMongoDBQuery: ValueProcessorByRule =\n getDatetimeRuleProcessorMongoDBQuery(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"natural_language\" format using date-fns\n */\nexport const datetimeRuleProcessorNL: ValueProcessorByRule =\n getDatetimeRuleProcessorNL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"cypher\"/\"gql\" format using date-fns\n */\nexport const datetimeRuleProcessorCypher: ValueProcessorByRule =\n getDatetimeRuleProcessorCypher(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"sparql\" format using date-fns\n */\nexport const datetimeRuleProcessorSPARQL: ValueProcessorByRule =\n getDatetimeRuleProcessorSPARQL(rqbDateTimeLibraryAPI);\n\nexport * from './rqbDateTimeLibraryAPI.date-fns';\n"],"mappings":"iQAYA,MAAMA,EAA+B,GAAM,OAAO,GAAM,SAAW,EAAS,EAAE,CAAGC,EAAc,EAAE,CAC3F,EAAkB,aAKX,EAA+C,CAC1D,QAAS,EAAG,IAAQ,EAAOD,EAAO,EAAE,CAAE,EAAI,QAAQ,aAAc,EAAgB,CAAC,CACjF,UACA,WACA,QAAS,EAAG,IAAM,CAChB,IAAM,EAAUA,EAAO,EAAE,CACnB,EAAUA,EAAO,EAAE,CACzB,OAAO,EAAoB,EAAE,EAAI,EAAoB,EAAE,CACnD,EAAU,EAAS,EAAQ,CAC3B,EAAQ,SAAS,GAAK,EAAQ,SAAS,EAE7C,QAAS,GAAK,EAAQA,EAAO,EAAE,CAAC,CAChC,OAAA,EACA,YAAa,GAAK,CAChB,IAAM,EAAUA,EAAO,EAAE,CACzB,OAAO,EAAQ,EAAQ,CAAG,EAAQ,aAAa,CAAG,IAEpD,oBAAqB,GAAK,CACxB,IAAM,EAAUA,EAAO,EAAE,CACzB,OAAO,EAAQ,EAAQ,CAAG,EAAO,EAAS,EAAgB,CAAG,IAEhE,CCZY,EACX,EAA+B,EAAsB,CAK1C,EACX,EAA4B,EAAsB,CAIvC,EACX,EAA8B,EAAsB,CAIzC,EACX,EAA+B,EAAsB,CAI1C,EACX,EAA+B,EAAsB,CAI1C,EACX,EAAgC,EAAsB,CAI3C,EACX,EAAoC,EAAsB,CAK/C,EACX,EAA4B,EAAsB,CAKvC,EACX,EAAqC,EAAsB,CAKhD,EACX,EAA2B,EAAsB,CAKtC,EACX,EAA+B,EAAsB,CAK1C,EACX,EAA+B,EAAsB"}
|
|
@@ -48,6 +48,14 @@ declare const datetimeRuleProcessorMongoDBQuery: ValueProcessorByRule;
|
|
|
48
48
|
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "natural_language" format using Day.js
|
|
49
49
|
*/
|
|
50
50
|
declare const datetimeRuleProcessorNL: ValueProcessorByRule;
|
|
51
|
+
/**
|
|
52
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "cypher"/"gql" format using Day.js
|
|
53
|
+
*/
|
|
54
|
+
declare const datetimeRuleProcessorCypher: ValueProcessorByRule;
|
|
55
|
+
/**
|
|
56
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "sparql" format using Day.js
|
|
57
|
+
*/
|
|
58
|
+
declare const datetimeRuleProcessorSPARQL: ValueProcessorByRule;
|
|
51
59
|
//#endregion
|
|
52
|
-
export { datetimeRuleProcessorCEL, datetimeRuleProcessorMongoDBQuery, datetimeRuleProcessorNL, datetimeRuleProcessorSQL, datetimeValueProcessorANSI, datetimeValueProcessorMSSQL, datetimeValueProcessorMySQL, datetimeValueProcessorOracle, datetimeValueProcessorPostgreSQL, jsonLogicDateTimeOperations, rqbDateTimeLibraryAPI };
|
|
60
|
+
export { datetimeRuleProcessorCEL, datetimeRuleProcessorCypher, datetimeRuleProcessorMongoDBQuery, datetimeRuleProcessorNL, datetimeRuleProcessorSPARQL, datetimeRuleProcessorSQL, datetimeValueProcessorANSI, datetimeValueProcessorMSSQL, datetimeValueProcessorMySQL, datetimeValueProcessorOracle, datetimeValueProcessorPostgreSQL, jsonLogicDateTimeOperations, rqbDateTimeLibraryAPI };
|
|
53
61
|
//# sourceMappingURL=react-querybuilder_datetime.production.dayjs.d.mts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,d as t,f as n,
|
|
1
|
+
import{a as e,d as t,f as n,h as r,i,m as a,n as o,o as s,p as c,r as l,s as u,t as d,u as f}from"./getDatetimeRuleProcessorSQL-CWqAiVwU.mjs";import p from"dayjs";const m={format:(e,t)=>p(e).format(t),isAfter:(e,t)=>p(e).isAfter(t),isBefore:(e,t)=>p(e).isBefore(t),isSame:(e,t)=>p(e).isSame(t,r(e)||r(t)?`d`:`ms`),isValid:e=>p(e).isValid(),toDate:e=>p(e).toDate(),toISOString:e=>{let t=p(e);return t.isValid()?t.toISOString():``},toISOStringDateOnly:e=>{let t=p(e);return t.isValid()?t.format(`YYYY-MM-DD`):``}},h=a(m),g=d(m),_=o(m),v=l(m),y=i(m),b=e(m),x=s(m),S=c(m),C=t(m),w=f(m),T=n(m),E=u(m);export{S as datetimeRuleProcessorCEL,T as datetimeRuleProcessorCypher,C as datetimeRuleProcessorMongoDBQuery,w as datetimeRuleProcessorNL,E as datetimeRuleProcessorSPARQL,g as datetimeRuleProcessorSQL,_ as datetimeValueProcessorANSI,v as datetimeValueProcessorMSSQL,y as datetimeValueProcessorMySQL,b as datetimeValueProcessorOracle,x as datetimeValueProcessorPostgreSQL,h as jsonLogicDateTimeOperations,m as rqbDateTimeLibraryAPI};
|
|
2
2
|
//# sourceMappingURL=react-querybuilder_datetime.production.dayjs.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-querybuilder_datetime.production.dayjs.mjs","names":[],"sources":["../src/rqbDateTimeLibraryAPI.dayjs.ts","../src/index.dayjs.ts"],"sourcesContent":["import dayjs from 'dayjs';\nimport type { RQBDateTimeLibraryAPI } from './types';\nimport { isISOStringDateOnly } from './utils';\n\n/**\n * {@link RQBDateTimeLibraryAPI} for Day.js\n */\nexport const rqbDateTimeLibraryAPI: RQBDateTimeLibraryAPI = {\n format: (d, fmt) => dayjs(d).format(fmt),\n isAfter: (a, b) => dayjs(a).isAfter(b),\n isBefore: (a, b) => dayjs(a).isBefore(b),\n isSame: (a, b) =>\n dayjs(a).isSame(b, isISOStringDateOnly(a) || isISOStringDateOnly(b) ? 'd' : 'ms'),\n isValid: d => dayjs(d).isValid(),\n toDate: d => dayjs(d).toDate(),\n toISOString: d => {\n const dToDate = dayjs(d);\n return dToDate.isValid() ? dToDate.toISOString() : '';\n },\n toISOStringDateOnly: d => {\n const dToDate = dayjs(d);\n return dToDate.isValid() ? dToDate.format('YYYY-MM-DD') : '';\n },\n};\n","/**\n * Import from `\"@react-querybuilder/datetime/dayjs\"` for enhanced date/time support using [Day.js](https://day.js.org/).\n *\n * @module dayjs\n */\n\nimport type { RuleProcessor, ValueProcessorByRule } from 'react-querybuilder';\nimport { getDatetimeJsonLogicOperations } from './getDatetimeJsonLogicOperations';\nimport { getDatetimeRuleProcessorCEL } from './getDatetimeRuleProcessorCEL';\nimport { getDatetimeRuleProcessorMongoDBQuery } from './getDatetimeRuleProcessorMongoDBQuery';\nimport { getDatetimeRuleProcessorNL } from './getDatetimeRuleProcessorNL';\nimport {\n getDatetimeRuleProcessorSQL,\n getDatetimeValueProcessorANSI,\n getDatetimeValueProcessorMSSQL,\n getDatetimeValueProcessorMySQL,\n getDatetimeValueProcessorOracle,\n getDatetimeValueProcessorPostgreSQL,\n} from './getDatetimeRuleProcessorSQL';\nimport { rqbDateTimeLibraryAPI } from './rqbDateTimeLibraryAPI.dayjs';\nimport type { RQBJsonLogicDateTimeOperations } from './types';\n\n/**\n * Custom JsonLogic date/time operations using Day.js\n */\nexport const jsonLogicDateTimeOperations: RQBJsonLogicDateTimeOperations =\n getDatetimeJsonLogicOperations(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"sql\" format using Day.js\n */\nexport const datetimeRuleProcessorSQL: RuleProcessor =\n getDatetimeRuleProcessorSQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"ansi\" preset) using Day.js\n */\nexport const datetimeValueProcessorANSI: ValueProcessorByRule =\n getDatetimeValueProcessorANSI(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"mssql\" preset) using Day.js\n */\nexport const datetimeValueProcessorMSSQL: ValueProcessorByRule =\n getDatetimeValueProcessorMSSQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"mysql\" preset) using Day.js\n */\nexport const datetimeValueProcessorMySQL: ValueProcessorByRule =\n getDatetimeValueProcessorMySQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"oracle\" preset) using Day.js\n */\nexport const datetimeValueProcessorOracle: ValueProcessorByRule =\n getDatetimeValueProcessorOracle(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"postgresql\" preset) using Day.js\n */\nexport const datetimeValueProcessorPostgreSQL: ValueProcessorByRule =\n getDatetimeValueProcessorPostgreSQL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"cel\" format using Day.js\n */\nexport const datetimeRuleProcessorCEL: ValueProcessorByRule =\n getDatetimeRuleProcessorCEL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"mongodb_query\" format using Day.js\n */\nexport const datetimeRuleProcessorMongoDBQuery: ValueProcessorByRule =\n getDatetimeRuleProcessorMongoDBQuery(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"natural_language\" format using Day.js\n */\nexport const datetimeRuleProcessorNL: ValueProcessorByRule =\n getDatetimeRuleProcessorNL(rqbDateTimeLibraryAPI);\n\nexport * from './rqbDateTimeLibraryAPI.dayjs';\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"react-querybuilder_datetime.production.dayjs.mjs","names":[],"sources":["../src/rqbDateTimeLibraryAPI.dayjs.ts","../src/index.dayjs.ts"],"sourcesContent":["import dayjs from 'dayjs';\nimport type { RQBDateTimeLibraryAPI } from './types';\nimport { isISOStringDateOnly } from './utils';\n\n/**\n * {@link RQBDateTimeLibraryAPI} for Day.js\n */\nexport const rqbDateTimeLibraryAPI: RQBDateTimeLibraryAPI = {\n format: (d, fmt) => dayjs(d).format(fmt),\n isAfter: (a, b) => dayjs(a).isAfter(b),\n isBefore: (a, b) => dayjs(a).isBefore(b),\n isSame: (a, b) =>\n dayjs(a).isSame(b, isISOStringDateOnly(a) || isISOStringDateOnly(b) ? 'd' : 'ms'),\n isValid: d => dayjs(d).isValid(),\n toDate: d => dayjs(d).toDate(),\n toISOString: d => {\n const dToDate = dayjs(d);\n return dToDate.isValid() ? dToDate.toISOString() : '';\n },\n toISOStringDateOnly: d => {\n const dToDate = dayjs(d);\n return dToDate.isValid() ? dToDate.format('YYYY-MM-DD') : '';\n },\n};\n","/**\n * Import from `\"@react-querybuilder/datetime/dayjs\"` for enhanced date/time support using [Day.js](https://day.js.org/).\n *\n * @module dayjs\n */\n\nimport type { RuleProcessor, ValueProcessorByRule } from 'react-querybuilder';\nimport { getDatetimeJsonLogicOperations } from './getDatetimeJsonLogicOperations';\nimport { getDatetimeRuleProcessorCEL } from './getDatetimeRuleProcessorCEL';\nimport { getDatetimeRuleProcessorCypher } from './getDatetimeRuleProcessorCypher';\nimport { getDatetimeRuleProcessorMongoDBQuery } from './getDatetimeRuleProcessorMongoDBQuery';\nimport { getDatetimeRuleProcessorNL } from './getDatetimeRuleProcessorNL';\nimport { getDatetimeRuleProcessorSPARQL } from './getDatetimeRuleProcessorSPARQL';\nimport {\n getDatetimeRuleProcessorSQL,\n getDatetimeValueProcessorANSI,\n getDatetimeValueProcessorMSSQL,\n getDatetimeValueProcessorMySQL,\n getDatetimeValueProcessorOracle,\n getDatetimeValueProcessorPostgreSQL,\n} from './getDatetimeRuleProcessorSQL';\nimport { rqbDateTimeLibraryAPI } from './rqbDateTimeLibraryAPI.dayjs';\nimport type { RQBJsonLogicDateTimeOperations } from './types';\n\n/**\n * Custom JsonLogic date/time operations using Day.js\n */\nexport const jsonLogicDateTimeOperations: RQBJsonLogicDateTimeOperations =\n getDatetimeJsonLogicOperations(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"sql\" format using Day.js\n */\nexport const datetimeRuleProcessorSQL: RuleProcessor =\n getDatetimeRuleProcessorSQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"ansi\" preset) using Day.js\n */\nexport const datetimeValueProcessorANSI: ValueProcessorByRule =\n getDatetimeValueProcessorANSI(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"mssql\" preset) using Day.js\n */\nexport const datetimeValueProcessorMSSQL: ValueProcessorByRule =\n getDatetimeValueProcessorMSSQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"mysql\" preset) using Day.js\n */\nexport const datetimeValueProcessorMySQL: ValueProcessorByRule =\n getDatetimeValueProcessorMySQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"oracle\" preset) using Day.js\n */\nexport const datetimeValueProcessorOracle: ValueProcessorByRule =\n getDatetimeValueProcessorOracle(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"postgresql\" preset) using Day.js\n */\nexport const datetimeValueProcessorPostgreSQL: ValueProcessorByRule =\n getDatetimeValueProcessorPostgreSQL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"cel\" format using Day.js\n */\nexport const datetimeRuleProcessorCEL: ValueProcessorByRule =\n getDatetimeRuleProcessorCEL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"mongodb_query\" format using Day.js\n */\nexport const datetimeRuleProcessorMongoDBQuery: ValueProcessorByRule =\n getDatetimeRuleProcessorMongoDBQuery(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"natural_language\" format using Day.js\n */\nexport const datetimeRuleProcessorNL: ValueProcessorByRule =\n getDatetimeRuleProcessorNL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"cypher\"/\"gql\" format using Day.js\n */\nexport const datetimeRuleProcessorCypher: ValueProcessorByRule =\n getDatetimeRuleProcessorCypher(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"sparql\" format using Day.js\n */\nexport const datetimeRuleProcessorSPARQL: ValueProcessorByRule =\n getDatetimeRuleProcessorSPARQL(rqbDateTimeLibraryAPI);\n\nexport * from './rqbDateTimeLibraryAPI.dayjs';\n"],"mappings":"mKAOA,MAAa,EAA+C,CAC1D,QAAS,EAAG,IAAQ,EAAM,EAAE,CAAC,OAAO,EAAI,CACxC,SAAU,EAAG,IAAM,EAAM,EAAE,CAAC,QAAQ,EAAE,CACtC,UAAW,EAAG,IAAM,EAAM,EAAE,CAAC,SAAS,EAAE,CACxC,QAAS,EAAG,IACV,EAAM,EAAE,CAAC,OAAO,EAAG,EAAoB,EAAE,EAAI,EAAoB,EAAE,CAAG,IAAM,KAAK,CACnF,QAAS,GAAK,EAAM,EAAE,CAAC,SAAS,CAChC,OAAQ,GAAK,EAAM,EAAE,CAAC,QAAQ,CAC9B,YAAa,GAAK,CAChB,IAAM,EAAU,EAAM,EAAE,CACxB,OAAO,EAAQ,SAAS,CAAG,EAAQ,aAAa,CAAG,IAErD,oBAAqB,GAAK,CACxB,IAAM,EAAU,EAAM,EAAE,CACxB,OAAO,EAAQ,SAAS,CAAG,EAAQ,OAAO,aAAa,CAAG,IAE7D,CCIY,EACX,EAA+B,EAAsB,CAK1C,EACX,EAA4B,EAAsB,CAIvC,EACX,EAA8B,EAAsB,CAIzC,EACX,EAA+B,EAAsB,CAI1C,EACX,EAA+B,EAAsB,CAI1C,EACX,EAAgC,EAAsB,CAI3C,EACX,EAAoC,EAAsB,CAK/C,EACX,EAA4B,EAAsB,CAKvC,EACX,EAAqC,EAAsB,CAKhD,EACX,EAA2B,EAAsB,CAKtC,EACX,EAA+B,EAAsB,CAK1C,EACX,EAA+B,EAAsB"}
|
|
@@ -51,6 +51,14 @@ declare const datetimeRuleProcessorMongoDBQuery: RuleProcessor;
|
|
|
51
51
|
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "natural_language" format using JavaScript `Date`
|
|
52
52
|
*/
|
|
53
53
|
declare const datetimeRuleProcessorNL: ValueProcessorByRule;
|
|
54
|
+
/**
|
|
55
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "cypher"/"gql" format using JavaScript `Date`
|
|
56
|
+
*/
|
|
57
|
+
declare const datetimeRuleProcessorCypher: RuleProcessor;
|
|
58
|
+
/**
|
|
59
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "sparql" format using JavaScript `Date`
|
|
60
|
+
*/
|
|
61
|
+
declare const datetimeRuleProcessorSPARQL: RuleProcessor;
|
|
54
62
|
//#endregion
|
|
55
|
-
export { datetimeRuleProcessorCEL, datetimeRuleProcessorMongoDBQuery, datetimeRuleProcessorNL, datetimeRuleProcessorSQL, datetimeValueProcessorANSI, datetimeValueProcessorMSSQL, datetimeValueProcessorMySQL, datetimeValueProcessorOracle, datetimeValueProcessorPostgreSQL, jsonLogicDateTimeOperations, rqbDateTimeLibraryAPI };
|
|
63
|
+
export { datetimeRuleProcessorCEL, datetimeRuleProcessorCypher, datetimeRuleProcessorMongoDBQuery, datetimeRuleProcessorNL, datetimeRuleProcessorSPARQL, datetimeRuleProcessorSQL, datetimeValueProcessorANSI, datetimeValueProcessorMSSQL, datetimeValueProcessorMySQL, datetimeValueProcessorOracle, datetimeValueProcessorPostgreSQL, jsonLogicDateTimeOperations, rqbDateTimeLibraryAPI };
|
|
56
64
|
//# sourceMappingURL=react-querybuilder_datetime.production.jsdate.d.mts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,d as t,f as n,
|
|
1
|
+
import{a as e,d as t,f as n,h as r,i,m as a,n as o,o as s,p as c,r as l,s as u,t as d,u as f}from"./getDatetimeRuleProcessorSQL-CWqAiVwU.mjs";const p=new Date(NaN),m=/^(\d{4})-(\d{2})-(\d{2})([T ](\d{2}):(\d{2}):(\d{2})(\.(\d{1,3}))?)?/,h=e=>{if(e instanceof Date)return e;let t=m.exec(e);if(!t)return p;let[n,r,i,a,o,s,c,l,u,d]=t,[f,h,g,_,v,y,b]=[r,i,a,s,c,l,d??`0`].filter(Boolean).map(Number),x=h-1;return s?new Date(Date.UTC(f,x,g,_,v,y,b)):new Date(f,x,g)},g=e=>{let t=h(e);return t instanceof Date&&!Number.isNaN(t.getTime())},_=e=>{let t=h(e);return g(t)?t.toISOString().slice(0,10):``},v={format:e=>h(e).toISOString(),isAfter:(e,t)=>{let n=h(e).getTime(),r=h(t).getTime();return!Number.isNaN(n)&&!Number.isNaN(r)&&n>r},isBefore:(e,t)=>{let n=h(e).getTime(),r=h(t).getTime();return!Number.isNaN(n)&&!Number.isNaN(r)&&n<r},isSame:(e,t)=>{let n=h(e),i=h(t);return r(e)||r(t)?_(e)===_(t):n.getTime()===i.getTime()},isValid:g,toDate:h,toISOString:e=>{let t=h(e);return g(t)?t.toISOString():``},toISOStringDateOnly:_},y=a(v),b=d(v),x=o(v),S=l(v),C=i(v),w=e(v),T=s(v),E=c(v),D=t(v),O=f(v),k=n(v),A=u(v);export{E as datetimeRuleProcessorCEL,k as datetimeRuleProcessorCypher,D as datetimeRuleProcessorMongoDBQuery,O as datetimeRuleProcessorNL,A as datetimeRuleProcessorSPARQL,b as datetimeRuleProcessorSQL,x as datetimeValueProcessorANSI,S as datetimeValueProcessorMSSQL,C as datetimeValueProcessorMySQL,w as datetimeValueProcessorOracle,T as datetimeValueProcessorPostgreSQL,y as jsonLogicDateTimeOperations,v as rqbDateTimeLibraryAPI};
|
|
2
2
|
//# sourceMappingURL=react-querybuilder_datetime.production.jsdate.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-querybuilder_datetime.production.jsdate.mjs","names":[],"sources":["../src/rqbDateTimeLibraryAPI.jsdate.ts","../src/index.jsdate.ts"],"sourcesContent":["import type { RQBDateTimeLibraryAPI } from './types';\nimport { isISOStringDateOnly } from './utils';\n\nconst invalidDate = new Date(Number.NaN);\n\nconst dateRegExp = /^(\\d{4})-(\\d{2})-(\\d{2})([T ](\\d{2}):(\\d{2}):(\\d{2})(\\.(\\d{1,3}))?)?/;\n\nconst toDate = (d: string | Date) => {\n if (d instanceof Date) return d;\n\n const reMatch = dateRegExp.exec(d);\n\n if (!reMatch) return invalidDate;\n\n const [_all, yyyy, mm, dd, _time, hh, mi, ss, _decimal, sss] = reMatch;\n const [year, month, day, hours, minutes, seconds, ms] = [yyyy, mm, dd, hh, mi, ss, sss ?? '0']\n .filter(Boolean)\n .map(Number);\n\n const monthIndex = month - 1;\n\n return hh\n ? new Date(Date.UTC(year, monthIndex, day, hours, minutes, seconds, ms))\n : new Date(year, monthIndex, day);\n};\n\nconst isValid = (d: string | Date) => {\n const dToDate = toDate(d);\n return dToDate instanceof Date && !Number.isNaN(dToDate.getTime());\n};\n\nconst toISOStringDateOnly = (d: string | Date) => {\n const dToDate = toDate(d);\n return isValid(dToDate) ? dToDate.toISOString().slice(0, 10) : '';\n};\n\n/**\n * {@link RQBDateTimeLibraryAPI} for JavaScript `Date`\n *\n * @deprecated This API will not be removed, but we recommend using one of the other\n * {@link RQBDateTimeLibraryAPI}s based on a popular library instead.\n */\nexport const rqbDateTimeLibraryAPI: RQBDateTimeLibraryAPI = {\n format: d => toDate(d).toISOString(),\n isAfter: (a, b) => {\n const dateA = toDate(a).getTime();\n const dateB = toDate(b).getTime();\n return !Number.isNaN(dateA) && !Number.isNaN(dateB) && dateA > dateB;\n },\n isBefore: (a, b) => {\n const dateA = toDate(a).getTime();\n const dateB = toDate(b).getTime();\n return !Number.isNaN(dateA) && !Number.isNaN(dateB) && dateA < dateB;\n },\n isSame: (a, b) => {\n const aToDate = toDate(a);\n const bToDate = toDate(b);\n return isISOStringDateOnly(a) || isISOStringDateOnly(b)\n ? toISOStringDateOnly(a) === toISOStringDateOnly(b)\n : aToDate.getTime() === bToDate.getTime();\n },\n isValid,\n toDate,\n toISOString: d => {\n const dToDate = toDate(d);\n return isValid(dToDate) ? dToDate.toISOString() : '';\n },\n toISOStringDateOnly,\n};\n","/**\n * Import from `\"@react-querybuilder/datetime/jsdate\"` for enhanced date/time support using a custom JavaScript `Date`-based library.\n *\n * @module jsdate\n */\n\nimport type { RuleProcessor, ValueProcessorByRule } from 'react-querybuilder';\nimport { getDatetimeJsonLogicOperations } from './getDatetimeJsonLogicOperations';\nimport { getDatetimeRuleProcessorCEL } from './getDatetimeRuleProcessorCEL';\nimport { getDatetimeRuleProcessorMongoDBQuery } from './getDatetimeRuleProcessorMongoDBQuery';\nimport { getDatetimeRuleProcessorNL } from './getDatetimeRuleProcessorNL';\nimport {\n getDatetimeRuleProcessorSQL,\n getDatetimeValueProcessorANSI,\n getDatetimeValueProcessorMSSQL,\n getDatetimeValueProcessorMySQL,\n getDatetimeValueProcessorOracle,\n getDatetimeValueProcessorPostgreSQL,\n} from './getDatetimeRuleProcessorSQL';\nimport { rqbDateTimeLibraryAPI } from './rqbDateTimeLibraryAPI.jsdate';\nimport type { RQBJsonLogicDateTimeOperations } from './types';\n\n/**\n * Custom JsonLogic date/time operations using JavaScript `Date`.\n */\nexport const jsonLogicDateTimeOperations: RQBJsonLogicDateTimeOperations =\n getDatetimeJsonLogicOperations(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"sql\" format using JavaScript `Date`\n */\nexport const datetimeRuleProcessorSQL: RuleProcessor =\n getDatetimeRuleProcessorSQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"ansi\" preset) using JavaScript `Date`\n */\nexport const datetimeValueProcessorANSI: ValueProcessorByRule =\n getDatetimeValueProcessorANSI(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"mssql\" preset) using JavaScript `Date`\n */\nexport const datetimeValueProcessorMSSQL: ValueProcessorByRule =\n getDatetimeValueProcessorMSSQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"mysql\" preset) using JavaScript `Date`\n */\nexport const datetimeValueProcessorMySQL: ValueProcessorByRule =\n getDatetimeValueProcessorMySQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"oracle\" preset) using JavaScript `Date`\n */\nexport const datetimeValueProcessorOracle: ValueProcessorByRule =\n getDatetimeValueProcessorOracle(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"postgresql\" preset) using JavaScript `Date`\n */\nexport const datetimeValueProcessorPostgreSQL: ValueProcessorByRule =\n getDatetimeValueProcessorPostgreSQL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"cel\" format using JavaScript `Date`\n */\nexport const datetimeRuleProcessorCEL: RuleProcessor =\n getDatetimeRuleProcessorCEL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"mongodb_query\" format using JavaScript `Date`\n */\nexport const datetimeRuleProcessorMongoDBQuery: RuleProcessor =\n getDatetimeRuleProcessorMongoDBQuery(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"natural_language\" format using JavaScript `Date`\n */\nexport const datetimeRuleProcessorNL: ValueProcessorByRule =\n getDatetimeRuleProcessorNL(rqbDateTimeLibraryAPI);\n\nexport * from './rqbDateTimeLibraryAPI.jsdate';\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"react-querybuilder_datetime.production.jsdate.mjs","names":[],"sources":["../src/rqbDateTimeLibraryAPI.jsdate.ts","../src/index.jsdate.ts"],"sourcesContent":["import type { RQBDateTimeLibraryAPI } from './types';\nimport { isISOStringDateOnly } from './utils';\n\nconst invalidDate = new Date(Number.NaN);\n\nconst dateRegExp = /^(\\d{4})-(\\d{2})-(\\d{2})([T ](\\d{2}):(\\d{2}):(\\d{2})(\\.(\\d{1,3}))?)?/;\n\nconst toDate = (d: string | Date) => {\n if (d instanceof Date) return d;\n\n const reMatch = dateRegExp.exec(d);\n\n if (!reMatch) return invalidDate;\n\n const [_all, yyyy, mm, dd, _time, hh, mi, ss, _decimal, sss] = reMatch;\n const [year, month, day, hours, minutes, seconds, ms] = [yyyy, mm, dd, hh, mi, ss, sss ?? '0']\n .filter(Boolean)\n .map(Number);\n\n const monthIndex = month - 1;\n\n return hh\n ? new Date(Date.UTC(year, monthIndex, day, hours, minutes, seconds, ms))\n : new Date(year, monthIndex, day);\n};\n\nconst isValid = (d: string | Date) => {\n const dToDate = toDate(d);\n return dToDate instanceof Date && !Number.isNaN(dToDate.getTime());\n};\n\nconst toISOStringDateOnly = (d: string | Date) => {\n const dToDate = toDate(d);\n return isValid(dToDate) ? dToDate.toISOString().slice(0, 10) : '';\n};\n\n/**\n * {@link RQBDateTimeLibraryAPI} for JavaScript `Date`\n *\n * @deprecated This API will not be removed, but we recommend using one of the other\n * {@link RQBDateTimeLibraryAPI}s based on a popular library instead.\n */\nexport const rqbDateTimeLibraryAPI: RQBDateTimeLibraryAPI = {\n format: d => toDate(d).toISOString(),\n isAfter: (a, b) => {\n const dateA = toDate(a).getTime();\n const dateB = toDate(b).getTime();\n return !Number.isNaN(dateA) && !Number.isNaN(dateB) && dateA > dateB;\n },\n isBefore: (a, b) => {\n const dateA = toDate(a).getTime();\n const dateB = toDate(b).getTime();\n return !Number.isNaN(dateA) && !Number.isNaN(dateB) && dateA < dateB;\n },\n isSame: (a, b) => {\n const aToDate = toDate(a);\n const bToDate = toDate(b);\n return isISOStringDateOnly(a) || isISOStringDateOnly(b)\n ? toISOStringDateOnly(a) === toISOStringDateOnly(b)\n : aToDate.getTime() === bToDate.getTime();\n },\n isValid,\n toDate,\n toISOString: d => {\n const dToDate = toDate(d);\n return isValid(dToDate) ? dToDate.toISOString() : '';\n },\n toISOStringDateOnly,\n};\n","/**\n * Import from `\"@react-querybuilder/datetime/jsdate\"` for enhanced date/time support using a custom JavaScript `Date`-based library.\n *\n * @module jsdate\n */\n\nimport type { RuleProcessor, ValueProcessorByRule } from 'react-querybuilder';\nimport { getDatetimeJsonLogicOperations } from './getDatetimeJsonLogicOperations';\nimport { getDatetimeRuleProcessorCEL } from './getDatetimeRuleProcessorCEL';\nimport { getDatetimeRuleProcessorCypher } from './getDatetimeRuleProcessorCypher';\nimport { getDatetimeRuleProcessorMongoDBQuery } from './getDatetimeRuleProcessorMongoDBQuery';\nimport { getDatetimeRuleProcessorNL } from './getDatetimeRuleProcessorNL';\nimport { getDatetimeRuleProcessorSPARQL } from './getDatetimeRuleProcessorSPARQL';\nimport {\n getDatetimeRuleProcessorSQL,\n getDatetimeValueProcessorANSI,\n getDatetimeValueProcessorMSSQL,\n getDatetimeValueProcessorMySQL,\n getDatetimeValueProcessorOracle,\n getDatetimeValueProcessorPostgreSQL,\n} from './getDatetimeRuleProcessorSQL';\nimport { rqbDateTimeLibraryAPI } from './rqbDateTimeLibraryAPI.jsdate';\nimport type { RQBJsonLogicDateTimeOperations } from './types';\n\n/**\n * Custom JsonLogic date/time operations using JavaScript `Date`.\n */\nexport const jsonLogicDateTimeOperations: RQBJsonLogicDateTimeOperations =\n getDatetimeJsonLogicOperations(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"sql\" format using JavaScript `Date`\n */\nexport const datetimeRuleProcessorSQL: RuleProcessor =\n getDatetimeRuleProcessorSQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"ansi\" preset) using JavaScript `Date`\n */\nexport const datetimeValueProcessorANSI: ValueProcessorByRule =\n getDatetimeValueProcessorANSI(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"mssql\" preset) using JavaScript `Date`\n */\nexport const datetimeValueProcessorMSSQL: ValueProcessorByRule =\n getDatetimeValueProcessorMSSQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"mysql\" preset) using JavaScript `Date`\n */\nexport const datetimeValueProcessorMySQL: ValueProcessorByRule =\n getDatetimeValueProcessorMySQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"oracle\" preset) using JavaScript `Date`\n */\nexport const datetimeValueProcessorOracle: ValueProcessorByRule =\n getDatetimeValueProcessorOracle(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"postgresql\" preset) using JavaScript `Date`\n */\nexport const datetimeValueProcessorPostgreSQL: ValueProcessorByRule =\n getDatetimeValueProcessorPostgreSQL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"cel\" format using JavaScript `Date`\n */\nexport const datetimeRuleProcessorCEL: RuleProcessor =\n getDatetimeRuleProcessorCEL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"mongodb_query\" format using JavaScript `Date`\n */\nexport const datetimeRuleProcessorMongoDBQuery: RuleProcessor =\n getDatetimeRuleProcessorMongoDBQuery(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"natural_language\" format using JavaScript `Date`\n */\nexport const datetimeRuleProcessorNL: ValueProcessorByRule =\n getDatetimeRuleProcessorNL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"cypher\"/\"gql\" format using JavaScript `Date`\n */\nexport const datetimeRuleProcessorCypher: RuleProcessor =\n getDatetimeRuleProcessorCypher(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"sparql\" format using JavaScript `Date`\n */\nexport const datetimeRuleProcessorSPARQL: RuleProcessor =\n getDatetimeRuleProcessorSPARQL(rqbDateTimeLibraryAPI);\n\nexport * from './rqbDateTimeLibraryAPI.jsdate';\n"],"mappings":"8IAGA,MAAM,EAAc,IAAI,KAAK,IAAW,CAElC,EAAa,uEAEb,EAAU,GAAqB,CACnC,GAAI,aAAa,KAAM,OAAO,EAE9B,IAAM,EAAU,EAAW,KAAK,EAAE,CAElC,GAAI,CAAC,EAAS,OAAO,EAErB,GAAM,CAAC,EAAM,EAAM,EAAI,EAAI,EAAO,EAAI,EAAI,EAAI,EAAU,GAAO,EACzD,CAAC,EAAM,EAAO,EAAK,EAAO,EAAS,EAAS,GAAM,CAAC,EAAM,EAAI,EAAI,EAAI,EAAI,EAAI,GAAO,IAAI,CAC3F,OAAO,QAAQ,CACf,IAAI,OAAO,CAER,EAAa,EAAQ,EAE3B,OAAO,EACH,IAAI,KAAK,KAAK,IAAI,EAAM,EAAY,EAAK,EAAO,EAAS,EAAS,EAAG,CAAC,CACtE,IAAI,KAAK,EAAM,EAAY,EAAI,EAG/B,EAAW,GAAqB,CACpC,IAAM,EAAU,EAAO,EAAE,CACzB,OAAO,aAAmB,MAAQ,CAAC,OAAO,MAAM,EAAQ,SAAS,CAAC,EAG9D,EAAuB,GAAqB,CAChD,IAAM,EAAU,EAAO,EAAE,CACzB,OAAO,EAAQ,EAAQ,CAAG,EAAQ,aAAa,CAAC,MAAM,EAAG,GAAG,CAAG,IASpD,EAA+C,CAC1D,OAAQ,GAAK,EAAO,EAAE,CAAC,aAAa,CACpC,SAAU,EAAG,IAAM,CACjB,IAAM,EAAQ,EAAO,EAAE,CAAC,SAAS,CAC3B,EAAQ,EAAO,EAAE,CAAC,SAAS,CACjC,MAAO,CAAC,OAAO,MAAM,EAAM,EAAI,CAAC,OAAO,MAAM,EAAM,EAAI,EAAQ,GAEjE,UAAW,EAAG,IAAM,CAClB,IAAM,EAAQ,EAAO,EAAE,CAAC,SAAS,CAC3B,EAAQ,EAAO,EAAE,CAAC,SAAS,CACjC,MAAO,CAAC,OAAO,MAAM,EAAM,EAAI,CAAC,OAAO,MAAM,EAAM,EAAI,EAAQ,GAEjE,QAAS,EAAG,IAAM,CAChB,IAAM,EAAU,EAAO,EAAE,CACnB,EAAU,EAAO,EAAE,CACzB,OAAO,EAAoB,EAAE,EAAI,EAAoB,EAAE,CACnD,EAAoB,EAAE,GAAK,EAAoB,EAAE,CACjD,EAAQ,SAAS,GAAK,EAAQ,SAAS,EAE7C,UACA,SACA,YAAa,GAAK,CAChB,IAAM,EAAU,EAAO,EAAE,CACzB,OAAO,EAAQ,EAAQ,CAAG,EAAQ,aAAa,CAAG,IAEpD,sBACD,CCzCY,EACX,EAA+B,EAAsB,CAK1C,EACX,EAA4B,EAAsB,CAIvC,EACX,EAA8B,EAAsB,CAIzC,EACX,EAA+B,EAAsB,CAI1C,EACX,EAA+B,EAAsB,CAI1C,EACX,EAAgC,EAAsB,CAI3C,EACX,EAAoC,EAAsB,CAK/C,EACX,EAA4B,EAAsB,CAKvC,EACX,EAAqC,EAAsB,CAKhD,EACX,EAA2B,EAAsB,CAKtC,EACX,EAA+B,EAAsB,CAK1C,EACX,EAA+B,EAAsB"}
|
|
@@ -48,6 +48,14 @@ declare const datetimeRuleProcessorMongoDBQuery: ValueProcessorByRule;
|
|
|
48
48
|
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "natural_language" format using Luxon
|
|
49
49
|
*/
|
|
50
50
|
declare const datetimeRuleProcessorNL: ValueProcessorByRule;
|
|
51
|
+
/**
|
|
52
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "cypher"/"gql" format using Luxon
|
|
53
|
+
*/
|
|
54
|
+
declare const datetimeRuleProcessorCypher: ValueProcessorByRule;
|
|
55
|
+
/**
|
|
56
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "sparql" format using Luxon
|
|
57
|
+
*/
|
|
58
|
+
declare const datetimeRuleProcessorSPARQL: ValueProcessorByRule;
|
|
51
59
|
//#endregion
|
|
52
|
-
export { datetimeRuleProcessorCEL, datetimeRuleProcessorMongoDBQuery, datetimeRuleProcessorNL, datetimeRuleProcessorSQL, datetimeValueProcessorANSI, datetimeValueProcessorMSSQL, datetimeValueProcessorMySQL, datetimeValueProcessorOracle, datetimeValueProcessorPostgreSQL, jsonLogicDateTimeOperations, rqbDateTimeLibraryAPI };
|
|
60
|
+
export { datetimeRuleProcessorCEL, datetimeRuleProcessorCypher, datetimeRuleProcessorMongoDBQuery, datetimeRuleProcessorNL, datetimeRuleProcessorSPARQL, datetimeRuleProcessorSQL, datetimeValueProcessorANSI, datetimeValueProcessorMSSQL, datetimeValueProcessorMySQL, datetimeValueProcessorOracle, datetimeValueProcessorPostgreSQL, jsonLogicDateTimeOperations, rqbDateTimeLibraryAPI };
|
|
53
61
|
//# sourceMappingURL=react-querybuilder_datetime.production.luxon.d.mts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,d as t,f as n,
|
|
1
|
+
import{a as e,d as t,f as n,h as r,i,m as a,n as o,o as s,p as c,r as l,s as u,t as d,u as f}from"./getDatetimeRuleProcessorSQL-CWqAiVwU.mjs";import{DateTime as p}from"luxon";const m=e=>typeof e==`string`?p.fromISO(e):p.fromJSDate(e),h=`yyyy-MM-dd`,g={format:(e,t)=>m(e).toFormat(t.replace(`YYYY-MM-DD`,h)),isAfter:(e,t)=>m(e)>m(t),isBefore:(e,t)=>m(e)<m(t),isSame:(e,t)=>r(e)||r(t)?m(e).hasSame(m(t),`day`):+m(e)==+m(t),isValid:e=>m(e).isValid,toDate:e=>m(e).toJSDate(),toISOString:e=>{let t=m(e);return t.isValid?t.toJSDate().toISOString():``},toISOStringDateOnly:e=>{let t=m(e);return t.isValid?t.toFormat(h):``}},_=a(g),v=d(g),y=o(g),b=l(g),x=i(g),S=e(g),C=s(g),w=c(g),T=t(g),E=f(g),D=n(g),O=u(g);export{w as datetimeRuleProcessorCEL,D as datetimeRuleProcessorCypher,T as datetimeRuleProcessorMongoDBQuery,E as datetimeRuleProcessorNL,O as datetimeRuleProcessorSPARQL,v as datetimeRuleProcessorSQL,y as datetimeValueProcessorANSI,b as datetimeValueProcessorMSSQL,x as datetimeValueProcessorMySQL,S as datetimeValueProcessorOracle,C as datetimeValueProcessorPostgreSQL,_ as jsonLogicDateTimeOperations,g as rqbDateTimeLibraryAPI};
|
|
2
2
|
//# sourceMappingURL=react-querybuilder_datetime.production.luxon.mjs.map
|