@react-querybuilder/datetime 8.8.3 → 8.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/getDatetimeRuleProcessorSQL-npwUe9aM.js +2 -0
- package/dist/cjs/getDatetimeRuleProcessorSQL-npwUe9aM.js.map +1 -0
- package/dist/cjs/react-querybuilder_datetime.cjs.development.date-fns.js +81 -775
- package/dist/cjs/react-querybuilder_datetime.cjs.development.date-fns.js.map +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.development.dayjs.js +75 -785
- package/dist/cjs/react-querybuilder_datetime.cjs.development.dayjs.js.map +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.development.js +124 -934
- package/dist/cjs/react-querybuilder_datetime.cjs.development.js.map +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.development.jsdate.js +113 -834
- package/dist/cjs/react-querybuilder_datetime.cjs.development.jsdate.js.map +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.development.luxon.js +77 -779
- package/dist/cjs/react-querybuilder_datetime.cjs.development.luxon.js.map +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.date-fns.js +1 -6
- package/dist/cjs/react-querybuilder_datetime.cjs.production.date-fns.js.map +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.dayjs.js +1 -6
- package/dist/cjs/react-querybuilder_datetime.cjs.production.dayjs.js.map +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.js +1 -7
- package/dist/cjs/react-querybuilder_datetime.cjs.production.js.map +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.jsdate.js +1 -7
- package/dist/cjs/react-querybuilder_datetime.cjs.production.jsdate.js.map +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.luxon.js +1 -6
- package/dist/cjs/react-querybuilder_datetime.cjs.production.luxon.js.map +1 -1
- package/dist/getDatetimeRuleProcessorSQL-CocyaiI5.mjs +373 -0
- package/dist/getDatetimeRuleProcessorSQL-CocyaiI5.mjs.map +1 -0
- package/dist/getDatetimeRuleProcessorSQL-CutYTD23.js +392 -0
- package/dist/getDatetimeRuleProcessorSQL-CutYTD23.js.map +1 -0
- package/dist/react-querybuilder_datetime.date-fns.mjs +72 -57
- package/dist/react-querybuilder_datetime.date-fns.mjs.map +1 -1
- package/dist/react-querybuilder_datetime.dayjs.mjs +66 -57
- package/dist/react-querybuilder_datetime.dayjs.mjs.map +1 -1
- package/dist/react-querybuilder_datetime.jsdate.mjs +102 -114
- package/dist/react-querybuilder_datetime.jsdate.mjs.map +1 -1
- package/dist/react-querybuilder_datetime.legacy-esm.date-fns.js +72 -57
- package/dist/react-querybuilder_datetime.legacy-esm.date-fns.js.map +1 -1
- package/dist/react-querybuilder_datetime.legacy-esm.dayjs.js +66 -57
- package/dist/react-querybuilder_datetime.legacy-esm.dayjs.js.map +1 -1
- package/dist/react-querybuilder_datetime.legacy-esm.js +113 -215
- package/dist/react-querybuilder_datetime.legacy-esm.js.map +1 -1
- package/dist/react-querybuilder_datetime.legacy-esm.jsdate.js +102 -114
- package/dist/react-querybuilder_datetime.legacy-esm.jsdate.js.map +1 -1
- package/dist/react-querybuilder_datetime.legacy-esm.luxon.js +68 -61
- package/dist/react-querybuilder_datetime.legacy-esm.luxon.js.map +1 -1
- package/dist/react-querybuilder_datetime.luxon.mjs +68 -61
- package/dist/react-querybuilder_datetime.luxon.mjs.map +1 -1
- package/dist/react-querybuilder_datetime.mjs +112 -215
- package/dist/react-querybuilder_datetime.mjs.map +1 -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.mjs +1 -1
- package/dist/react-querybuilder_datetime.production.dayjs.mjs.map +1 -1
- package/dist/react-querybuilder_datetime.production.jsdate.mjs +1 -2
- package/dist/react-querybuilder_datetime.production.jsdate.mjs.map +1 -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 -2
- package/dist/react-querybuilder_datetime.production.mjs.map +1 -1
- package/package.json +10 -10
- package/dist/chunk-SLTJVKUE.mjs +0 -7
- package/dist/chunk-SLTJVKUE.mjs.map +0 -1
- package/dist/chunk-ZLH5EH6W.mjs +0 -713
- package/dist/chunk-ZLH5EH6W.mjs.map +0 -1
- package/dist/chunk-ZS6AX35I.js +0 -738
- package/dist/chunk-ZS6AX35I.js.map +0 -1
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
import { defaultOperatorProcessorNL, defaultRuleProcessorCEL, defaultRuleProcessorMongoDBQuery, defaultRuleProcessorNL, defaultRuleProcessorSQL, defaultValueProcessorByRule, getQuotedFieldName, lc, mapSQLOperator, mongoOperators, normalizeConstituentWordOrder, toArray } from "react-querybuilder";
|
|
2
|
+
|
|
3
|
+
//#region src/utils.ts
|
|
4
|
+
const isISOStringDateOnly = (date) => typeof date === "string" && /^\d{4}-\d{2}-\d{2}$/.test(date);
|
|
5
|
+
const defaultIsDateField = (...[rule, opts]) => {
|
|
6
|
+
var _opts$fieldData;
|
|
7
|
+
return rule.operator !== "contains" && rule.operator !== "beginsWith" && rule.operator !== "endsWith" && rule.operator !== "doesNotContain" && rule.operator !== "doesNotBeginWith" && rule.operator !== "doesNotEndWith" && rule.operator !== "null" && rule.operator !== "notNull" && /^(?:date|datetime|datetimeoffset|timestamp)\b/i.test(opts === null || opts === void 0 || (_opts$fieldData = opts.fieldData) === null || _opts$fieldData === void 0 ? void 0 : _opts$fieldData.datatype);
|
|
8
|
+
};
|
|
9
|
+
const processIsDateField = (isDateField, ...[rule, opts]) => {
|
|
10
|
+
if (typeof isDateField === "boolean") return isDateField;
|
|
11
|
+
if (typeof isDateField === "function") return isDateField(rule, opts);
|
|
12
|
+
if (Array.isArray(isDateField)) return isDateField.some((condition) => Object.entries(condition).every(([key, value]) => {
|
|
13
|
+
var _opts$fieldData2;
|
|
14
|
+
return (opts === null || opts === void 0 || (_opts$fieldData2 = opts.fieldData) === null || _opts$fieldData2 === void 0 ? void 0 : _opts$fieldData2[key]) === value;
|
|
15
|
+
}));
|
|
16
|
+
if (typeof isDateField === "object") return Object.entries(isDateField).every(([key, value]) => {
|
|
17
|
+
var _opts$fieldData3;
|
|
18
|
+
return (opts === null || opts === void 0 || (_opts$fieldData3 = opts.fieldData) === null || _opts$fieldData3 === void 0 ? void 0 : _opts$fieldData3[key]) === value;
|
|
19
|
+
});
|
|
20
|
+
return defaultIsDateField(rule, opts);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/getDatetimeJsonLogicOperations.ts
|
|
25
|
+
/**
|
|
26
|
+
* Custom operations for use with JsonLogic objects generated by
|
|
27
|
+
* {@link datetimeRuleProcessorJsonLogic}.
|
|
28
|
+
*/
|
|
29
|
+
const getDatetimeJsonLogicOperations = ({ isAfter, isBefore, isSame }) => ({
|
|
30
|
+
dateAfter: (a, b) => isAfter(a, b),
|
|
31
|
+
dateBefore: (a, b) => isBefore(a, b),
|
|
32
|
+
dateBetween: (a, b, c) => isSame(b, a) || isSame(b, c) || isAfter(b, a) && isBefore(b, c) || isAfter(b, c) && isBefore(b, a),
|
|
33
|
+
dateNotBetween: (a, b, c) => !isSame(b, a) && !isSame(b, c) && (isBefore(a, c) && (isBefore(b, a) || isAfter(b, c)) || isAfter(a, c) && (isBefore(b, c) || isAfter(b, a))),
|
|
34
|
+
dateIn: (a, b) => b.some((v) => isSame(a, v)),
|
|
35
|
+
dateNotIn: (a, b) => b.every((v) => !isSame(a, v)),
|
|
36
|
+
dateNotOn: (a, b) => !isSame(a, b),
|
|
37
|
+
dateOn: (a, b) => isSame(a, b),
|
|
38
|
+
dateOnOrAfter: (a, b) => isAfter(a, b) || isSame(a, b),
|
|
39
|
+
dateOnOrBefore: (a, b) => isBefore(a, b) || isSame(a, b)
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region src/getDatetimeRuleProcessorCEL.ts
|
|
44
|
+
const shouldNegate = (op) => new RegExp("^(does)?not", "i").test(op);
|
|
45
|
+
/**
|
|
46
|
+
* Generates a rule processor with date/time features for use by
|
|
47
|
+
* {@link react-querybuilder!index.formatQuery formatQuery} with the "cel" format.
|
|
48
|
+
*/
|
|
49
|
+
const getDatetimeRuleProcessorCEL = (apiFns) => (rule, options) => {
|
|
50
|
+
const opts = options !== null && options !== void 0 ? options : ( /* istanbul ignore next */ {});
|
|
51
|
+
const { context = {} } = opts;
|
|
52
|
+
if (rule.valueSource === "field" || !processIsDateField(context.isDateField, rule, opts)) return defaultRuleProcessorCEL(rule, opts);
|
|
53
|
+
const ts = (d) => `timestamp("${apiFns.toISOString(d)}")`;
|
|
54
|
+
const operatorTL = lc(rule.operator.replace(/^=$/, "=="));
|
|
55
|
+
switch (operatorTL) {
|
|
56
|
+
case "<":
|
|
57
|
+
case "<=":
|
|
58
|
+
case "==":
|
|
59
|
+
case "!=":
|
|
60
|
+
case ">":
|
|
61
|
+
case ">=": return `${rule.field} ${operatorTL} ${ts(rule.value)}`;
|
|
62
|
+
}
|
|
63
|
+
const valueAsArray = toArray(rule.value, { retainEmptyStrings: false });
|
|
64
|
+
const valueAsDateArray = valueAsArray.map((v) => apiFns.toDate(v)).filter((dateVal) => apiFns.isValid(dateVal));
|
|
65
|
+
switch (operatorTL) {
|
|
66
|
+
case "in":
|
|
67
|
+
case "notin": {
|
|
68
|
+
if (valueAsDateArray.length === 0) return "";
|
|
69
|
+
const [prefix, suffix] = shouldNegate(operatorTL) ? ["!(", ")"] : ["", ""];
|
|
70
|
+
return `${prefix}${rule.field} in [${valueAsDateArray.map((val) => ts(val)).join(", ")}]${suffix}`;
|
|
71
|
+
}
|
|
72
|
+
case "between":
|
|
73
|
+
case "notbetween": {
|
|
74
|
+
if (valueAsDateArray.length < 2) return "";
|
|
75
|
+
const [first, second] = valueAsDateArray;
|
|
76
|
+
const [firstDate, secondDate] = apiFns.isBefore(first, second) ? [first, second] : [second, first];
|
|
77
|
+
return operatorTL === "between" ? `(${rule.field} >= ${ts(firstDate)} && ${rule.field} <= ${ts(secondDate)})` : `(${rule.field} < ${ts(firstDate)} || ${rule.field} > ${ts(secondDate)})`;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return defaultRuleProcessorCEL(rule, opts);
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
//#endregion
|
|
84
|
+
//#region src/getDatetimeRuleProcessorMongoDBQuery.ts
|
|
85
|
+
/**
|
|
86
|
+
* Generates a rule processor with date/time features for use by
|
|
87
|
+
* {@link react-querybuilder!index.formatQuery formatQuery} with the "mongodb_query" format.
|
|
88
|
+
*/
|
|
89
|
+
const getDatetimeRuleProcessorMongoDBQuery = (apiFns) => (rule, options) => {
|
|
90
|
+
var _opts$context;
|
|
91
|
+
const opts = options !== null && options !== void 0 ? options : ( /* istanbul ignore next */ {});
|
|
92
|
+
const { field, operator, value, valueSource } = rule;
|
|
93
|
+
if (valueSource === "field" || !processIsDateField((_opts$context = opts.context) === null || _opts$context === void 0 ? void 0 : _opts$context.isDateField, rule, opts)) return defaultRuleProcessorMongoDBQuery(rule, opts);
|
|
94
|
+
if (operator === "=") return { [field]: apiFns.toDate(value) };
|
|
95
|
+
switch (operator) {
|
|
96
|
+
case "<":
|
|
97
|
+
case "<=":
|
|
98
|
+
case "!=":
|
|
99
|
+
case ">":
|
|
100
|
+
case ">=": return { [field]: { [mongoOperators[operator]]: apiFns.toDate(value) } };
|
|
101
|
+
}
|
|
102
|
+
const valueAsArray = toArray(rule.value, { retainEmptyStrings: false });
|
|
103
|
+
const valueAsDateArray = valueAsArray.map((v) => apiFns.toDate(v)).filter((dateVal) => apiFns.isValid(dateVal));
|
|
104
|
+
switch (operator) {
|
|
105
|
+
case "in":
|
|
106
|
+
case "notIn": return { [field]: { [mongoOperators[operator]]: valueAsDateArray } };
|
|
107
|
+
case "between":
|
|
108
|
+
case "notBetween": {
|
|
109
|
+
if (valueAsDateArray.length < 2) return "";
|
|
110
|
+
const [first, second] = valueAsDateArray;
|
|
111
|
+
const orderedArray = apiFns.isBefore(first, second) ? [first, second] : [second, first];
|
|
112
|
+
return operator === "between" ? { [field]: {
|
|
113
|
+
$gte: orderedArray[0],
|
|
114
|
+
$lte: orderedArray[1]
|
|
115
|
+
} } : { $or: [{ [field]: { $lt: orderedArray[0] } }, { [field]: { $gt: orderedArray[1] } }] };
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return defaultRuleProcessorMongoDBQuery(rule, opts);
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
//#endregion
|
|
122
|
+
//#region ../../node_modules/tsdown/node_modules/rolldown/node_modules/@oxc-project/runtime/src/helpers/esm/typeof.js
|
|
123
|
+
function _typeof(o) {
|
|
124
|
+
"@babel/helpers - typeof";
|
|
125
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
|
|
126
|
+
return typeof o$1;
|
|
127
|
+
} : function(o$1) {
|
|
128
|
+
return o$1 && "function" == typeof Symbol && o$1.constructor === Symbol && o$1 !== Symbol.prototype ? "symbol" : typeof o$1;
|
|
129
|
+
}, _typeof(o);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
//#endregion
|
|
133
|
+
//#region ../../node_modules/tsdown/node_modules/rolldown/node_modules/@oxc-project/runtime/src/helpers/esm/toPrimitive.js
|
|
134
|
+
function toPrimitive(t, r) {
|
|
135
|
+
if ("object" != _typeof(t) || !t) return t;
|
|
136
|
+
var e = t[Symbol.toPrimitive];
|
|
137
|
+
if (void 0 !== e) {
|
|
138
|
+
var i = e.call(t, r || "default");
|
|
139
|
+
if ("object" != _typeof(i)) return i;
|
|
140
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
141
|
+
}
|
|
142
|
+
return ("string" === r ? String : Number)(t);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
//#endregion
|
|
146
|
+
//#region ../../node_modules/tsdown/node_modules/rolldown/node_modules/@oxc-project/runtime/src/helpers/esm/toPropertyKey.js
|
|
147
|
+
function toPropertyKey(t) {
|
|
148
|
+
var i = toPrimitive(t, "string");
|
|
149
|
+
return "symbol" == _typeof(i) ? i : i + "";
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
//#endregion
|
|
153
|
+
//#region ../../node_modules/tsdown/node_modules/rolldown/node_modules/@oxc-project/runtime/src/helpers/esm/defineProperty.js
|
|
154
|
+
function _defineProperty(e, r, t) {
|
|
155
|
+
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
156
|
+
value: t,
|
|
157
|
+
enumerable: !0,
|
|
158
|
+
configurable: !0,
|
|
159
|
+
writable: !0
|
|
160
|
+
}) : e[r] = t, e;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
//#endregion
|
|
164
|
+
//#region ../../node_modules/tsdown/node_modules/rolldown/node_modules/@oxc-project/runtime/src/helpers/esm/objectSpread2.js
|
|
165
|
+
function ownKeys(e, r) {
|
|
166
|
+
var t = Object.keys(e);
|
|
167
|
+
if (Object.getOwnPropertySymbols) {
|
|
168
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
169
|
+
r && (o = o.filter(function(r$1) {
|
|
170
|
+
return Object.getOwnPropertyDescriptor(e, r$1).enumerable;
|
|
171
|
+
})), t.push.apply(t, o);
|
|
172
|
+
}
|
|
173
|
+
return t;
|
|
174
|
+
}
|
|
175
|
+
function _objectSpread2(e) {
|
|
176
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
177
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
178
|
+
r % 2 ? ownKeys(Object(t), !0).forEach(function(r$1) {
|
|
179
|
+
_defineProperty(e, r$1, t[r$1]);
|
|
180
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r$1) {
|
|
181
|
+
Object.defineProperty(e, r$1, Object.getOwnPropertyDescriptor(t, r$1));
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
return e;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
//#endregion
|
|
188
|
+
//#region src/getDatetimeRuleProcessorNL.ts
|
|
189
|
+
const defaultDateTimeNLOperatorMap = {
|
|
190
|
+
"<": "is before",
|
|
191
|
+
">": "is after",
|
|
192
|
+
"<=": "is on or before",
|
|
193
|
+
">=": "is on or after",
|
|
194
|
+
in: ["is one of the dates", "is the same as a date in"],
|
|
195
|
+
notin: ["is not one of the dates", "is not the same as any date in"],
|
|
196
|
+
between: ["is between", "is between the dates in"],
|
|
197
|
+
notbetween: ["is not between", "is not between the dates in"]
|
|
198
|
+
};
|
|
199
|
+
/**
|
|
200
|
+
* Generates a value processor with date/time features for use by
|
|
201
|
+
* {@link react-querybuilder!index.formatQuery formatQuery} with the "natural_language" format.
|
|
202
|
+
*/
|
|
203
|
+
const datetimeValueProcessorNL = (rule, opts) => {
|
|
204
|
+
var _opts$context, _opts$context4, _opts$context5;
|
|
205
|
+
if (isISOStringDateOnly(opts === null || opts === void 0 || (_opts$context = opts.context) === null || _opts$context === void 0 ? void 0 : _opts$context.originalValue)) {
|
|
206
|
+
var _opts$context2, _opts$context3;
|
|
207
|
+
return new Intl.DateTimeFormat(opts === null || opts === void 0 || (_opts$context2 = opts.context) === null || _opts$context2 === void 0 ? void 0 : _opts$context2.locales, _objectSpread2({ dateStyle: "full" }, opts === null || opts === void 0 || (_opts$context3 = opts.context) === null || _opts$context3 === void 0 ? void 0 : _opts$context3.dateFormat)).format(rule.value);
|
|
208
|
+
}
|
|
209
|
+
return new Intl.DateTimeFormat(opts === null || opts === void 0 || (_opts$context4 = opts.context) === null || _opts$context4 === void 0 ? void 0 : _opts$context4.locales, _objectSpread2({
|
|
210
|
+
dateStyle: "full",
|
|
211
|
+
timeStyle: "long"
|
|
212
|
+
}, opts === null || opts === void 0 || (_opts$context5 = opts.context) === null || _opts$context5 === void 0 ? void 0 : _opts$context5.dateTimeFormat)).format(rule.value);
|
|
213
|
+
};
|
|
214
|
+
/**
|
|
215
|
+
* Generates a rule processor with date/time features for use by {@link react-querybuilder!index.formatQuery formatQuery} with
|
|
216
|
+
* the "natural_language" format.
|
|
217
|
+
*/
|
|
218
|
+
const getDatetimeRuleProcessorNL = (apiFns) => (rule, options) => {
|
|
219
|
+
var _fieldData$label;
|
|
220
|
+
const opts = options !== null && options !== void 0 ? options : ( /* istanbul ignore next */ {});
|
|
221
|
+
const operatorLowerCase = lc(rule.operator);
|
|
222
|
+
let finalValue = "";
|
|
223
|
+
// istanbul ignore next
|
|
224
|
+
const { fieldData, quoteFieldNamesWith = ["", ""], fieldIdentifierSeparator = "", operatorProcessor = defaultOperatorProcessorNL, wordOrder = "SVO", context = {}, operatorMap = defaultDateTimeNLOperatorMap } = opts;
|
|
225
|
+
if (!processIsDateField(context.isDateField, rule, opts)) return defaultRuleProcessorNL(rule, opts);
|
|
226
|
+
if (rule.valueSource === "field") return defaultRuleProcessorNL(rule, _objectSpread2(_objectSpread2({}, opts), {}, { operatorMap: defaultDateTimeNLOperatorMap }));
|
|
227
|
+
if ((operatorLowerCase === "in" || operatorLowerCase === "notin" || operatorLowerCase === "between" || operatorLowerCase === "notbetween") && !rule.value) return "";
|
|
228
|
+
const valueAsArray = toArray(rule.value, { retainEmptyStrings: false });
|
|
229
|
+
const valueAsDateArray = valueAsArray.map((v) => [v, apiFns.toDate(v)]).filter((v) => apiFns.isValid(v[1]));
|
|
230
|
+
switch (operatorLowerCase) {
|
|
231
|
+
case "in":
|
|
232
|
+
case "notin":
|
|
233
|
+
if (valueAsDateArray.length === 0) return "";
|
|
234
|
+
finalValue = `(${valueAsDateArray.map((value) => datetimeValueProcessorNL({
|
|
235
|
+
field: rule.field,
|
|
236
|
+
operator: "=",
|
|
237
|
+
value: value[1]
|
|
238
|
+
}, _objectSpread2(_objectSpread2({}, opts), {}, { context: _objectSpread2(_objectSpread2({}, context), {}, { originalValue: value[0] }) }))).join(", ")})`;
|
|
239
|
+
break;
|
|
240
|
+
case "between":
|
|
241
|
+
case "notbetween":
|
|
242
|
+
{
|
|
243
|
+
var _opts$translations$an, _opts$translations;
|
|
244
|
+
if (valueAsDateArray.length < 2) return "";
|
|
245
|
+
const [first, second] = valueAsDateArray;
|
|
246
|
+
const orderedArray = apiFns.isBefore(first[1], second[1]) ? [first, second] : [second, first];
|
|
247
|
+
finalValue = orderedArray.map(([originalValue, value]) => datetimeValueProcessorNL({
|
|
248
|
+
field: rule.field,
|
|
249
|
+
operator: "=",
|
|
250
|
+
value
|
|
251
|
+
}, _objectSpread2(_objectSpread2({}, opts), {}, { context: _objectSpread2(_objectSpread2({}, context), {}, { originalValue }) }))).join(` ${(_opts$translations$an = (_opts$translations = opts.translations) === null || _opts$translations === void 0 ? void 0 : _opts$translations.and) !== null && _opts$translations$an !== void 0 ? _opts$translations$an : "and"} `);
|
|
252
|
+
}
|
|
253
|
+
break;
|
|
254
|
+
default: {
|
|
255
|
+
var _valueAsDateArray$;
|
|
256
|
+
const [originalValue, value] = (_valueAsDateArray$ = valueAsDateArray[0]) !== null && _valueAsDateArray$ !== void 0 ? _valueAsDateArray$ : ["", ""];
|
|
257
|
+
finalValue = originalValue ? datetimeValueProcessorNL({
|
|
258
|
+
field: rule.field,
|
|
259
|
+
operator: "=",
|
|
260
|
+
value
|
|
261
|
+
}, _objectSpread2(_objectSpread2({}, opts), {}, { context: _objectSpread2(_objectSpread2({}, context), {}, { originalValue }) })) : "";
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
const processedField = getQuotedFieldName((_fieldData$label = fieldData === null || fieldData === void 0 ? void 0 : fieldData.label) !== null && _fieldData$label !== void 0 ? _fieldData$label : rule.field, {
|
|
265
|
+
quoteFieldNamesWith,
|
|
266
|
+
fieldIdentifierSeparator
|
|
267
|
+
});
|
|
268
|
+
const processedOperator = operatorProcessor(rule, _objectSpread2(_objectSpread2({}, opts), {}, { operatorMap: _objectSpread2(_objectSpread2({}, defaultDateTimeNLOperatorMap), operatorMap) }));
|
|
269
|
+
const wordOrderMap = {
|
|
270
|
+
S: processedField,
|
|
271
|
+
V: processedOperator,
|
|
272
|
+
O: finalValue
|
|
273
|
+
};
|
|
274
|
+
return normalizeConstituentWordOrder(wordOrder).map((term) => `${wordOrderMap[term]}`).join(" ").trim();
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
//#endregion
|
|
278
|
+
//#region src/getDatetimeRuleProcessorSQL.ts
|
|
279
|
+
/**
|
|
280
|
+
* Generates a value processor with date/time features for use by
|
|
281
|
+
* {@link react-querybuilder!index.formatQuery formatQuery} with the "sql" format and "ansi" preset.
|
|
282
|
+
*/
|
|
283
|
+
const getDatetimeValueProcessorANSI = ({ toISOStringDateOnly, toISOString }) => (rule, opts) => {
|
|
284
|
+
var _opts$context;
|
|
285
|
+
if (isISOStringDateOnly(opts === null || opts === void 0 || (_opts$context = opts.context) === null || _opts$context === void 0 ? void 0 : _opts$context.originalValue)) return defaultValueProcessorByRule(_objectSpread2(_objectSpread2({}, rule), {}, { value: toISOStringDateOnly(rule.value) }), opts);
|
|
286
|
+
return defaultValueProcessorByRule(_objectSpread2(_objectSpread2({}, rule), {}, { value: toISOString(rule.value) }), opts);
|
|
287
|
+
};
|
|
288
|
+
/**
|
|
289
|
+
* Generates a value processor with date/time features for use by {@link react-querybuilder!index.formatQuery formatQuery} with
|
|
290
|
+
* the "sql" format and "mssql" preset.
|
|
291
|
+
*/
|
|
292
|
+
const getDatetimeValueProcessorMSSQL = ({ toISOStringDateOnly, toISOString }) => (rule, opts) => {
|
|
293
|
+
var _opts$fieldData;
|
|
294
|
+
const datatype = /^(?:small)?datetime/i.test(opts === null || opts === void 0 || (_opts$fieldData = opts.fieldData) === null || _opts$fieldData === void 0 ? void 0 : _opts$fieldData.datatype) ? "datetimeoffset" : "date";
|
|
295
|
+
const value = datatype === "datetimeoffset" ? toISOString(rule.value) : toISOStringDateOnly(rule.value);
|
|
296
|
+
return defaultValueProcessorByRule(_objectSpread2(_objectSpread2({}, rule), {}, { value }), _objectSpread2(_objectSpread2({}, opts), {}, { wrapValueWith: [`cast(`, ` as ${datatype})`] }));
|
|
297
|
+
};
|
|
298
|
+
/**
|
|
299
|
+
* Generates a value processor with date/time features for use by {@link react-querybuilder!index.formatQuery formatQuery} with
|
|
300
|
+
* the "sql" format and "mysql" preset.
|
|
301
|
+
*/
|
|
302
|
+
const getDatetimeValueProcessorMySQL = ({ toISOStringDateOnly, toISOString }) => (rule, opts) => {
|
|
303
|
+
var _opts$fieldData2;
|
|
304
|
+
const datatype = /^(?:datetime|timestamp)/i.test(opts === null || opts === void 0 || (_opts$fieldData2 = opts.fieldData) === null || _opts$fieldData2 === void 0 ? void 0 : _opts$fieldData2.datatype) ? "datetime" : "date";
|
|
305
|
+
const value = datatype === "datetime" ? toISOString(rule.value) : toISOStringDateOnly(rule.value);
|
|
306
|
+
return defaultValueProcessorByRule(_objectSpread2(_objectSpread2({}, rule), {}, { value }), _objectSpread2(_objectSpread2({}, opts), {}, { wrapValueWith: [`cast(`, ` as ${datatype})`] }));
|
|
307
|
+
};
|
|
308
|
+
/**
|
|
309
|
+
* Generates a value processor with date/time features for use by {@link react-querybuilder!index.formatQuery formatQuery} with
|
|
310
|
+
* the "sql" format and "oracle" preset.
|
|
311
|
+
*/
|
|
312
|
+
const getDatetimeValueProcessorOracle = ({ toISOStringDateOnly, toISOString }) => (rule, opts) => {
|
|
313
|
+
var _opts$fieldData3;
|
|
314
|
+
const datatype = /^timestamp/i.test(opts === null || opts === void 0 || (_opts$fieldData3 = opts.fieldData) === null || _opts$fieldData3 === void 0 ? void 0 : _opts$fieldData3.datatype) ? "timestamp" : "date";
|
|
315
|
+
const value = datatype === "timestamp" ? toISOString(rule.value).replaceAll("T", " ").replace("Z", " UTC") : toISOStringDateOnly(rule.value);
|
|
316
|
+
return defaultValueProcessorByRule(_objectSpread2(_objectSpread2({}, rule), {}, { value }), _objectSpread2(_objectSpread2({}, opts), {}, { wrapValueWith: [datatype, ``] }));
|
|
317
|
+
};
|
|
318
|
+
/**
|
|
319
|
+
* Generates a value processor with date/time features for use by {@link react-querybuilder!index.formatQuery formatQuery} with
|
|
320
|
+
* the "sql" format and "postgresql" preset.
|
|
321
|
+
*/
|
|
322
|
+
const getDatetimeValueProcessorPostgreSQL = ({ toISOStringDateOnly, toISOString }) => (rule, opts) => {
|
|
323
|
+
var _opts$fieldData4;
|
|
324
|
+
const datatype = /^timestamp/i.test(opts === null || opts === void 0 || (_opts$fieldData4 = opts.fieldData) === null || _opts$fieldData4 === void 0 ? void 0 : _opts$fieldData4.datatype) ? "timestamp" : "date";
|
|
325
|
+
const value = datatype === "timestamp" ? toISOString(rule.value) : toISOStringDateOnly(rule.value);
|
|
326
|
+
return defaultValueProcessorByRule(_objectSpread2(_objectSpread2({}, rule), {}, { value }), _objectSpread2(_objectSpread2({}, opts), {}, { wrapValueWith: [datatype, ``] }));
|
|
327
|
+
};
|
|
328
|
+
const presetToValueProcessorMap = {
|
|
329
|
+
ansi: getDatetimeValueProcessorANSI,
|
|
330
|
+
mssql: getDatetimeValueProcessorMSSQL,
|
|
331
|
+
mysql: getDatetimeValueProcessorMySQL,
|
|
332
|
+
oracle: getDatetimeValueProcessorOracle,
|
|
333
|
+
postgresql: getDatetimeValueProcessorPostgreSQL,
|
|
334
|
+
sqlite: getDatetimeValueProcessorANSI
|
|
335
|
+
};
|
|
336
|
+
/**
|
|
337
|
+
* Generates a rule processor with date/time features for use by {@link react-querybuilder!index.formatQuery formatQuery} with
|
|
338
|
+
* the "sql" format.
|
|
339
|
+
*/
|
|
340
|
+
const getDatetimeRuleProcessorSQL = (apiFns) => (rule, options) => {
|
|
341
|
+
const opts = options !== null && options !== void 0 ? options : ( /* istanbul ignore next */ {});
|
|
342
|
+
const operator = mapSQLOperator(rule.operator);
|
|
343
|
+
const operatorLowerCase = lc(operator);
|
|
344
|
+
// istanbul ignore next
|
|
345
|
+
const { quoteFieldNamesWith = ["", ""], fieldIdentifierSeparator = "", context = {} } = opts;
|
|
346
|
+
let finalValue = "";
|
|
347
|
+
if (rule.valueSource === "field" || !processIsDateField(context.isDateField, rule, opts)) return defaultRuleProcessorSQL(rule, opts);
|
|
348
|
+
const valueProcessor = presetToValueProcessorMap[opts.preset](apiFns);
|
|
349
|
+
const valueAsArray = toArray(rule.value, { retainEmptyStrings: false });
|
|
350
|
+
const valueAsDateArray = valueAsArray.map((v) => [v, apiFns.toDate(v)]).filter((v) => apiFns.isValid(v[1]));
|
|
351
|
+
switch (operatorLowerCase) {
|
|
352
|
+
case "in":
|
|
353
|
+
case "not in":
|
|
354
|
+
if (valueAsDateArray.length === 0) return "";
|
|
355
|
+
finalValue = `(${valueAsDateArray.map((value) => valueProcessor({
|
|
356
|
+
field: rule.field,
|
|
357
|
+
operator: "=",
|
|
358
|
+
value: value[1]
|
|
359
|
+
}, _objectSpread2(_objectSpread2({}, opts), {}, { context: { originalValue: value[0] } }))).join(", ")})`;
|
|
360
|
+
break;
|
|
361
|
+
case "between":
|
|
362
|
+
case "not between":
|
|
363
|
+
{
|
|
364
|
+
if (valueAsDateArray.length < 2) return "";
|
|
365
|
+
const [first, second] = valueAsDateArray;
|
|
366
|
+
const orderedArray = apiFns.isBefore(first[1], second[1]) ? [first, second] : [second, first];
|
|
367
|
+
finalValue = orderedArray.map(([originalValue, value]) => valueProcessor({
|
|
368
|
+
field: rule.field,
|
|
369
|
+
operator: "=",
|
|
370
|
+
value
|
|
371
|
+
}, _objectSpread2(_objectSpread2({}, opts), {}, { context: { originalValue } }))).join(" and ");
|
|
372
|
+
}
|
|
373
|
+
break;
|
|
374
|
+
default: {
|
|
375
|
+
var _valueAsDateArray$;
|
|
376
|
+
const [originalValue, value] = (_valueAsDateArray$ = valueAsDateArray[0]) !== null && _valueAsDateArray$ !== void 0 ? _valueAsDateArray$ : ["", ""];
|
|
377
|
+
finalValue = valueProcessor({
|
|
378
|
+
field: rule.field,
|
|
379
|
+
operator: "=",
|
|
380
|
+
value
|
|
381
|
+
}, _objectSpread2(_objectSpread2({}, opts), {}, { context: { originalValue } }));
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
return `${getQuotedFieldName(rule.field, {
|
|
385
|
+
quoteFieldNamesWith,
|
|
386
|
+
fieldIdentifierSeparator
|
|
387
|
+
})} ${operator} ${finalValue}`.trim();
|
|
388
|
+
};
|
|
389
|
+
|
|
390
|
+
//#endregion
|
|
391
|
+
export { datetimeValueProcessorNL, defaultDateTimeNLOperatorMap, getDatetimeJsonLogicOperations, getDatetimeRuleProcessorCEL, getDatetimeRuleProcessorMongoDBQuery, getDatetimeRuleProcessorNL, getDatetimeRuleProcessorSQL, getDatetimeValueProcessorANSI, getDatetimeValueProcessorMSSQL, getDatetimeValueProcessorMySQL, getDatetimeValueProcessorOracle, getDatetimeValueProcessorPostgreSQL, isISOStringDateOnly, processIsDateField };
|
|
392
|
+
//# sourceMappingURL=getDatetimeRuleProcessorSQL-CutYTD23.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getDatetimeRuleProcessorSQL-CutYTD23.js","names":["defaultIsDateField: IsDateFieldFunction","valueAsArray: string[]","valueAsArray: string[]","o","r","defaultDateTimeNLOperatorMap: ExportOperatorMap","datetimeValueProcessorNL: ValueProcessorByRule","valueAsArray: string[]","valueAsArray: string[]"],"sources":["../src/utils.ts","../src/getDatetimeJsonLogicOperations.ts","../src/getDatetimeRuleProcessorCEL.ts","../src/getDatetimeRuleProcessorMongoDBQuery.ts","../../../node_modules/tsdown/node_modules/rolldown/node_modules/@oxc-project/runtime/src/helpers/esm/typeof.js","../../../node_modules/tsdown/node_modules/rolldown/node_modules/@oxc-project/runtime/src/helpers/esm/toPrimitive.js","../../../node_modules/tsdown/node_modules/rolldown/node_modules/@oxc-project/runtime/src/helpers/esm/toPropertyKey.js","../../../node_modules/tsdown/node_modules/rolldown/node_modules/@oxc-project/runtime/src/helpers/esm/defineProperty.js","../../../node_modules/tsdown/node_modules/rolldown/node_modules/@oxc-project/runtime/src/helpers/esm/objectSpread2.js","../src/getDatetimeRuleProcessorNL.ts","../src/getDatetimeRuleProcessorSQL.ts"],"sourcesContent":["import type { RuleProcessor } from 'react-querybuilder';\nimport type { IsDateField, IsDateFieldFunction } from './types';\n\nexport const isISOStringDateOnly = (\n date: unknown\n): date is `${number}${number}${number}${number}-${number}${number}-${number}${number}` =>\n typeof date === 'string' && /^\\d{4}-\\d{2}-\\d{2}$/.test(date);\n\nexport const defaultIsDateField: IsDateFieldFunction = (\n ...[rule, opts]: Parameters<RuleProcessor>\n): boolean =>\n rule.operator !== 'contains' &&\n rule.operator !== 'beginsWith' &&\n rule.operator !== 'endsWith' &&\n rule.operator !== 'doesNotContain' &&\n rule.operator !== 'doesNotBeginWith' &&\n rule.operator !== 'doesNotEndWith' &&\n rule.operator !== 'null' &&\n rule.operator !== 'notNull' &&\n /^(?:date|datetime|datetimeoffset|timestamp)\\b/i.test(opts?.fieldData?.datatype as string);\n\nexport const processIsDateField = (\n isDateField: IsDateField,\n ...[rule, opts]: Parameters<RuleProcessor>\n): boolean => {\n if (typeof isDateField === 'boolean') {\n return isDateField;\n }\n\n if (typeof isDateField === 'function') {\n return isDateField(rule, opts);\n }\n\n if (Array.isArray(isDateField)) {\n return isDateField.some(condition =>\n Object.entries(condition).every(([key, value]) => opts?.fieldData?.[key] === value)\n );\n }\n\n if (typeof isDateField === 'object') {\n return Object.entries(isDateField).every(([key, value]) => opts?.fieldData?.[key] === value);\n }\n\n return defaultIsDateField(rule, opts);\n};\n","import type { RQBDateTimeLibraryAPI, RQBJsonLogicDateTimeOperations } from './types';\n\n/**\n * Custom operations for use with JsonLogic objects generated by\n * {@link datetimeRuleProcessorJsonLogic}.\n */\nexport const getDatetimeJsonLogicOperations = ({\n isAfter,\n isBefore,\n isSame,\n}: RQBDateTimeLibraryAPI): RQBJsonLogicDateTimeOperations => ({\n dateAfter: (a, b) => isAfter(a, b),\n dateBefore: (a, b) => isBefore(a, b),\n dateBetween: (a, b, c) =>\n isSame(b, a) ||\n isSame(b, c) ||\n (isAfter(b, a) && isBefore(b, c)) ||\n (isAfter(b, c) && isBefore(b, a)),\n dateNotBetween: (a, b, c) =>\n !isSame(b, a) &&\n !isSame(b, c) &&\n ((isBefore(a, c) && (isBefore(b, a) || isAfter(b, c))) ||\n (isAfter(a, c) && (isBefore(b, c) || isAfter(b, a)))),\n dateIn: (a, b) => b.some(v => isSame(a, v)),\n dateNotIn: (a, b) => b.every(v => !isSame(a, v)),\n dateNotOn: (a, b) => !isSame(a, b),\n dateOn: (a, b) => isSame(a, b),\n dateOnOrAfter: (a, b) => isAfter(a, b) || isSame(a, b),\n dateOnOrBefore: (a, b) => isBefore(a, b) || isSame(a, b),\n});\n","import type { RuleProcessor } from 'react-querybuilder';\nimport { defaultRuleProcessorCEL, lc, toArray } from 'react-querybuilder';\nimport type { RQBDateTimeLibraryAPI } from './types';\nimport { processIsDateField } from './utils';\n\nconst shouldNegate = (op: string) => /^(does)?not/i.test(op);\n\n/**\n * Generates a rule processor with date/time features for use by\n * {@link react-querybuilder!index.formatQuery formatQuery} with the \"cel\" format.\n */\nexport const getDatetimeRuleProcessorCEL =\n (apiFns: RQBDateTimeLibraryAPI): RuleProcessor =>\n (rule, options) => {\n const opts = options ?? /* istanbul ignore next */ {};\n const { context = {} } = opts;\n\n if (rule.valueSource === 'field' || !processIsDateField(context.isDateField, rule, opts)) {\n return defaultRuleProcessorCEL(rule, opts);\n }\n\n const ts = (d: string | Date) => `timestamp(\"${apiFns.toISOString(d)}\")`;\n\n const operatorTL = lc(rule.operator.replace(/^=$/, '=='));\n\n switch (operatorTL) {\n case '<':\n case '<=':\n case '==':\n case '!=':\n case '>':\n case '>=':\n return `${rule.field} ${operatorTL} ${ts(rule.value)}`;\n }\n\n const valueAsArray: string[] = toArray(rule.value, { retainEmptyStrings: false });\n const valueAsDateArray = valueAsArray\n .map(v => apiFns.toDate(v))\n .filter(dateVal => apiFns.isValid(dateVal));\n\n switch (operatorTL) {\n case 'in':\n case 'notin': {\n if (valueAsDateArray.length === 0) return '';\n const [prefix, suffix] = shouldNegate(operatorTL) ? ['!(', ')'] : ['', ''];\n return `${prefix}${rule.field} in [${valueAsDateArray\n .map(val => ts(val))\n .join(', ')}]${suffix}`;\n }\n\n case 'between':\n case 'notbetween': {\n if (valueAsDateArray.length < 2) return '';\n const [first, second] = valueAsDateArray;\n const [firstDate, secondDate] = apiFns.isBefore(first, second)\n ? [first, second]\n : [second, first];\n return operatorTL === 'between'\n ? `(${rule.field} >= ${ts(firstDate)} && ${rule.field} <= ${ts(secondDate)})`\n : `(${rule.field} < ${ts(firstDate)} || ${rule.field} > ${ts(secondDate)})`;\n }\n }\n\n return defaultRuleProcessorCEL(rule, opts);\n };\n","import type { RuleProcessor } from 'react-querybuilder';\nimport { defaultRuleProcessorMongoDBQuery, mongoOperators, toArray } from 'react-querybuilder';\nimport type { RQBDateTimeLibraryAPI } from './types';\nimport { processIsDateField } from './utils';\n\n/**\n * Generates a rule processor with date/time features for use by\n * {@link react-querybuilder!index.formatQuery formatQuery} with the \"mongodb_query\" format.\n */\nexport const getDatetimeRuleProcessorMongoDBQuery =\n (apiFns: RQBDateTimeLibraryAPI): RuleProcessor =>\n (rule, options) => {\n const opts = options ?? /* istanbul ignore next */ {};\n const { field, operator, value, valueSource } = rule;\n\n if (valueSource === 'field' || !processIsDateField(opts.context?.isDateField, rule, opts)) {\n return defaultRuleProcessorMongoDBQuery(rule, opts);\n }\n\n if (operator === '=') {\n return { [field]: apiFns.toDate(value) };\n }\n\n switch (operator) {\n case '<':\n case '<=':\n case '!=':\n case '>':\n case '>=':\n return { [field]: { [mongoOperators[operator]]: apiFns.toDate(value) } };\n }\n\n const valueAsArray: string[] = toArray(rule.value, { retainEmptyStrings: false });\n const valueAsDateArray = valueAsArray\n .map(v => apiFns.toDate(v))\n .filter(dateVal => apiFns.isValid(dateVal));\n\n switch (operator) {\n case 'in':\n case 'notIn':\n return { [field]: { [mongoOperators[operator]]: valueAsDateArray } };\n\n case 'between':\n case 'notBetween': {\n if (valueAsDateArray.length < 2) return '';\n const [first, second] = valueAsDateArray;\n const orderedArray = apiFns.isBefore(first, second) ? [first, second] : [second, first];\n return operator === 'between'\n ? { [field]: { $gte: orderedArray[0], $lte: orderedArray[1] } }\n : {\n $or: [{ [field]: { $lt: orderedArray[0] } }, { [field]: { $gt: orderedArray[1] } }],\n };\n }\n }\n\n return defaultRuleProcessorMongoDBQuery(rule, opts);\n };\n","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nexport { _typeof as default };","import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nexport { toPropertyKey as default };","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperty(e, r, t) {\n return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nexport { _defineProperty as default };","import defineProperty from \"./defineProperty.js\";\nfunction ownKeys(e, r) {\n var t = Object.keys(e);\n if (Object.getOwnPropertySymbols) {\n var o = Object.getOwnPropertySymbols(e);\n r && (o = o.filter(function (r) {\n return Object.getOwnPropertyDescriptor(e, r).enumerable;\n })), t.push.apply(t, o);\n }\n return t;\n}\nfunction _objectSpread2(e) {\n for (var r = 1; r < arguments.length; r++) {\n var t = null != arguments[r] ? arguments[r] : {};\n r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {\n defineProperty(e, r, t[r]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {\n Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n });\n }\n return e;\n}\nexport { _objectSpread2 as default };","import type { ExportOperatorMap, RuleProcessor, ValueProcessorByRule } from 'react-querybuilder';\nimport {\n defaultOperatorProcessorNL,\n defaultRuleProcessorNL,\n getQuotedFieldName,\n lc,\n normalizeConstituentWordOrder,\n toArray,\n} from 'react-querybuilder';\nimport type { RQBDateTimeLibraryAPI } from './types';\nimport { isISOStringDateOnly, processIsDateField } from './utils';\n\nexport const defaultDateTimeNLOperatorMap: ExportOperatorMap = {\n // '=': 'is',\n // '!=': 'is not',\n '<': 'is before',\n '>': 'is after',\n '<=': 'is on or before',\n '>=': 'is on or after',\n in: ['is one of the dates', 'is the same as a date in'],\n notin: ['is not one of the dates', 'is not the same as any date in'],\n between: ['is between', 'is between the dates in'],\n notbetween: ['is not between', 'is not between the dates in'],\n};\n\n/**\n * Generates a value processor with date/time features for use by\n * {@link react-querybuilder!index.formatQuery formatQuery} with the \"natural_language\" format.\n */\nexport const datetimeValueProcessorNL: ValueProcessorByRule = (rule, opts) => {\n if (isISOStringDateOnly(opts?.context?.originalValue)) {\n return new Intl.DateTimeFormat(opts?.context?.locales, {\n dateStyle: 'full',\n ...opts?.context?.dateFormat,\n }).format(rule.value);\n }\n return new Intl.DateTimeFormat(opts?.context?.locales, {\n dateStyle: 'full',\n timeStyle: 'long',\n ...opts?.context?.dateTimeFormat,\n }).format(rule.value);\n};\n\n/**\n * Generates a rule processor with date/time features for use by {@link react-querybuilder!index.formatQuery formatQuery} with\n * the \"natural_language\" format.\n */\nexport const getDatetimeRuleProcessorNL =\n (apiFns: RQBDateTimeLibraryAPI): RuleProcessor =>\n (rule, options) => {\n const opts = options ?? /* istanbul ignore next */ {};\n const operatorLowerCase = lc(rule.operator);\n let finalValue = '';\n\n // istanbul ignore next\n const {\n fieldData,\n quoteFieldNamesWith = ['', ''] as [string, string],\n fieldIdentifierSeparator = '',\n operatorProcessor = defaultOperatorProcessorNL,\n // valueProcessor = datetimeValueProcessorNL,\n wordOrder = 'SVO',\n context = {},\n operatorMap = defaultDateTimeNLOperatorMap,\n } = opts;\n\n if (!processIsDateField(context.isDateField, rule, opts)) {\n return defaultRuleProcessorNL(rule, opts);\n }\n\n if (rule.valueSource === 'field') {\n return defaultRuleProcessorNL(rule, { ...opts, operatorMap: defaultDateTimeNLOperatorMap });\n }\n\n if (\n (operatorLowerCase === 'in' ||\n operatorLowerCase === 'notin' ||\n operatorLowerCase === 'between' ||\n operatorLowerCase === 'notbetween') &&\n !rule.value\n ) {\n return '';\n }\n\n const valueAsArray: string[] = toArray(rule.value, { retainEmptyStrings: false });\n const valueAsDateArray = valueAsArray\n .map((v): [string, Date] => [v, apiFns.toDate(v)])\n .filter(v => apiFns.isValid(v[1]));\n\n switch (operatorLowerCase) {\n case 'in':\n case 'notin':\n {\n if (valueAsDateArray.length === 0) return '';\n finalValue = `(${valueAsDateArray\n .map(value =>\n datetimeValueProcessorNL(\n { field: rule.field, operator: '=', value: value[1] },\n { ...opts, context: { ...context, originalValue: value[0] } }\n )\n )\n .join(', ')})`;\n }\n break;\n\n case 'between':\n case 'notbetween':\n {\n if (valueAsDateArray.length < 2) return '';\n const [first, second] = valueAsDateArray;\n const orderedArray = apiFns.isBefore(first[1], second[1])\n ? [first, second]\n : [second, first];\n finalValue = orderedArray\n .map(([originalValue, value]) =>\n datetimeValueProcessorNL(\n { field: rule.field, operator: '=', value },\n { ...opts, context: { ...context, originalValue } }\n )\n )\n .join(` ${opts.translations?.and ?? 'and'} `);\n }\n break;\n\n default: {\n const [originalValue, value] = valueAsDateArray[0] ?? ['', ''];\n finalValue = originalValue\n ? datetimeValueProcessorNL(\n { field: rule.field, operator: '=', value },\n { ...opts, context: { ...context, originalValue } }\n )\n : '';\n }\n }\n\n const processedField = getQuotedFieldName(fieldData?.label ?? rule.field, {\n quoteFieldNamesWith,\n fieldIdentifierSeparator,\n });\n\n const processedOperator = operatorProcessor(rule, {\n ...opts,\n operatorMap: { ...defaultDateTimeNLOperatorMap, ...operatorMap },\n });\n\n const wordOrderMap = {\n S: processedField,\n V: processedOperator,\n O: finalValue,\n };\n\n return normalizeConstituentWordOrder(wordOrder)\n .map(term => `${wordOrderMap[term]}`)\n .join(' ')\n .trim();\n };\n","import type { RuleProcessor, SQLPreset, ValueProcessorByRule } from 'react-querybuilder';\nimport {\n defaultRuleProcessorSQL,\n defaultValueProcessorByRule,\n getQuotedFieldName,\n lc,\n mapSQLOperator,\n toArray,\n} from 'react-querybuilder';\nimport type { RQBDateTimeLibraryAPI } from './types';\nimport { isISOStringDateOnly, processIsDateField } from './utils';\n\n/**\n * Generates a value processor with date/time features for use by\n * {@link react-querybuilder!index.formatQuery formatQuery} with the \"sql\" format and \"ansi\" preset.\n */\nexport const getDatetimeValueProcessorANSI =\n ({ toISOStringDateOnly, toISOString }: RQBDateTimeLibraryAPI): ValueProcessorByRule =>\n (rule, opts) => {\n if (isISOStringDateOnly(opts?.context?.originalValue)) {\n return defaultValueProcessorByRule({ ...rule, value: toISOStringDateOnly(rule.value) }, opts);\n }\n return defaultValueProcessorByRule({ ...rule, value: toISOString(rule.value as Date) }, opts);\n };\n\n/**\n * Generates a value processor with date/time features for use by {@link react-querybuilder!index.formatQuery formatQuery} with\n * the \"sql\" format and \"mssql\" preset.\n */\nexport const getDatetimeValueProcessorMSSQL =\n ({ toISOStringDateOnly, toISOString }: RQBDateTimeLibraryAPI): ValueProcessorByRule =>\n (rule, opts) => {\n const datatype = /^(?:small)?datetime/i.test(opts?.fieldData?.datatype as string)\n ? 'datetimeoffset'\n : 'date';\n const value =\n datatype === 'datetimeoffset' ? toISOString(rule.value) : toISOStringDateOnly(rule.value);\n return defaultValueProcessorByRule(\n { ...rule, value },\n { ...opts, wrapValueWith: [`cast(`, ` as ${datatype})`] }\n );\n };\n\n/**\n * Generates a value processor with date/time features for use by {@link react-querybuilder!index.formatQuery formatQuery} with\n * the \"sql\" format and \"mysql\" preset.\n */\nexport const getDatetimeValueProcessorMySQL =\n ({ toISOStringDateOnly, toISOString }: RQBDateTimeLibraryAPI): ValueProcessorByRule =>\n (rule, opts) => {\n const datatype = /^(?:datetime|timestamp)/i.test(opts?.fieldData?.datatype as string)\n ? 'datetime'\n : 'date';\n const value =\n datatype === 'datetime' ? toISOString(rule.value) : toISOStringDateOnly(rule.value);\n return defaultValueProcessorByRule(\n { ...rule, value },\n { ...opts, wrapValueWith: [`cast(`, ` as ${datatype})`] }\n );\n };\n\n/**\n * Generates a value processor with date/time features for use by {@link react-querybuilder!index.formatQuery formatQuery} with\n * the \"sql\" format and \"oracle\" preset.\n */\nexport const getDatetimeValueProcessorOracle =\n ({ toISOStringDateOnly, toISOString }: RQBDateTimeLibraryAPI): ValueProcessorByRule =>\n (rule, opts) => {\n // Oracle date format for _reading_ ISO 8601: 'YYYY-MM-DD\"T\"HH24:MI:SS.ff3\"Z\"'\n const datatype = /^timestamp/i.test(opts?.fieldData?.datatype as string) ? 'timestamp' : 'date';\n const value =\n datatype === 'timestamp'\n ? toISOString(rule.value).replaceAll('T', ' ').replace('Z', ' UTC')\n : toISOStringDateOnly(rule.value);\n return defaultValueProcessorByRule(\n { ...rule, value },\n { ...opts, wrapValueWith: [datatype, ``] }\n );\n };\n\n/**\n * Generates a value processor with date/time features for use by {@link react-querybuilder!index.formatQuery formatQuery} with\n * the \"sql\" format and \"postgresql\" preset.\n */\nexport const getDatetimeValueProcessorPostgreSQL =\n ({ toISOStringDateOnly, toISOString }: RQBDateTimeLibraryAPI): ValueProcessorByRule =>\n (rule, opts) => {\n const datatype = /^timestamp/i.test(opts?.fieldData?.datatype as string) ? 'timestamp' : 'date';\n const value =\n datatype === 'timestamp' ? toISOString(rule.value) : toISOStringDateOnly(rule.value);\n return defaultValueProcessorByRule(\n { ...rule, value },\n { ...opts, wrapValueWith: [datatype, ``] }\n );\n };\n\nconst presetToValueProcessorMap = {\n ansi: getDatetimeValueProcessorANSI,\n mssql: getDatetimeValueProcessorMSSQL,\n mysql: getDatetimeValueProcessorMySQL,\n oracle: getDatetimeValueProcessorOracle,\n postgresql: getDatetimeValueProcessorPostgreSQL,\n sqlite: getDatetimeValueProcessorANSI,\n} satisfies Record<SQLPreset, (apiFns: RQBDateTimeLibraryAPI) => ValueProcessorByRule>;\n\n/**\n * Generates a rule processor with date/time features for use by {@link react-querybuilder!index.formatQuery formatQuery} with\n * the \"sql\" format.\n */\nexport const getDatetimeRuleProcessorSQL =\n (apiFns: RQBDateTimeLibraryAPI): RuleProcessor =>\n (rule, options) => {\n const opts = options ?? /* istanbul ignore next */ {};\n const operator = mapSQLOperator(rule.operator);\n const operatorLowerCase = lc(operator);\n // istanbul ignore next\n const {\n quoteFieldNamesWith = ['', ''] as [string, string],\n fieldIdentifierSeparator = '',\n context = {},\n } = opts;\n let finalValue = '';\n\n if (rule.valueSource === 'field' || !processIsDateField(context.isDateField, rule, opts)) {\n return defaultRuleProcessorSQL(rule, opts);\n }\n\n const valueProcessor = presetToValueProcessorMap[opts.preset!](apiFns);\n\n const valueAsArray: string[] = toArray(rule.value, { retainEmptyStrings: false });\n const valueAsDateArray = valueAsArray\n .map((v): [string, Date] => [v, apiFns.toDate(v)])\n .filter(v => apiFns.isValid(v[1]));\n\n switch (operatorLowerCase) {\n case 'in':\n case 'not in':\n {\n if (valueAsDateArray.length === 0) return '';\n finalValue = `(${valueAsDateArray\n .map(value =>\n valueProcessor(\n { field: rule.field, operator: '=', value: value[1] },\n { ...opts, context: { originalValue: value[0] } }\n )\n )\n .join(', ')})`;\n }\n break;\n\n case 'between':\n case 'not between':\n {\n if (valueAsDateArray.length < 2) return '';\n const [first, second] = valueAsDateArray;\n const orderedArray = apiFns.isBefore(first[1], second[1])\n ? [first, second]\n : [second, first];\n finalValue = orderedArray\n .map(([originalValue, value]) =>\n valueProcessor(\n { field: rule.field, operator: '=', value },\n { ...opts, context: { originalValue } }\n )\n )\n .join(' and ');\n }\n break;\n\n default: {\n const [originalValue, value] = valueAsDateArray[0] ?? ['', ''];\n finalValue = valueProcessor(\n { field: rule.field, operator: '=', value },\n { ...opts, context: { originalValue } }\n );\n }\n }\n\n return `${getQuotedFieldName(rule.field, { quoteFieldNamesWith, fieldIdentifierSeparator })} ${operator} ${finalValue}`.trim();\n };\n"],"x_google_ignoreList":[4,5,6,7,8],"mappings":";;;AAGA,MAAa,uBACX,SAEA,OAAO,SAAS,YAAY,sBAAsB,KAAK;AAEzD,MAAaA,sBACX,GAAG,CAAC,MAAM,UAEV;;aAAK,aAAa,cAClB,KAAK,aAAa,gBAClB,KAAK,aAAa,cAClB,KAAK,aAAa,oBAClB,KAAK,aAAa,sBAClB,KAAK,aAAa,oBAClB,KAAK,aAAa,UAClB,KAAK,aAAa,aAClB,iDAAiD,4DAAK,KAAM,6EAAW;;AAEzE,MAAa,sBACX,aACA,GAAG,CAAC,MAAM,UACE;AACZ,KAAI,OAAO,gBAAgB,UACzB,QAAO;AAGT,KAAI,OAAO,gBAAgB,WACzB,QAAO,YAAY,MAAM;AAG3B,KAAI,MAAM,QAAQ,aAChB,QAAO,YAAY,MAAK,cACtB,OAAO,QAAQ,WAAW,OAAO,CAAC,KAAK,WAAW;;uEAAM,+EAAY,UAAS;;AAIjF,KAAI,OAAO,gBAAgB,SACzB,QAAO,OAAO,QAAQ,aAAa,OAAO,CAAC,KAAK,WAAW;;uEAAM,+EAAY,UAAS;;AAGxF,QAAO,mBAAmB,MAAM;;;;;;;;;ACrClC,MAAa,kCAAkC,EAC7C,SACA,UACA,cAC4D;CAC5D,YAAY,GAAG,MA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iB,SAAS,EAAG,QAAO;IACxC,MAAM,CAAC,OAAO,UAAU;IACxB,MAAM,eAAe,OAAO,SAAS,MAAM,IAAI,OAAO,MAClD,CAAC,OAAO,UACR,CAAC,QAAQ;AACb,iBAAa,aACV,KAAK,CAAC,eAAe,WACpB,eACE;KAAE,OAAO,KAAK;KAAO,UAAU;KAAK;yCAC/B,aAAM,SAAS,EAAE,qBAGzB,KAAK;;AAEV;EAEF,SAAS;;GACP,MAAM,CAAC,eAAe,+BAAS,iBAAiB,qEAAM,CAAC,IAAI;AAC3D,gBAAa,eACX;IAAE,OAAO,KAAK;IAAO,UAAU;IAAK;wCAC/B,aAAM,SAAS,EAAE;;;AAK5B,QAAO,GAAG,mBAAmB,KAAK,OAAO;EAAE;EAAqB;IAA4B,GAAG,SAAS,GAAG,aAAa"}
|
|
@@ -1,61 +1,76 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
getDatetimeRuleProcessorCEL,
|
|
4
|
-
getDatetimeRuleProcessorMongoDBQuery,
|
|
5
|
-
getDatetimeRuleProcessorNL,
|
|
6
|
-
getDatetimeRuleProcessorSQL,
|
|
7
|
-
getDatetimeValueProcessorANSI,
|
|
8
|
-
getDatetimeValueProcessorMSSQL,
|
|
9
|
-
getDatetimeValueProcessorMySQL,
|
|
10
|
-
getDatetimeValueProcessorOracle,
|
|
11
|
-
getDatetimeValueProcessorPostgreSQL,
|
|
12
|
-
isISOStringDateOnly
|
|
13
|
-
} from "./chunk-ZLH5EH6W.mjs";
|
|
1
|
+
import { getDatetimeJsonLogicOperations, getDatetimeRuleProcessorCEL, getDatetimeRuleProcessorMongoDBQuery, getDatetimeRuleProcessorNL, getDatetimeRuleProcessorSQL, getDatetimeValueProcessorANSI, getDatetimeValueProcessorMSSQL, getDatetimeValueProcessorMySQL, getDatetimeValueProcessorOracle, getDatetimeValueProcessorPostgreSQL, isISOStringDateOnly } from "./getDatetimeRuleProcessorSQL-CocyaiI5.mjs";
|
|
2
|
+
import { format, isAfter, isBefore, isSameDay, isValid, parseISO, toDate } from "date-fns";
|
|
14
3
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
4
|
+
//#region src/rqbDateTimeLibraryAPI.date-fns.ts
|
|
5
|
+
const toDate$1 = (a) => typeof a === "string" ? parseISO(a) : toDate(a);
|
|
6
|
+
const iso8601DateOnly = "yyyy-MM-dd";
|
|
7
|
+
/**
|
|
8
|
+
* {@link RQBDateTimeLibraryAPI} for date-fns
|
|
9
|
+
*/
|
|
10
|
+
const rqbDateTimeLibraryAPI = {
|
|
11
|
+
format: (d, fmt) => format(toDate$1(d), fmt.replace("YYYY-MM-DD", iso8601DateOnly)),
|
|
12
|
+
isAfter,
|
|
13
|
+
isBefore,
|
|
14
|
+
isSame: (a, b) => {
|
|
15
|
+
const aToDate = toDate$1(a);
|
|
16
|
+
const bToDate = toDate$1(b);
|
|
17
|
+
return isISOStringDateOnly(a) || isISOStringDateOnly(b) ? isSameDay(aToDate, bToDate) : aToDate.getTime() === bToDate.getTime();
|
|
18
|
+
},
|
|
19
|
+
isValid: (d) => isValid(toDate$1(d)),
|
|
20
|
+
toDate: toDate$1,
|
|
21
|
+
toISOString: (d) => {
|
|
22
|
+
const dToDate = toDate$1(d);
|
|
23
|
+
return isValid(dToDate) ? dToDate.toISOString() : "";
|
|
24
|
+
},
|
|
25
|
+
toISOStringDateOnly: (d) => {
|
|
26
|
+
const dToDate = toDate$1(d);
|
|
27
|
+
return isValid(dToDate) ? format(dToDate, iso8601DateOnly) : "";
|
|
28
|
+
}
|
|
19
29
|
};
|
|
20
|
-
var iso8601DateOnly = "yyyy-MM-dd";
|
|
21
|
-
var rqbDateTimeLibraryAPI = { format: function format(d, fmt) {
|
|
22
|
-
return _format(toDate(d), fmt.replace("YYYY-MM-DD", iso8601DateOnly));
|
|
23
|
-
}, isAfter, isBefore, isSame: function isSame(a, b) {
|
|
24
|
-
var aToDate = toDate(a);
|
|
25
|
-
var bToDate = toDate(b);
|
|
26
|
-
return isISOStringDateOnly(a) || isISOStringDateOnly(b) ? isSameDay(aToDate, bToDate) : aToDate.getTime() === bToDate.getTime();
|
|
27
|
-
}, isValid: function isValid(d) {
|
|
28
|
-
return _isValid(toDate(d));
|
|
29
|
-
}, toDate, toISOString: function toISOString(d) {
|
|
30
|
-
var dToDate = toDate(d);
|
|
31
|
-
return _isValid(dToDate) ? dToDate.toISOString() : "";
|
|
32
|
-
}, toISOStringDateOnly: function toISOStringDateOnly(d) {
|
|
33
|
-
var dToDate = toDate(d);
|
|
34
|
-
return _isValid(dToDate) ? _format(dToDate, iso8601DateOnly) : "";
|
|
35
|
-
} };
|
|
36
30
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/index.date-fns.ts
|
|
33
|
+
/**
|
|
34
|
+
* Custom JsonLogic date/time operations using date-fns
|
|
35
|
+
*/
|
|
36
|
+
const jsonLogicDateTimeOperations = getDatetimeJsonLogicOperations(rqbDateTimeLibraryAPI);
|
|
37
|
+
/**
|
|
38
|
+
* {@link react-querybuilder!index.formatQuery formatQuery} rule processor for "sql" format using date-fns
|
|
39
|
+
*/
|
|
40
|
+
const datetimeRuleProcessorSQL = getDatetimeRuleProcessorSQL(rqbDateTimeLibraryAPI);
|
|
41
|
+
/**
|
|
42
|
+
* {@link react-querybuilder!index.formatQuery formatQuery} value processor for "sql" format ("ansi" preset) using date-fns
|
|
43
|
+
*/
|
|
44
|
+
const datetimeValueProcessorANSI = getDatetimeValueProcessorANSI(rqbDateTimeLibraryAPI);
|
|
45
|
+
/**
|
|
46
|
+
* {@link react-querybuilder!index.formatQuery formatQuery} value processor for "sql" format ("mssql" preset) using date-fns
|
|
47
|
+
*/
|
|
48
|
+
const datetimeValueProcessorMSSQL = getDatetimeValueProcessorMSSQL(rqbDateTimeLibraryAPI);
|
|
49
|
+
/**
|
|
50
|
+
* {@link react-querybuilder!index.formatQuery formatQuery} value processor for "sql" format ("mysql" preset) using date-fns
|
|
51
|
+
*/
|
|
52
|
+
const datetimeValueProcessorMySQL = getDatetimeValueProcessorMySQL(rqbDateTimeLibraryAPI);
|
|
53
|
+
/**
|
|
54
|
+
* {@link react-querybuilder!index.formatQuery formatQuery} value processor for "sql" format ("oracle" preset) using date-fns
|
|
55
|
+
*/
|
|
56
|
+
const datetimeValueProcessorOracle = getDatetimeValueProcessorOracle(rqbDateTimeLibraryAPI);
|
|
57
|
+
/**
|
|
58
|
+
* {@link react-querybuilder!index.formatQuery formatQuery} value processor for "sql" format ("postgresql" preset) using date-fns
|
|
59
|
+
*/
|
|
60
|
+
const datetimeValueProcessorPostgreSQL = getDatetimeValueProcessorPostgreSQL(rqbDateTimeLibraryAPI);
|
|
61
|
+
/**
|
|
62
|
+
* {@link react-querybuilder!index.formatQuery formatQuery} rule processor for "cel" format using date-fns
|
|
63
|
+
*/
|
|
64
|
+
const datetimeRuleProcessorCEL = getDatetimeRuleProcessorCEL(rqbDateTimeLibraryAPI);
|
|
65
|
+
/**
|
|
66
|
+
* {@link react-querybuilder!index.formatQuery formatQuery} rule processor for "mongodb_query" format using date-fns
|
|
67
|
+
*/
|
|
68
|
+
const datetimeRuleProcessorMongoDBQuery = getDatetimeRuleProcessorMongoDBQuery(rqbDateTimeLibraryAPI);
|
|
69
|
+
/**
|
|
70
|
+
* {@link react-querybuilder!index.formatQuery formatQuery} rule processor for "natural_language" format using date-fns
|
|
71
|
+
*/
|
|
72
|
+
const datetimeRuleProcessorNL = getDatetimeRuleProcessorNL(rqbDateTimeLibraryAPI);
|
|
73
|
+
|
|
74
|
+
//#endregion
|
|
75
|
+
export { datetimeRuleProcessorCEL, datetimeRuleProcessorMongoDBQuery, datetimeRuleProcessorNL, datetimeRuleProcessorSQL, datetimeValueProcessorANSI, datetimeValueProcessorMSSQL, datetimeValueProcessorMySQL, datetimeValueProcessorOracle, datetimeValueProcessorPostgreSQL, jsonLogicDateTimeOperations, rqbDateTimeLibraryAPI };
|
|
61
76
|
//# sourceMappingURL=react-querybuilder_datetime.date-fns.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/rqbDateTimeLibraryAPI.date-fns.ts","../src/index.date-fns.ts"],"sourcesContent":["import{toDate as dateFnsToDate
|
|
1
|
+
{"version":3,"file":"react-querybuilder_datetime.date-fns.mjs","names":["toDate: typeof dateFnsToDate","dateFnsToDate","rqbDateTimeLibraryAPI: RQBDateTimeLibraryAPI","toDate","jsonLogicDateTimeOperations: RQBJsonLogicDateTimeOperations","datetimeRuleProcessorSQL: RuleProcessor","datetimeValueProcessorANSI: ValueProcessorByRule","datetimeValueProcessorMSSQL: ValueProcessorByRule","datetimeValueProcessorMySQL: ValueProcessorByRule","datetimeValueProcessorOracle: ValueProcessorByRule","datetimeValueProcessorPostgreSQL: ValueProcessorByRule","datetimeRuleProcessorCEL: ValueProcessorByRule","datetimeRuleProcessorMongoDBQuery: ValueProcessorByRule","datetimeRuleProcessorNL: ValueProcessorByRule"],"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!index.formatQuery formatQuery} rule processor for \"sql\" format using date-fns\n */\nexport const datetimeRuleProcessorSQL: RuleProcessor =\n getDatetimeRuleProcessorSQL(rqbDateTimeLibraryAPI);\n/**\n * {@link react-querybuilder!index.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!index.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!index.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!index.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!index.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!index.formatQuery formatQuery} rule processor for \"cel\" format using date-fns\n */\nexport const datetimeRuleProcessorCEL: ValueProcessorByRule =\n getDatetimeRuleProcessorCEL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link react-querybuilder!index.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!index.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":";;;;AAYA,MAAMA,YAA+B,MAAM,OAAO,MAAM,WAAW,SAAS,KAAKC,OAAc;AAC/F,MAAM,kBAAkB;;;;AAKxB,MAAaC,wBAA+C;CAC1D,SAAS,GAAG,QAAQ,OAAOC,SAAO,IAAI,IAAI,QAAQ,cAAc;CAChE;CACA;CACA,SAAS,GAAG,MAAM;EAChB,MAAM,UAAUA,SAAO;EACvB,MAAM,UAAUA,SAAO;AACvB,SAAO,oBAAoB,MAAM,oBAAoB,KACjD,UAAU,SAAS,WACnB,QAAQ,cAAc,QAAQ;;CAEpC,UAAS,MAAK,QAAQA,SAAO;CAC7B;CACA,cAAa,MAAK;EAChB,MAAM,UAAUA,SAAO;AACvB,SAAO,QAAQ,WAAW,QAAQ,gBAAgB;;CAEpD,sBAAqB,MAAK;EACxB,MAAM,UAAUA,SAAO;AACvB,SAAO,QAAQ,WAAW,OAAO,SAAS,mBAAmB;;;;;;;;;ACZjE,MAAaC,8BACX,+BAA+B;;;;AAKjC,MAAaC,2BACX,4BAA4B;;;;AAI9B,MAAaC,6BACX,8BAA8B;;;;AAIhC,MAAaC,8BACX,+BAA+B;;;;AAIjC,MAAaC,8BACX,+BAA+B;;;;AAIjC,MAAaC,+BACX,gCAAgC;;;;AAIlC,MAAaC,mCACX,oCAAoC;;;;AAKtC,MAAaC,2BACX,4BAA4B;;;;AAK9B,MAAaC,oCACX,qCAAqC;;;;AAKvC,MAAaC,0BACX,2BAA2B"}
|