@react-querybuilder/datetime 8.8.3 → 8.9.1

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.
Files changed (134) hide show
  1. package/dist/cjs/date-fns.d.ts +1 -0
  2. package/dist/cjs/dayjs.d.ts +1 -0
  3. package/dist/cjs/getDatetimeRuleProcessorSQL-D95jgDK6.js +2 -0
  4. package/dist/cjs/getDatetimeRuleProcessorSQL-D95jgDK6.js.map +1 -0
  5. package/dist/cjs/index.d.ts +1 -0
  6. package/dist/cjs/jsdate.d.ts +1 -0
  7. package/dist/cjs/luxon.d.ts +1 -0
  8. package/dist/cjs/react-querybuilder_datetime.cjs.development.d.ts +108 -0
  9. package/dist/cjs/react-querybuilder_datetime.cjs.development.date-fns.d.ts +53 -0
  10. package/dist/cjs/react-querybuilder_datetime.cjs.development.date-fns.js +82 -775
  11. package/dist/cjs/react-querybuilder_datetime.cjs.development.date-fns.js.map +1 -1
  12. package/dist/cjs/react-querybuilder_datetime.cjs.development.dayjs.d.ts +53 -0
  13. package/dist/cjs/react-querybuilder_datetime.cjs.development.dayjs.js +76 -785
  14. package/dist/cjs/react-querybuilder_datetime.cjs.development.dayjs.js.map +1 -1
  15. package/dist/cjs/react-querybuilder_datetime.cjs.development.js +125 -934
  16. package/dist/cjs/react-querybuilder_datetime.cjs.development.js.map +1 -1
  17. package/dist/cjs/react-querybuilder_datetime.cjs.development.jsdate.d.ts +56 -0
  18. package/dist/cjs/react-querybuilder_datetime.cjs.development.jsdate.js +113 -834
  19. package/dist/cjs/react-querybuilder_datetime.cjs.development.jsdate.js.map +1 -1
  20. package/dist/cjs/react-querybuilder_datetime.cjs.development.luxon.d.ts +53 -0
  21. package/dist/cjs/react-querybuilder_datetime.cjs.development.luxon.js +78 -779
  22. package/dist/cjs/react-querybuilder_datetime.cjs.development.luxon.js.map +1 -1
  23. package/dist/cjs/react-querybuilder_datetime.cjs.production.d.ts +108 -0
  24. package/dist/cjs/react-querybuilder_datetime.cjs.production.date-fns.d.ts +53 -0
  25. package/dist/cjs/react-querybuilder_datetime.cjs.production.date-fns.js +1 -6
  26. package/dist/cjs/react-querybuilder_datetime.cjs.production.date-fns.js.map +1 -1
  27. package/dist/cjs/react-querybuilder_datetime.cjs.production.dayjs.d.ts +53 -0
  28. package/dist/cjs/react-querybuilder_datetime.cjs.production.dayjs.js +1 -6
  29. package/dist/cjs/react-querybuilder_datetime.cjs.production.dayjs.js.map +1 -1
  30. package/dist/cjs/react-querybuilder_datetime.cjs.production.js +1 -7
  31. package/dist/cjs/react-querybuilder_datetime.cjs.production.js.map +1 -1
  32. package/dist/cjs/react-querybuilder_datetime.cjs.production.jsdate.d.ts +56 -0
  33. package/dist/cjs/react-querybuilder_datetime.cjs.production.jsdate.js +1 -7
  34. package/dist/cjs/react-querybuilder_datetime.cjs.production.jsdate.js.map +1 -1
  35. package/dist/cjs/react-querybuilder_datetime.cjs.production.luxon.d.ts +53 -0
  36. package/dist/cjs/react-querybuilder_datetime.cjs.production.luxon.js +1 -6
  37. package/dist/cjs/react-querybuilder_datetime.cjs.production.luxon.js.map +1 -1
  38. package/dist/cjs/types-QCQUGVZa.d.ts +1694 -0
  39. package/dist/getDatetimeRuleProcessorSQL-CN80oEFK.js +386 -0
  40. package/dist/getDatetimeRuleProcessorSQL-CN80oEFK.js.map +1 -0
  41. package/dist/getDatetimeRuleProcessorSQL-KYRPP9qd.mjs +367 -0
  42. package/dist/getDatetimeRuleProcessorSQL-KYRPP9qd.mjs.map +1 -0
  43. package/dist/react-querybuilder_datetime.d.mts +108 -0
  44. package/dist/react-querybuilder_datetime.date-fns.d.mts +53 -0
  45. package/dist/react-querybuilder_datetime.date-fns.mjs +72 -57
  46. package/dist/react-querybuilder_datetime.date-fns.mjs.map +1 -1
  47. package/dist/react-querybuilder_datetime.dayjs.d.mts +53 -0
  48. package/dist/react-querybuilder_datetime.dayjs.mjs +66 -57
  49. package/dist/react-querybuilder_datetime.dayjs.mjs.map +1 -1
  50. package/dist/react-querybuilder_datetime.jsdate.d.mts +56 -0
  51. package/dist/react-querybuilder_datetime.jsdate.mjs +102 -114
  52. package/dist/react-querybuilder_datetime.jsdate.mjs.map +1 -1
  53. package/dist/react-querybuilder_datetime.legacy-esm.d.ts +108 -0
  54. package/dist/react-querybuilder_datetime.legacy-esm.date-fns.d.ts +53 -0
  55. package/dist/react-querybuilder_datetime.legacy-esm.date-fns.js +72 -57
  56. package/dist/react-querybuilder_datetime.legacy-esm.date-fns.js.map +1 -1
  57. package/dist/react-querybuilder_datetime.legacy-esm.dayjs.d.ts +53 -0
  58. package/dist/react-querybuilder_datetime.legacy-esm.dayjs.js +66 -57
  59. package/dist/react-querybuilder_datetime.legacy-esm.dayjs.js.map +1 -1
  60. package/dist/react-querybuilder_datetime.legacy-esm.js +113 -215
  61. package/dist/react-querybuilder_datetime.legacy-esm.js.map +1 -1
  62. package/dist/react-querybuilder_datetime.legacy-esm.jsdate.d.ts +56 -0
  63. package/dist/react-querybuilder_datetime.legacy-esm.jsdate.js +102 -114
  64. package/dist/react-querybuilder_datetime.legacy-esm.jsdate.js.map +1 -1
  65. package/dist/react-querybuilder_datetime.legacy-esm.luxon.d.ts +53 -0
  66. package/dist/react-querybuilder_datetime.legacy-esm.luxon.js +68 -61
  67. package/dist/react-querybuilder_datetime.legacy-esm.luxon.js.map +1 -1
  68. package/dist/react-querybuilder_datetime.luxon.d.mts +53 -0
  69. package/dist/react-querybuilder_datetime.luxon.mjs +68 -61
  70. package/dist/react-querybuilder_datetime.luxon.mjs.map +1 -1
  71. package/dist/react-querybuilder_datetime.mjs +112 -215
  72. package/dist/react-querybuilder_datetime.mjs.map +1 -1
  73. package/dist/react-querybuilder_datetime.production.d.mts +108 -0
  74. package/dist/react-querybuilder_datetime.production.date-fns.d.mts +53 -0
  75. package/dist/react-querybuilder_datetime.production.date-fns.mjs +1 -1
  76. package/dist/react-querybuilder_datetime.production.date-fns.mjs.map +1 -1
  77. package/dist/react-querybuilder_datetime.production.dayjs.d.mts +53 -0
  78. package/dist/react-querybuilder_datetime.production.dayjs.mjs +1 -1
  79. package/dist/react-querybuilder_datetime.production.dayjs.mjs.map +1 -1
  80. package/dist/react-querybuilder_datetime.production.jsdate.d.mts +56 -0
  81. package/dist/react-querybuilder_datetime.production.jsdate.mjs +1 -2
  82. package/dist/react-querybuilder_datetime.production.jsdate.mjs.map +1 -1
  83. package/dist/react-querybuilder_datetime.production.luxon.d.mts +53 -0
  84. package/dist/react-querybuilder_datetime.production.luxon.mjs +1 -1
  85. package/dist/react-querybuilder_datetime.production.luxon.mjs.map +1 -1
  86. package/dist/react-querybuilder_datetime.production.mjs +1 -2
  87. package/dist/react-querybuilder_datetime.production.mjs.map +1 -1
  88. package/dist/types-CDEkL2M_.d.mts +1694 -0
  89. package/dist/types-EgfSemtR.d.ts +1694 -0
  90. package/package.json +24 -24
  91. package/dist/chunk-SLTJVKUE.mjs +0 -7
  92. package/dist/chunk-SLTJVKUE.mjs.map +0 -1
  93. package/dist/chunk-ZLH5EH6W.mjs +0 -713
  94. package/dist/chunk-ZLH5EH6W.mjs.map +0 -1
  95. package/dist/chunk-ZS6AX35I.js +0 -738
  96. package/dist/chunk-ZS6AX35I.js.map +0 -1
  97. package/dist/types/QueryBuilderDateTime.d.ts +0 -4
  98. package/dist/types/datetimeRuleProcessorJsonLogic.d.ts +0 -10
  99. package/dist/types/getDatetimeJsonLogicOperations.d.ts +0 -6
  100. package/dist/types/getDatetimeRuleProcessorCEL.d.ts +0 -7
  101. package/dist/types/getDatetimeRuleProcessorJSONata.d.ts +0 -7
  102. package/dist/types/getDatetimeRuleProcessorMongoDBQuery.d.ts +0 -7
  103. package/dist/types/getDatetimeRuleProcessorNL.d.ts +0 -13
  104. package/dist/types/getDatetimeRuleProcessorSQL.d.ts +0 -32
  105. package/dist/types/index.d.ts +0 -8
  106. package/dist/types/index.date-fns.d.ts +0 -48
  107. package/dist/types/index.dayjs.d.ts +0 -48
  108. package/dist/types/index.jsdate.d.ts +0 -48
  109. package/dist/types/index.luxon.d.ts +0 -48
  110. package/dist/types/rqbDateTimeLibraryAPI.date-fns.d.ts +0 -5
  111. package/dist/types/rqbDateTimeLibraryAPI.dayjs.d.ts +0 -5
  112. package/dist/types/rqbDateTimeLibraryAPI.jsdate.d.ts +0 -8
  113. package/dist/types/rqbDateTimeLibraryAPI.luxon.d.ts +0 -5
  114. package/dist/types/types.d.ts +0 -111
  115. package/dist/types/utils.d.ts +0 -5
  116. package/dist/types-esm/QueryBuilderDateTime.d.mts +0 -4
  117. package/dist/types-esm/datetimeRuleProcessorJsonLogic.d.mts +0 -10
  118. package/dist/types-esm/getDatetimeJsonLogicOperations.d.mts +0 -6
  119. package/dist/types-esm/getDatetimeRuleProcessorCEL.d.mts +0 -7
  120. package/dist/types-esm/getDatetimeRuleProcessorJSONata.d.mts +0 -7
  121. package/dist/types-esm/getDatetimeRuleProcessorMongoDBQuery.d.mts +0 -7
  122. package/dist/types-esm/getDatetimeRuleProcessorNL.d.mts +0 -13
  123. package/dist/types-esm/getDatetimeRuleProcessorSQL.d.mts +0 -32
  124. package/dist/types-esm/index.d.mts +0 -8
  125. package/dist/types-esm/index.date-fns.d.mts +0 -48
  126. package/dist/types-esm/index.dayjs.d.mts +0 -48
  127. package/dist/types-esm/index.jsdate.d.mts +0 -48
  128. package/dist/types-esm/index.luxon.d.mts +0 -48
  129. package/dist/types-esm/rqbDateTimeLibraryAPI.date-fns.d.mts +0 -5
  130. package/dist/types-esm/rqbDateTimeLibraryAPI.dayjs.d.mts +0 -5
  131. package/dist/types-esm/rqbDateTimeLibraryAPI.jsdate.d.mts +0 -8
  132. package/dist/types-esm/rqbDateTimeLibraryAPI.luxon.d.mts +0 -5
  133. package/dist/types-esm/types.d.mts +0 -111
  134. package/dist/types-esm/utils.d.mts +0 -5
