@react-querybuilder/datetime 8.20.1 → 8.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/README.md +9 -3
  2. package/dist/cjs/{getDatetimeRuleProcessorTanStackDB-CL79A1_x.js → getDatetimeRuleProcessorTanStackDB-CDEB9coD.js} +88 -218
  3. package/dist/cjs/getDatetimeRuleProcessorTanStackDB-CDEB9coD.js.map +1 -0
  4. package/dist/cjs/getDatetimeRuleProcessorTanStackDB-X6tZv7yV.js +2 -0
  5. package/dist/cjs/getDatetimeRuleProcessorTanStackDB-X6tZv7yV.js.map +1 -0
  6. package/dist/cjs/react-querybuilder_datetime.cjs.development.d.ts +124 -260
  7. package/dist/cjs/react-querybuilder_datetime.cjs.development.date-fns.d.ts +50 -51
  8. package/dist/cjs/react-querybuilder_datetime.cjs.development.date-fns.js +3 -2
  9. package/dist/cjs/react-querybuilder_datetime.cjs.development.date-fns.js.map +1 -1
  10. package/dist/cjs/react-querybuilder_datetime.cjs.development.dayjs.d.ts +50 -51
  11. package/dist/cjs/react-querybuilder_datetime.cjs.development.dayjs.js +53 -26
  12. package/dist/cjs/react-querybuilder_datetime.cjs.development.dayjs.js.map +1 -1
  13. package/dist/cjs/react-querybuilder_datetime.cjs.development.js +11 -467
  14. package/dist/cjs/react-querybuilder_datetime.cjs.development.js.map +1 -1
  15. package/dist/cjs/react-querybuilder_datetime.cjs.development.jsdate.d.ts +53 -54
  16. package/dist/cjs/react-querybuilder_datetime.cjs.development.jsdate.js +26 -144
  17. package/dist/cjs/react-querybuilder_datetime.cjs.development.jsdate.js.map +1 -1
  18. package/dist/cjs/react-querybuilder_datetime.cjs.development.luxon.d.ts +50 -51
  19. package/dist/cjs/react-querybuilder_datetime.cjs.development.luxon.js +3 -2
  20. package/dist/cjs/react-querybuilder_datetime.cjs.development.luxon.js.map +1 -1
  21. package/dist/cjs/react-querybuilder_datetime.cjs.development.ui.d.ts +214 -0
  22. package/dist/cjs/react-querybuilder_datetime.cjs.development.ui.js +466 -0
  23. package/dist/cjs/react-querybuilder_datetime.cjs.development.ui.js.map +1 -0
  24. package/dist/cjs/react-querybuilder_datetime.cjs.production.d.ts +124 -260
  25. package/dist/cjs/react-querybuilder_datetime.cjs.production.date-fns.d.ts +50 -51
  26. package/dist/cjs/react-querybuilder_datetime.cjs.production.date-fns.js +1 -1
  27. package/dist/cjs/react-querybuilder_datetime.cjs.production.date-fns.js.map +1 -1
  28. package/dist/cjs/react-querybuilder_datetime.cjs.production.dayjs.d.ts +50 -51
  29. package/dist/cjs/react-querybuilder_datetime.cjs.production.dayjs.js +1 -1
  30. package/dist/cjs/react-querybuilder_datetime.cjs.production.dayjs.js.map +1 -1
  31. package/dist/cjs/react-querybuilder_datetime.cjs.production.js +1 -1
  32. package/dist/cjs/react-querybuilder_datetime.cjs.production.js.map +1 -1
  33. package/dist/cjs/react-querybuilder_datetime.cjs.production.jsdate.d.ts +53 -54
  34. package/dist/cjs/react-querybuilder_datetime.cjs.production.jsdate.js +1 -1
  35. package/dist/cjs/react-querybuilder_datetime.cjs.production.jsdate.js.map +1 -1
  36. package/dist/cjs/react-querybuilder_datetime.cjs.production.luxon.d.ts +50 -51
  37. package/dist/cjs/react-querybuilder_datetime.cjs.production.luxon.js +1 -1
  38. package/dist/cjs/react-querybuilder_datetime.cjs.production.luxon.js.map +1 -1
  39. package/dist/cjs/react-querybuilder_datetime.cjs.production.ui.d.ts +214 -0
  40. package/dist/cjs/react-querybuilder_datetime.cjs.production.ui.js +2 -0
  41. package/dist/cjs/react-querybuilder_datetime.cjs.production.ui.js.map +1 -0
  42. package/dist/cjs/rolldown-runtime-CMqjfN_6.js +1 -0
  43. package/dist/cjs/rolldown-runtime-D6vf50IK.js +28 -0
  44. package/dist/cjs/rqbDateTimeLibraryAPI.jsdate-BuSiVdk7.js +2 -0
  45. package/dist/cjs/rqbDateTimeLibraryAPI.jsdate-BuSiVdk7.js.map +1 -0
  46. package/dist/cjs/rqbDateTimeLibraryAPI.jsdate-C3jJb6ip.js +128 -0
  47. package/dist/cjs/rqbDateTimeLibraryAPI.jsdate-C3jJb6ip.js.map +1 -0
  48. package/dist/cjs/types-BKA1aoY6.d.ts +174 -0
  49. package/dist/cjs/ui.d.ts +1 -0
  50. package/dist/cjs/ui.js +6 -0
  51. package/dist/cjs/utils-DdBYGWHZ.js +2 -0
  52. package/dist/cjs/utils-DdBYGWHZ.js.map +1 -0
  53. package/dist/cjs/utils-_X97pUtk.js +166 -0
  54. package/dist/cjs/utils-_X97pUtk.js.map +1 -0
  55. package/dist/getDatetimeRuleProcessorTanStackDB-6K1DsuEV.mjs +2 -0
  56. package/dist/getDatetimeRuleProcessorTanStackDB-6K1DsuEV.mjs.map +1 -0
  57. package/dist/{getDatetimeRuleProcessorTanStackDB-BL8mbdbl.js → getDatetimeRuleProcessorTanStackDB-BrSD2e9G.js} +24 -198
  58. package/dist/getDatetimeRuleProcessorTanStackDB-BrSD2e9G.js.map +1 -0
  59. package/dist/{getDatetimeRuleProcessorTanStackDB-BcOC-o2A.mjs → getDatetimeRuleProcessorTanStackDB-DR8aYrUa.mjs} +24 -124
  60. package/dist/getDatetimeRuleProcessorTanStackDB-DR8aYrUa.mjs.map +1 -0
  61. package/dist/objectSpread2-MqoZ2hSz.js +187 -0
  62. package/dist/objectSpread2-MqoZ2hSz.js.map +1 -0
  63. package/dist/react-querybuilder_datetime.d.mts +124 -260
  64. package/dist/react-querybuilder_datetime.date-fns.d.mts +50 -51
  65. package/dist/react-querybuilder_datetime.date-fns.mjs +2 -1
  66. package/dist/react-querybuilder_datetime.date-fns.mjs.map +1 -1
  67. package/dist/react-querybuilder_datetime.dayjs.d.mts +50 -51
  68. package/dist/react-querybuilder_datetime.dayjs.mjs +27 -2
  69. package/dist/react-querybuilder_datetime.dayjs.mjs.map +1 -1
  70. package/dist/react-querybuilder_datetime.jsdate.d.mts +53 -54
  71. package/dist/react-querybuilder_datetime.jsdate.mjs +2 -120
  72. package/dist/react-querybuilder_datetime.jsdate.mjs.map +1 -1
  73. package/dist/react-querybuilder_datetime.legacy-esm.d.ts +124 -260
  74. package/dist/react-querybuilder_datetime.legacy-esm.date-fns.d.ts +50 -51
  75. package/dist/react-querybuilder_datetime.legacy-esm.date-fns.js +2 -1
  76. package/dist/react-querybuilder_datetime.legacy-esm.date-fns.js.map +1 -1
  77. package/dist/react-querybuilder_datetime.legacy-esm.dayjs.d.ts +50 -51
  78. package/dist/react-querybuilder_datetime.legacy-esm.dayjs.js +27 -2
  79. package/dist/react-querybuilder_datetime.legacy-esm.dayjs.js.map +1 -1
  80. package/dist/react-querybuilder_datetime.legacy-esm.js +5 -449
  81. package/dist/react-querybuilder_datetime.legacy-esm.js.map +1 -1
  82. package/dist/react-querybuilder_datetime.legacy-esm.jsdate.d.ts +53 -54
  83. package/dist/react-querybuilder_datetime.legacy-esm.jsdate.js +2 -120
  84. package/dist/react-querybuilder_datetime.legacy-esm.jsdate.js.map +1 -1
  85. package/dist/react-querybuilder_datetime.legacy-esm.luxon.d.ts +50 -51
  86. package/dist/react-querybuilder_datetime.legacy-esm.luxon.js +2 -1
  87. package/dist/react-querybuilder_datetime.legacy-esm.luxon.js.map +1 -1
  88. package/dist/react-querybuilder_datetime.legacy-esm.ui.d.ts +214 -0
  89. package/dist/react-querybuilder_datetime.legacy-esm.ui.js +453 -0
  90. package/dist/react-querybuilder_datetime.legacy-esm.ui.js.map +1 -0
  91. package/dist/react-querybuilder_datetime.luxon.d.mts +50 -51
  92. package/dist/react-querybuilder_datetime.luxon.mjs +2 -1
  93. package/dist/react-querybuilder_datetime.luxon.mjs.map +1 -1
  94. package/dist/react-querybuilder_datetime.mjs +5 -446
  95. package/dist/react-querybuilder_datetime.mjs.map +1 -1
  96. package/dist/react-querybuilder_datetime.production.d.mts +124 -260
  97. package/dist/react-querybuilder_datetime.production.date-fns.d.mts +50 -51
  98. package/dist/react-querybuilder_datetime.production.date-fns.mjs +1 -1
  99. package/dist/react-querybuilder_datetime.production.date-fns.mjs.map +1 -1
  100. package/dist/react-querybuilder_datetime.production.dayjs.d.mts +50 -51
  101. package/dist/react-querybuilder_datetime.production.dayjs.mjs +1 -1
  102. package/dist/react-querybuilder_datetime.production.dayjs.mjs.map +1 -1
  103. package/dist/react-querybuilder_datetime.production.jsdate.d.mts +53 -54
  104. package/dist/react-querybuilder_datetime.production.jsdate.mjs +1 -1
  105. package/dist/react-querybuilder_datetime.production.jsdate.mjs.map +1 -1
  106. package/dist/react-querybuilder_datetime.production.luxon.d.mts +50 -51
  107. package/dist/react-querybuilder_datetime.production.luxon.mjs +1 -1
  108. package/dist/react-querybuilder_datetime.production.luxon.mjs.map +1 -1
  109. package/dist/react-querybuilder_datetime.production.mjs +1 -1
  110. package/dist/react-querybuilder_datetime.production.mjs.map +1 -1
  111. package/dist/react-querybuilder_datetime.production.ui.d.mts +214 -0
  112. package/dist/react-querybuilder_datetime.production.ui.mjs +2 -0
  113. package/dist/react-querybuilder_datetime.production.ui.mjs.map +1 -0
  114. package/dist/react-querybuilder_datetime.ui.d.mts +214 -0
  115. package/dist/react-querybuilder_datetime.ui.mjs +450 -0
  116. package/dist/react-querybuilder_datetime.ui.mjs.map +1 -0
  117. package/dist/rqbDateTimeLibraryAPI.jsdate-COp9qTw_.js +123 -0
  118. package/dist/rqbDateTimeLibraryAPI.jsdate-COp9qTw_.js.map +1 -0
  119. package/dist/rqbDateTimeLibraryAPI.jsdate-DxBmxW2C.mjs +2 -0
  120. package/dist/rqbDateTimeLibraryAPI.jsdate-DxBmxW2C.mjs.map +1 -0
  121. package/dist/rqbDateTimeLibraryAPI.jsdate-WHnzblie.mjs +123 -0
  122. package/dist/rqbDateTimeLibraryAPI.jsdate-WHnzblie.mjs.map +1 -0
  123. package/dist/types-BKA1aoY6.d.mts +174 -0
  124. package/dist/types-BKA1aoY6.d.ts +174 -0
  125. package/dist/utils-BAgUBdyf.mjs +113 -0
  126. package/dist/utils-BAgUBdyf.mjs.map +1 -0
  127. package/dist/utils-DA8aluCt.mjs +2 -0
  128. package/dist/utils-DA8aluCt.mjs.map +1 -0
  129. package/package.json +36 -17
  130. package/ui/package.json +4 -0
  131. package/dist/cjs/getDatetimeRuleProcessorTanStackDB-CL79A1_x.js.map +0 -1
  132. package/dist/cjs/getDatetimeRuleProcessorTanStackDB-DgUg_arY.js +0 -2
  133. package/dist/cjs/getDatetimeRuleProcessorTanStackDB-DgUg_arY.js.map +0 -1
  134. package/dist/cjs/rqbDateTimeLibraryAPI.dayjs-BfILPx88.js +0 -2
  135. package/dist/cjs/rqbDateTimeLibraryAPI.dayjs-BfILPx88.js.map +0 -1
  136. package/dist/cjs/rqbDateTimeLibraryAPI.dayjs-CzLh_zi9.js +0 -63
  137. package/dist/cjs/rqbDateTimeLibraryAPI.dayjs-CzLh_zi9.js.map +0 -1
  138. package/dist/cjs/types-XYMw0jFT.d.ts +0 -265
  139. package/dist/getDatetimeRuleProcessorTanStackDB-BL8mbdbl.js.map +0 -1
  140. package/dist/getDatetimeRuleProcessorTanStackDB-BcOC-o2A.mjs.map +0 -1
  141. package/dist/getDatetimeRuleProcessorTanStackDB-Dloxv6k2.mjs +0 -2
  142. package/dist/getDatetimeRuleProcessorTanStackDB-Dloxv6k2.mjs.map +0 -1
  143. package/dist/rqbDateTimeLibraryAPI.dayjs-BW7faYFD.mjs +0 -29
  144. package/dist/rqbDateTimeLibraryAPI.dayjs-BW7faYFD.mjs.map +0 -1
  145. package/dist/rqbDateTimeLibraryAPI.dayjs-BoX90aqZ.mjs +0 -2
  146. package/dist/rqbDateTimeLibraryAPI.dayjs-BoX90aqZ.mjs.map +0 -1
  147. package/dist/rqbDateTimeLibraryAPI.dayjs-Da4VXvFM.js +0 -29
  148. package/dist/rqbDateTimeLibraryAPI.dayjs-Da4VXvFM.js.map +0 -1
  149. package/dist/types-CdjHqQ0k.d.mts +0 -265
  150. package/dist/types-CdjHqQ0k.d.ts +0 -265