@@ -0,0 +1,56 @@
1
+ import { RQBDateTimeLibraryAPI, RQBJsonLogicDateTimeOperations, RuleProcessor, ValueProcessorByRule } from "./types-EgfSemtR.js";
2
+
3
+ //#region src/rqbDateTimeLibraryAPI.jsdate.d.ts
4
+
5
+ /**
6
+ * {@link RQBDateTimeLibraryAPI} for JavaScript `Date`
7
+ *
8
+ * @deprecated This API will not be removed, but we recommend using one of the other
9
+ * {@link RQBDateTimeLibraryAPI}s based on a popular library instead.
10
+ */
11
+ declare const rqbDateTimeLibraryAPI: RQBDateTimeLibraryAPI;
12
+ //#endregion
13
+ //#region src/index.jsdate.d.ts
14
+ /**
15
+ * Custom JsonLogic date/time operations using JavaScript `Date`.
16
+ */
17
+ declare const jsonLogicDateTimeOperations: RQBJsonLogicDateTimeOperations;
18
+ /**
19
+ * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "sql" format using JavaScript `Date`
20
+ */
21
+ declare const datetimeRuleProcessorSQL: RuleProcessor;
22
+ /**
23
+ * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("ansi" preset) using JavaScript `Date`
24
+ */
25
+ declare const datetimeValueProcessorANSI: ValueProcessorByRule;
26
+ /**
27
+ * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("mssql" preset) using JavaScript `Date`
28
+ */
29
+ declare const datetimeValueProcessorMSSQL: ValueProcessorByRule;
30
+ /**
31
+ * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("mysql" preset) using JavaScript `Date`
32
+ */
33
+ declare const datetimeValueProcessorMySQL: ValueProcessorByRule;
34
+ /**
35
+ * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("oracle" preset) using JavaScript `Date`
36
+ */
37
+ declare const datetimeValueProcessorOracle: ValueProcessorByRule;
38
+ /**
39
+ * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("postgresql" preset) using JavaScript `Date`
40
+ */
41
+ declare const datetimeValueProcessorPostgreSQL: ValueProcessorByRule;
42
+ /**
43
+ * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "cel" format using JavaScript `Date`
44
+ */
45
+ declare const datetimeRuleProcessorCEL: RuleProcessor;
46
+ /**
47
+ * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "mongodb_query" format using JavaScript `Date`
48
+ */
49
+ declare const datetimeRuleProcessorMongoDBQuery: RuleProcessor;
50
+ /**
51
+ * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "natural_language" format using JavaScript `Date`
52
+ */
53
+ declare const datetimeRuleProcessorNL: ValueProcessorByRule;
54
+ //#endregion
55
+ export { datetimeRuleProcessorCEL, datetimeRuleProcessorMongoDBQuery, datetimeRuleProcessorNL, datetimeRuleProcessorSQL, datetimeValueProcessorANSI, datetimeValueProcessorMSSQL, datetimeValueProcessorMySQL, datetimeValueProcessorOracle, datetimeValueProcessorPostgreSQL, jsonLogicDateTimeOperations, rqbDateTimeLibraryAPI };
56
+ //# sourceMappingURL=react-querybuilder_datetime.legacy-esm.jsdate.d.ts.map
@@ -1,120 +1,108 @@
1
- import {
2
- getDatetimeJsonLogicOperations,
3
- getDatetimeRuleProcessorCEL,
4
- getDatetimeRuleProcessorMongoDBQuery,
5
- getDatetimeRuleProcessorNL,
6
- getDatetimeRuleProcessorSQL,
7
- getDatetimeValueProcessorANSI,
8
- getDatetimeValueProcessorMSSQL,
9
- getDatetimeValueProcessorMySQL,
10
- getDatetimeValueProcessorOracle,
11
- getDatetimeValueProcessorPostgreSQL,
12
- isISOStringDateOnly
13
- } from "./chunk-ZS6AX35I.js";
1
+ import { getDatetimeJsonLogicOperations, getDatetimeRuleProcessorCEL, getDatetimeRuleProcessorMongoDBQuery, getDatetimeRuleProcessorNL, getDatetimeRuleProcessorSQL, getDatetimeValueProcessorANSI, getDatetimeValueProcessorMSSQL, getDatetimeValueProcessorMySQL, getDatetimeValueProcessorOracle, getDatetimeValueProcessorPostgreSQL, isISOStringDateOnly } from "./getDatetimeRuleProcessorSQL-CN80oEFK.js";
14
2
 
15
- // src/rqbDateTimeLibraryAPI.jsdate.ts
16
- function _slicedToArray(r, e) {
17
- return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
18
- }
19
- function _nonIterableRest() {
20
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
21
- }
22
- function _unsupportedIterableToArray(r, a) {
23
- if (r) {
24
- if ("string" == typeof r) return _arrayLikeToArray(r, a);
25
- var t = {}.toString.call(r).slice(8, -1);
26
- return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
27
- }
28
- }
29
- function _arrayLikeToArray(r, a) {
30
- (null == a || a > r.length) && (a = r.length);
31
- for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
32
- return n;
33
- }
34
- function _iterableToArrayLimit(r, l) {
35
- var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
36
- if (null != t) {
37
- var e, n, i, u, a = [], f = true, o = false;
38
- try {
39
- if (i = (t = t.call(r)).next, 0 === l) {
40
- if (Object(t) !== t) return;
41
- f = false;
42
- } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = true) ;
43
- } catch (r2) {
44
- o = true, n = r2;
45
- } finally {
46
- try {
47
- if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
48
- } finally {
49
- if (o) throw n;
50
- }
51
- }
52
- return a;
53
- }
54
- }
55
- function _arrayWithHoles(r) {
56
- if (Array.isArray(r)) return r;
57
- }
58
- var invalidDate = new Date(Number.NaN);
59
- var dateRegExp = /^(\d{4})-(\d{2})-(\d{2})([T ](\d{2}):(\d{2}):(\d{2})(\.(\d{1,3}))?)?/;
60
- var toDate = function toDate2(d) {
61
- if (d instanceof Date) return d;
62
- var reMatch = dateRegExp.exec(d);
63
- if (!reMatch) return invalidDate;
64
- var _reMatch = _slicedToArray(reMatch, 10), _all = _reMatch[0], yyyy = _reMatch[1], mm = _reMatch[2], dd = _reMatch[3], _time = _reMatch[4], hh = _reMatch[5], mi = _reMatch[6], ss = _reMatch[7], _decimal = _reMatch[8], sss = _reMatch[9];
65
- var _filter$map = [yyyy, mm, dd, hh, mi, ss, sss != null ? sss : "0"].filter(Boolean).map(Number), _filter$map2 = _slicedToArray(_filter$map, 7), year = _filter$map2[0], month = _filter$map2[1], day = _filter$map2[2], hours = _filter$map2[3], minutes = _filter$map2[4], seconds = _filter$map2[5], ms = _filter$map2[6];
66
- var monthIndex = month - 1;
67
- return hh ? new Date(Date.UTC(year, monthIndex, day, hours, minutes, seconds, ms)) : new Date(year, monthIndex, day);
3
+ //#region src/rqbDateTimeLibraryAPI.jsdate.ts
4
+ const invalidDate = /* @__PURE__ */ new Date(NaN);
5
+ const dateRegExp = /^(\d{4})-(\d{2})-(\d{2})([T ](\d{2}):(\d{2}):(\d{2})(\.(\d{1,3}))?)?/;
6
+ const toDate = (d) => {
7
+ if (d instanceof Date) return d;
8
+ const reMatch = dateRegExp.exec(d);
9
+ if (!reMatch) return invalidDate;
10
+ const [_all, yyyy, mm, dd, _time, hh, mi, ss, _decimal, sss] = reMatch;
11
+ const [year, month, day, hours, minutes, seconds, ms] = [
12
+ yyyy,
13
+ mm,
14
+ dd,
15
+ hh,
16
+ mi,
17
+ ss,
18
+ sss !== null && sss !== void 0 ? sss : "0"
19
+ ].filter(Boolean).map(Number);
20
+ const monthIndex = month - 1;
21
+ return hh ? new Date(Date.UTC(year, monthIndex, day, hours, minutes, seconds, ms)) : new Date(year, monthIndex, day);
68
22
  };
69
- var isValid = function isValid2(d) {
70
- var dToDate = toDate(d);
71
- return dToDate instanceof Date && !Number.isNaN(dToDate.getTime());
23
+ const isValid = (d) => {
24
+ const dToDate = toDate(d);
25
+ return dToDate instanceof Date && !Number.isNaN(dToDate.getTime());
72
26
  };
73
- var toISOStringDateOnly = function toISOStringDateOnly2(d) {
74
- var dToDate = toDate(d);
75
- return isValid(dToDate) ? dToDate.toISOString().slice(0, 10) : "";
27
+ const toISOStringDateOnly = (d) => {
28
+ const dToDate = toDate(d);
29
+ return isValid(dToDate) ? dToDate.toISOString().slice(0, 10) : "";
76
30
  };
77
- var rqbDateTimeLibraryAPI = { format: function format(d) {
78
- return toDate(d).toISOString();
79
- }, isAfter: function isAfter(a, b) {
80
- var dateA = toDate(a).getTime();
81
- var dateB = toDate(b).getTime();
82
- return !Number.isNaN(dateA) && !Number.isNaN(dateB) && dateA > dateB;
83
- }, isBefore: function isBefore(a, b) {
84
- var dateA = toDate(a).getTime();
85
- var dateB = toDate(b).getTime();
86
- return !Number.isNaN(dateA) && !Number.isNaN(dateB) && dateA < dateB;
87
- }, isSame: function isSame(a, b) {
88
- var aToDate = toDate(a);
89
- var bToDate = toDate(b);
90
- return isISOStringDateOnly(a) || isISOStringDateOnly(b) ? toISOStringDateOnly(a) === toISOStringDateOnly(b) : aToDate.getTime() === bToDate.getTime();
91
- }, isValid, toDate, toISOString: function toISOString(d) {
92
- var dToDate = toDate(d);
93
- return isValid(dToDate) ? dToDate.toISOString() : "";
94
- }, toISOStringDateOnly };
95
-
96
- // src/index.jsdate.ts
97
- var jsonLogicDateTimeOperations = getDatetimeJsonLogicOperations(rqbDateTimeLibraryAPI);
98
- var datetimeRuleProcessorSQL = getDatetimeRuleProcessorSQL(rqbDateTimeLibraryAPI);
99
- var datetimeValueProcessorANSI = getDatetimeValueProcessorANSI(rqbDateTimeLibraryAPI);
100
- var datetimeValueProcessorMSSQL = getDatetimeValueProcessorMSSQL(rqbDateTimeLibraryAPI);
101
- var datetimeValueProcessorMySQL = getDatetimeValueProcessorMySQL(rqbDateTimeLibraryAPI);
102
- var datetimeValueProcessorOracle = getDatetimeValueProcessorOracle(rqbDateTimeLibraryAPI);
103
- var datetimeValueProcessorPostgreSQL = getDatetimeValueProcessorPostgreSQL(rqbDateTimeLibraryAPI);
104
- var datetimeRuleProcessorCEL = getDatetimeRuleProcessorCEL(rqbDateTimeLibraryAPI);
105
- var datetimeRuleProcessorMongoDBQuery = getDatetimeRuleProcessorMongoDBQuery(rqbDateTimeLibraryAPI);
106
- var datetimeRuleProcessorNL = getDatetimeRuleProcessorNL(rqbDateTimeLibraryAPI);
107
- export {
108
- datetimeRuleProcessorCEL,
109
- datetimeRuleProcessorMongoDBQuery,
110
- datetimeRuleProcessorNL,
111
- datetimeRuleProcessorSQL,
112
- datetimeValueProcessorANSI,
113
- datetimeValueProcessorMSSQL,
114
- datetimeValueProcessorMySQL,
115
- datetimeValueProcessorOracle,
116
- datetimeValueProcessorPostgreSQL,
117
- jsonLogicDateTimeOperations,
118
- rqbDateTimeLibraryAPI
31
+ /**
32
+ * {@link RQBDateTimeLibraryAPI} for JavaScript `Date`
33
+ *
34
+ * @deprecated This API will not be removed, but we recommend using one of the other
35
+ * {@link RQBDateTimeLibraryAPI}s based on a popular library instead.
36
+ */
37
+ const rqbDateTimeLibraryAPI = {
38
+ format: (d) => toDate(d).toISOString(),
39
+ isAfter: (a, b) => {
40
+ const dateA = toDate(a).getTime();
41
+ const dateB = toDate(b).getTime();
42
+ return !Number.isNaN(dateA) && !Number.isNaN(dateB) && dateA > dateB;
43
+ },
44
+ isBefore: (a, b) => {
45
+ const dateA = toDate(a).getTime();
46
+ const dateB = toDate(b).getTime();
47
+ return !Number.isNaN(dateA) && !Number.isNaN(dateB) && dateA < dateB;
48
+ },
49
+ isSame: (a, b) => {
50
+ const aToDate = toDate(a);
51
+ const bToDate = toDate(b);
52
+ return isISOStringDateOnly(a) || isISOStringDateOnly(b) ? toISOStringDateOnly(a) === toISOStringDateOnly(b) : aToDate.getTime() === bToDate.getTime();
53
+ },
54
+ isValid,
55
+ toDate,
56
+ toISOString: (d) => {
57
+ const dToDate = toDate(d);
58
+ return isValid(dToDate) ? dToDate.toISOString() : "";
59
+ },
60
+ toISOStringDateOnly
119
61
  };
62
+
63
+ //#endregion
64
+ //#region src/index.jsdate.ts
65
+ /**
66
+ * Custom JsonLogic date/time operations using JavaScript `Date`.
67
+ */
68
+ const jsonLogicDateTimeOperations = getDatetimeJsonLogicOperations(rqbDateTimeLibraryAPI);
69
+ /**
70
+ * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "sql" format using JavaScript `Date`
71
+ */
72
+ const datetimeRuleProcessorSQL = getDatetimeRuleProcessorSQL(rqbDateTimeLibraryAPI);
73
+ /**
74
+ * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("ansi" preset) using JavaScript `Date`
75
+ */
76
+ const datetimeValueProcessorANSI = getDatetimeValueProcessorANSI(rqbDateTimeLibraryAPI);
77
+ /**
78
+ * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("mssql" preset) using JavaScript `Date`
79
+ */
80
+ const datetimeValueProcessorMSSQL = getDatetimeValueProcessorMSSQL(rqbDateTimeLibraryAPI);
81
+ /**
82
+ * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("mysql" preset) using JavaScript `Date`
83
+ */
84
+ const datetimeValueProcessorMySQL = getDatetimeValueProcessorMySQL(rqbDateTimeLibraryAPI);
85
+ /**
86
+ * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("oracle" preset) using JavaScript `Date`
87
+ */
88
+ const datetimeValueProcessorOracle = getDatetimeValueProcessorOracle(rqbDateTimeLibraryAPI);
89
+ /**
90
+ * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("postgresql" preset) using JavaScript `Date`
91
+ */
92
+ const datetimeValueProcessorPostgreSQL = getDatetimeValueProcessorPostgreSQL(rqbDateTimeLibraryAPI);
93
+ /**
94
+ * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "cel" format using JavaScript `Date`
95
+ */
96
+ const datetimeRuleProcessorCEL = getDatetimeRuleProcessorCEL(rqbDateTimeLibraryAPI);
97
+ /**
98
+ * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "mongodb_query" format using JavaScript `Date`
99
+ */
100
+ const datetimeRuleProcessorMongoDBQuery = getDatetimeRuleProcessorMongoDBQuery(rqbDateTimeLibraryAPI);
101
+ /**
102
+ * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "natural_language" format using JavaScript `Date`
103
+ */
104
+ const datetimeRuleProcessorNL = getDatetimeRuleProcessorNL(rqbDateTimeLibraryAPI);
105
+
106
+ //#endregion
107
+ export { datetimeRuleProcessorCEL, datetimeRuleProcessorMongoDBQuery, datetimeRuleProcessorNL, datetimeRuleProcessorSQL, datetimeValueProcessorANSI, datetimeValueProcessorMSSQL, datetimeValueProcessorMySQL, datetimeValueProcessorOracle, datetimeValueProcessorPostgreSQL, jsonLogicDateTimeOperations, rqbDateTimeLibraryAPI };
120
108
  //# sourceMappingURL=react-querybuilder_datetime.legacy-esm.jsdate.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/rqbDateTimeLibraryAPI.jsdate.ts","../src/index.jsdate.ts"],"sourcesContent":["function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");}function _unsupportedIterableToArray(r,a){if(r){if(\"string\"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return\"Object\"===t&&r.constructor&&(t=r.constructor.name),\"Map\"===t||\"Set\"===t?Array.from(r):\"Arguments\"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _iterableToArrayLimit(r,l){var t=null==r?null:\"undefined\"!=typeof Symbol&&r[Symbol.iterator]||r[\"@@iterator\"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1;}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t[\"return\"]&&(u=t[\"return\"](),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}function _arrayWithHoles(r){if(Array.isArray(r))return r;}import{isISOStringDateOnly}from\"./utils\";var invalidDate=new Date(Number.NaN);var dateRegExp=/^(\\d{4})-(\\d{2})-(\\d{2})([T ](\\d{2}):(\\d{2}):(\\d{2})(\\.(\\d{1,3}))?)?/;var toDate=function toDate(d){if(d instanceof Date)return d;var reMatch=dateRegExp.exec(d);if(!reMatch)return invalidDate;var _reMatch=_slicedToArray(reMatch,10),_all=_reMatch[0],yyyy=_reMatch[1],mm=_reMatch[2],dd=_reMatch[3],_time=_reMatch[4],hh=_reMatch[5],mi=_reMatch[6],ss=_reMatch[7],_decimal=_reMatch[8],sss=_reMatch[9];var _filter$map=[yyyy,mm,dd,hh,mi,ss,sss!=null?sss:\"0\"].filter(Boolean).map(Number),_filter$map2=_slicedToArray(_filter$map,7),year=_filter$map2[0],month=_filter$map2[1],day=_filter$map2[2],hours=_filter$map2[3],minutes=_filter$map2[4],seconds=_filter$map2[5],ms=_filter$map2[6];var monthIndex=month-1;return hh?new Date(Date.UTC(year,monthIndex,day,hours,minutes,seconds,ms)):new Date(year,monthIndex,day);};var isValid=function isValid(d){var dToDate=toDate(d);return dToDate instanceof Date&&!Number.isNaN(dToDate.getTime());};var toISOStringDateOnly=function toISOStringDateOnly(d){var dToDate=toDate(d);return isValid(dToDate)?dToDate.toISOString().slice(0,10):\"\";};export var rqbDateTimeLibraryAPI={format:function format(d){return toDate(d).toISOString();},isAfter:function isAfter(a,b){var dateA=toDate(a).getTime();var dateB=toDate(b).getTime();return!Number.isNaN(dateA)&&!Number.isNaN(dateB)&&dateA>dateB;},isBefore:function isBefore(a,b){var dateA=toDate(a).getTime();var dateB=toDate(b).getTime();return!Number.isNaN(dateA)&&!Number.isNaN(dateB)&&dateA<dateB;},isSame:function isSame(a,b){var aToDate=toDate(a);var bToDate=toDate(b);return isISOStringDateOnly(a)||isISOStringDateOnly(b)?toISOStringDateOnly(a)===toISOStringDateOnly(b):aToDate.getTime()===bToDate.getTime();},isValid:isValid,toDate:toDate,toISOString:function toISOString(d){var dToDate=toDate(d);return isValid(dToDate)?dToDate.toISOString():\"\";},toISOStringDateOnly:toISOStringDateOnly};","import{getDatetimeJsonLogicOperations}from\"./getDatetimeJsonLogicOperations\";import{getDatetimeRuleProcessorCEL}from\"./getDatetimeRuleProcessorCEL\";import{getDatetimeRuleProcessorMongoDBQuery}from\"./getDatetimeRuleProcessorMongoDBQuery\";import{getDatetimeRuleProcessorNL}from\"./getDatetimeRuleProcessorNL\";import{getDatetimeRuleProcessorSQL,getDatetimeValueProcessorANSI,getDatetimeValueProcessorMSSQL,getDatetimeValueProcessorMySQL,getDatetimeValueProcessorOracle,getDatetimeValueProcessorPostgreSQL}from\"./getDatetimeRuleProcessorSQL\";import{rqbDateTimeLibraryAPI}from\"./rqbDateTimeLibraryAPI.jsdate\";export var jsonLogicDateTimeOperations=getDatetimeJsonLogicOperations(rqbDateTimeLibraryAPI);export var datetimeRuleProcessorSQL=getDatetimeRuleProcessorSQL(rqbDateTimeLibraryAPI);export var datetimeValueProcessorANSI=getDatetimeValueProcessorANSI(rqbDateTimeLibraryAPI);export var datetimeValueProcessorMSSQL=getDatetimeValueProcessorMSSQL(rqbDateTimeLibraryAPI);export var datetimeValueProcessorMySQL=getDatetimeValueProcessorMySQL(rqbDateTimeLibraryAPI);export var datetimeValueProcessorOracle=getDatetimeValueProcessorOracle(rqbDateTimeLibraryAPI);export var datetimeValueProcessorPostgreSQL=getDatetimeValueProcessorPostgreSQL(rqbDateTimeLibraryAPI);export var datetimeRuleProcessorCEL=getDatetimeRuleProcessorCEL(rqbDateTimeLibraryAPI);export var datetimeRuleProcessorMongoDBQuery=getDatetimeRuleProcessorMongoDBQuery(rqbDateTimeLibraryAPI);export var datetimeRulePro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Q;AAAE,GAAE,SAAgB,QAAc,aAAY,SAAS,YAAY,GAAE;AAAC,MAAI,UAAQ,OAAO,CAAC;AAAE,SAAO,QAAQ,OAAO,IAAE,QAAQ,YAAY,IAAE;AAAG,GAAE,oBAAuC;;;ACAjjF,IAAI,8BAA4B,+BAA+B,qBAAqB;AAAS,IAAI,2BAAyB,4BAA4B,qBAAqB;AAAS,IAAI,6BAA2B,8BAA8B,qBAAqB;AAAS,IAAI,8BAA4B,+BAA+B,qBAAqB;AAAS,IAAI,8BAA4B,+BAA+B,qBAAqB;AAAS,IAAI,+BAA6B,gCAAgC,qBAAqB;AAAS,IAAI,mCAAiC,oCAAoC,qBAAqB;AAAS,IAAI,2BAAyB,4BAA4B,qBAAqB;AAAS,IAAI,oCAAkC,qCAAqC,qBAAqB;AAAS,IAAI,0BAAwB,2BAA2B,qBAAqB;","names":["r","toDate","isValid","toISOStringDateOnly"]}
1
+ {"version":3,"file":"react-querybuilder_datetime.legacy-esm.jsdate.js","names":["rqbDateTimeLibraryAPI: RQBDateTimeLibraryAPI","jsonLogicDateTimeOperations: RQBJsonLogicDateTimeOperations","datetimeRuleProcessorSQL: RuleProcessor","datetimeValueProcessorANSI: ValueProcessorByRule","datetimeValueProcessorMSSQL: ValueProcessorByRule","datetimeValueProcessorMySQL: ValueProcessorByRule","datetimeValueProcessorOracle: ValueProcessorByRule","datetimeValueProcessorPostgreSQL: ValueProcessorByRule","datetimeRuleProcessorCEL: RuleProcessor","datetimeRuleProcessorMongoDBQuery: RuleProcessor","datetimeRuleProcessorNL: ValueProcessorByRule"],"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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AQ,GAAG,QAAQ,aAAa,GAAG;;CAEpD;CACD;;;;;;;AC3CD,MAAaC,8BACX,+BAA+B,sBAAsB;;;;AAKvD,MAAaC,2BACX,4BAA4B,sBAAsB;;;;AAIpD,MAAaC,6BACX,8BAA8B,sBAAsB;;;;AAItD,MAAaC,8BACX,+BAA+B,sBAAsB;;;;AAIvD,MAAaC,8BACX,+BAA+B,sBAAsB;;;;AAIvD,MAAaC,+BACX,gCAAgC,sBAAsB;;;;AAIxD,MAAaC,mCACX,oCAAoC,sBAAsB;;;;AAK5D,MAAaC,2BACX,4BAA4B,sBAAsB;;;;AAKpD,MAAaC,oCACX,qCAAqC,sBAAsB;;;;AAK7D,MAAaC,0BACX,2BAA2B,sBAAsB"}
@@ -0,0 +1,53 @@
1
+ import { RQBDateTimeLibraryAPI, RQBJsonLogicDateTimeOperations, RuleProcessor, ValueProcessorByRule } from "./types-EgfSemtR.js";
2
+
3
+ //#region src/rqbDateTimeLibraryAPI.luxon.d.ts
4
+
5
+ /**
6
+ * {@link RQBDateTimeLibraryAPI} for Luxon
7
+ */
8
+ declare const rqbDateTimeLibraryAPI: RQBDateTimeLibraryAPI;
9
+ //#endregion
10
+ //#region src/index.luxon.d.ts
11
+ /**
12
+ * Custom JsonLogic date/time operations using Luxon
13
+ */
14
+ declare const jsonLogicDateTimeOperations: RQBJsonLogicDateTimeOperations;
15
+ /**
16
+ * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "sql" format using Luxon
17
+ */
18
+ declare const datetimeRuleProcessorSQL: RuleProcessor;
19
+ /**
20
+ * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("ansi" preset) using Luxon
21
+ */
22
+ declare const datetimeValueProcessorANSI: ValueProcessorByRule;
23
+ /**
24
+ * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("mssql" preset) using Luxon
25
+ */
26
+ declare const datetimeValueProcessorMSSQL: ValueProcessorByRule;
27
+ /**
28
+ * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("mysql" preset) using Luxon
29
+ */
30
+ declare const datetimeValueProcessorMySQL: ValueProcessorByRule;
31
+ /**
32
+ * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("oracle" preset) using Luxon
33
+ */
34
+ declare const datetimeValueProcessorOracle: ValueProcessorByRule;
35
+ /**
36
+ * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("postgresql" preset) using Luxon
37
+ */
38
+ declare const datetimeValueProcessorPostgreSQL: ValueProcessorByRule;
39
+ /**
40
+ * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "cel" format using Luxon
41
+ */
42
+ declare const datetimeRuleProcessorCEL: ValueProcessorByRule;
43
+ /**
44
+ * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "mongodb_query" format using Luxon
45
+ */
46
+ declare const datetimeRuleProcessorMongoDBQuery: ValueProcessorByRule;
47
+ /**
48
+ * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "natural_language" format using Luxon
49
+ */
50
+ declare const datetimeRuleProcessorNL: ValueProcessorByRule;
51
+ //#endregion
52
+ export { datetimeRuleProcessorCEL, datetimeRuleProcessorMongoDBQuery, datetimeRuleProcessorNL, datetimeRuleProcessorSQL, datetimeValueProcessorANSI, datetimeValueProcessorMSSQL, datetimeValueProcessorMySQL, datetimeValueProcessorOracle, datetimeValueProcessorPostgreSQL, jsonLogicDateTimeOperations, rqbDateTimeLibraryAPI };
53
+ //# sourceMappingURL=react-querybuilder_datetime.legacy-esm.luxon.d.ts.map
@@ -1,65 +1,72 @@
1
- import {
2
- getDatetimeJsonLogicOperations,
3
- getDatetimeRuleProcessorCEL,
4
- getDatetimeRuleProcessorMongoDBQuery,
5
- getDatetimeRuleProcessorNL,
6
- getDatetimeRuleProcessorSQL,
7
- getDatetimeValueProcessorANSI,
8
- getDatetimeValueProcessorMSSQL,
9
- getDatetimeValueProcessorMySQL,
10
- getDatetimeValueProcessorOracle,
11
- getDatetimeValueProcessorPostgreSQL,
12
- isISOStringDateOnly
13
- } from "./chunk-ZS6AX35I.js";
14
-
15
- // src/rqbDateTimeLibraryAPI.luxon.ts
1
+ import { getDatetimeJsonLogicOperations, getDatetimeRuleProcessorCEL, getDatetimeRuleProcessorMongoDBQuery, getDatetimeRuleProcessorNL, getDatetimeRuleProcessorSQL, getDatetimeValueProcessorANSI, getDatetimeValueProcessorMSSQL, getDatetimeValueProcessorMySQL, getDatetimeValueProcessorOracle, getDatetimeValueProcessorPostgreSQL, isISOStringDateOnly } from "./getDatetimeRuleProcessorSQL-CN80oEFK.js";
16
2
  import { DateTime } from "luxon";
17
- var toDateTime = function toDateTime2(a) {
18
- return typeof a === "string" ? DateTime.fromISO(a) : DateTime.fromJSDate(a);
19
- };
20
- var iso8601DateOnly = "yyyy-MM-dd";
21
- var rqbDateTimeLibraryAPI = { format: function format(d, fmt) {
22
- return toDateTime(d).toFormat(fmt.replace("YYYY-MM-DD", iso8601DateOnly));
23
- }, isAfter: function isAfter(a, b) {
24
- return toDateTime(a) > toDateTime(b);
25
- }, isBefore: function isBefore(a, b) {
26
- return toDateTime(a) < toDateTime(b);
27
- }, isSame: function isSame(a, b) {
28
- return isISOStringDateOnly(a) || isISOStringDateOnly(b) ? toDateTime(a).hasSame(toDateTime(b), "day") : +toDateTime(a) === +toDateTime(b);
29
- }, isValid: function isValid(d) {
30
- return toDateTime(d).isValid;
31
- }, toDate: function toDate(d) {
32
- return toDateTime(d).toJSDate();
33
- }, toISOString: function toISOString(d) {
34
- var dToDate = toDateTime(d);
35
- return dToDate.isValid ? dToDate.toJSDate().toISOString() : "";
36
- }, toISOStringDateOnly: function toISOStringDateOnly(d) {
37
- var dToDate = toDateTime(d);
38
- return dToDate.isValid ? dToDate.toFormat(iso8601DateOnly) : "";
39
- } };
40
3
 
41
- // src/index.luxon.ts
42
- var jsonLogicDateTimeOperations = getDatetimeJsonLogicOperations(rqbDateTimeLibraryAPI);
43
- var datetimeRuleProcessorSQL = getDatetimeRuleProcessorSQL(rqbDateTimeLibraryAPI);
44
- var datetimeValueProcessorANSI = getDatetimeValueProcessorANSI(rqbDateTimeLibraryAPI);
45
- var datetimeValueProcessorMSSQL = getDatetimeValueProcessorMSSQL(rqbDateTimeLibraryAPI);
46
- var datetimeValueProcessorMySQL = getDatetimeValueProcessorMySQL(rqbDateTimeLibraryAPI);
47
- var datetimeValueProcessorOracle = getDatetimeValueProcessorOracle(rqbDateTimeLibraryAPI);
48
- var datetimeValueProcessorPostgreSQL = getDatetimeValueProcessorPostgreSQL(rqbDateTimeLibraryAPI);
49
- var datetimeRuleProcessorCEL = getDatetimeRuleProcessorCEL(rqbDateTimeLibraryAPI);
50
- var datetimeRuleProcessorMongoDBQuery = getDatetimeRuleProcessorMongoDBQuery(rqbDateTimeLibraryAPI);
51
- var datetimeRuleProcessorNL = getDatetimeRuleProcessorNL(rqbDateTimeLibraryAPI);
52
- export {
53
- datetimeRuleProcessorCEL,
54
- datetimeRuleProcessorMongoDBQuery,
55
- datetimeRuleProcessorNL,
56
- datetimeRuleProcessorSQL,
57
- datetimeValueProcessorANSI,
58
- datetimeValueProcessorMSSQL,
59
- datetimeValueProcessorMySQL,
60
- datetimeValueProcessorOracle,
61
- datetimeValueProcessorPostgreSQL,
62
- jsonLogicDateTimeOperations,
63
- rqbDateTimeLibraryAPI
4
+ //#region src/rqbDateTimeLibraryAPI.luxon.ts
5
+ const toDateTime = (a) => typeof a === "string" ? DateTime.fromISO(a) : DateTime.fromJSDate(a);
6
+ const iso8601DateOnly = "yyyy-MM-dd";
7
+ /**
8
+ * {@link RQBDateTimeLibraryAPI} for Luxon
9
+ */
10
+ const rqbDateTimeLibraryAPI = {
11
+ format: (d, fmt) => toDateTime(d).toFormat(fmt.replace("YYYY-MM-DD", iso8601DateOnly)),
12
+ isAfter: (a, b) => toDateTime(a) > toDateTime(b),
13
+ isBefore: (a, b) => toDateTime(a) < toDateTime(b),
14
+ isSame: (a, b) => isISOStringDateOnly(a) || isISOStringDateOnly(b) ? toDateTime(a).hasSame(toDateTime(b), "day") : +toDateTime(a) === +toDateTime(b),
15
+ isValid: (d) => toDateTime(d).isValid,
16
+ toDate: (d) => toDateTime(d).toJSDate(),
17
+ toISOString: (d) => {
18
+ const dToDate = toDateTime(d);
19
+ return dToDate.isValid ? dToDate.toJSDate().toISOString() : "";
20
+ },
21
+ toISOStringDateOnly: (d) => {
22
+ const dToDate = toDateTime(d);
23
+ return dToDate.isValid ? dToDate.toFormat(iso8601DateOnly) : "";
24
+ }
64
25
  };
26
+
27
+ //#endregion
28
+ //#region src/index.luxon.ts
29
+ /**
30
+ * Custom JsonLogic date/time operations using Luxon
31
+ */
32
+ const jsonLogicDateTimeOperations = getDatetimeJsonLogicOperations(rqbDateTimeLibraryAPI);
33
+ /**
34
+ * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "sql" format using Luxon
35
+ */
36
+ const datetimeRuleProcessorSQL = getDatetimeRuleProcessorSQL(rqbDateTimeLibraryAPI);
37
+ /**
38
+ * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("ansi" preset) using Luxon
39
+ */
40
+ const datetimeValueProcessorANSI = getDatetimeValueProcessorANSI(rqbDateTimeLibraryAPI);
41
+ /**
42
+ * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("mssql" preset) using Luxon
43
+ */
44
+ const datetimeValueProcessorMSSQL = getDatetimeValueProcessorMSSQL(rqbDateTimeLibraryAPI);
45
+ /**
46
+ * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("mysql" preset) using Luxon
47
+ */
48
+ const datetimeValueProcessorMySQL = getDatetimeValueProcessorMySQL(rqbDateTimeLibraryAPI);
49
+ /**
50
+ * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("oracle" preset) using Luxon
51
+ */
52
+ const datetimeValueProcessorOracle = getDatetimeValueProcessorOracle(rqbDateTimeLibraryAPI);
53
+ /**
54
+ * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("postgresql" preset) using Luxon
55
+ */
56
+ const datetimeValueProcessorPostgreSQL = getDatetimeValueProcessorPostgreSQL(rqbDateTimeLibraryAPI);
57
+ /**
58
+ * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "cel" format using Luxon
59
+ */
60
+ const datetimeRuleProcessorCEL = getDatetimeRuleProcessorCEL(rqbDateTimeLibraryAPI);
61
+ /**
62
+ * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "mongodb_query" format using Luxon
63
+ */
64
+ const datetimeRuleProcessorMongoDBQuery = getDatetimeRuleProcessorMongoDBQuery(rqbDateTimeLibraryAPI);
65
+ /**
66
+ * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "natural_language" format using Luxon
67
+ */
68
+ const datetimeRuleProcessorNL = getDatetimeRuleProcessorNL(rqbDateTimeLibraryAPI);
69
+
70
+ //#endregion
71
+ export { datetimeRuleProcessorCEL, datetimeRuleProcessorMongoDBQuery, datetimeRuleProcessorNL, datetimeRuleProcessorSQL, datetimeValueProcessorANSI, datetimeValueProcessorMSSQL, datetimeValueProcessorMySQL, datetimeValueProcessorOracle, datetimeValueProcessorPostgreSQL, jsonLogicDateTimeOperations, rqbDateTimeLibraryAPI };
65
72
  //# sourceMappingURL=react-querybuilder_datetime.legacy-esm.luxon.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/rqbDateTimeLibraryAPI.luxon.ts","../src/index.luxon.ts"],"sourcesContent":["import{DateTime}from\"luxon\";import{isISOStringDateOnly}from\"./utils\";var toDateTime=function toDateTime(a){return typeof a===\"string\"?DateTime.fromISO(a):DateTime.fromJSDate(a);};var iso8601DateOnly=\"yyyy-MM-dd\";export var rqbDateTimeLibraryAPI={format:function format(d,fmt){return toDateTime(d).toFormat(fmt.replace(\"YYYY-MM-DD\",iso8601DateOnly));},isAfter:function isAfter(a,b){return toDateTime(a)>toDateTime(b);},isBefore:function isBefore(a,b){return toDateTime(a)<toDateTime(b);},isSame:function isSame(a,b){return isISOStringDateOnly(a)||isISOStringDateOnly(b)?toDateTime(a).hasSame(toDateTime(b),\"day\"):+toDateTime(a)===+toDateTime(b);},isValid:function isValid(d){return toDateTime(d).isValid;},toDate:function toDate(d){return toDateTime(d).toJSDate();},toISOString:function toISOString(d){var dToDate=toDateTime(d);return dToDate.isValid?dToDate.toJSDate().toISOString():\"\";},toISOStringDateOnly:function toISOStringDateOnly(d){var dToDate=toDateTime(d);return dToDate.isValid?dToDate.toFormat(iso8601DateOnly):\"\";}};","import{getDatetimeJsonLogicOperations}from\"./getDatetimeJsonLogicOperations\";import{getDatetimeRuleProcessorCEL}from\"./getDatetimeRuleProcessorCEL\";import{getDatetimeRuleProcessorMongoDBQuery}from\"./getDatetimeRuleProcessorMongoDBQuery\";import{getDatetimeRuleProcessorNL}from\"./getDatetimeRuleProcessorNL\";import{getDatetimeRuleProcessorSQL,getDatetimeValueProcessorANSI,getDatetimeValueProcessorMSSQL,getDatetimeValueProcessorMySQL,getDatetimeValueProcessorOracle,getDatetimeValueProcessorPostgreSQL}from\"./getDatetimeRuleProcessorSQL\";import{rqbDateTimeLibraryAPI}from\"./rqbDateTimeLibraryAPI.luxon\";export var jsonLogicDateTimeOperations=getDatetimeJsonLogicOperations(rqbDateTimeLibraryAPI);export var datetimeRuleProcessorSQL=getDatetimeRuleProcessorSQL(rqbDateTimeLibraryAPI);export var datetimeValueProcessorANSI=getDatetimeValueProcessorANSI(rqbDateTimeLibraryAPI);export var datetimeValueProcessorMSSQL=getDatetimeValueProcessorMSSQL(rqbDateTimeLibraryAPI);export var datetimeValueProcessorMySQL=getDatetimeValueProcessorMySQL(rqbDateTimeLibraryAPI);export var datetimeValueProcessorOracle=getDatetimeValueProcessorOracle(rqbDateTimeLibraryAPI);export var datetimeValueProcessorPostgreSQL=getDatetimeValueProcessorPostgreSQL(rqbDateTimeLibraryAPI);export var datetimeRuleProcessorCEL=getDatetimeRuleProcessorCEL(rqbDateTimeLibraryAPI);export var datetimeRuleProcessor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AI,8BAA4B,+BAA+B,qBAAqB;AAAS,IAAI,2BAAyB,4BAA4B,qBAAqB;AAAS,IAAI,6BAA2B,8BAA8B,qBAAqB;AAAS,IAAI,8BAA4B,+BAA+B,qBAAqB;AAAS,IAAI,8BAA4B,+BAA+B,qBAAqB;AAAS,IAAI,+BAA6B,gCAAgC,qBAAqB;AAAS,IAAI,mCAAiC,oCAAoC,qBAAqB;AAAS,IAAI,2BAAyB,4BAA4B,qBAAqB;AAAS,IAAI,oCAAkC,qCAAqC,qBAAqB;AAAS,IAAI,0BAAwB,2BAA2B,qBAAqB;","names":["toDateTime"]}
1
+ {"version":3,"file":"react-querybuilder_datetime.legacy-esm.luxon.js","names":["rqbDateTimeLibraryAPI: RQBDateTimeLibraryAPI","jsonLogicDateTimeOperations: RQBJsonLogicDateTimeOperations","datetimeRuleProcessorSQL: RuleProcessor","datetimeValueProcessorANSI: ValueProcessorByRule","datetimeValueProcessorMSSQL: ValueProcessorByRule","datetimeValueProcessorMySQL: ValueProcessorByRule","datetimeValueProcessorOracle: ValueProcessorByRule","datetimeValueProcessorPostgreSQL: ValueProcessorByRule","datetimeRuleProcessorCEL: ValueProcessorByRule","datetimeRuleProcessorMongoDBQuery: ValueProcessorByRule","datetimeRuleProcessorNL: ValueProcessorByRule"],"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 './rq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AAsB"}
@@ -0,0 +1,53 @@
1
+ import { RQBDateTimeLibraryAPI, RQBJsonLogicDateTimeOperations, RuleProcessor, ValueProcessorByRule } from "./types-CDEkL2M_.mjs";
2
+
3
+ //#region src/rqbDateTimeLibraryAPI.luxon.d.ts
4
+
5
+ /**
6
+ * {@link RQBDateTimeLibraryAPI} for Luxon
7
+ */
8
+ declare const rqbDateTimeLibraryAPI: RQBDateTimeLibraryAPI;
9
+ //#endregion
10
+ //#region src/index.luxon.d.ts
11
+ /**
12
+ * Custom JsonLogic date/time operations using Luxon
13
+ */
14
+ declare const jsonLogicDateTimeOperations: RQBJsonLogicDateTimeOperations;
15
+ /**
16
+ * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "sql" format using Luxon
17
+ */
18
+ declare const datetimeRuleProcessorSQL: RuleProcessor;
19
+ /**
20
+ * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("ansi" preset) using Luxon
21
+ */
22
+ declare const datetimeValueProcessorANSI: ValueProcessorByRule;
23
+ /**
24
+ * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("mssql" preset) using Luxon
25
+ */
26
+ declare const datetimeValueProcessorMSSQL: ValueProcessorByRule;
27
+ /**
28
+ * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("mysql" preset) using Luxon
29
+ */
30
+ declare const datetimeValueProcessorMySQL: ValueProcessorByRule;
31
+ /**
32
+ * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("oracle" preset) using Luxon
33
+ */
34
+ declare const datetimeValueProcessorOracle: ValueProcessorByRule;
35
+ /**
36
+ * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("postgresql" preset) using Luxon
37
+ */
38
+ declare const datetimeValueProcessorPostgreSQL: ValueProcessorByRule;
39
+ /**
40
+ * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "cel" format using Luxon
41
+ */
42
+ declare const datetimeRuleProcessorCEL: ValueProcessorByRule;
43
+ /**
44
+ * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "mongodb_query" format using Luxon
45
+ */
46
+ declare const datetimeRuleProcessorMongoDBQuery: ValueProcessorByRule;
47
+ /**
48
+ * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "natural_language" format using Luxon
49
+ */
50
+ declare const datetimeRuleProcessorNL: ValueProcessorByRule;
51
+ //#endregion
52
+ export { datetimeRuleProcessorCEL, datetimeRuleProcessorMongoDBQuery, datetimeRuleProcessorNL, datetimeRuleProcessorSQL, datetimeValueProcessorANSI, datetimeValueProcessorMSSQL, datetimeValueProcessorMySQL, datetimeValueProcessorOracle, datetimeValueProcessorPostgreSQL, jsonLogicDateTimeOperations, rqbDateTimeLibraryAPI };
53
+ //# sourceMappingURL=react-querybuilder_datetime.luxon.d.mts.map