@@ -1 +0,0 @@
1
- {"version":3,"file":"getDatetimeRuleProcessorTanStackDB-DgUg_arY.js","names":["shouldNegate","shouldNegate","shouldNegate","mongoOperators","defaultOperatorProcessorNL"],"sources":["../../src/utils.ts","../../src/getDatetimeJsonLogicOperations.ts","../../src/getDatetimeRuleProcessorCEL.ts","../../src/getDatetimeRuleProcessorCypher.ts","../../src/getDatetimeRuleProcessorDrizzle.ts","../../src/getDatetimeRuleProcessorElasticSearch.ts","../../src/getDatetimeRuleProcessorGremlin.ts","../../src/getDatetimeRuleProcessorJSONata.ts","../../src/getDatetimeRuleProcessorLDAP.ts","../../src/getDatetimeRuleProcessorMongoDBQuery.ts","../../src/getDatetimeRuleProcessorMongoDB.ts","../../src/getDatetimeRuleProcessorNL.ts","../../src/getDatetimeRuleProcessorParameterized.ts","../../src/getDatetimeRuleProcessorPrisma.ts","../../src/getDatetimeRuleProcessorSequelize.ts","../../src/getDatetimeRuleProcessorSPARQL.ts","../../src/getDatetimeRuleProcessorSpEL.ts","../../src/getRelativeDateTimeSQL.ts","../../src/getDatetimeRuleProcessorSQL.ts","../../src/getDatetimeRuleProcessorTanStackDB.ts"],"sourcesContent":["import type { RuleProcessor } from 'react-querybuilder';\nimport type {\n IsDateField,\n IsDateFieldFunction,\n RelativeDateTimeTruncationUnit,\n RelativeDateTimeValue,\n RQBDateTimeLibraryAPI,\n} 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\n/**\n * Type guard for {@link RelativeDateTimeValue}. Relative values are stored as objects\n * (distinguishing them from the ISO 8601 strings used for absolute date/time values).\n */\nexport const isRelativeDateTimeValue = (value: unknown): value is RelativeDateTimeValue =>\n typeof value === 'object' &&\n value !== null &&\n (value as { mode?: unknown }).mode === 'relative' &&\n typeof (value as RelativeDateTimeValue).anchor === 'string';\n\nconst anchorRegExp = /^(start|end)Of(Day|Week|Month|Year)$/;\n\n/**\n * Resolves a {@link RelativeDateTimeValue} into a concrete `Date` using the given\n * date library API. The anchor is applied relative to `base` (defaulting to now),\n * then the signed offset is added.\n */\nexport const resolveRelativeDateTime = (\n apiFns: RQBDateTimeLibraryAPI,\n value: RelativeDateTimeValue,\n base: Date = new Date()\n): Date => {\n let result: Date = base;\n\n if (value.anchor !== 'now') {\n const match = anchorRegExp.exec(value.anchor);\n // v8 ignore next -- guarded by the RelativeDateTimeAnchor type\n if (match) {\n const unit = match[2].toLowerCase() as RelativeDateTimeTruncationUnit;\n result = match[1] === 'start' ? apiFns.startOf(result, unit) : apiFns.endOf(result, unit);\n }\n }\n\n if (value.offset) {\n result = apiFns.add(result, value.offset, value.unit);\n }\n\n return result;\n};\n\n/**\n * Whether a `datatype` represents a date-only (no time component) type, e.g. `date`\n * but not `datetime`/`datetimeoffset`/`timestamp`. Used to choose the precision when\n * materializing a relative value to an ISO 8601 string.\n */\nexport const isDateOnlyDatatype = (datatype: unknown): boolean =>\n /^date\\b/i.test(datatype as string);\n\n/**\n * Replaces any {@link RelativeDateTimeValue} in `value` (or in each element, if `value`\n * is an array) with a concrete ISO 8601 string, resolved via\n * {@link resolveRelativeDateTime}. The \"now\" reference can be pinned with\n * `opts.context.relativeDateTimeBase` for deterministic output; precision (date-only vs\n * full) follows the field's `datatype`. Non-relative values pass through unchanged.\n */\nexport const materializeRelativeValues = (\n apiFns: RQBDateTimeLibraryAPI,\n value: unknown,\n opts: Parameters<RuleProcessor>[1]\n): unknown => {\n const base = opts?.context?.relativeDateTimeBase as Date | undefined;\n const dateOnly = isDateOnlyDatatype(opts?.fieldData?.datatype);\n const conv = (v: unknown): unknown => {\n if (!isRelativeDateTimeValue(v)) return v;\n const resolved = resolveRelativeDateTime(apiFns, v, base);\n return dateOnly ? apiFns.toISOStringDateOnly(resolved) : apiFns.toISOString(resolved);\n };\n return Array.isArray(value) ? value.map(conv) : conv(value);\n};\n\n/**\n * Resolves a rule's operator for export, applying any `context.relativeOperatorMap`\n * entry. Operator-driven mode controllers (see `createOperatorModeController`) use\n * dedicated operator names to signal relative mode; this maps those names to the real\n * comparison operator at format time. Operators absent from the map pass through unchanged.\n */\nexport const resolveDatetimeOperator = (...[rule, opts]: Parameters<RuleProcessor>): string =>\n (opts?.context?.relativeOperatorMap as Record<string, string> | undefined)?.[rule.operator] ??\n rule.operator;\n\n/**\n * Prepares a date/time rule for delegation to a non-symbolic default rule processor\n * (e.g. \"parameterized\", \"spel\", \"ldap\", \"gremlin\", \"prisma\", \"sequelize\", \"drizzle\",\n * \"tanstack_db\"). Relative values are materialized to concrete dates (these formats have\n * no symbolic relative form), and `between`/`notBetween` operands are ordered\n * chronologically (defaults can't reorder non-numeric date operands). When `asDate` is\n * set, each valid value is converted to a `Date` (for object-based formats); otherwise\n * the materialized ISO 8601 strings are passed through. The resolved `operator` (after\n * any `relativeOperatorMap` mapping) is returned alongside the prepared `value`.\n */\nexport const materializeForExport = (\n apiFns: RQBDateTimeLibraryAPI,\n rule: Parameters<RuleProcessor>[0],\n opts: Parameters<RuleProcessor>[1],\n asDate = false\n): { operator: string; value: unknown } => {\n const operator = resolveDatetimeOperator(rule, opts);\n const materialized = materializeRelativeValues(apiFns, rule.value, opts);\n\n let prepared = materialized;\n if (Array.isArray(materialized) && materialized.length >= 2) {\n const opLC = operator.toLowerCase();\n if (opLC === 'between' || opLC === 'notbetween') {\n const first = apiFns.toDate(materialized[0] as string | Date);\n const second = apiFns.toDate(materialized[1] as string | Date);\n if (apiFns.isValid(first) && apiFns.isValid(second) && !apiFns.isBefore(first, second)) {\n prepared = [materialized[1], materialized[0], ...materialized.slice(2)];\n }\n }\n }\n\n if (!asDate) return { operator, value: prepared };\n\n const toDateVal = (v: unknown) => {\n const d = apiFns.toDate(v as string | Date);\n return apiFns.isValid(d) ? d : v;\n };\n return {\n operator,\n value: Array.isArray(prepared) ? prepared.map(toDateVal) : toDateVal(prepared),\n };\n};\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';\nimport { resolveRelativeDateTime } from './utils';\n\n/**\n * Custom operations for use with JsonLogic objects generated by\n * {@link datetimeRuleProcessorJsonLogic}.\n */\nexport const getDatetimeJsonLogicOperations = (\n apiFns: RQBDateTimeLibraryAPI\n): RQBJsonLogicDateTimeOperations => {\n const { isAfter, isBefore, isSame } = apiFns;\n return {\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 dateRelative: (anchor, offset, unit, dateOnly) => {\n const resolved = resolveRelativeDateTime(apiFns, { mode: 'relative', anchor, offset, unit });\n return dateOnly ? apiFns.toISOStringDateOnly(resolved) : apiFns.toISOString(resolved);\n },\n };\n};\n","import type { RuleProcessor } from 'react-querybuilder';\nimport { defaultRuleProcessorCEL, lc, toArray } from 'react-querybuilder';\nimport type { RQBDateTimeLibraryAPI } from './types';\nimport { materializeRelativeValues, processIsDateField, resolveDatetimeOperator } 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/core!formatQuery formatQuery} with the \"cel\" format.\n */\nexport const getDatetimeRuleProcessorCEL =\n (apiFns: RQBDateTimeLibraryAPI): RuleProcessor =>\n (rule, options) => {\n const opts = options ?? /* v8 ignore start -- @preserve */ {} /* v8 ignore stop -- @preserve */;\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 // Resolve any relative value(s) to concrete literals (CEL has no symbolic relative form).\n const value = materializeRelativeValues(apiFns, rule.value, opts);\n\n const operatorTL = lc(resolveDatetimeOperator(rule, opts).replace(/^=$/, '=='));\n\n switch (operatorTL) {\n case '<':\n case '<=':\n case '==':\n case '!=':\n case '>':\n case '>=':\n return `${rule.field} ${operatorTL} ${ts(value as string | Date)}`;\n }\n\n const valueAsArray: string[] = toArray(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 { defaultRuleProcessorCypher, lc, toArray } from 'react-querybuilder';\nimport type { RQBDateTimeLibraryAPI } from './types';\nimport {\n isISOStringDateOnly,\n materializeRelativeValues,\n processIsDateField,\n resolveDatetimeOperator,\n} from './utils';\n\nconst shouldNegate = (op: string) => /^(does)?not/i.test(op);\n\n/**\n * Wraps a date string in the appropriate Cypher temporal constructor.\n * - Date-only strings (YYYY-MM-DD) become `date('...')`\n * - Full ISO strings become `datetime('...')`\n */\nconst cypherTemporal = (iso: string, dateOnly: boolean): string =>\n dateOnly ? `date('${iso}')` : `datetime('${iso}')`;\n\n/**\n * Generates a rule processor with date/time features for use by\n * {@link @react-querybuilder/core!formatQuery formatQuery} with the \"cypher\" or \"gql\" format.\n *\n * Supports:\n * - Standard comparison operators (`=`, `!=`, `<`, `>`, `<=`, `>=`)\n * - Range operators (between, notBetween, in, notIn)\n * - Duration math via custom operators: `olderThanDuration` and `withinDuration`\n * (e.g., value `\"P30D\"` → `datetime() - field > duration('P30D')`)\n */\nexport const getDatetimeRuleProcessorCypher =\n (apiFns: RQBDateTimeLibraryAPI): RuleProcessor =>\n (rule, options) => {\n const opts = options ?? /* v8 ignore start -- @preserve */ {} /* v8 ignore stop -- @preserve */;\n const { context = {} } = opts;\n\n if (rule.valueSource === 'field' || !processIsDateField(context.isDateField, rule, opts)) {\n return defaultRuleProcessorCypher(rule, opts);\n }\n\n const { field } = rule;\n const operator = resolveDatetimeOperator(rule, opts);\n const operatorTL = lc(operator);\n\n // Duration math operators — compare elapsed time against a duration literal\n if (operatorTL === 'olderthanduration') {\n return `datetime() - ${field} > duration('${rule.value}')`;\n }\n if (operatorTL === 'withinduration') {\n return `datetime() - ${field} <= duration('${rule.value}')`;\n }\n\n // Resolve any relative value(s) to concrete literals (Cypher has no symbolic relative form).\n const value = materializeRelativeValues(apiFns, rule.value, opts);\n\n const valueAsArray: string[] = toArray(value, { retainEmptyStrings: false });\n const valueAsDateArray = valueAsArray\n .map((v): [string, Date] => [v, apiFns.toDate(v)])\n .filter(([, d]) => apiFns.isValid(d));\n\n const fmtDate = (originalValue: string): string => {\n const dateOnly = isISOStringDateOnly(originalValue);\n const iso = dateOnly\n ? apiFns.toISOStringDateOnly(originalValue)\n : apiFns.toISOString(originalValue);\n return cypherTemporal(iso, dateOnly);\n };\n\n switch (operatorTL) {\n case 'in':\n case 'notin': {\n if (valueAsDateArray.length === 0) return '';\n const items = valueAsDateArray.map(([orig]) => fmtDate(orig));\n const prefix = shouldNegate(operatorTL) ? 'NOT ' : '';\n return `${prefix}${field} IN [${items.join(', ')}]`;\n }\n\n case 'between':\n case 'notbetween': {\n if (valueAsDateArray.length < 2) return '';\n const [first, second] = valueAsDateArray;\n const [lo, hi] = apiFns.isBefore(first[1], second[1]) ? [first, second] : [second, first];\n const expr = `${fmtDate(lo[0])} <= ${field} AND ${field} <= ${fmtDate(hi[0])}`;\n return operatorTL === 'notbetween' ? `NOT (${expr})` : expr;\n }\n\n default: {\n // Standard comparison: =, !=, <, >, <=, >=\n if (valueAsDateArray.length === 0) return '';\n const [orig] = valueAsDateArray[0];\n const op = operatorTL === '<>' ? '<>' : operatorTL;\n return `${field} ${op} ${fmtDate(orig)}`;\n }\n }\n };\n","import type { RuleProcessor } from 'react-querybuilder';\nimport { defaultRuleProcessorDrizzle } from 'react-querybuilder';\nimport type { RQBDateTimeLibraryAPI } from './types';\nimport { materializeForExport, processIsDateField } from './utils';\n\n/**\n * Generates a rule processor with date/time features for use by\n * {@link @react-querybuilder/core!formatQuery formatQuery} with the \"drizzle\" format.\n * Relative values are materialized and all date/time values are converted to `Date`\n * objects (Drizzle column operators compare against native `Date` values).\n */\nexport const getDatetimeRuleProcessorDrizzle =\n (apiFns: RQBDateTimeLibraryAPI): RuleProcessor =>\n (rule, options) => {\n const opts = options ?? /* v8 ignore start -- @preserve */ {} /* v8 ignore stop -- @preserve */;\n const { context = {} } = opts;\n\n if (rule.valueSource === 'field' || !processIsDateField(context.isDateField, rule, opts)) {\n return defaultRuleProcessorDrizzle(rule, opts);\n }\n\n const { operator, value } = materializeForExport(apiFns, rule, opts, true);\n return defaultRuleProcessorDrizzle({ ...rule, operator, value }, opts);\n };\n","import type { RuleProcessor } from 'react-querybuilder';\nimport { defaultRuleProcessorElasticSearch } from 'react-querybuilder';\nimport type { RQBDateTimeLibraryAPI } from './types';\nimport { materializeForExport, processIsDateField } from './utils';\n\n/**\n * Generates a rule processor with date/time features for use by\n * {@link @react-querybuilder/core!formatQuery formatQuery} with the \"elasticsearch\" format.\n * Relative values are materialized to concrete ISO 8601 strings (ElasticSearch has no\n * symbolic relative form); absolute values pass through.\n */\nexport const getDatetimeRuleProcessorElasticSearch =\n (apiFns: RQBDateTimeLibraryAPI): RuleProcessor =>\n (rule, options) => {\n const opts = options ?? /* v8 ignore start -- @preserve */ {} /* v8 ignore stop -- @preserve */;\n const { context = {} } = opts;\n\n if (rule.valueSource === 'field' || !processIsDateField(context.isDateField, rule, opts)) {\n return defaultRuleProcessorElasticSearch(rule, opts);\n }\n\n const { operator, value } = materializeForExport(apiFns, rule, opts);\n return defaultRuleProcessorElasticSearch({ ...rule, operator, value }, opts);\n };\n","import type { RuleProcessor } from 'react-querybuilder';\nimport { defaultRuleProcessorGremlin } from 'react-querybuilder';\nimport type { RQBDateTimeLibraryAPI } from './types';\nimport { materializeForExport, processIsDateField } from './utils';\n\n/**\n * Generates a rule processor with date/time features for use by\n * {@link @react-querybuilder/core!formatQuery formatQuery} with the \"gremlin\" format.\n * Relative values are materialized to concrete ISO 8601 strings (Gremlin has no symbolic\n * relative form); absolute values pass through.\n */\nexport const getDatetimeRuleProcessorGremlin =\n (apiFns: RQBDateTimeLibraryAPI): RuleProcessor =>\n (rule, options) => {\n const opts = options ?? /* v8 ignore start -- @preserve */ {} /* v8 ignore stop -- @preserve */;\n const { context = {} } = opts;\n\n if (rule.valueSource === 'field' || !processIsDateField(context.isDateField, rule, opts)) {\n return defaultRuleProcessorGremlin(rule, opts);\n }\n\n const { operator, value } = materializeForExport(apiFns, rule, opts);\n return defaultRuleProcessorGremlin({ ...rule, operator, value }, opts);\n };\n","import type { RuleProcessor } from 'react-querybuilder';\nimport {\n defaultRuleProcessorJSONata,\n getQuotedFieldName,\n nullOrUndefinedOrEmpty,\n toArray,\n} from 'react-querybuilder';\nimport type { RQBDateTimeLibraryAPI } from './types';\nimport { materializeRelativeValues, processIsDateField, resolveDatetimeOperator } from './utils';\n\nconst shouldNegate = (op: string) => /^(does)?not/i.test(op);\n\nconst negate = (clause: string, neg: boolean) => (neg ? `$not(${clause})` : `${clause}`);\n\n/**\n * Generates a rule processor with date/time features for use by\n * {@link @react-querybuilder/core!formatQuery formatQuery} with the \"jsonata\" format.\n */\nexport const getDatetimeRuleProcessorJSONata =\n (apiFns: RQBDateTimeLibraryAPI): RuleProcessor =>\n (rule, options) => {\n const opts = options ?? /* v8 ignore start -- @preserve */ {} /* v8 ignore stop -- @preserve */;\n const { context = {} } = opts;\n\n // v8 ignore next\n const { quoteFieldNamesWith = ['', ''] as [string, string], fieldIdentifierSeparator = '' } =\n opts;\n const { field, valueSource } = rule;\n const operator = resolveDatetimeOperator(rule, opts);\n\n if (!processIsDateField(context.isDateField, rule, opts)) {\n return defaultRuleProcessorJSONata(rule, opts);\n }\n\n const valueIsField = valueSource === 'field';\n\n // Resolve any relative value(s) to concrete literals (JSONata has no symbolic relative form).\n // Field-source values are field names and pass through untouched.\n const value = valueIsField ? rule.value : materializeRelativeValues(apiFns, rule.value, opts);\n\n const fldToMs = (f: string) =>\n `$toMillis(${getQuotedFieldName(f, { quoteFieldNamesWith, fieldIdentifierSeparator })})`;\n const valToMs = (v: string | Date) => `$toMillis(\"${apiFns.toISOString(v)}\")`;\n\n switch (operator) {\n case '<':\n case '<=':\n case '=':\n case '!=':\n case '>':\n case '>=':\n return `${fldToMs(field)} ${operator} ${valueIsField ? fldToMs(value as string) : valToMs(value as string | Date)}`;\n }\n\n const valueAsArray: string[] = toArray(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 if (valueIsField) {\n if (valueAsArray.length === 0) return '';\n return negate(\n `${fldToMs(field)} in [${valueAsArray.map(val => fldToMs(val)).join(', ')}]`,\n shouldNegate(operator)\n );\n }\n if (valueAsDateArray.length === 0) return '';\n return negate(\n `${fldToMs(field)} in [${valueAsDateArray.map(val => valToMs(val)).join(', ')}]`,\n shouldNegate(operator)\n );\n }\n\n case 'between':\n case 'notBetween': {\n if (\n valueAsArray.length < 2 ||\n nullOrUndefinedOrEmpty(valueAsArray[0]) ||\n nullOrUndefinedOrEmpty(valueAsArray[1]) ||\n (!valueIsField && valueAsDateArray.length < 2)\n ) {\n return '';\n }\n\n if (valueIsField) {\n const [firstValue, secondValue] = valueAsArray;\n const expression = `${fldToMs(field)} >= ${fldToMs(firstValue)} and ${fldToMs(field)} <= ${fldToMs(secondValue)}`;\n return operator === 'between' ? `(${expression})` : negate(expression, true);\n }\n\n const [first, second] = valueAsDateArray;\n const [firstDate, secondDate] = apiFns.isBefore(first, second)\n ? [first, second]\n : [second, first];\n const expression = `${fldToMs(field)} >= ${valToMs(firstDate)} and ${fldToMs(field)} <= ${valToMs(secondDate)}`;\n return operator === 'between' ? `(${expression})` : negate(expression, true);\n }\n }\n\n return defaultRuleProcessorJSONata(rule, opts);\n };\n","import type { RuleProcessor } from 'react-querybuilder';\nimport { defaultRuleProcessorLDAP } from 'react-querybuilder';\nimport type { RQBDateTimeLibraryAPI } from './types';\nimport { materializeForExport, processIsDateField } from './utils';\n\n/**\n * Generates a rule processor with date/time features for use by\n * {@link @react-querybuilder/core!formatQuery formatQuery} with the \"ldap\" format.\n * Relative values are materialized to concrete ISO 8601 strings (LDAP has no symbolic\n * relative form); absolute values pass through.\n */\nexport const getDatetimeRuleProcessorLDAP =\n (apiFns: RQBDateTimeLibraryAPI): RuleProcessor =>\n (rule, options) => {\n const opts = options ?? /* v8 ignore start -- @preserve */ {} /* v8 ignore stop -- @preserve */;\n const { context = {} } = opts;\n\n if (rule.valueSource === 'field' || !processIsDateField(context.isDateField, rule, opts)) {\n return defaultRuleProcessorLDAP(rule, opts);\n }\n\n const { operator, value } = materializeForExport(apiFns, rule, opts);\n return defaultRuleProcessorLDAP({ ...rule, operator, value }, opts);\n };\n","import type { RuleProcessor } from 'react-querybuilder';\nimport { defaultRuleProcessorMongoDBQuery, mongoOperators, toArray } from 'react-querybuilder';\nimport type { RQBDateTimeLibraryAPI } from './types';\nimport { materializeRelativeValues, processIsDateField, resolveDatetimeOperator } from './utils';\n\n/**\n * Generates a rule processor with date/time features for use by\n * {@link @react-querybuilder/core!formatQuery formatQuery} with the \"mongodb_query\" format.\n */\nexport const getDatetimeRuleProcessorMongoDBQuery =\n (apiFns: RQBDateTimeLibraryAPI): RuleProcessor =>\n (rule, options) => {\n const opts = options ?? /* v8 ignore start -- @preserve */ {} /* v8 ignore stop -- @preserve */;\n const { field, valueSource } = rule;\n const operator = resolveDatetimeOperator(rule, opts);\n\n if (valueSource === 'field' || !processIsDateField(opts.context?.isDateField, rule, opts)) {\n return defaultRuleProcessorMongoDBQuery(rule, opts);\n }\n\n // Resolve any relative value(s) to concrete literals (MongoDB queries use concrete dates).\n const value = materializeRelativeValues(apiFns, rule.value, opts);\n\n if (operator === '=') {\n return { [field]: apiFns.toDate(value as string | Date) };\n }\n\n switch (operator) {\n case '<':\n case '<=':\n case '!=':\n case '>':\n case '>=':\n return { [field]: { [mongoOperators[operator]]: apiFns.toDate(value as string | Date) } };\n }\n\n const valueAsArray: string[] = toArray(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","import type { RuleProcessor } from 'react-querybuilder';\nimport { getDatetimeRuleProcessorMongoDBQuery } from './getDatetimeRuleProcessorMongoDBQuery';\nimport type { RQBDateTimeLibraryAPI } from './types';\n\n/**\n * Generates a rule processor with date/time features for use by\n * {@link @react-querybuilder/core!formatQuery formatQuery} with the (deprecated) \"mongodb\"\n * format. Delegates to the \"mongodb_query\" date/time processor and serializes the result;\n * `Date` values serialize to ISO 8601 strings.\n */\nexport const getDatetimeRuleProcessorMongoDB = (apiFns: RQBDateTimeLibraryAPI): RuleProcessor => {\n const mongoDBQueryProcessor = getDatetimeRuleProcessorMongoDBQuery(apiFns);\n return (rule, options) => {\n const queryObj = mongoDBQueryProcessor(rule, options);\n return queryObj ? JSON.stringify(queryObj) : '';\n };\n};\n","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 {\n isISOStringDateOnly,\n materializeRelativeValues,\n processIsDateField,\n resolveDatetimeOperator,\n} 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/core!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/core!formatQuery formatQuery} with\n * the \"natural_language\" format.\n */\nexport const getDatetimeRuleProcessorNL =\n (apiFns: RQBDateTimeLibraryAPI): RuleProcessor =>\n (rule, options) => {\n const opts = options ?? /* v8 ignore start -- @preserve */ {} /* v8 ignore stop -- @preserve */;\n const operator = resolveDatetimeOperator(rule, opts);\n const operatorLowerCase = lc(operator);\n let finalValue = '';\n\n // v8 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 // Natural language is descriptive (not executable), so relative value(s) are\n // resolved to concrete dates and rendered like any other literal.\n const ruleValue = materializeRelativeValues(apiFns, rule.value, opts);\n\n const valueAsArray: string[] = toArray(ruleValue, { 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(\n { ...rule, operator },\n {\n ...opts,\n operatorMap: { ...defaultDateTimeNLOperatorMap, ...operatorMap },\n }\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 } from 'react-querybuilder';\nimport { defaultRuleProcessorParameterized } from 'react-querybuilder';\nimport type { RQBDateTimeLibraryAPI } from './types';\nimport { materializeForExport, processIsDateField } from './utils';\n\n/**\n * Generates a rule processor with date/time features for use by\n * {@link @react-querybuilder/core!formatQuery formatQuery} with the \"parameterized\" and\n * \"parameterized_named\" formats. Relative values are materialized to concrete ISO 8601\n * strings (these formats have no symbolic relative form); absolute values pass through.\n */\nexport const getDatetimeRuleProcessorParameterized =\n (apiFns: RQBDateTimeLibraryAPI): RuleProcessor =>\n (rule, options, meta) => {\n const opts = options ?? /* v8 ignore start -- @preserve */ {} /* v8 ignore stop -- @preserve */;\n const { context = {} } = opts;\n\n if (rule.valueSource === 'field' || !processIsDateField(context.isDateField, rule, opts)) {\n return defaultRuleProcessorParameterized(rule, opts, meta);\n }\n\n const { operator, value } = materializeForExport(apiFns, rule, opts);\n return defaultRuleProcessorParameterized({ ...rule, operator, value }, opts, meta);\n };\n","import type { RuleProcessor } from 'react-querybuilder';\nimport { defaultRuleProcessorPrisma } from 'react-querybuilder';\nimport type { RQBDateTimeLibraryAPI } from './types';\nimport { materializeForExport, processIsDateField } from './utils';\n\n/**\n * Generates a rule processor with date/time features for use by\n * {@link @react-querybuilder/core!formatQuery formatQuery} with the \"prisma\" format.\n * Relative values are materialized and all date/time values are converted to `Date`\n * objects (Prisma's `where` clauses use native `Date` values for date columns).\n */\nexport const getDatetimeRuleProcessorPrisma =\n (apiFns: RQBDateTimeLibraryAPI): RuleProcessor =>\n (rule, options) => {\n const opts = options ?? /* v8 ignore start -- @preserve */ {} /* v8 ignore stop -- @preserve */;\n const { context = {} } = opts;\n\n if (rule.valueSource === 'field' || !processIsDateField(context.isDateField, rule, opts)) {\n return defaultRuleProcessorPrisma(rule, opts);\n }\n\n const { operator, value } = materializeForExport(apiFns, rule, opts, true);\n return defaultRuleProcessorPrisma({ ...rule, operator, value }, opts);\n };\n","import type { RuleProcessor } from 'react-querybuilder';\nimport { defaultRuleProcessorSequelize } from 'react-querybuilder';\nimport type { RQBDateTimeLibraryAPI } from './types';\nimport { materializeForExport, processIsDateField } from './utils';\n\n/**\n * Generates a rule processor with date/time features for use by\n * {@link @react-querybuilder/core!formatQuery formatQuery} with the \"sequelize\" format.\n * Relative values are materialized and all date/time values are converted to `Date`\n * objects (Sequelize `where` clauses use native `Date` values for date columns).\n */\nexport const getDatetimeRuleProcessorSequelize =\n (apiFns: RQBDateTimeLibraryAPI): RuleProcessor =>\n (rule, options) => {\n const opts = options ?? /* v8 ignore start -- @preserve */ {} /* v8 ignore stop -- @preserve */;\n const { context = {} } = opts;\n\n if (rule.valueSource === 'field' || !processIsDateField(context.isDateField, rule, opts)) {\n return defaultRuleProcessorSequelize(rule, opts);\n }\n\n const { operator, value } = materializeForExport(apiFns, rule, opts, true);\n return defaultRuleProcessorSequelize({ ...rule, operator, value }, opts);\n };\n","import type { RuleProcessor } from 'react-querybuilder';\nimport { defaultRuleProcessorSPARQL, lc, sparqlVar, toArray } from 'react-querybuilder';\nimport type { RQBDateTimeLibraryAPI } from './types';\nimport {\n isISOStringDateOnly,\n materializeRelativeValues,\n processIsDateField,\n resolveDatetimeOperator,\n} from './utils';\n\nconst shouldNegate = (op: string) => /^(does)?not/i.test(op);\n\n/**\n * Wraps a date string in the appropriate SPARQL typed literal.\n * - Date-only strings (YYYY-MM-DD) become `\"...\"^^xsd:date`\n * - Full ISO strings become `\"...\"^^xsd:dateTime`\n */\nconst sparqlTemporal = (iso: string, dateOnly: boolean): string =>\n dateOnly ? `\"${iso}\"^^xsd:date` : `\"${iso}\"^^xsd:dateTime`;\n\n/**\n * Generates a rule processor with date/time features for use by\n * {@link @react-querybuilder/core!formatQuery formatQuery} with the \"sparql\" format.\n *\n * Supports:\n * - Standard comparison operators (`=`, `!=`, `<`, `>`, `<=`, `>=`)\n * - Range operators (between, notBetween, in, notIn)\n * - Duration math via custom operators: `olderThanDuration` and `withinDuration`\n * (e.g., value `\"P30D\"` → `NOW() - ?field > \"P30D\"^^xsd:duration`)\n */\nexport const getDatetimeRuleProcessorSPARQL =\n (apiFns: RQBDateTimeLibraryAPI): RuleProcessor =>\n (rule, options) => {\n const opts = options ?? /* v8 ignore start -- @preserve */ {} /* v8 ignore stop -- @preserve */;\n const { context = {} } = opts;\n\n if (rule.valueSource === 'field' || !processIsDateField(context.isDateField, rule, opts)) {\n return defaultRuleProcessorSPARQL(rule, opts);\n }\n\n const { field: rawField, value } = rule;\n const operator = resolveDatetimeOperator(rule, opts);\n const field = sparqlVar(rawField);\n const operatorTL = lc(operator);\n\n // Duration math operators — compare elapsed time against an xsd:duration literal\n if (operatorTL === 'olderthanduration') {\n return `NOW() - ${field} > \"${value}\"^^xsd:duration`;\n }\n if (operatorTL === 'withinduration') {\n return `NOW() - ${field} <= \"${value}\"^^xsd:duration`;\n }\n\n // Resolve any relative value(s) to concrete literals (SPARQL has no symbolic relative form).\n const valueAsArray: string[] = toArray(materializeRelativeValues(apiFns, value, opts), {\n retainEmptyStrings: false,\n });\n const valueAsDateArray = valueAsArray\n .map((v): [string, Date] => [v, apiFns.toDate(v)])\n .filter(([, d]) => apiFns.isValid(d));\n\n const fmtDate = (originalValue: string): string => {\n const dateOnly = isISOStringDateOnly(originalValue);\n const iso = dateOnly\n ? apiFns.toISOStringDateOnly(originalValue)\n : apiFns.toISOString(originalValue);\n return sparqlTemporal(iso, dateOnly);\n };\n\n switch (operatorTL) {\n case 'in':\n case 'notin': {\n if (valueAsDateArray.length === 0) return '';\n const items = valueAsDateArray.map(([orig]) => fmtDate(orig));\n const prefix = shouldNegate(operatorTL) ? 'NOT ' : '';\n return `${field} ${prefix}IN (${items.join(', ')})`;\n }\n\n case 'between':\n case 'notbetween': {\n if (valueAsDateArray.length < 2) return '';\n const [first, second] = valueAsDateArray;\n const [lo, hi] = apiFns.isBefore(first[1], second[1]) ? [first, second] : [second, first];\n if (operatorTL === 'notbetween') {\n return `(${field} < ${fmtDate(lo[0])} || ${field} > ${fmtDate(hi[0])})`;\n }\n return `${field} >= ${fmtDate(lo[0])} && ${field} <= ${fmtDate(hi[0])}`;\n }\n\n default: {\n // Standard comparison: =, !=, <, >, <=, >=\n if (valueAsDateArray.length === 0) return '';\n const [orig] = valueAsDateArray[0];\n const op = operatorTL === '<>' ? '!=' : operatorTL;\n return `${field} ${op} ${fmtDate(orig)}`;\n }\n }\n };\n","import type { RuleProcessor } from 'react-querybuilder';\nimport { defaultRuleProcessorSpEL } from 'react-querybuilder';\nimport type { RQBDateTimeLibraryAPI } from './types';\nimport { materializeForExport, processIsDateField } from './utils';\n\n/**\n * Generates a rule processor with date/time features for use by\n * {@link @react-querybuilder/core!formatQuery formatQuery} with the \"spel\" format.\n * Relative values are materialized to concrete ISO 8601 strings (SpEL has no symbolic\n * relative form); absolute values pass through.\n */\nexport const getDatetimeRuleProcessorSpEL =\n (apiFns: RQBDateTimeLibraryAPI): RuleProcessor =>\n (rule, options) => {\n const opts = options ?? /* v8 ignore start -- @preserve */ {} /* v8 ignore stop -- @preserve */;\n const { context = {} } = opts;\n\n if (rule.valueSource === 'field' || !processIsDateField(context.isDateField, rule, opts)) {\n return defaultRuleProcessorSpEL(rule, opts);\n }\n\n const { operator, value } = materializeForExport(apiFns, rule, opts);\n return defaultRuleProcessorSpEL({ ...rule, operator, value }, opts);\n };\n","import type { SQLPreset } from 'react-querybuilder';\nimport type {\n RelativeDateTimeTruncationUnit,\n RelativeDateTimeUnit,\n RelativeDateTimeValue,\n} from './types';\n\n/**\n * Parsed form of a {@link RelativeDateTimeValue} anchor: either the current\n * date/time (`now`) or a truncation to the start/end of a calendar period.\n */\ninterface ParsedAnchor {\n bound: 'now' | 'start' | 'end';\n unit?: RelativeDateTimeTruncationUnit;\n}\n\nconst parseAnchor = (anchor: RelativeDateTimeValue['anchor']): ParsedAnchor => {\n if (anchor === 'now') return { bound: 'now' };\n const match = /^(start|end)Of(Day|Week|Month|Year)$/.exec(anchor)!;\n return {\n bound: match[1] as 'start' | 'end',\n unit: match[2].toLowerCase() as ParsedAnchor['unit'],\n };\n};\n\n/**\n * A relative-date/time SQL expression builder for a single dialect. Produces a\n * symbolic expression (e.g. `current_date - interval '3 months'`) so the value\n * stays relative to query-execution time rather than being materialized.\n */\ntype RelativeSQLBuilder = (value: RelativeDateTimeValue, asDate: boolean) => string;\n\nconst pluralUnit = (unit: RelativeDateTimeUnit): string => `${unit}s`;\n\n// --- PostgreSQL / ANSI ------------------------------------------------------\n\nconst pgBuild: RelativeSQLBuilder = (value, asDate) => {\n const now = asDate ? 'current_date' : 'current_timestamp';\n const { bound, unit } = parseAnchor(value.anchor);\n\n let expr = now;\n let modified = false;\n\n if (bound === 'start' && unit) {\n expr = `date_trunc('${unit}', ${now})`;\n modified = true;\n } else if (bound === 'end' && unit) {\n const tail = asDate ? `interval '1 day'` : `interval '1 microsecond'`;\n expr = `date_trunc('${unit}', ${now}) + interval '1 ${unit}' - ${tail}`;\n modified = true;\n }\n\n if (value.offset) {\n const op = value.offset < 0 ? '-' : '+';\n expr = `${expr} ${op} interval '${Math.abs(value.offset)} ${pluralUnit(value.unit)}'`;\n modified = true;\n }\n\n return asDate && modified ? `cast(${expr} as date)` : expr;\n};\n\n// --- MySQL ------------------------------------------------------------------\n\nconst mysqlTrunc = (now: string, bound: 'start' | 'end', unit: RelativeDateTimeTruncationUnit) => {\n if (bound === 'start') {\n switch (unit) {\n case 'day':\n return `date(${now})`;\n case 'week':\n return `date_sub(date(${now}), interval dayofweek(${now}) - 1 day)`;\n case 'month':\n return `date_format(${now}, '%Y-%m-01')`;\n case 'year':\n return `date_format(${now}, '%Y-01-01')`;\n }\n }\n switch (unit) {\n case 'day':\n return `date(${now})`;\n case 'week':\n return `date_add(date(${now}), interval 7 - dayofweek(${now}) day)`;\n case 'month':\n return `last_day(${now})`;\n }\n // year\n return `date_format(${now}, '%Y-12-31')`;\n};\n\nconst mysqlBuild: RelativeSQLBuilder = (value, asDate) => {\n const now = asDate ? 'curdate()' : 'now()';\n const { bound, unit } = parseAnchor(value.anchor);\n\n let expr = now;\n if (bound !== 'now' && unit) {\n expr = mysqlTrunc(now, bound, unit);\n if (bound === 'end' && !asDate) {\n // mysqlTrunc yields the period's last day at midnight. For timestamp\n // granularity, step to the last instant (one microsecond before the next\n // period) so intraday values aren't excluded. DATE columns are time-less,\n // so the date-granular result above is left untouched.\n expr = `date_sub(date_add(${expr}, interval 1 day), interval 1 microsecond)`;\n }\n }\n\n if (value.offset) {\n const fn = value.offset < 0 ? 'date_sub' : 'date_add';\n expr = `${fn}(${expr}, interval ${Math.abs(value.offset)} ${value.unit})`;\n }\n\n return expr;\n};\n\n// --- MSSQL ------------------------------------------------------------------\n\nconst mssqlTrunc = (\n now: string,\n bound: 'start' | 'end',\n unit: RelativeDateTimeTruncationUnit,\n asDate: boolean\n) => {\n // datediff/dateadd truncation: number of <unit> since epoch 0, re-added to 0.\n const start = `dateadd(${unit}, datediff(${unit}, 0, ${now}), 0)`;\n if (bound === 'start') return start;\n const nextStart = `dateadd(${unit}, datediff(${unit}, 0, ${now}) + 1, 0)`;\n // Date granularity: last day at midnight. Timestamp granularity: the last\n // instant (100ns before the next period, as datetime2). Using datetime2 is\n // safe for datetime/smalldatetime columns too, since SQL Server promotes the\n // lower-precision side when comparing, so nothing from the next period leaks in.\n return asDate\n ? `dateadd(day, -1, ${nextStart})`\n : `dateadd(nanosecond, -100, cast(${nextStart} as datetime2))`;\n};\n\nconst mssqlBuild: RelativeSQLBuilder = (value, asDate) => {\n const now = asDate ? 'cast(getdate() as date)' : 'getdate()';\n const { bound, unit } = parseAnchor(value.anchor);\n\n let expr = now;\n if (bound !== 'now' && unit) {\n expr = mssqlTrunc(now, bound, unit, asDate);\n }\n\n if (value.offset) {\n expr = `dateadd(${value.unit}, ${value.offset}, ${expr})`;\n }\n\n return expr;\n};\n\n// --- Oracle -----------------------------------------------------------------\n\nconst oracleTruncFormat: Record<RelativeDateTimeTruncationUnit, string> = {\n day: 'DDD',\n week: 'IW',\n month: 'MM',\n year: 'YYYY',\n};\n\nconst oracleBuild: RelativeSQLBuilder = (value, asDate) => {\n const now = asDate ? 'trunc(sysdate)' : 'systimestamp';\n const { bound, unit } = parseAnchor(value.anchor);\n\n let expr = now;\n // When true, the end boundary's sub-second step-back is deferred until after\n // any offset is applied (subtraction commutes with the additive offset), so\n // precision survives the intermediate DATE arithmetic.\n let endTimestampStepBack = false;\n if (bound !== 'now' && unit) {\n const start = `trunc(${now}, '${oracleTruncFormat[unit]}')`;\n if (bound === 'start') {\n expr = start;\n } else {\n // End = next period start, stepped back to the last instant. Oracle's DATE\n // always carries a time component (no time-less date type), so even\n // date-typed columns can hold intraday values; landing on the last instant\n // avoids excluding them, unlike stepping back a full day to midnight.\n const next =\n unit === 'month' || unit === 'year'\n ? `add_months(${start}, ${unit === 'month' ? 1 : 12})`\n : `${start} + interval '1' day${unit === 'week' ? ' * 7' : ''}`;\n if (asDate) {\n // DATE has only second precision; one second is the smallest step.\n expr = `${next} - interval '1' second`;\n } else {\n // TIMESTAMP: defer cast + 1ms step-back until after offset (see below).\n expr = next;\n endTimestampStepBack = true;\n }\n }\n }\n\n if (value.offset) {\n if (value.unit === 'month' || value.unit === 'year') {\n expr = `add_months(${expr}, ${value.offset * (value.unit === 'year' ? 12 : 1)})`;\n } else {\n const days = { day: 1, week: 7 }[value.unit as 'day' | 'week'];\n expr = days\n ? `${expr} ${value.offset < 0 ? '-' : '+'} ${Math.abs(value.offset) * days}`\n : `${expr} + numtodsinterval(${value.offset}, '${value.unit.toUpperCase()}')`;\n }\n }\n\n // TRUNC/DATE arithmetic above is second-granular, so cast to TIMESTAMP and\n // step back one microsecond to reach the period's true last instant (matches\n // PostgreSQL; default TIMESTAMP precision is microseconds).\n if (endTimestampStepBack) {\n expr = `cast(${expr} as timestamp) - numtodsinterval(0.000001, 'second')`;\n }\n\n return expr;\n};\n\n// --- SQLite -----------------------------------------------------------------\n\nconst sqliteStartModifier: Record<RelativeDateTimeTruncationUnit, string> = {\n day: `'start of day'`,\n week: `'weekday 0', '-7 days'`,\n month: `'start of month'`,\n year: `'start of year'`,\n};\n\nconst sqliteBuild: RelativeSQLBuilder = (value, asDate) => {\n const fn = asDate ? 'date' : 'datetime';\n const args: string[] = [`'now'`];\n const { bound, unit } = parseAnchor(value.anchor);\n\n if (bound !== 'now' && unit) {\n if (bound === 'start') {\n args.push(sqliteStartModifier[unit]);\n } else {\n // End = start of next period, minus the smallest representable amount.\n switch (unit) {\n case 'day':\n args.push(`'start of day'`, `'+1 day'`, asDate ? `'-1 day'` : `'-1 second'`);\n break;\n case 'week':\n args.push(`'weekday 0'`, asDate ? `'-1 day'` : `'-1 second'`);\n break;\n case 'month':\n args.push(`'start of month'`, `'+1 month'`, asDate ? `'-1 day'` : `'-1 second'`);\n break;\n case 'year':\n args.push(`'start of year'`, `'+1 year'`, asDate ? `'-1 day'` : `'-1 second'`);\n break;\n }\n }\n }\n\n if (value.offset) {\n const sign = value.offset < 0 ? '-' : '+';\n args.push(`'${sign}${Math.abs(value.offset)} ${pluralUnit(value.unit)}'`);\n }\n\n return `${fn}(${args.join(', ')})`;\n};\n\nconst presetToRelativeBuilderMap = {\n ansi: pgBuild,\n mssql: mssqlBuild,\n mysql: mysqlBuild,\n oracle: oracleBuild,\n postgresql: pgBuild,\n sqlite: sqliteBuild,\n} satisfies Record<SQLPreset, RelativeSQLBuilder>;\n\n/**\n * Determines whether the SQL expression for a relative date/time should be a\n * date (vs. a timestamp/datetime) based on the field's declared `datatype` and\n * the SQL dialect. Mirrors the per-dialect logic used for literal date values.\n */\nconst isDateGranularity = (preset: SQLPreset, datatype: unknown): boolean => {\n const dt = datatype as string;\n switch (preset) {\n case 'mssql':\n return !/^(?:small)?datetime/i.test(dt);\n case 'mysql':\n return !/^(?:datetime|timestamp)/i.test(dt);\n case 'oracle':\n case 'postgresql':\n return !/^timestamp/i.test(dt);\n default:\n // ansi/sqlite: anything not explicitly a datetime/timestamp is date-only.\n return !/^(?:datetime|timestamp)/i.test(dt);\n }\n};\n\n/**\n * Builds a dialect-specific symbolic SQL expression for a {@link RelativeDateTimeValue}.\n */\nexport const getRelativeDateTimeSQL = (\n value: RelativeDateTimeValue,\n preset: SQLPreset,\n datatype: unknown\n): string => presetToRelativeBuilderMap[preset](value, isDateGranularity(preset, datatype));\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 { getRelativeDateTimeSQL } from './getRelativeDateTimeSQL';\nimport type { RQBDateTimeLibraryAPI } from './types';\nimport {\n isISOStringDateOnly,\n isRelativeDateTimeValue,\n materializeRelativeValues,\n processIsDateField,\n resolveDatetimeOperator,\n} from './utils';\n\n/**\n * Generates a value processor with date/time features for use by\n * {@link @react-querybuilder/core!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/core!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/core!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/core!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/core!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/core!formatQuery formatQuery} with\n * the \"sql\" format.\n */\nexport const getDatetimeRuleProcessorSQL =\n (apiFns: RQBDateTimeLibraryAPI): RuleProcessor =>\n (rule, options) => {\n const opts = options ?? /* v8 ignore start -- @preserve */ {} /* v8 ignore stop -- @preserve */;\n const operator = mapSQLOperator(resolveDatetimeOperator(rule, opts));\n const operatorLowerCase = lc(operator);\n // v8 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 quotedField = getQuotedFieldName(rule.field, {\n quoteFieldNamesWith,\n fieldIdentifierSeparator,\n });\n\n // SQL can emit \"live\" symbolic relative expressions, so relative values stay\n // symbolic by default. When `context.materializeRelativeDateTime` is set, resolve\n // them to concrete literals up front and let the standard literal path handle them.\n const ruleValue = context.materializeRelativeDateTime\n ? materializeRelativeValues(apiFns, rule.value, opts)\n : rule.value;\n\n // Relative date/time values are stored as objects. Intercept them before\n // `toArray` (which drops objects) and emit symbolic dialect-specific SQL.\n const rawValues = Array.isArray(ruleValue) ? ruleValue : [ruleValue];\n if (rawValues.some(isRelativeDateTimeValue)) {\n const exprFor = (v: unknown): string | undefined => {\n if (isRelativeDateTimeValue(v)) {\n return getRelativeDateTimeSQL(v, opts.preset!, opts.fieldData?.datatype);\n }\n const dateVal = apiFns.toDate(v as string | Date);\n if (!apiFns.isValid(dateVal)) return undefined;\n return valueProcessor(\n { field: rule.field, operator: '=', value: dateVal },\n { ...opts, context: { originalValue: v } }\n );\n };\n\n switch (operatorLowerCase) {\n case 'in':\n case 'not in': {\n const exprs = rawValues.map(exprFor).filter((e): e is string => e !== undefined);\n // v8 ignore next -- a relative operand always yields an expression\n if (exprs.length === 0) return '';\n finalValue = `(${exprs.join(', ')})`;\n break;\n }\n\n case 'between':\n case 'not between': {\n // Operand order is preserved — symbolic expressions can't be compared\n // at format time to auto-order them.\n const first = exprFor(rawValues[0]);\n const second = exprFor(rawValues[1]);\n if (first === undefined || second === undefined) return '';\n finalValue = `${first} and ${second}`;\n break;\n }\n\n default: {\n const expr = exprFor(rawValues[0]);\n // v8 ignore next -- a single relative operand always yields an expression\n if (expr === undefined) return '';\n finalValue = expr;\n }\n }\n\n return `${quotedField} ${operator} ${finalValue}`.trim();\n }\n\n const valueAsArray: string[] = toArray(ruleValue, { 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 `${quotedField} ${operator} ${finalValue}`.trim();\n };\n","import type { RuleProcessor } from 'react-querybuilder';\nimport { defaultRuleProcessorTanStackDB } from 'react-querybuilder';\nimport type { RQBDateTimeLibraryAPI } from './types';\nimport { materializeForExport, processIsDateField } from './utils';\n\n/**\n * Generates a rule processor with date/time features for use by\n * {@link @react-querybuilder/core!formatQuery formatQuery} with the \"tanstack_db\" format.\n * Relative values are materialized and all date/time values are converted to `Date`\n * objects (TanStack DB collection filters compare against native `Date` values).\n */\nexport const getDatetimeRuleProcessorTanStackDB =\n (apiFns: RQBDateTimeLibraryAPI): RuleProcessor =>\n (rule, options) => {\n const opts = options ?? /* v8 ignore start -- @preserve */ {} /* v8 ignore stop -- @preserve */;\n const { context = {} } = opts;\n\n if (rule.valueSource === 'field' || !processIsDateField(context.isDateField, rule, opts)) {\n return defaultRuleProcessorTanStackDB(rule, opts);\n }\n\n const { operator, value } = materializeForExport(apiFns, rule, opts, true);\n return defaultRuleProcessorTanStackDB({ ...rule, operator, value }, opts);\n };\n"],"mappings":"oCASA,MAAa,EACX,GAEA,OAAO,GAAS,UAAY,sBAAsB,KAAK,CAAI,EAMhD,EAA2B,GACtC,OAAO,GAAU,YACjB,GACC,EAA6B,OAAS,YACvC,OAAQ,EAAgC,QAAW,SAE/C,EAAe,uCAOR,GACX,EACA,EACA,EAAa,IAAI,OACR,CACT,IAAI,EAAe,EAEnB,GAAI,EAAM,SAAW,MAAO,CAC1B,IAAM,EAAQ,EAAa,KAAK,EAAM,MAAM,EAE5C,GAAI,EAAO,CACT,IAAM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,CAAI,EACrF,OAAA,EAAA,EAAA,+BAAA,CAAsC,EAAM,CAAI,EAGlD,GAAM,CAAE,WAAU,SAAU,EAAqB,EAAQ,EAAM,EAAM,EAAI,EACzE,OAAA,EAAA,EAAA,+BAAA,CAAsC,CAAE,GAAG,EAAM,WAAU,OAAM,EAAG,CAAI,CAC1E"}
@@ -1,2 +0,0 @@
1
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));const c=require("./getDatetimeRuleProcessorTanStackDB-DgUg_arY.js");let l=require("dayjs");l=s(l);const u={format:(e,t)=>(0,l.default)(e).format(t),isAfter:(e,t)=>(0,l.default)(e).isAfter(t),isBefore:(e,t)=>(0,l.default)(e).isBefore(t),isSame:(e,t)=>(0,l.default)(e).isSame(t,c.D(e)||c.D(t)?`d`:`ms`),isValid:e=>(0,l.default)(e).isValid(),toDate:e=>(0,l.default)(e).toDate(),toISOString:e=>{let t=(0,l.default)(e);return t.isValid()?t.toISOString():``},toISOStringDateOnly:e=>{let t=(0,l.default)(e);return t.isValid()?t.format(`YYYY-MM-DD`):``},startOf:(e,t)=>(0,l.default)(e).startOf(t).toDate(),endOf:(e,t)=>(0,l.default)(e).endOf(t).toDate(),add:(e,t,n)=>(0,l.default)(e).add(t,n).toDate()};Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return u}});
2
- //# sourceMappingURL=rqbDateTimeLibraryAPI.dayjs-BfILPx88.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rqbDateTimeLibraryAPI.dayjs-BfILPx88.js","names":["isISOStringDateOnly"],"sources":["../../src/rqbDateTimeLibraryAPI.dayjs.ts"],"sourcesContent":["import dayjs from 'dayjs';\nimport type { RQBDateTimeLibraryAPI } from './types';\nimport { isISOStringDateOnly } from './utils';\n\n/**\n * {@link RQBDateTimeLibraryAPI} for Day.js\n */\nexport const rqbDateTimeLibraryAPI: RQBDateTimeLibraryAPI = {\n format: (d, fmt) => dayjs(d).format(fmt),\n isAfter: (a, b) => dayjs(a).isAfter(b),\n isBefore: (a, b) => dayjs(a).isBefore(b),\n isSame: (a, b) =>\n dayjs(a).isSame(b, isISOStringDateOnly(a) || isISOStringDateOnly(b) ? 'd' : 'ms'),\n isValid: d => dayjs(d).isValid(),\n toDate: d => dayjs(d).toDate(),\n toISOString: d => {\n const dToDate = dayjs(d);\n return dToDate.isValid() ? dToDate.toISOString() : '';\n },\n toISOStringDateOnly: d => {\n const dToDate = dayjs(d);\n return dToDate.isValid() ? dToDate.format('YYYY-MM-DD') : '';\n },\n startOf: (d, unit) => dayjs(d).startOf(unit).toDate(),\n endOf: (d, unit) => dayjs(d).endOf(unit).toDate(),\n add: (d, amount, unit) => dayjs(d).add(amount, unit).toDate(),\n};\n"],"mappings":"gkBAOA,MAAa,EAA+C,CAC1D,QAAS,EAAG,KAAA,EAAA,EAAA,QAAA,CAAc,CAAC,CAAC,CAAC,OAAO,CAAG,EACvC,SAAU,EAAG,KAAA,EAAA,EAAA,QAAA,CAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,EACrC,UAAW,EAAG,KAAA,EAAA,EAAA,QAAA,CAAY,CAAC,CAAC,CAAC,SAAS,CAAC,EACvC,QAAS,EAAG,KAAA,EAAA,EAAA,QAAA,CACJ,CAAC,CAAC,CAAC,OAAO,EAAGA,EAAAA,EAAoB,CAAC,GAAKA,EAAAA,EAAoB,CAAC,EAAI,IAAM,IAAI,EAClF,QAAS,IAAA,EAAA,EAAA,QAAA,CAAW,CAAC,CAAC,CAAC,QAAQ,EAC/B,OAAQ,IAAA,EAAA,EAAA,QAAA,CAAW,CAAC,CAAC,CAAC,OAAO,EAC7B,YAAa,GAAK,CAChB,IAAM,GAAA,EAAA,EAAA,QAAA,CAAgB,CAAC,EACvB,OAAO,EAAQ,QAAQ,EAAI,EAAQ,YAAY,EAAI,EACrD,EACA,oBAAqB,GAAK,CACxB,IAAM,GAAA,EAAA,EAAA,QAAA,CAAgB,CAAC,EACvB,OAAO,EAAQ,QAAQ,EAAI,EAAQ,OAAO,YAAY,EAAI,EAC5D,EACA,SAAU,EAAG,KAAA,EAAA,EAAA,QAAA,CAAe,CAAC,CAAC,CAAC,QAAQ,CAAI,CAAC,CAAC,OAAO,EACpD,OAAQ,EAAG,KAAA,EAAA,EAAA,QAAA,CAAe,CAAC,CAAC,CAAC,MAAM,CAAI,CAAC,CAAC,OAAO,EAChD,KAAM,EAAG,EAAQ,KAAA,EAAA,EAAA,QAAA,CAAe,CAAC,CAAC,CAAC,IAAI,EAAQ,CAAI,CAAC,CAAC,OAAO,CAC9D"}
@@ -1,63 +0,0 @@
1
- //#region \0rolldown/runtime.js
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
- key = keys[i];
11
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
- get: ((k) => from[k]).bind(null, key),
13
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
- });
15
- }
16
- return to;
17
- };
18
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
19
- value: mod,
20
- enumerable: true
21
- }) : target, mod));
22
- //#endregion
23
- const require_getDatetimeRuleProcessorTanStackDB = require("./getDatetimeRuleProcessorTanStackDB-CL79A1_x.js");
24
- let dayjs = require("dayjs");
25
- dayjs = __toESM(dayjs);
26
- //#region src/rqbDateTimeLibraryAPI.dayjs.ts
27
- /**
28
- * {@link RQBDateTimeLibraryAPI} for Day.js
29
- */
30
- const rqbDateTimeLibraryAPI = {
31
- format: (d, fmt) => (0, dayjs.default)(d).format(fmt),
32
- isAfter: (a, b) => (0, dayjs.default)(a).isAfter(b),
33
- isBefore: (a, b) => (0, dayjs.default)(a).isBefore(b),
34
- isSame: (a, b) => (0, dayjs.default)(a).isSame(b, require_getDatetimeRuleProcessorTanStackDB.isISOStringDateOnly(a) || require_getDatetimeRuleProcessorTanStackDB.isISOStringDateOnly(b) ? "d" : "ms"),
35
- isValid: (d) => (0, dayjs.default)(d).isValid(),
36
- toDate: (d) => (0, dayjs.default)(d).toDate(),
37
- toISOString: (d) => {
38
- const dToDate = (0, dayjs.default)(d);
39
- return dToDate.isValid() ? dToDate.toISOString() : "";
40
- },
41
- toISOStringDateOnly: (d) => {
42
- const dToDate = (0, dayjs.default)(d);
43
- return dToDate.isValid() ? dToDate.format("YYYY-MM-DD") : "";
44
- },
45
- startOf: (d, unit) => (0, dayjs.default)(d).startOf(unit).toDate(),
46
- endOf: (d, unit) => (0, dayjs.default)(d).endOf(unit).toDate(),
47
- add: (d, amount, unit) => (0, dayjs.default)(d).add(amount, unit).toDate()
48
- };
49
- //#endregion
50
- Object.defineProperty(exports, "__toESM", {
51
- enumerable: true,
52
- get: function() {
53
- return __toESM;
54
- }
55
- });
56
- Object.defineProperty(exports, "rqbDateTimeLibraryAPI", {
57
- enumerable: true,
58
- get: function() {
59
- return rqbDateTimeLibraryAPI;
60
- }
61
- });
62
-
63
- //# sourceMappingURL=rqbDateTimeLibraryAPI.dayjs-CzLh_zi9.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rqbDateTimeLibraryAPI.dayjs-CzLh_zi9.js","names":["isISOStringDateOnly"],"sources":["../../src/rqbDateTimeLibraryAPI.dayjs.ts"],"sourcesContent":["import dayjs from 'dayjs';\nimport type { RQBDateTimeLibraryAPI } from './types';\nimport { isISOStringDateOnly } from './utils';\n\n/**\n * {@link RQBDateTimeLibraryAPI} for Day.js\n */\nexport const rqbDateTimeLibraryAPI: RQBDateTimeLibraryAPI = {\n format: (d, fmt) => dayjs(d).format(fmt),\n isAfter: (a, b) => dayjs(a).isAfter(b),\n isBefore: (a, b) => dayjs(a).isBefore(b),\n isSame: (a, b) =>\n dayjs(a).isSame(b, isISOStringDateOnly(a) || isISOStringDateOnly(b) ? 'd' : 'ms'),\n isValid: d => dayjs(d).isValid(),\n toDate: d => dayjs(d).toDate(),\n toISOString: d => {\n const dToDate = dayjs(d);\n return dToDate.isValid() ? dToDate.toISOString() : '';\n },\n toISOStringDateOnly: d => {\n const dToDate = dayjs(d);\n return dToDate.isValid() ? dToDate.format('YYYY-MM-DD') : '';\n },\n startOf: (d, unit) => dayjs(d).startOf(unit).toDate(),\n endOf: (d, unit) => dayjs(d).endOf(unit).toDate(),\n add: (d, amount, unit) => dayjs(d).add(amount, unit).toDate(),\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAa,wBAA+C;CAC1D,SAAS,GAAG,SAAA,GAAA,MAAA,QAAA,CAAc,CAAC,CAAC,CAAC,OAAO,GAAG;CACvC,UAAU,GAAG,OAAA,GAAA,MAAA,QAAA,CAAY,CAAC,CAAC,CAAC,QAAQ,CAAC;CACrC,WAAW,GAAG,OAAA,GAAA,MAAA,QAAA,CAAY,CAAC,CAAC,CAAC,SAAS,CAAC;CACvC,SAAS,GAAG,OAAA,GAAA,MAAA,QAAA,CACJ,CAAC,CAAC,CAAC,OAAO,GAAGA,2CAAAA,oBAAoB,CAAC,KAAKA,2CAAAA,oBAAoB,CAAC,IAAI,MAAM,IAAI;CAClF,UAAS,OAAA,GAAA,MAAA,QAAA,CAAW,CAAC,CAAC,CAAC,QAAQ;CAC/B,SAAQ,OAAA,GAAA,MAAA,QAAA,CAAW,CAAC,CAAC,CAAC,OAAO;CAC7B,cAAa,MAAK;EAChB,MAAM,WAAA,GAAA,MAAA,QAAA,CAAgB,CAAC;EACvB,OAAO,QAAQ,QAAQ,IAAI,QAAQ,YAAY,IAAI;CACrD;CACA,sBAAqB,MAAK;EACxB,MAAM,WAAA,GAAA,MAAA,QAAA,CAAgB,CAAC;EACvB,OAAO,QAAQ,QAAQ,IAAI,QAAQ,OAAO,YAAY,IAAI;CAC5D;CACA,UAAU,GAAG,UAAA,GAAA,MAAA,QAAA,CAAe,CAAC,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,OAAO;CACpD,QAAQ,GAAG,UAAA,GAAA,MAAA,QAAA,CAAe,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,OAAO;CAChD,MAAM,GAAG,QAAQ,UAAA,GAAA,MAAA,QAAA,CAAe,CAAC,CAAC,CAAC,IAAI,QAAQ,IAAI,CAAC,CAAC,OAAO;AAC9D"}
@@ -1,265 +0,0 @@
1
- import { FullOption, RQBJsonLogic, RuleProcessor, ValueEditorProps } from "react-querybuilder";
2
- import { RulesLogic } from "json-logic-js";
3
- import { ComponentType, ReactNode } from "react";
4
-
5
- //#region src/types.d.ts
6
- interface RQBJsonLogicDateBetween {
7
- dateBetween: [RQBJsonLogic, RQBJsonLogic, RQBJsonLogic];
8
- }
9
- interface RQBJsonLogicDateNotBetween {
10
- dateNotBetween: [RQBJsonLogic, RQBJsonLogic, RQBJsonLogic];
11
- }
12
- interface RQBJsonLogicDateIn {
13
- dateIn: [RQBJsonLogic, RQBJsonLogic[]];
14
- }
15
- interface RQBJsonLogicDateNotIn {
16
- dateNotIn: [RQBJsonLogic, RQBJsonLogic[]];
17
- }
18
- interface RQBJsonLogicDateBefore {
19
- dateBefore: [RQBJsonLogic, RQBJsonLogic, ...RQBJsonLogic[]];
20
- }
21
- interface RQBJsonLogicDateOnOrBefore {
22
- dateOnOrBefore: [RQBJsonLogic, RQBJsonLogic, ...RQBJsonLogic[]];
23
- }
24
- interface RQBJsonLogicDateOn {
25
- dateOn: [RQBJsonLogic, RQBJsonLogic, ...RQBJsonLogic[]];
26
- }
27
- interface RQBJsonLogicDateNotOn {
28
- dateNotOn: [RQBJsonLogic, RQBJsonLogic, ...RQBJsonLogic[]];
29
- }
30
- interface RQBJsonLogicDateAfter {
31
- dateAfter: [RQBJsonLogic, RQBJsonLogic, ...RQBJsonLogic[]];
32
- }
33
- interface RQBJsonLogicDateOnOrAfter {
34
- dateOnOrAfter: [RQBJsonLogic, RQBJsonLogic, ...RQBJsonLogic[]];
35
- }
36
- interface RQBJsonLogicDateRelative {
37
- dateRelative: [RelativeDateTimeAnchor, number, RelativeDateTimeUnit, boolean];
38
- }
39
- /**
40
- * JsonLogic rule object with additional operators generated by
41
- * {@link @react-querybuilder/core!formatQuery formatQuery} and accepted by
42
- * {@link @react-querybuilder/core!parseJsonLogic parseJsonLogic}.
43
- */
44
- type RQBDateTimeJsonLogic = RQBJsonLogic | RulesLogic<RQBJsonLogicDateAfter | RQBJsonLogicDateBefore | RQBJsonLogicDateBetween | RQBJsonLogicDateIn | RQBJsonLogicDateNotBetween | RQBJsonLogicDateNotIn | RQBJsonLogicDateNotOn | RQBJsonLogicDateOn | RQBJsonLogicDateOnOrAfter | RQBJsonLogicDateOnOrBefore | RQBJsonLogicDateRelative>;
45
- type DateOrString = string | Date;
46
- /**
47
- * Unit of measure for a relative date/time offset.
48
- */
49
- type RelativeDateTimeUnit = "minute" | "hour" | "day" | "week" | "month" | "year";
50
- /**
51
- * Unit of measure for truncating a date/time to the start or end of a period
52
- * (the subset of {@link RelativeDateTimeUnit} that represents a calendar period).
53
- */
54
- type RelativeDateTimeTruncationUnit = "day" | "week" | "month" | "year";
55
- /**
56
- * Reference point (zero-offset) for a {@link RelativeDateTimeValue}. `'now'` is the
57
- * current date/time; the `startOf*`/`endOf*` anchors truncate to the start or end
58
- * of the corresponding calendar period.
59
- */
60
- type RelativeDateTimeAnchor = "now" | "startOfDay" | "endOfDay" | "startOfWeek" | "endOfWeek" | "startOfMonth" | "endOfMonth" | "startOfYear" | "endOfYear";
61
- /**
62
- * Structured representation of a relative date/time value, e.g. "three months ago"
63
- * or "the beginning of this year". Stored as the `value` of a rule (in place of the
64
- * usual ISO 8601 string) and recognized by the date/time rule processors.
65
- *
66
- * The final date/time is computed as: apply the `anchor` to the current date/time,
67
- * then add `offset` units of `unit`. When `offset` is `0`, `unit` is irrelevant.
68
- */
69
- interface RelativeDateTimeValue {
70
- /** Discriminant identifying a relative (as opposed to absolute) value. */
71
- mode: "relative";
72
- /** Zero-offset reference point. */
73
- anchor: RelativeDateTimeAnchor;
74
- /** Signed offset from the anchor; negative = past, positive = future, 0 = exact anchor. */
75
- offset: number;
76
- /** Unit of the `offset`. */
77
- unit: RelativeDateTimeUnit;
78
- }
79
- interface RQBDateTimeLibraryAPI {
80
- /**
81
- * Formats a date as a string.
82
- */
83
- format: (d: DateOrString, fmt: string) => string;
84
- /**
85
- * Formats a date as an ISO 8601 string, only including
86
- * the year, month, and day ('YYYY-MM-DD').
87
- */
88
- toISOStringDateOnly: (d: DateOrString) => string;
89
- /**
90
- * Determines whether the first date is after the second date.
91
- */
92
- isAfter: (a: DateOrString, b: DateOrString) => boolean;
93
- /**
94
- * Determines whether the first date is before the second date.
95
- */
96
- isBefore: (a: DateOrString, b: DateOrString) => boolean;
97
- /**
98
- * Determines whether the first date is the same as the second date.
99
- *
100
- * If either the first date or the second date is a string in the
101
- * format 'YYYY-MM-DD', then the dates will only be compared at
102
- * the date level (no time component). Otherwise, they will be
103
- * compared to the millisecond.
104
- */
105
- isSame: (a: DateOrString, b: DateOrString) => boolean;
106
- /**
107
- * Determines whether the date is either a valid `Date` object or an
108
- * ISO 8601-formatted string representing a valid date.
109
- */
110
- isValid: (d: DateOrString) => boolean;
111
- /**
112
- * Converts a string to a `Date` object or returns a valid `Date` as is.
113
- */
114
- toDate: (d: DateOrString) => Date;
115
- /**
116
- * Converts a `Date` or ISO 8601-formatted string into a full ISO 8601 UTC
117
- * string, in the format 'YYYY-MM-DDTHH:mm:ss.SSSZ' (the "T" and "Z" are
118
- * static; other parts represent standard time units, increasing in precision
119
- * from left to right).
120
- */
121
- toISOString: (d: DateOrString) => string;
122
- /**
123
- * Returns a new `Date` truncated to the start of the given period.
124
- *
125
- * Week start follows the date library's own default/locale (e.g. Luxon uses
126
- * Monday per ISO 8601; Day.js and date-fns default to Sunday).
127
- */
128
- startOf: (d: DateOrString, unit: RelativeDateTimeTruncationUnit) => Date;
129
- /**
130
- * Returns a new `Date` advanced to the end of the given period (the last
131
- * representable instant within it).
132
- *
133
- * Week start follows the date library's own default/locale (see {@link RQBDateTimeLibraryAPI.startOf}).
134
- */
135
- endOf: (d: DateOrString, unit: RelativeDateTimeTruncationUnit) => Date;
136
- /**
137
- * Returns a new `Date` offset from the input by `amount` units of `unit`
138
- * (negative `amount` moves into the past).
139
- */
140
- add: (d: DateOrString, amount: number, unit: RelativeDateTimeUnit) => Date;
141
- }
142
- type FnDateDate = (a: DateOrString, b: DateOrString) => boolean;
143
- type FnDateArrayOfDates = (a: DateOrString, b: DateOrString[]) => boolean;
144
- type FnDateDateDate = (a: DateOrString, b: DateOrString, c: DateOrString) => boolean;
145
- type RQBJsonLogicDateTimeOperations = {
146
- /** Determines if the first date is after the second date. */dateAfter: FnDateDate; /** Determines if the first date is before the second date. */
147
- dateBefore: FnDateDate; /** Determines if the second date is between the first and third dates (inclusive). */
148
- dateBetween: FnDateDateDate; /** Determines if the first date is one of the values in the array of dates. */
149
- dateIn: FnDateArrayOfDates; /** Determines if the second date is not between the first and third dates. */
150
- dateNotBetween: FnDateDateDate; /** Determines if the first date is not one of the values in the array of dates. */
151
- dateNotIn: FnDateArrayOfDates; /** Determines if the first date is not the same as the second date. */
152
- dateNotOn: FnDateDate; /** Determines if the first date is the same as the second date (at the level of least precision between the two). */
153
- dateOn: FnDateDate; /** Determines if the first date is either the same as the second date or after it. */
154
- dateOnOrAfter: FnDateDate; /** Determines if the first date is either the same as the second date or before it. */
155
- dateOnOrBefore: FnDateDate;
156
- /**
157
- * Resolves a relative date/time descriptor (anchor, offset, unit, and date-only
158
- * flag) to a concrete ISO 8601 string at evaluation time ("live" semantics).
159
- */
160
- dateRelative: (anchor: RelativeDateTimeAnchor, offset: number, unit: RelativeDateTimeUnit, dateOnly: boolean) => string;
161
- };
162
- /**
163
- * Customizable content/labels for the absolute/relative mode toggle rendered by
164
- * {@link toggleModeController}. The default glyphs come from CSS pseudo-elements, so
165
- * `absoluteContent`/`relativeContent` are only needed to override them (e.g. to render
166
- * an icon component or localized text).
167
- */
168
- interface RelativeDateTimeToggleLabels {
169
- /** Accessible label (`aria-label`) for the toggle button. */
170
- label?: string;
171
- /** Tooltip shown while in absolute mode (clicking switches to relative). */
172
- absoluteTitle?: string;
173
- /** Tooltip shown while in relative mode (clicking switches to absolute). */
174
- relativeTitle?: string;
175
- /** Custom content rendered while in absolute mode. Defaults to a CSS glyph. */
176
- absoluteContent?: ReactNode;
177
- /** Custom content rendered while in relative mode. Defaults to a CSS glyph. */
178
- relativeContent?: ReactNode;
179
- }
180
- /**
181
- * Props passed to a {@link RelativeDateTimeModeController}'s `ModeControl` component —
182
- * the affordance (e.g. a toggle button) that switches a rule between absolute and
183
- * relative date/time entry.
184
- */
185
- interface RelativeDateTimeModeControlProps {
186
- /** Whether the rule is currently in relative mode. */
187
- isRelative: boolean;
188
- /** Switches the rule between absolute and relative mode. */
189
- setMode: (mode: "absolute" | "relative") => void;
190
- /** The value editor's schema (for theme-aware rendering). */
191
- schema: ValueEditorProps["schema"];
192
- /** Whether the control is disabled. */
193
- disabled?: boolean;
194
- /** Class name applied to the control. */
195
- className?: string;
196
- /** Title/tooltip from the value editor (fallback when labels omit titles). */
197
- title?: string;
198
- /** Test ID from the value editor. */
199
- testID?: string;
200
- /** Resolved toggle labels (merged with defaults). */
201
- labels: Required<RelativeDateTimeToggleLabels>;
202
- }
203
- /**
204
- * A pluggable strategy that governs how a user switches between absolute and relative
205
- * date/time entry in the {@link RelativeDateTimeValueEditor}. The stored value shape is
206
- * unaffected — a controller only decides the current mode and (optionally) renders an
207
- * affordance to change it.
208
- *
209
- * Ships with {@link toggleModeController} (the zero-config default); build an
210
- * operator-driven controller with {@link createOperatorModeController}, or supply a custom
211
- * object to fully control the UX.
212
- */
213
- interface RelativeDateTimeModeController {
214
- /** Derives the current mode from the rule (its operator and/or value). */
215
- isRelative: (props: ValueEditorProps) => boolean;
216
- /**
217
- * Optional affordance rendered inside the editor to switch modes. Omit it (as the
218
- * operator-driven controller does) when the mode is selected elsewhere, e.g. via the
219
- * operator selector.
220
- */
221
- ModeControl?: ComponentType<RelativeDateTimeModeControlProps>;
222
- }
223
- /**
224
- * Configuration for the {@link RelativeDateTimeValueEditor}, supplied as props to
225
- * {@link QueryBuilderDateTime} (or via the relative date/time config context). Every
226
- * field is optional; omitting all of them yields the zero-config toggle experience.
227
- */
228
- interface RelativeDateTimeEditorConfig {
229
- /** Strategy for switching between absolute and relative modes. Defaults to {@link toggleModeController}. */
230
- modeController?: RelativeDateTimeModeController;
231
- /** Anchor (reference-point) options. Defaults to {@link defaultRelativeDateTimeAnchors}. */
232
- anchors?: FullOption<RelativeDateTimeAnchor>[];
233
- /** Unit options. Defaults to {@link defaultRelativeDateTimeUnits}. */
234
- units?: FullOption<RelativeDateTimeUnit>[];
235
- /** Content/labels for the absolute/relative toggle. */
236
- toggleLabels?: RelativeDateTimeToggleLabels;
237
- /**
238
- * Date/time library adapter used by the value editor to parse/validate the rule value
239
- * for the native date input. Defaults to the Day.js adapter. Pass the adapter matching
240
- * your chosen entry point (e.g. from `@react-querybuilder/datetime/luxon`) so the editor
241
- * interprets values consistently with the rule processors.
242
- */
243
- dateTimeAPI?: RQBDateTimeLibraryAPI;
244
- }
245
- /**
246
- * Maps operator names that are used only to _signal_ relative mode (see
247
- * {@link createOperatorModeController}) to the real comparison operator that should be used
248
- * when exporting via `formatQuery`. Supplied through `context.relativeOperatorMap`. Operators
249
- * not present in the map are exported unchanged.
250
- *
251
- * @example
252
- * ```ts
253
- * formatQuery(query, {
254
- * format: 'sql',
255
- * ruleProcessor: datetimeRuleProcessorSQL,
256
- * context: { relativeOperatorMap: { relativeEq: '=' } },
257
- * });
258
- * ```
259
- */
260
- type RelativeOperatorMap = Record<string, string>;
261
- type IsDateFieldFunction = (...[rule, opts]: Parameters<RuleProcessor>) => boolean;
262
- type IsDateField = IsDateFieldFunction | Record<string, unknown> | Record<string, unknown>[] | boolean | undefined;
263
- //#endregion
264
- export { RelativeDateTimeUnit as C, RelativeDateTimeTruncationUnit as S, RelativeOperatorMap as T, RelativeDateTimeAnchor as _, RQBJsonLogicDateAfter as a, RelativeDateTimeModeController as b, RQBJsonLogicDateIn as c, RQBJsonLogicDateNotOn as d, RQBJsonLogicDateOn as f, RQBJsonLogicDateTimeOperations as g, RQBJsonLogicDateRelative as h, RQBDateTimeLibraryAPI as i, RQBJsonLogicDateNotBetween as l, RQBJsonLogicDateOnOrBefore as m, IsDateFieldFunction as n, RQBJsonLogicDateBefore as o, RQBJsonLogicDateOnOrAfter as p, RQBDateTimeJsonLogic as r, RQBJsonLogicDateBetween as s, IsDateField as t, RQBJsonLogicDateNotIn as u, RelativeDateTimeEditorConfig as v, RelativeDateTimeValue as w, RelativeDateTimeToggleLabels as x, RelativeDateTimeModeControlProps as y };
265
- //# sourceMappingURL=types-XYMw0jFT.d.ts.map