@react-querybuilder/datetime 8.20.1 → 8.20.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -3
- package/dist/cjs/getDatetimeRuleProcessorTanStackDB-BVNfYaIj.js +2 -0
- package/dist/cjs/getDatetimeRuleProcessorTanStackDB-BVNfYaIj.js.map +1 -0
- package/dist/cjs/{getDatetimeRuleProcessorTanStackDB-CL79A1_x.js → getDatetimeRuleProcessorTanStackDB-cmGqMT0Q.js} +83 -216
- package/dist/cjs/getDatetimeRuleProcessorTanStackDB-cmGqMT0Q.js.map +1 -0
- package/dist/cjs/react-querybuilder_datetime.cjs.development.d.ts +3 -123
- package/dist/cjs/react-querybuilder_datetime.cjs.development.date-fns.d.ts +2 -2
- package/dist/cjs/react-querybuilder_datetime.cjs.development.date-fns.js +3 -2
- package/dist/cjs/react-querybuilder_datetime.cjs.development.date-fns.js.map +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.development.dayjs.d.ts +2 -2
- package/dist/cjs/react-querybuilder_datetime.cjs.development.dayjs.js +53 -26
- package/dist/cjs/react-querybuilder_datetime.cjs.development.dayjs.js.map +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.development.js +10 -467
- package/dist/cjs/react-querybuilder_datetime.cjs.development.js.map +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.development.jsdate.d.ts +2 -2
- package/dist/cjs/react-querybuilder_datetime.cjs.development.jsdate.js +26 -144
- package/dist/cjs/react-querybuilder_datetime.cjs.development.jsdate.js.map +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.development.luxon.d.ts +2 -2
- package/dist/cjs/react-querybuilder_datetime.cjs.development.luxon.js +3 -2
- package/dist/cjs/react-querybuilder_datetime.cjs.development.luxon.js.map +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.development.ui.d.ts +228 -0
- package/dist/cjs/react-querybuilder_datetime.cjs.development.ui.js +464 -0
- package/dist/cjs/react-querybuilder_datetime.cjs.development.ui.js.map +1 -0
- package/dist/cjs/react-querybuilder_datetime.cjs.production.d.ts +3 -123
- package/dist/cjs/react-querybuilder_datetime.cjs.production.date-fns.d.ts +2 -2
- package/dist/cjs/react-querybuilder_datetime.cjs.production.date-fns.js +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.date-fns.js.map +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.dayjs.d.ts +2 -2
- package/dist/cjs/react-querybuilder_datetime.cjs.production.dayjs.js +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.dayjs.js.map +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.js +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.js.map +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.jsdate.d.ts +2 -2
- package/dist/cjs/react-querybuilder_datetime.cjs.production.jsdate.js +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.jsdate.js.map +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.luxon.d.ts +2 -2
- package/dist/cjs/react-querybuilder_datetime.cjs.production.luxon.js +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.luxon.js.map +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.ui.d.ts +228 -0
- package/dist/cjs/react-querybuilder_datetime.cjs.production.ui.js +2 -0
- package/dist/cjs/react-querybuilder_datetime.cjs.production.ui.js.map +1 -0
- package/dist/cjs/rolldown-runtime-CMqjfN_6.js +1 -0
- package/dist/cjs/rolldown-runtime-D6vf50IK.js +28 -0
- package/dist/cjs/rqbDateTimeLibraryAPI.jsdate-BPEcMhhr.js +128 -0
- package/dist/cjs/rqbDateTimeLibraryAPI.jsdate-BPEcMhhr.js.map +1 -0
- package/dist/cjs/rqbDateTimeLibraryAPI.jsdate-ioz2B1zh.js +2 -0
- package/dist/cjs/rqbDateTimeLibraryAPI.jsdate-ioz2B1zh.js.map +1 -0
- package/dist/cjs/{types-XYMw0jFT.d.ts → types-Di8kFIXV.d.ts} +3 -103
- package/dist/cjs/ui.d.ts +1 -0
- package/dist/cjs/ui.js +6 -0
- package/dist/cjs/utils-DUePrC--.js +154 -0
- package/dist/cjs/utils-DUePrC--.js.map +1 -0
- package/dist/cjs/utils-jkW5R1AA.js +2 -0
- package/dist/cjs/utils-jkW5R1AA.js.map +1 -0
- package/dist/{getDatetimeRuleProcessorTanStackDB-BcOC-o2A.mjs → getDatetimeRuleProcessorTanStackDB-B93XaPdB.mjs} +4 -107
- package/dist/getDatetimeRuleProcessorTanStackDB-B93XaPdB.mjs.map +1 -0
- package/dist/{getDatetimeRuleProcessorTanStackDB-BL8mbdbl.js → getDatetimeRuleProcessorTanStackDB-BDFJlfJh.js} +4 -181
- package/dist/getDatetimeRuleProcessorTanStackDB-BDFJlfJh.js.map +1 -0
- package/dist/getDatetimeRuleProcessorTanStackDB-Czg9Fbb8.mjs +2 -0
- package/dist/getDatetimeRuleProcessorTanStackDB-Czg9Fbb8.mjs.map +1 -0
- package/dist/objectSpread2-73AKOozq.js +181 -0
- package/dist/objectSpread2-73AKOozq.js.map +1 -0
- package/dist/react-querybuilder_datetime.d.mts +3 -123
- package/dist/react-querybuilder_datetime.date-fns.d.mts +2 -2
- package/dist/react-querybuilder_datetime.date-fns.mjs +2 -1
- package/dist/react-querybuilder_datetime.date-fns.mjs.map +1 -1
- package/dist/react-querybuilder_datetime.dayjs.d.mts +2 -2
- package/dist/react-querybuilder_datetime.dayjs.mjs +27 -2
- package/dist/react-querybuilder_datetime.dayjs.mjs.map +1 -1
- package/dist/react-querybuilder_datetime.jsdate.d.mts +2 -2
- package/dist/react-querybuilder_datetime.jsdate.mjs +2 -120
- package/dist/react-querybuilder_datetime.jsdate.mjs.map +1 -1
- package/dist/react-querybuilder_datetime.legacy-esm.d.ts +3 -123
- package/dist/react-querybuilder_datetime.legacy-esm.date-fns.d.ts +2 -2
- package/dist/react-querybuilder_datetime.legacy-esm.date-fns.js +2 -1
- package/dist/react-querybuilder_datetime.legacy-esm.date-fns.js.map +1 -1
- package/dist/react-querybuilder_datetime.legacy-esm.dayjs.d.ts +2 -2
- package/dist/react-querybuilder_datetime.legacy-esm.dayjs.js +27 -2
- package/dist/react-querybuilder_datetime.legacy-esm.dayjs.js.map +1 -1
- package/dist/react-querybuilder_datetime.legacy-esm.js +4 -449
- package/dist/react-querybuilder_datetime.legacy-esm.js.map +1 -1
- package/dist/react-querybuilder_datetime.legacy-esm.jsdate.d.ts +2 -2
- package/dist/react-querybuilder_datetime.legacy-esm.jsdate.js +2 -120
- package/dist/react-querybuilder_datetime.legacy-esm.jsdate.js.map +1 -1
- package/dist/react-querybuilder_datetime.legacy-esm.luxon.d.ts +2 -2
- package/dist/react-querybuilder_datetime.legacy-esm.luxon.js +2 -1
- package/dist/react-querybuilder_datetime.legacy-esm.luxon.js.map +1 -1
- package/dist/react-querybuilder_datetime.legacy-esm.ui.d.ts +228 -0
- package/dist/react-querybuilder_datetime.legacy-esm.ui.js +451 -0
- package/dist/react-querybuilder_datetime.legacy-esm.ui.js.map +1 -0
- package/dist/react-querybuilder_datetime.luxon.d.mts +2 -2
- package/dist/react-querybuilder_datetime.luxon.mjs +2 -1
- package/dist/react-querybuilder_datetime.luxon.mjs.map +1 -1
- package/dist/react-querybuilder_datetime.mjs +4 -446
- package/dist/react-querybuilder_datetime.mjs.map +1 -1
- package/dist/react-querybuilder_datetime.production.d.mts +3 -123
- package/dist/react-querybuilder_datetime.production.date-fns.d.mts +2 -2
- package/dist/react-querybuilder_datetime.production.date-fns.mjs +1 -1
- package/dist/react-querybuilder_datetime.production.date-fns.mjs.map +1 -1
- package/dist/react-querybuilder_datetime.production.dayjs.d.mts +2 -2
- package/dist/react-querybuilder_datetime.production.dayjs.mjs +1 -1
- package/dist/react-querybuilder_datetime.production.dayjs.mjs.map +1 -1
- package/dist/react-querybuilder_datetime.production.jsdate.d.mts +2 -2
- package/dist/react-querybuilder_datetime.production.jsdate.mjs +1 -1
- package/dist/react-querybuilder_datetime.production.jsdate.mjs.map +1 -1
- package/dist/react-querybuilder_datetime.production.luxon.d.mts +2 -2
- package/dist/react-querybuilder_datetime.production.luxon.mjs +1 -1
- package/dist/react-querybuilder_datetime.production.luxon.mjs.map +1 -1
- package/dist/react-querybuilder_datetime.production.mjs +1 -1
- package/dist/react-querybuilder_datetime.production.mjs.map +1 -1
- package/dist/react-querybuilder_datetime.production.ui.d.mts +228 -0
- package/dist/react-querybuilder_datetime.production.ui.mjs +2 -0
- package/dist/react-querybuilder_datetime.production.ui.mjs.map +1 -0
- package/dist/react-querybuilder_datetime.ui.d.mts +228 -0
- package/dist/react-querybuilder_datetime.ui.mjs +448 -0
- package/dist/react-querybuilder_datetime.ui.mjs.map +1 -0
- package/dist/rqbDateTimeLibraryAPI.jsdate-CDOtydFq.mjs +2 -0
- package/dist/rqbDateTimeLibraryAPI.jsdate-CDOtydFq.mjs.map +1 -0
- package/dist/rqbDateTimeLibraryAPI.jsdate-CpGoQAje.js +123 -0
- package/dist/rqbDateTimeLibraryAPI.jsdate-CpGoQAje.js.map +1 -0
- package/dist/rqbDateTimeLibraryAPI.jsdate-D66yJ1hK.mjs +123 -0
- package/dist/rqbDateTimeLibraryAPI.jsdate-D66yJ1hK.mjs.map +1 -0
- package/dist/{types-CdjHqQ0k.d.ts → types-Di8kFIXV.d.mts} +3 -103
- package/dist/{types-CdjHqQ0k.d.mts → types-Di8kFIXV.d.ts} +3 -103
- package/dist/utils-BC2SALFm.mjs +107 -0
- package/dist/utils-BC2SALFm.mjs.map +1 -0
- package/dist/utils-VKS8YY2D.mjs +2 -0
- package/dist/utils-VKS8YY2D.mjs.map +1 -0
- package/package.json +27 -8
- package/ui/package.json +4 -0
- package/dist/cjs/getDatetimeRuleProcessorTanStackDB-CL79A1_x.js.map +0 -1
- package/dist/cjs/getDatetimeRuleProcessorTanStackDB-DgUg_arY.js +0 -2
- package/dist/cjs/getDatetimeRuleProcessorTanStackDB-DgUg_arY.js.map +0 -1
- package/dist/cjs/rqbDateTimeLibraryAPI.dayjs-BfILPx88.js +0 -2
- package/dist/cjs/rqbDateTimeLibraryAPI.dayjs-BfILPx88.js.map +0 -1
- package/dist/cjs/rqbDateTimeLibraryAPI.dayjs-CzLh_zi9.js +0 -63
- package/dist/cjs/rqbDateTimeLibraryAPI.dayjs-CzLh_zi9.js.map +0 -1
- package/dist/getDatetimeRuleProcessorTanStackDB-BL8mbdbl.js.map +0 -1
- package/dist/getDatetimeRuleProcessorTanStackDB-BcOC-o2A.mjs.map +0 -1
- package/dist/getDatetimeRuleProcessorTanStackDB-Dloxv6k2.mjs +0 -2
- package/dist/getDatetimeRuleProcessorTanStackDB-Dloxv6k2.mjs.map +0 -1
- package/dist/rqbDateTimeLibraryAPI.dayjs-BW7faYFD.mjs +0 -29
- package/dist/rqbDateTimeLibraryAPI.dayjs-BW7faYFD.mjs.map +0 -1
- package/dist/rqbDateTimeLibraryAPI.dayjs-BoX90aqZ.mjs +0 -2
- package/dist/rqbDateTimeLibraryAPI.dayjs-BoX90aqZ.mjs.map +0 -1
- package/dist/rqbDateTimeLibraryAPI.dayjs-Da4VXvFM.js +0 -29
- package/dist/rqbDateTimeLibraryAPI.dayjs-Da4VXvFM.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-querybuilder_datetime.production.mjs","names":["defaultDateTimeAPI"],"sources":["../src/datetimeRuleProcessorJsonLogic.ts","../src/InheritedValueEditorContext.ts","../src/relativeDateTimeConstants.ts","../src/relativeDateTimeModeControllers.tsx","../src/RelativeDateTimeConfigContext.tsx","../src/RelativeDateTimeValueEditor.tsx","../src/QueryBuilderDateTime.tsx"],"sourcesContent":["import type { DefaultOperatorName, JsonLogicVar, RuleProcessor } from 'react-querybuilder';\nimport { defaultRuleProcessorJsonLogic, toArray } from 'react-querybuilder';\nimport type { RQBJsonLogicDateRelative, RQBDateTimeJsonLogic } from './types';\nimport {\n isDateOnlyDatatype,\n isRelativeDateTimeValue,\n processIsDateField,\n resolveDatetimeOperator,\n} from './utils';\n\nconst dateOperationMap = {\n '!=': 'dateNotOn',\n '<': 'dateBefore',\n '<=': 'dateOnOrBefore',\n '=': 'dateOn',\n '>': 'dateAfter',\n '>=': 'dateOnOrAfter',\n between: 'dateBetween',\n in: 'dateIn',\n notBetween: 'dateNotBetween',\n notIn: 'dateNotIn',\n} as const satisfies Partial<Record<DefaultOperatorName, string>>;\n\n/**\n * Date/time rule processor for use by {@link @react-querybuilder/core!formatQuery formatQuery}\n * with the \"jsonlogic\" format.\n *\n * Note: Unlike other date/time rule processors from this library, this function does\n * not require a date/time library API. Instead, the date/time library API is used by\n * {@link getDatetimeJsonLogicOperations} during the evaluation process.\n */\nexport const datetimeRuleProcessorJsonLogic: RuleProcessor = (\n rule,\n options\n): RQBDateTimeJsonLogic => {\n const opts = options ?? /* v8 ignore start -- @preserve */ {} /* v8 ignore stop -- @preserve */;\n\n if (!processIsDateField(opts.context?.isDateField, rule, opts)) {\n return defaultRuleProcessorJsonLogic(rule, opts);\n }\n\n const { field, value, valueSource } = rule;\n const operator = resolveDatetimeOperator(rule, opts);\n const valueIsField = valueSource === 'field';\n const fieldObject: JsonLogicVar = { var: field };\n const dateOnly = isDateOnlyDatatype(opts?.fieldData?.datatype);\n // Relative values stay \"live\": emit a `dateRelative` op resolved at evaluation time.\n // Field-source values are field names and render as `var` references.\n const renderValue = (v: unknown) => {\n if (valueIsField) return { var: `${v}` };\n if (isRelativeDateTimeValue(v)) {\n return {\n dateRelative: [v.anchor, v.offset, v.unit, dateOnly],\n } as RQBJsonLogicDateRelative;\n }\n return v as string;\n };\n\n switch (operator) {\n case '<':\n case '<=':\n case '=':\n case '!=':\n case '>':\n case '>=':\n return {\n [dateOperationMap[operator]]: [fieldObject, renderValue(value)],\n } as RQBDateTimeJsonLogic;\n\n case 'in':\n case 'notIn': {\n const valueAsArray = (Array.isArray(value) ? value : toArray(value)).map(renderValue);\n return { [dateOperationMap[operator]]: [fieldObject, valueAsArray] } as RQBDateTimeJsonLogic;\n }\n\n case 'between':\n case 'notBetween': {\n const valueAsArray = (Array.isArray(value) ? value : toArray(value)).map(renderValue);\n\n if (valueAsArray.length < 2) return false;\n\n return {\n [dateOperationMap[operator]]: [valueAsArray[0], fieldObject, valueAsArray[1]],\n } as RQBDateTimeJsonLogic;\n }\n }\n\n return defaultRuleProcessorJsonLogic(rule, options);\n};\n","import type { Context } from 'react';\nimport { createContext, useContext } from 'react';\nimport type { ValueEditorProps } from 'react-querybuilder';\n\n/**\n * Holds the value editor inherited from an outer (compat package) context provider,\n * captured _before_ {@link QueryBuilderDateTime} overrides it. Lets the date/time value\n * editor delegate non-date fields (and absolute date inputs) to the compat editor instead\n * of the bare default {@link react-querybuilder!ValueEditor ValueEditor}. `null` = none\n * inherited (fall back to default).\n */\nexport const InheritedValueEditorContext: Context<React.ComponentType<ValueEditorProps> | null> =\n createContext<React.ComponentType<ValueEditorProps> | null>(null);\n\n/** Inherited (compat) value editor, or `null` if none. See {@link InheritedValueEditorContext}. */\nexport const useInheritedValueEditor = (): React.ComponentType<ValueEditorProps> | null =>\n useContext(InheritedValueEditorContext);\n","import type { FullOption } from 'react-querybuilder';\nimport type {\n RelativeDateTimeAnchor,\n RelativeDateTimeToggleLabels,\n RelativeDateTimeUnit,\n RelativeDateTimeValue,\n} from './types';\n\n/**\n * Class name applied to the absolute/relative mode toggle button. Package-local (not part\n * of the core `standardClassnames`) to avoid coupling core to this extension.\n */\nexport const relativeDateTimeToggleClassName = 'rule-value-dateTimeRelative-toggle';\n\n/** Default value applied when switching a rule to relative mode. */\nexport const defaultRelativeDateTimeValue: RelativeDateTimeValue = {\n mode: 'relative',\n anchor: 'now',\n offset: 0,\n unit: 'day',\n};\n\n/** Default anchor (reference-point) options for the relative date/time editor. */\nexport const defaultRelativeDateTimeAnchors: FullOption<RelativeDateTimeAnchor>[] = [\n { name: 'now', value: 'now', label: 'now' },\n { name: 'startOfDay', value: 'startOfDay', label: 'start of day' },\n { name: 'endOfDay', value: 'endOfDay', label: 'end of day' },\n { name: 'startOfWeek', value: 'startOfWeek', label: 'start of week' },\n { name: 'endOfWeek', value: 'endOfWeek', label: 'end of week' },\n { name: 'startOfMonth', value: 'startOfMonth', label: 'start of month' },\n { name: 'endOfMonth', value: 'endOfMonth', label: 'end of month' },\n { name: 'startOfYear', value: 'startOfYear', label: 'start of year' },\n { name: 'endOfYear', value: 'endOfYear', label: 'end of year' },\n];\n\n/** Default unit options for the relative date/time editor. */\nexport const defaultRelativeDateTimeUnits: FullOption<RelativeDateTimeUnit>[] = [\n { name: 'minute', value: 'minute', label: 'minute(s)' },\n { name: 'hour', value: 'hour', label: 'hour(s)' },\n { name: 'day', value: 'day', label: 'day(s)' },\n { name: 'week', value: 'week', label: 'week(s)' },\n { name: 'month', value: 'month', label: 'month(s)' },\n { name: 'year', value: 'year', label: 'year(s)' },\n];\n\n/** Default labels/content for the absolute/relative mode toggle. */\nexport const defaultRelativeDateTimeToggleLabels: Required<RelativeDateTimeToggleLabels> = {\n label: 'Toggle relative date/time',\n absoluteTitle: 'Absolute date/time (click for relative)',\n relativeTitle: 'Relative date/time (click for absolute)',\n // Empty by default; the CSS pseudo-element renders the glyph based on `aria-checked`.\n absoluteContent: '',\n relativeContent: '',\n};\n","import * as React from 'react';\nimport type { FullOperator } from 'react-querybuilder';\nimport { clsx, defaultOperators } from 'react-querybuilder';\nimport { relativeDateTimeToggleClassName } from './relativeDateTimeConstants';\nimport type { RelativeDateTimeModeController, RelativeDateTimeModeControlProps } from './types';\nimport { isRelativeDateTimeValue } from './utils';\n\n/**\n * Compact absolute/relative toggle rendered by {@link toggleModeController}. A\n * `role=\"switch\"` button whose default glyph is supplied by CSS (keyed on\n * `aria-checked`); override via the `toggleLabels` config.\n *\n * @group Components\n */\nexport const RelativeDateTimeModeToggle = ({\n isRelative,\n setMode,\n disabled,\n className,\n labels,\n}: RelativeDateTimeModeControlProps): React.JSX.Element => {\n const onClick = React.useCallback(\n () => setMode(isRelative ? 'absolute' : 'relative'),\n [setMode, isRelative]\n );\n\n return (\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={isRelative}\n aria-label={labels.label}\n title={isRelative ? labels.relativeTitle : labels.absoluteTitle}\n disabled={disabled}\n className={clsx(relativeDateTimeToggleClassName, className)}\n onClick={onClick}>\n {isRelative ? labels.relativeContent : labels.absoluteContent}\n </button>\n );\n};\n\n/**\n * Zero-config default {@link RelativeDateTimeModeController}: derives the mode from the\n * value shape and renders a compact toggle button to switch between absolute and\n * relative entry.\n */\nexport const toggleModeController: RelativeDateTimeModeController = {\n isRelative: props => isRelativeDateTimeValue(props.value),\n ModeControl: RelativeDateTimeModeToggle,\n};\n\n/**\n * Builds an operator-driven {@link RelativeDateTimeModeController} that derives the mode\n * from the rule's operator. Pass the operator name(s) (or a predicate) that should put the\n * editor in relative mode. No toggle is rendered — the operator selector is the mode\n * affordance.\n *\n * NOTE: the chosen operators only signal _mode_; the rule's value remains a\n * {@link RelativeDateTimeValue}. For these operators to export correctly, map each one to a\n * real comparison operator via `context.relativeOperatorMap` when calling `formatQuery`\n * (e.g. `{ relativeEq: '=' }`). See the documentation.\n */\nexport const createOperatorModeController = (\n relativeOperators: string[] | ((operator: string) => boolean)\n): RelativeDateTimeModeController => ({\n isRelative: props =>\n typeof relativeOperators === 'function'\n ? relativeOperators(props.operator)\n : relativeOperators.includes(props.operator),\n});\n\ninterface FieldWithOperators {\n operators?: FullOperator[];\n [key: string]: unknown;\n}\n\n/**\n * Appends the given `operators` to each field's `operators` list, so the operator-driven\n * controller (see {@link createOperatorModeController}) has an operator to switch into\n * relative mode. Fields without an explicit `operators` list fall back to the core\n * `defaultOperators`.\n */\nexport const withRelativeOperators = <F extends FieldWithOperators>(\n fields: F[],\n operators: FullOperator[]\n): F[] =>\n fields.map(field => ({\n ...field,\n operators: [...(field.operators ?? (defaultOperators as FullOperator[])), ...operators],\n }));\n","import * as React from 'react';\nimport { createContext, useContext, useMemo } from 'react';\nimport type { FullOption } from 'react-querybuilder';\nimport {\n defaultRelativeDateTimeAnchors,\n defaultRelativeDateTimeToggleLabels,\n defaultRelativeDateTimeUnits,\n} from './relativeDateTimeConstants';\nimport { toggleModeController } from './relativeDateTimeModeControllers';\nimport { rqbDateTimeLibraryAPI as defaultDateTimeAPI } from './rqbDateTimeLibraryAPI.dayjs';\nimport type {\n RelativeDateTimeAnchor,\n RelativeDateTimeEditorConfig,\n RelativeDateTimeModeController,\n RelativeDateTimeToggleLabels,\n RelativeDateTimeUnit,\n RQBDateTimeLibraryAPI,\n} from './types';\n\n/** Fully-resolved relative date/time editor config (no optional fields). */\nexport interface ResolvedRelativeDateTimeConfig {\n modeController: RelativeDateTimeModeController;\n anchors: FullOption<RelativeDateTimeAnchor>[];\n units: FullOption<RelativeDateTimeUnit>[];\n toggleLabels: Required<RelativeDateTimeToggleLabels>;\n dateTimeAPI: RQBDateTimeLibraryAPI;\n}\n\n/**\n * Carries {@link RelativeDateTimeEditorConfig} to the {@link RelativeDateTimeValueEditor}.\n * Provided by {@link QueryBuilderDateTime}; defaults apply when no provider is present.\n */\nexport const RelativeDateTimeConfigContext: React.Context<RelativeDateTimeEditorConfig> =\n createContext<RelativeDateTimeEditorConfig>({});\n\n/** Reads the relative date/time editor config from context, merged with defaults. */\nexport const useRelativeDateTimeConfig = (): ResolvedRelativeDateTimeConfig => {\n const config = useContext(RelativeDateTimeConfigContext);\n return useMemo(\n () => ({\n modeController: config.modeController ?? toggleModeController,\n anchors: config.anchors ?? defaultRelativeDateTimeAnchors,\n units: config.units ?? defaultRelativeDateTimeUnits,\n toggleLabels: { ...defaultRelativeDateTimeToggleLabels, ...config.toggleLabels },\n dateTimeAPI: config.dateTimeAPI ?? defaultDateTimeAPI,\n }),\n [config]\n );\n};\n","import * as React from 'react';\nimport { useCallback, useMemo } from 'react';\nimport type { FullField, Path, ValueEditorProps, ValueSelectorProps } from 'react-querybuilder';\nimport {\n clsx,\n parseNumber,\n standardClassnames,\n toArray,\n useValueEditor,\n ValueEditor,\n} from 'react-querybuilder';\nimport { useInheritedValueEditor } from './InheritedValueEditorContext';\nimport { DateTimeValueEditor } from './QueryBuilderDateTime';\nimport type { ResolvedRelativeDateTimeConfig } from './RelativeDateTimeConfigContext';\nimport { useRelativeDateTimeConfig } from './RelativeDateTimeConfigContext';\nimport { defaultRelativeDateTimeValue } from './relativeDateTimeConstants';\nimport type { RelativeDateTimeAnchor, RelativeDateTimeUnit, RelativeDateTimeValue } from './types';\nimport { isRelativeDateTimeValue } from './utils';\n\nconst dummyPath: Path = [];\nconst dummyFieldData: FullField = { name: '', value: '', label: '' };\n\n/** Splits a value into the from/to pair used by between/notBetween, object-safe. */\nconst toBetweenArray = (value: unknown): unknown[] =>\n Array.isArray(value) ? value : isRelativeDateTimeValue(value) ? [value] : toArray(value);\n\ninterface RelativeDateTimeSingleValueEditorProps {\n /** The original value editor props (for mode derivation and absolute rendering). */\n baseProps: ValueEditorProps;\n /** The value for this slot (the whole value, or one element of a between pair). */\n value: unknown;\n /** Emits a new value for this slot. */\n onChange: (value: unknown) => void;\n /** Operator passed to the absolute editor (forced to `=` for between slots). */\n absoluteOperator: string;\n config: ResolvedRelativeDateTimeConfig;\n SelectorComponent: React.ComponentType<ValueSelectorProps>;\n /** Themed numeric offset input: the inherited (compat) editor when present, else the default. */\n NumericEditorComponent: React.ComponentType<ValueEditorProps>;\n valueListItemClassName?: string;\n numericSchema: ValueEditorProps['schema'];\n}\n\n/**\n * Renders a single absolute-or-relative date/time value: a mode affordance (per the\n * controller) plus either an absolute date input or anchor + signed offset + unit\n * selectors. Reused once per slot so between/notBetween can mix bounds (e.g. an absolute\n * \"from\" and a relative \"to\").\n */\nconst RelativeDateTimeSingleValueEditor = ({\n baseProps,\n value,\n onChange,\n absoluteOperator,\n config,\n SelectorComponent,\n NumericEditorComponent,\n valueListItemClassName,\n numericSchema,\n}: RelativeDateTimeSingleValueEditorProps): React.JSX.Element => {\n const { schema, disabled, title, testID } = baseProps;\n const { modeController, anchors, units, toggleLabels } = config;\n\n const isRelative = modeController.isRelative({ ...baseProps, value });\n const relValue: RelativeDateTimeValue = isRelativeDateTimeValue(value)\n ? value\n : defaultRelativeDateTimeValue;\n\n const handleSetMode = useCallback(\n (mode: 'absolute' | 'relative') =>\n onChange(mode === 'relative' ? defaultRelativeDateTimeValue : ''),\n [onChange]\n );\n\n const handleChangeAnchor = useCallback(\n (anchor: string) => onChange({ ...relValue, anchor: anchor as RelativeDateTimeAnchor }),\n [onChange, relValue]\n );\n\n const handleChangeOffset = useCallback(\n (offset: unknown) =>\n onChange({\n ...relValue,\n offset: (parseNumber(offset, { parseNumbers: true }) as number) || 0,\n }),\n [onChange, relValue]\n );\n\n const handleChangeUnit = useCallback(\n (unit: string) => onChange({ ...relValue, unit: unit as RelativeDateTimeUnit }),\n [onChange, relValue]\n );\n\n const { ModeControl } = modeController;\n\n return (\n <React.Fragment>\n {ModeControl && (\n <ModeControl\n isRelative={isRelative}\n setMode={handleSetMode}\n schema={schema}\n disabled={disabled}\n className={valueListItemClassName}\n title={title}\n testID={testID}\n labels={toggleLabels}\n />\n )}\n {isRelative ? (\n <React.Fragment>\n <SelectorComponent\n schema={schema}\n testID={testID}\n title={title}\n className={valueListItemClassName}\n handleOnChange={handleChangeAnchor}\n disabled={disabled}\n value={relValue.anchor}\n options={anchors}\n multiple={false}\n listsAsArrays={false}\n path={dummyPath}\n level={0}\n />\n <NumericEditorComponent\n skipHook\n testID={testID}\n inputType=\"number\"\n title={title}\n className={valueListItemClassName}\n disabled={disabled}\n handleOnChange={handleChangeOffset}\n field={''}\n operator={''}\n value={relValue.offset}\n valueSource={'value'}\n fieldData={dummyFieldData}\n schema={numericSchema}\n path={dummyPath}\n level={0}\n rule={{ field: '', operator: '=', value: relValue.offset }}\n />\n {relValue.offset !== 0 && (\n <SelectorComponent\n schema={schema}\n testID={testID}\n title={title}\n className={valueListItemClassName}\n handleOnChange={handleChangeUnit}\n disabled={disabled}\n value={relValue.unit}\n options={units}\n multiple={false}\n listsAsArrays={false}\n path={dummyPath}\n level={0}\n />\n )}\n </React.Fragment>\n ) : (\n <DateTimeValueEditor\n {...baseProps}\n operator={absoluteOperator}\n value={value}\n handleOnChange={onChange}\n className={standardClassnames.value}\n />\n )}\n </React.Fragment>\n );\n};\n\n/**\n * Value editor with support for {@link RelativeDateTimeValue relative date/time values}\n * (e.g. \"three months ago\" or \"the beginning of this year\"). How the user switches\n * between absolute and relative modes is delegated to a pluggable\n * {@link RelativeDateTimeModeController} (default: a compact toggle), supplied via\n * {@link QueryBuilderDateTime}. In relative mode it renders anchor + signed offset + unit\n * selectors; the unit selector is hidden when the offset is `0`.\n *\n * For the `between`/`notBetween` operators it renders two independent value editors (each\n * with its own mode affordance) and stores the bounds as a two-element array, so the from\n * and to bounds can independently be absolute or relative.\n *\n * @group Components\n */\nexport const RelativeDateTimeValueEditor = (props: ValueEditorProps): React.JSX.Element => {\n const { valueListItemClassName } = useValueEditor(props);\n\n const { className, value, handleOnChange, schema, operator, separator } = props;\n const { suppressStandardClassnames } = schema;\n\n const SelectorComponent = props.selectorComponent ?? schema.controls.valueSelector;\n\n // Themed numeric offset input from the inherited (compat) editor when present, else default.\n const NumericEditorComponent = useInheritedValueEditor() ?? ValueEditor;\n\n const config = useRelativeDateTimeConfig();\n\n const numericSchema = useMemo(() => ({ ...schema, parseNumbers: true }), [schema]);\n\n const outerClassname = useMemo(\n () => clsx(suppressStandardClassnames || standardClassnames.valueDateTimeRelative, className),\n [suppressStandardClassnames, className]\n );\n\n const isBetween = operator === 'between' || operator === 'notBetween';\n\n // For between/notBetween, store the bounds as a two-element array. Relative values are\n // objects (which can't survive comma-joining), so the array is emitted directly,\n // regardless of `listsAsArrays`.\n const valueAsArray = useMemo(() => toBetweenArray(value), [value]);\n\n const handleChangeBound = useCallback(\n (index: number) => (boundValue: unknown) => {\n const next = [valueAsArray[0], valueAsArray[1]];\n next[index] = boundValue;\n handleOnChange(next);\n },\n [valueAsArray, handleOnChange]\n );\n\n if (isBetween) {\n return (\n <span className={outerClassname}>\n <RelativeDateTimeSingleValueEditor\n baseProps={props}\n value={valueAsArray[0]}\n onChange={handleChangeBound(0)}\n absoluteOperator=\"=\"\n config={config}\n SelectorComponent={SelectorComponent}\n NumericEditorComponent={NumericEditorComponent}\n valueListItemClassName={valueListItemClassName}\n numericSchema={numericSchema}\n />\n {separator}\n <RelativeDateTimeSingleValueEditor\n baseProps={props}\n value={valueAsArray[1]}\n onChange={handleChangeBound(1)}\n absoluteOperator=\"=\"\n config={config}\n SelectorComponent={SelectorComponent}\n NumericEditorComponent={NumericEditorComponent}\n valueListItemClassName={valueListItemClassName}\n numericSchema={numericSchema}\n />\n </span>\n );\n }\n\n return (\n <span className={outerClassname}>\n <RelativeDateTimeSingleValueEditor\n baseProps={props}\n value={value}\n onChange={handleOnChange}\n absoluteOperator={operator}\n config={config}\n SelectorComponent={SelectorComponent}\n NumericEditorComponent={NumericEditorComponent}\n valueListItemClassName={valueListItemClassName}\n numericSchema={numericSchema}\n />\n </span>\n );\n};\n","import * as React from 'react';\nimport { useContext, useMemo } from 'react';\nimport type { QueryBuilderContextProvider, ValueEditorProps } from 'react-querybuilder';\nimport {\n getCompatContextProvider,\n QueryBuilderContext,\n useValueEditor,\n ValueEditor,\n} from 'react-querybuilder';\nimport {\n InheritedValueEditorContext,\n useInheritedValueEditor,\n} from './InheritedValueEditorContext';\nimport {\n RelativeDateTimeConfigContext,\n useRelativeDateTimeConfig,\n} from './RelativeDateTimeConfigContext';\nimport { RelativeDateTimeValueEditor } from './RelativeDateTimeValueEditor';\nimport type { RelativeDateTimeEditorConfig } from './types';\n\n/**\n * Whether a rule should use a date/time editor, based on either the coerced input\n * type (`date`/`datetime-local`) or a date-like `datatype` (`date`/`datetime`/`timestamp`).\n */\nconst isDateTimeEditor = (props: ValueEditorProps, inputTypeCoerced: string | undefined): boolean =>\n (props.type === 'text' &&\n (inputTypeCoerced === 'date' || inputTypeCoerced === 'datetime-local')) ||\n /^(?:date|datetime|timestamp)\\b/i.test(props.fieldData?.datatype as string);\n\nconst pad2 = (n: number): string => `${n}`.padStart(2, '0');\n\n/**\n * Formats a `Date` into the local value expected by a native `date`/`datetime-local`\n * input (library-agnostic; the date library only handles parsing/validation).\n */\nconst formatDateInputValue = (d: Date, withTime: boolean): string => {\n const datePart = `${d.getFullYear()}-${pad2(d.getMonth() + 1)}-${pad2(d.getDate())}`;\n return withTime ? `${datePart}T${pad2(d.getHours())}:${pad2(d.getMinutes())}` : datePart;\n};\n\n/**\n * Renders the inherited (compat) editor when one is provided, otherwise the default\n * {@link react-querybuilder!ValueEditor ValueEditor}. The editor is received as a prop (rather\n * than read from context here) so the JSX element type stays prop-sourced and stable.\n */\nconst FallbackValueEditor = ({\n editor: Editor,\n ...props\n}: ValueEditorProps & {\n editor: React.ComponentType<ValueEditorProps> | null;\n}): React.JSX.Element => (Editor ? <Editor {...props} /> : <ValueEditor {...props} skipHook />);\n\nexport const DateTimeValueEditor = (props: ValueEditorProps): React.JSX.Element => {\n const uVE = useValueEditor(props);\n const InheritedEditor = useInheritedValueEditor();\n const { dateTimeAPI } = useRelativeDateTimeConfig();\n\n // Non-date fields and unparseable values: delegate to the inherited (compat) editor when\n // present, otherwise the default editor.\n const fallback = (p: ValueEditorProps) => <FallbackValueEditor editor={InheritedEditor} {...p} />;\n\n if (!isDateTimeEditor(props, uVE.inputTypeCoerced)) {\n return fallback(props);\n }\n\n if (dateTimeAPI.isValid(props.value)) {\n const value = formatDateInputValue(\n dateTimeAPI.toDate(props.value),\n uVE.inputTypeCoerced !== 'date'\n );\n return fallback({ ...props, value });\n }\n\n return fallback(props);\n};\n\n/**\n * Provider value editor: renders the relative-capable {@link RelativeDateTimeValueEditor}\n * for date/time fields and falls back to the inherited (compat) editor for everything else.\n */\nconst QueryBuilderDateTimeValueEditor = (props: ValueEditorProps): React.JSX.Element => {\n const uVE = useValueEditor(props);\n const InheritedEditor = useInheritedValueEditor();\n\n if (isDateTimeEditor(props, uVE.inputTypeCoerced)) {\n return <RelativeDateTimeValueEditor {...props} />;\n }\n\n return <FallbackValueEditor editor={InheritedEditor} {...props} />;\n};\n\nexport const QueryBuilderDateTimeContext: QueryBuilderContextProvider = getCompatContextProvider({\n controlElements: { valueEditor: QueryBuilderDateTimeValueEditor },\n});\n\n/** Props for {@link QueryBuilderDateTime}: {@link RelativeDateTimeEditorConfig} plus children. */\nexport interface QueryBuilderDateTimeProps extends RelativeDateTimeEditorConfig {\n children?: React.ReactNode;\n}\n\n/**\n * Context provider enabling date/time features for a wrapped\n * {@link react-querybuilder!QueryBuilder QueryBuilder}: renders the relative-capable\n * {@link RelativeDateTimeValueEditor} for date/time fields, and accepts optional\n * {@link RelativeDateTimeEditorConfig} props (mode controller, anchor/unit options, and\n * toggle labels). With no props it provides the zero-config toggle experience.\n *\n * @group Components\n */\nexport const QueryBuilderDateTime = ({\n children,\n modeController,\n anchors,\n units,\n toggleLabels,\n dateTimeAPI,\n}: QueryBuilderDateTimeProps): React.JSX.Element => {\n const config = useMemo(\n (): RelativeDateTimeEditorConfig => ({\n modeController,\n anchors,\n units,\n toggleLabels,\n dateTimeAPI,\n }),\n [modeController, anchors, units, toggleLabels, dateTimeAPI]\n );\n\n // Capture the value editor inherited from any outer compat provider (e.g. QueryBuilderMaterial)\n // _before_ QueryBuilderDateTimeContext overrides it, so date/time editors can delegate to it.\n const inheritedValueEditor = (useContext(QueryBuilderContext).controlElements?.valueEditor ??\n null) as React.ComponentType<ValueEditorProps> | null;\n\n return (\n <RelativeDateTimeConfigContext.Provider value={config}>\n <InheritedValueEditorContext.Provider value={inheritedValueEditor}>\n <QueryBuilderDateTimeContext>{children}</QueryBuilderDateTimeContext>\n </InheritedValueEditorContext.Provider>\n </RelativeDateTimeConfigContext.Provider>\n );\n};\n"],"mappings":"mrBAUA,MAAM,EAAmB,CACvB,KAAM,YACN,IAAK,aACL,KAAM,iBACN,IAAK,SACL,IAAK,YACL,KAAM,gBACN,QAAS,cACT,GAAI,SACJ,WAAY,iBACZ,MAAO,WACT,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AEP,EADpC,EAAA,cAAC,EAAA,KAA6B,CAAsC,CAChC,CACA,CAE5C"}
|
|
1
|
+
{"version":3,"file":"react-querybuilder_datetime.production.mjs","names":[],"sources":["../src/datetimeRuleProcessorJsonLogic.ts"],"sourcesContent":["import type { DefaultOperatorName, JsonLogicVar, RuleProcessor } from '@react-querybuilder/core';\nimport { defaultRuleProcessorJsonLogic, toArray } from '@react-querybuilder/core';\nimport type { RQBJsonLogicDateRelative, RQBDateTimeJsonLogic } from './types';\nimport {\n isDateOnlyDatatype,\n isRelativeDateTimeValue,\n processIsDateField,\n resolveDatetimeOperator,\n} from './utils';\n\nconst dateOperationMap = {\n '!=': 'dateNotOn',\n '<': 'dateBefore',\n '<=': 'dateOnOrBefore',\n '=': 'dateOn',\n '>': 'dateAfter',\n '>=': 'dateOnOrAfter',\n between: 'dateBetween',\n in: 'dateIn',\n notBetween: 'dateNotBetween',\n notIn: 'dateNotIn',\n} as const satisfies Partial<Record<DefaultOperatorName, string>>;\n\n/**\n * Date/time rule processor for use by {@link @react-querybuilder/core!formatQuery formatQuery}\n * with the \"jsonlogic\" format.\n *\n * Note: Unlike other date/time rule processors from this library, this function does\n * not require a date/time library API. Instead, the date/time library API is used by\n * {@link getDatetimeJsonLogicOperations} during the evaluation process.\n */\nexport const datetimeRuleProcessorJsonLogic: RuleProcessor = (\n rule,\n options\n): RQBDateTimeJsonLogic => {\n const opts = options ?? /* v8 ignore start -- @preserve */ {} /* v8 ignore stop -- @preserve */;\n\n if (!processIsDateField(opts.context?.isDateField, rule, opts)) {\n return defaultRuleProcessorJsonLogic(rule, opts);\n }\n\n const { field, value, valueSource } = rule;\n const operator = resolveDatetimeOperator(rule, opts);\n const valueIsField = valueSource === 'field';\n const fieldObject: JsonLogicVar = { var: field };\n const dateOnly = isDateOnlyDatatype(opts?.fieldData?.datatype);\n // Relative values stay \"live\": emit a `dateRelative` op resolved at evaluation time.\n // Field-source values are field names and render as `var` references.\n const renderValue = (v: unknown) => {\n if (valueIsField) return { var: `${v}` };\n if (isRelativeDateTimeValue(v)) {\n return {\n dateRelative: [v.anchor, v.offset, v.unit, dateOnly],\n } as RQBJsonLogicDateRelative;\n }\n return v as string;\n };\n\n switch (operator) {\n case '<':\n case '<=':\n case '=':\n case '!=':\n case '>':\n case '>=':\n return {\n [dateOperationMap[operator]]: [fieldObject, renderValue(value)],\n } as RQBDateTimeJsonLogic;\n\n case 'in':\n case 'notIn': {\n const valueAsArray = (Array.isArray(value) ? value : toArray(value)).map(renderValue);\n return { [dateOperationMap[operator]]: [fieldObject, valueAsArray] } as RQBDateTimeJsonLogic;\n }\n\n case 'between':\n case 'notBetween': {\n const valueAsArray = (Array.isArray(value) ? value : toArray(value)).map(renderValue);\n\n if (valueAsArray.length < 2) return false;\n\n return {\n [dateOperationMap[operator]]: [valueAsArray[0], fieldObject, valueAsArray[1]],\n } as RQBDateTimeJsonLogic;\n }\n }\n\n return defaultRuleProcessorJsonLogic(rule, options);\n};\n"],"mappings":"wXAUA,MAAM,EAAmB,CACvB,KAAM,YACN,IAAK,aACL,KAAM,iBACN,IAAK,SACL,IAAK,YACL,KAAM,gBACN,QAAS,cACT,GAAI,SACJ,WAAY,iBACZ,MAAO,WACT,EAUa,GACX,EACA,IACyB,CACzB,IAAM,EAAO,GAA8C,CAAC,EAE5D,GAAI,CAAC,EAAmB,EAAK,SAAS,YAAa,EAAM,CAAI,EAC3D,OAAO,EAA8B,EAAM,CAAI,EAGjD,GAAM,CAAE,QAAO,QAAO,eAAgB,EAChC,EAAW,EAAwB,EAAM,CAAI,EAC7C,EAAe,IAAgB,QAC/B,EAA4B,CAAE,IAAK,CAAM,EACzC,EAAW,EAAmB,GAAM,WAAW,QAAQ,EAGvD,EAAe,GACf,EAAqB,CAAE,IAAK,GAAG,GAAI,EACnC,EAAwB,CAAC,EACpB,CACL,aAAc,CAAC,EAAE,OAAQ,EAAE,OAAQ,EAAE,KAAM,CAAQ,CACrD,EAEK,EAGT,OAAQ,EAAR,CACE,IAAK,IACL,IAAK,KACL,IAAK,IACL,IAAK,KACL,IAAK,IACL,IAAK,KACH,MAAO,EACJ,EAAiB,IAAY,CAAC,EAAa,EAAY,CAAK,CAAC,CAChE,EAEF,IAAK,KACL,IAAK,QAAS,CACZ,IAAM,GAAgB,MAAM,QAAQ,CAAK,EAAI,EAAQ,EAAQ,CAAK,EAAA,CAAG,IAAI,CAAW,EACpF,MAAO,EAAG,EAAiB,IAAY,CAAC,EAAa,CAAY,CAAE,CACrE,CAEA,IAAK,UACL,IAAK,aAAc,CACjB,IAAM,GAAgB,MAAM,QAAQ,CAAK,EAAI,EAAQ,EAAQ,CAAK,EAAA,CAAG,IAAI,CAAW,EAIpF,OAFI,EAAa,OAAS,EAAU,GAE7B,EACJ,EAAiB,IAAY,CAAC,EAAa,GAAI,EAAa,EAAa,EAAE,CAC9E,CACF,CACF,CAEA,OAAO,EAA8B,EAAM,CAAO,CACpD"}
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { _ as RelativeDateTimeAnchor, b as RelativeDateTimeValue, i as RQBDateTimeLibraryAPI, y as RelativeDateTimeUnit } from "./types-Di8kFIXV.mjs";
|
|
2
|
+
import { FullOption } from "@react-querybuilder/core";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { ComponentType, ReactNode } from "react";
|
|
5
|
+
import { FullOperator, FullOption as FullOption$1, QueryBuilderContextProvider, ValueEditorProps } from "react-querybuilder";
|
|
6
|
+
|
|
7
|
+
//#region src/ui/types.d.ts
|
|
8
|
+
/**
|
|
9
|
+
* Customizable content/labels for the absolute/relative mode toggle rendered by
|
|
10
|
+
* {@link toggleModeController}. The default glyphs come from CSS pseudo-elements, so
|
|
11
|
+
* `absoluteContent`/`relativeContent` are only needed to override them (e.g. to render
|
|
12
|
+
* an icon component or localized text).
|
|
13
|
+
*/
|
|
14
|
+
interface RelativeDateTimeToggleLabels {
|
|
15
|
+
/** Accessible label (`aria-label`) for the toggle button. */
|
|
16
|
+
label?: string;
|
|
17
|
+
/** Tooltip shown while in absolute mode (clicking switches to relative). */
|
|
18
|
+
absoluteTitle?: string;
|
|
19
|
+
/** Tooltip shown while in relative mode (clicking switches to absolute). */
|
|
20
|
+
relativeTitle?: string;
|
|
21
|
+
/** Custom content rendered while in absolute mode. Defaults to a CSS glyph. */
|
|
22
|
+
absoluteContent?: ReactNode;
|
|
23
|
+
/** Custom content rendered while in relative mode. Defaults to a CSS glyph. */
|
|
24
|
+
relativeContent?: ReactNode;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Props passed to a {@link RelativeDateTimeModeController}'s `ModeControl` component —
|
|
28
|
+
* the affordance (e.g. a toggle button) that switches a rule between absolute and
|
|
29
|
+
* relative date/time entry.
|
|
30
|
+
*/
|
|
31
|
+
interface RelativeDateTimeModeControlProps {
|
|
32
|
+
/** Whether the rule is currently in relative mode. */
|
|
33
|
+
isRelative: boolean;
|
|
34
|
+
/** Switches the rule between absolute and relative mode. */
|
|
35
|
+
setMode: (mode: "absolute" | "relative") => void;
|
|
36
|
+
/** The value editor's schema (for theme-aware rendering). */
|
|
37
|
+
schema: ValueEditorProps["schema"];
|
|
38
|
+
/** Whether the control is disabled. */
|
|
39
|
+
disabled?: boolean;
|
|
40
|
+
/** Class name applied to the control. */
|
|
41
|
+
className?: string;
|
|
42
|
+
/** Title/tooltip from the value editor (fallback when labels omit titles). */
|
|
43
|
+
title?: string;
|
|
44
|
+
/** Test ID from the value editor. */
|
|
45
|
+
testID?: string;
|
|
46
|
+
/** Resolved toggle labels (merged with defaults). */
|
|
47
|
+
labels: Required<RelativeDateTimeToggleLabels>;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* A pluggable strategy that governs how a user switches between absolute and relative
|
|
51
|
+
* date/time entry in the {@link RelativeDateTimeValueEditor}. The stored value shape is
|
|
52
|
+
* unaffected — a controller only decides the current mode and (optionally) renders an
|
|
53
|
+
* affordance to change it.
|
|
54
|
+
*
|
|
55
|
+
* Ships with {@link toggleModeController} (the zero-config default); build an
|
|
56
|
+
* operator-driven controller with {@link createOperatorModeController}, or supply a custom
|
|
57
|
+
* object to fully control the UX.
|
|
58
|
+
*/
|
|
59
|
+
interface RelativeDateTimeModeController {
|
|
60
|
+
/** Derives the current mode from the rule (its operator and/or value). */
|
|
61
|
+
isRelative: (props: ValueEditorProps) => boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Optional affordance rendered inside the editor to switch modes. Omit it (as the
|
|
64
|
+
* operator-driven controller does) when the mode is selected elsewhere, e.g. via the
|
|
65
|
+
* operator selector.
|
|
66
|
+
*/
|
|
67
|
+
ModeControl?: ComponentType<RelativeDateTimeModeControlProps>;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Configuration for the {@link RelativeDateTimeValueEditor}, supplied as props to
|
|
71
|
+
* {@link QueryBuilderDateTime} (or via the relative date/time config context). Every
|
|
72
|
+
* field is optional; omitting all of them yields the zero-config toggle experience.
|
|
73
|
+
*/
|
|
74
|
+
interface RelativeDateTimeEditorConfig {
|
|
75
|
+
/** Strategy for switching between absolute and relative modes. Defaults to {@link toggleModeController}. */
|
|
76
|
+
modeController?: RelativeDateTimeModeController;
|
|
77
|
+
/** Anchor (reference-point) options. Defaults to {@link defaultRelativeDateTimeAnchors}. */
|
|
78
|
+
anchors?: FullOption$1<RelativeDateTimeAnchor>[];
|
|
79
|
+
/** Unit options. Defaults to {@link defaultRelativeDateTimeUnits}. */
|
|
80
|
+
units?: FullOption$1<RelativeDateTimeUnit>[];
|
|
81
|
+
/** Content/labels for the absolute/relative toggle. */
|
|
82
|
+
toggleLabels?: RelativeDateTimeToggleLabels;
|
|
83
|
+
/**
|
|
84
|
+
* Date/time library adapter used by the value editor to parse/validate the rule value
|
|
85
|
+
* for the native date input. Defaults to the plain JavaScript adapter. Pass the adapter
|
|
86
|
+
* matching your chosen entry point (e.g. from `@react-querybuilder/datetime/luxon`) so the
|
|
87
|
+
* editor interprets values consistently with the rule processors.
|
|
88
|
+
*/
|
|
89
|
+
dateTimeAPI?: RQBDateTimeLibraryAPI;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Maps operator names that are used only to _signal_ relative mode (see
|
|
93
|
+
* {@link createOperatorModeController}) to the real comparison operator that should be used
|
|
94
|
+
* when exporting via `formatQuery`. Supplied through `context.relativeOperatorMap`. Operators
|
|
95
|
+
* not present in the map are exported unchanged.
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* ```ts
|
|
99
|
+
* formatQuery(query, {
|
|
100
|
+
* format: 'sql',
|
|
101
|
+
* ruleProcessor: datetimeRuleProcessorSQL,
|
|
102
|
+
* context: { relativeOperatorMap: { relativeEq: '=' } },
|
|
103
|
+
* });
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
type RelativeOperatorMap = Record<string, string>;
|
|
107
|
+
//#endregion
|
|
108
|
+
//#region src/ui/QueryBuilderDateTime.d.ts
|
|
109
|
+
declare const DateTimeValueEditor: (props: ValueEditorProps) => React.JSX.Element;
|
|
110
|
+
declare const QueryBuilderDateTimeContext: QueryBuilderContextProvider;
|
|
111
|
+
/** Props for {@link QueryBuilderDateTime}: {@link RelativeDateTimeEditorConfig} plus children. */
|
|
112
|
+
interface QueryBuilderDateTimeProps extends RelativeDateTimeEditorConfig {
|
|
113
|
+
children?: React.ReactNode;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Context provider enabling date/time features for a wrapped
|
|
117
|
+
* {@link react-querybuilder!QueryBuilder QueryBuilder}: renders the relative-capable
|
|
118
|
+
* {@link RelativeDateTimeValueEditor} for date/time fields, and accepts optional
|
|
119
|
+
* {@link RelativeDateTimeEditorConfig} props (mode controller, anchor/unit options, and
|
|
120
|
+
* toggle labels). With no props it provides the zero-config toggle experience.
|
|
121
|
+
*
|
|
122
|
+
* @group Components
|
|
123
|
+
*/
|
|
124
|
+
declare const QueryBuilderDateTime: ({
|
|
125
|
+
children,
|
|
126
|
+
modeController,
|
|
127
|
+
anchors,
|
|
128
|
+
units,
|
|
129
|
+
toggleLabels,
|
|
130
|
+
dateTimeAPI
|
|
131
|
+
}: QueryBuilderDateTimeProps) => React.JSX.Element;
|
|
132
|
+
//#endregion
|
|
133
|
+
//#region src/ui/RelativeDateTimeConfigContext.d.ts
|
|
134
|
+
/** Fully-resolved relative date/time editor config (no optional fields). */
|
|
135
|
+
interface ResolvedRelativeDateTimeConfig {
|
|
136
|
+
modeController: RelativeDateTimeModeController;
|
|
137
|
+
anchors: FullOption$1<RelativeDateTimeAnchor>[];
|
|
138
|
+
units: FullOption$1<RelativeDateTimeUnit>[];
|
|
139
|
+
toggleLabels: Required<RelativeDateTimeToggleLabels>;
|
|
140
|
+
dateTimeAPI: RQBDateTimeLibraryAPI;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Carries {@link RelativeDateTimeEditorConfig} to the {@link RelativeDateTimeValueEditor}.
|
|
144
|
+
* Provided by {@link QueryBuilderDateTime}; defaults apply when no provider is present.
|
|
145
|
+
*/
|
|
146
|
+
declare const RelativeDateTimeConfigContext: React.Context<RelativeDateTimeEditorConfig>;
|
|
147
|
+
/** Reads the relative date/time editor config from context, merged with defaults. */
|
|
148
|
+
declare const useRelativeDateTimeConfig: () => ResolvedRelativeDateTimeConfig;
|
|
149
|
+
//#endregion
|
|
150
|
+
//#region src/ui/RelativeDateTimeValueEditor.d.ts
|
|
151
|
+
/**
|
|
152
|
+
* Value editor with support for {@link RelativeDateTimeValue relative date/time values}
|
|
153
|
+
* (e.g. "three months ago" or "the beginning of this year"). How the user switches
|
|
154
|
+
* between absolute and relative modes is delegated to a pluggable
|
|
155
|
+
* {@link RelativeDateTimeModeController} (default: a compact toggle), supplied via
|
|
156
|
+
* {@link QueryBuilderDateTime}. In relative mode it renders anchor + signed offset + unit
|
|
157
|
+
* selectors; the unit selector is hidden when the offset is `0`.
|
|
158
|
+
*
|
|
159
|
+
* For the `between`/`notBetween` operators it renders two independent value editors (each
|
|
160
|
+
* with its own mode affordance) and stores the bounds as a two-element array, so the from
|
|
161
|
+
* and to bounds can independently be absolute or relative.
|
|
162
|
+
*
|
|
163
|
+
* @group Components
|
|
164
|
+
*/
|
|
165
|
+
declare const RelativeDateTimeValueEditor: (props: ValueEditorProps) => React.JSX.Element;
|
|
166
|
+
//#endregion
|
|
167
|
+
//#region src/ui/relativeDateTimeConstants.d.ts
|
|
168
|
+
/**
|
|
169
|
+
* Class name applied to the absolute/relative mode toggle button. Package-local (not part
|
|
170
|
+
* of the core `standardClassnames`) to avoid coupling core to this extension.
|
|
171
|
+
*/
|
|
172
|
+
declare const relativeDateTimeToggleClassName = "rule-value-dateTimeRelative-toggle";
|
|
173
|
+
/** Default value applied when switching a rule to relative mode. */
|
|
174
|
+
declare const defaultRelativeDateTimeValue: RelativeDateTimeValue;
|
|
175
|
+
/** Default anchor (reference-point) options for the relative date/time editor. */
|
|
176
|
+
declare const defaultRelativeDateTimeAnchors: FullOption<RelativeDateTimeAnchor>[];
|
|
177
|
+
/** Default unit options for the relative date/time editor. */
|
|
178
|
+
declare const defaultRelativeDateTimeUnits: FullOption<RelativeDateTimeUnit>[];
|
|
179
|
+
/** Default labels/content for the absolute/relative mode toggle. */
|
|
180
|
+
declare const defaultRelativeDateTimeToggleLabels: Required<RelativeDateTimeToggleLabels>;
|
|
181
|
+
//#endregion
|
|
182
|
+
//#region src/ui/relativeDateTimeModeControllers.d.ts
|
|
183
|
+
/**
|
|
184
|
+
* Compact absolute/relative toggle rendered by {@link toggleModeController}. A
|
|
185
|
+
* `role="switch"` button whose default glyph is supplied by CSS (keyed on
|
|
186
|
+
* `aria-checked`); override via the `toggleLabels` config.
|
|
187
|
+
*
|
|
188
|
+
* @group Components
|
|
189
|
+
*/
|
|
190
|
+
declare const RelativeDateTimeModeToggle: ({
|
|
191
|
+
isRelative,
|
|
192
|
+
setMode,
|
|
193
|
+
disabled,
|
|
194
|
+
className,
|
|
195
|
+
labels
|
|
196
|
+
}: RelativeDateTimeModeControlProps) => React.JSX.Element;
|
|
197
|
+
/**
|
|
198
|
+
* Zero-config default {@link RelativeDateTimeModeController}: derives the mode from the
|
|
199
|
+
* value shape and renders a compact toggle button to switch between absolute and
|
|
200
|
+
* relative entry.
|
|
201
|
+
*/
|
|
202
|
+
declare const toggleModeController: RelativeDateTimeModeController;
|
|
203
|
+
/**
|
|
204
|
+
* Builds an operator-driven {@link RelativeDateTimeModeController} that derives the mode
|
|
205
|
+
* from the rule's operator. Pass the operator name(s) (or a predicate) that should put the
|
|
206
|
+
* editor in relative mode. No toggle is rendered — the operator selector is the mode
|
|
207
|
+
* affordance.
|
|
208
|
+
*
|
|
209
|
+
* NOTE: the chosen operators only signal _mode_; the rule's value remains a
|
|
210
|
+
* {@link RelativeDateTimeValue}. For these operators to export correctly, map each one to a
|
|
211
|
+
* real comparison operator via `context.relativeOperatorMap` when calling `formatQuery`
|
|
212
|
+
* (e.g. `{ relativeEq: '=' }`). See the documentation.
|
|
213
|
+
*/
|
|
214
|
+
declare const createOperatorModeController: (relativeOperators: string[] | ((operator: string) => boolean)) => RelativeDateTimeModeController;
|
|
215
|
+
interface FieldWithOperators {
|
|
216
|
+
operators?: FullOperator[];
|
|
217
|
+
[key: string]: unknown;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Appends the given `operators` to each field's `operators` list, so the operator-driven
|
|
221
|
+
* controller (see {@link createOperatorModeController}) has an operator to switch into
|
|
222
|
+
* relative mode. Fields without an explicit `operators` list fall back to the core
|
|
223
|
+
* `defaultOperators`.
|
|
224
|
+
*/
|
|
225
|
+
declare const withRelativeOperators: <F extends FieldWithOperators>(fields: F[], operators: FullOperator[]) => F[];
|
|
226
|
+
//#endregion
|
|
227
|
+
export { DateTimeValueEditor, QueryBuilderDateTime, QueryBuilderDateTimeContext, QueryBuilderDateTimeProps, RelativeDateTimeConfigContext, RelativeDateTimeEditorConfig, RelativeDateTimeModeControlProps, RelativeDateTimeModeController, RelativeDateTimeModeToggle, RelativeDateTimeToggleLabels, RelativeDateTimeValueEditor, RelativeOperatorMap, ResolvedRelativeDateTimeConfig, createOperatorModeController, defaultRelativeDateTimeAnchors, defaultRelativeDateTimeToggleLabels, defaultRelativeDateTimeUnits, defaultRelativeDateTimeValue, relativeDateTimeToggleClassName, toggleModeController, useRelativeDateTimeConfig, withRelativeOperators };
|
|
228
|
+
//# sourceMappingURL=react-querybuilder_datetime.production.ui.d.mts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e}from"./utils-VKS8YY2D.mjs";import{t}from"./rqbDateTimeLibraryAPI.jsdate-CDOtydFq.mjs";import*as n from"react";import{createContext as r,useCallback as i,useContext as a,useMemo as o}from"react";import{QueryBuilderContext as s,ValueEditor as c,clsx as l,defaultOperators as u,getCompatContextProvider as d,parseNumber as f,standardClassnames as p,toArray as m,useValueEditor as h}from"react-querybuilder";const g=r(null),_=()=>a(g),v=`rule-value-dateTimeRelative-toggle`,y={mode:`relative`,anchor:`now`,offset:0,unit:`day`},b=[{name:`now`,value:`now`,label:`now`},{name:`startOfDay`,value:`startOfDay`,label:`start of day`},{name:`endOfDay`,value:`endOfDay`,label:`end of day`},{name:`startOfWeek`,value:`startOfWeek`,label:`start of week`},{name:`endOfWeek`,value:`endOfWeek`,label:`end of week`},{name:`startOfMonth`,value:`startOfMonth`,label:`start of month`},{name:`endOfMonth`,value:`endOfMonth`,label:`end of month`},{name:`startOfYear`,value:`startOfYear`,label:`start of year`},{name:`endOfYear`,value:`endOfYear`,label:`end of year`}],x=[{name:`minute`,value:`minute`,label:`minute(s)`},{name:`hour`,value:`hour`,label:`hour(s)`},{name:`day`,value:`day`,label:`day(s)`},{name:`week`,value:`week`,label:`week(s)`},{name:`month`,value:`month`,label:`month(s)`},{name:`year`,value:`year`,label:`year(s)`}],S={label:`Toggle relative date/time`,absoluteTitle:`Absolute date/time (click for relative)`,relativeTitle:`Relative date/time (click for absolute)`,absoluteContent:``,relativeContent:``},C=({isRelative:e,setMode:t,disabled:r,className:i,labels:a})=>{let o=n.useCallback(()=>t(e?`absolute`:`relative`),[t,e]);return n.createElement(`button`,{type:`button`,role:`switch`,"aria-checked":e,"aria-label":a.label,title:e?a.relativeTitle:a.absoluteTitle,disabled:r,className:l(v,i),onClick:o},e?a.relativeContent:a.absoluteContent)},w={isRelative:t=>e(t.value),ModeControl:C},T=e=>({isRelative:t=>typeof e==`function`?e(t.operator):e.includes(t.operator)}),E=(e,t)=>e.map(e=>({...e,operators:[...e.operators??u,...t]})),D=r({}),O=()=>{let e=a(D);return o(()=>({modeController:e.modeController??w,anchors:e.anchors??b,units:e.units??x,toggleLabels:{...S,...e.toggleLabels},dateTimeAPI:e.dateTimeAPI??t}),[e])},k=[],A={name:``,value:``,label:``},j=t=>Array.isArray(t)?t:e(t)?[t]:m(t),M=({baseProps:t,value:r,onChange:a,absoluteOperator:o,config:s,SelectorComponent:c,NumericEditorComponent:l,valueListItemClassName:u,numericSchema:d})=>{let{schema:m,disabled:h,title:g,testID:_}=t,{modeController:v,anchors:b,units:x,toggleLabels:S}=s,C=v.isRelative({...t,value:r}),w=e(r)?r:y,T=i(e=>a(e===`relative`?y:``),[a]),E=i(e=>a({...w,anchor:e}),[a,w]),D=i(e=>a({...w,offset:f(e,{parseNumbers:!0})||0}),[a,w]),O=i(e=>a({...w,unit:e}),[a,w]),{ModeControl:j}=v;return n.createElement(n.Fragment,null,j&&n.createElement(j,{isRelative:C,setMode:T,schema:m,disabled:h,className:u,title:g,testID:_,labels:S}),C?n.createElement(n.Fragment,null,n.createElement(c,{schema:m,testID:_,title:g,className:u,handleOnChange:E,disabled:h,value:w.anchor,options:b,multiple:!1,listsAsArrays:!1,path:k,level:0}),n.createElement(l,{skipHook:!0,testID:_,inputType:`number`,title:g,className:u,disabled:h,handleOnChange:D,field:``,operator:``,value:w.offset,valueSource:`value`,fieldData:A,schema:d,path:k,level:0,rule:{field:``,operator:`=`,value:w.offset}}),w.offset!==0&&n.createElement(c,{schema:m,testID:_,title:g,className:u,handleOnChange:O,disabled:h,value:w.unit,options:x,multiple:!1,listsAsArrays:!1,path:k,level:0})):n.createElement(R,{...t,operator:o,value:r,handleOnChange:a,className:p.value}))},N=e=>{let{valueListItemClassName:t}=h(e),{className:r,value:a,handleOnChange:s,schema:u,operator:d,separator:f}=e,{suppressStandardClassnames:m}=u,g=e.selectorComponent??u.controls.valueSelector,v=_()??c,y=O(),b=o(()=>({...u,parseNumbers:!0}),[u]),x=o(()=>l(m||p.valueDateTimeRelative,r),[m,r]),S=d===`between`||d===`notBetween`,C=o(()=>j(a),[a]),w=i(e=>t=>{let n=[C[0],C[1]];n[e]=t,s(n)},[C,s]);return S?n.createElement(`span`,{className:x},n.createElement(M,{baseProps:e,value:C[0],onChange:w(0),absoluteOperator:`=`,config:y,SelectorComponent:g,NumericEditorComponent:v,valueListItemClassName:t,numericSchema:b}),f,n.createElement(M,{baseProps:e,value:C[1],onChange:w(1),absoluteOperator:`=`,config:y,SelectorComponent:g,NumericEditorComponent:v,valueListItemClassName:t,numericSchema:b})):n.createElement(`span`,{className:x},n.createElement(M,{baseProps:e,value:a,onChange:s,absoluteOperator:d,config:y,SelectorComponent:g,NumericEditorComponent:v,valueListItemClassName:t,numericSchema:b}))},P=(e,t)=>e.type===`text`&&(t===`date`||t===`datetime-local`)||/^(?:date|datetime|timestamp)\b/i.test(e.fieldData?.datatype),F=e=>`${e}`.padStart(2,`0`),I=(e,t)=>{let n=`${e.getFullYear()}-${F(e.getMonth()+1)}-${F(e.getDate())}`;return t?`${n}T${F(e.getHours())}:${F(e.getMinutes())}`:n},L=({editor:e,...t})=>e?n.createElement(e,t):n.createElement(c,{...t,skipHook:!0}),R=e=>{let t=h(e),r=_(),{dateTimeAPI:i}=O(),a=e=>n.createElement(L,{editor:r,...e});if(!P(e,t.inputTypeCoerced))return a(e);if(i.isValid(e.value)){let n=I(i.toDate(e.value),t.inputTypeCoerced!==`date`);return a({...e,value:n})}return a(e)},z=d({controlElements:{valueEditor:e=>{let t=h(e),r=_();return P(e,t.inputTypeCoerced)?n.createElement(N,e):n.createElement(L,{editor:r,...e})}}}),B=({children:e,modeController:t,anchors:r,units:i,toggleLabels:c,dateTimeAPI:l})=>{let u=o(()=>({modeController:t,anchors:r,units:i,toggleLabels:c,dateTimeAPI:l}),[t,r,i,c,l]),d=a(s).controlElements?.valueEditor??null;return n.createElement(D.Provider,{value:u},n.createElement(g.Provider,{value:d},n.createElement(z,null,e)))};export{R as DateTimeValueEditor,B as QueryBuilderDateTime,z as QueryBuilderDateTimeContext,D as RelativeDateTimeConfigContext,C as RelativeDateTimeModeToggle,N as RelativeDateTimeValueEditor,T as createOperatorModeController,b as defaultRelativeDateTimeAnchors,S as defaultRelativeDateTimeToggleLabels,x as defaultRelativeDateTimeUnits,y as defaultRelativeDateTimeValue,v as relativeDateTimeToggleClassName,w as toggleModeController,O as useRelativeDateTimeConfig,E as withRelativeOperators};
|
|
2
|
+
//# sourceMappingURL=react-querybuilder_datetime.production.ui.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-querybuilder_datetime.production.ui.mjs","names":["defaultDateTimeAPI"],"sources":["../src/ui/InheritedValueEditorContext.ts","../src/ui/relativeDateTimeConstants.ts","../src/ui/relativeDateTimeModeControllers.tsx","../src/ui/RelativeDateTimeConfigContext.tsx","../src/ui/RelativeDateTimeValueEditor.tsx","../src/ui/QueryBuilderDateTime.tsx"],"sourcesContent":["import type { Context } from 'react';\nimport { createContext, useContext } from 'react';\nimport type { ValueEditorProps } from 'react-querybuilder';\n\n/**\n * Holds the value editor inherited from an outer (compat package) context provider,\n * captured _before_ {@link QueryBuilderDateTime} overrides it. Lets the date/time value\n * editor delegate non-date fields (and absolute date inputs) to the compat editor instead\n * of the bare default {@link react-querybuilder!ValueEditor ValueEditor}. `null` = none\n * inherited (fall back to default).\n */\nexport const InheritedValueEditorContext: Context<React.ComponentType<ValueEditorProps> | null> =\n createContext<React.ComponentType<ValueEditorProps> | null>(null);\n\n/** Inherited (compat) value editor, or `null` if none. See {@link InheritedValueEditorContext}. */\nexport const useInheritedValueEditor = (): React.ComponentType<ValueEditorProps> | null =>\n useContext(InheritedValueEditorContext);\n","import type { FullOption } from '@react-querybuilder/core';\nimport type { RelativeDateTimeAnchor, RelativeDateTimeUnit, RelativeDateTimeValue } from '../types';\nimport type { RelativeDateTimeToggleLabels } from './types';\n\n/**\n * Class name applied to the absolute/relative mode toggle button. Package-local (not part\n * of the core `standardClassnames`) to avoid coupling core to this extension.\n */\nexport const relativeDateTimeToggleClassName = 'rule-value-dateTimeRelative-toggle';\n\n/** Default value applied when switching a rule to relative mode. */\nexport const defaultRelativeDateTimeValue: RelativeDateTimeValue = {\n mode: 'relative',\n anchor: 'now',\n offset: 0,\n unit: 'day',\n};\n\n/** Default anchor (reference-point) options for the relative date/time editor. */\nexport const defaultRelativeDateTimeAnchors: FullOption<RelativeDateTimeAnchor>[] = [\n { name: 'now', value: 'now', label: 'now' },\n { name: 'startOfDay', value: 'startOfDay', label: 'start of day' },\n { name: 'endOfDay', value: 'endOfDay', label: 'end of day' },\n { name: 'startOfWeek', value: 'startOfWeek', label: 'start of week' },\n { name: 'endOfWeek', value: 'endOfWeek', label: 'end of week' },\n { name: 'startOfMonth', value: 'startOfMonth', label: 'start of month' },\n { name: 'endOfMonth', value: 'endOfMonth', label: 'end of month' },\n { name: 'startOfYear', value: 'startOfYear', label: 'start of year' },\n { name: 'endOfYear', value: 'endOfYear', label: 'end of year' },\n];\n\n/** Default unit options for the relative date/time editor. */\nexport const defaultRelativeDateTimeUnits: FullOption<RelativeDateTimeUnit>[] = [\n { name: 'minute', value: 'minute', label: 'minute(s)' },\n { name: 'hour', value: 'hour', label: 'hour(s)' },\n { name: 'day', value: 'day', label: 'day(s)' },\n { name: 'week', value: 'week', label: 'week(s)' },\n { name: 'month', value: 'month', label: 'month(s)' },\n { name: 'year', value: 'year', label: 'year(s)' },\n];\n\n/** Default labels/content for the absolute/relative mode toggle. */\nexport const defaultRelativeDateTimeToggleLabels: Required<RelativeDateTimeToggleLabels> = {\n label: 'Toggle relative date/time',\n absoluteTitle: 'Absolute date/time (click for relative)',\n relativeTitle: 'Relative date/time (click for absolute)',\n // Empty by default; the CSS pseudo-element renders the glyph based on `aria-checked`.\n absoluteContent: '',\n relativeContent: '',\n};\n","import * as React from 'react';\nimport type { FullOperator } from 'react-querybuilder';\nimport { clsx, defaultOperators } from 'react-querybuilder';\nimport { isRelativeDateTimeValue } from '../utils';\nimport { relativeDateTimeToggleClassName } from './relativeDateTimeConstants';\nimport type { RelativeDateTimeModeController, RelativeDateTimeModeControlProps } from './types';\n\n/**\n * Compact absolute/relative toggle rendered by {@link toggleModeController}. A\n * `role=\"switch\"` button whose default glyph is supplied by CSS (keyed on\n * `aria-checked`); override via the `toggleLabels` config.\n *\n * @group Components\n */\nexport const RelativeDateTimeModeToggle = ({\n isRelative,\n setMode,\n disabled,\n className,\n labels,\n}: RelativeDateTimeModeControlProps): React.JSX.Element => {\n const onClick = React.useCallback(\n () => setMode(isRelative ? 'absolute' : 'relative'),\n [setMode, isRelative]\n );\n\n return (\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={isRelative}\n aria-label={labels.label}\n title={isRelative ? labels.relativeTitle : labels.absoluteTitle}\n disabled={disabled}\n className={clsx(relativeDateTimeToggleClassName, className)}\n onClick={onClick}>\n {isRelative ? labels.relativeContent : labels.absoluteContent}\n </button>\n );\n};\n\n/**\n * Zero-config default {@link RelativeDateTimeModeController}: derives the mode from the\n * value shape and renders a compact toggle button to switch between absolute and\n * relative entry.\n */\nexport const toggleModeController: RelativeDateTimeModeController = {\n isRelative: props => isRelativeDateTimeValue(props.value),\n ModeControl: RelativeDateTimeModeToggle,\n};\n\n/**\n * Builds an operator-driven {@link RelativeDateTimeModeController} that derives the mode\n * from the rule's operator. Pass the operator name(s) (or a predicate) that should put the\n * editor in relative mode. No toggle is rendered — the operator selector is the mode\n * affordance.\n *\n * NOTE: the chosen operators only signal _mode_; the rule's value remains a\n * {@link RelativeDateTimeValue}. For these operators to export correctly, map each one to a\n * real comparison operator via `context.relativeOperatorMap` when calling `formatQuery`\n * (e.g. `{ relativeEq: '=' }`). See the documentation.\n */\nexport const createOperatorModeController = (\n relativeOperators: string[] | ((operator: string) => boolean)\n): RelativeDateTimeModeController => ({\n isRelative: props =>\n typeof relativeOperators === 'function'\n ? relativeOperators(props.operator)\n : relativeOperators.includes(props.operator),\n});\n\ninterface FieldWithOperators {\n operators?: FullOperator[];\n [key: string]: unknown;\n}\n\n/**\n * Appends the given `operators` to each field's `operators` list, so the operator-driven\n * controller (see {@link createOperatorModeController}) has an operator to switch into\n * relative mode. Fields without an explicit `operators` list fall back to the core\n * `defaultOperators`.\n */\nexport const withRelativeOperators = <F extends FieldWithOperators>(\n fields: F[],\n operators: FullOperator[]\n): F[] =>\n fields.map(field => ({\n ...field,\n operators: [...(field.operators ?? (defaultOperators as FullOperator[])), ...operators],\n }));\n","import * as React from 'react';\nimport { createContext, useContext, useMemo } from 'react';\nimport type { FullOption } from 'react-querybuilder';\nimport { rqbDateTimeLibraryAPI as defaultDateTimeAPI } from '../rqbDateTimeLibraryAPI.jsdate';\nimport type { RelativeDateTimeAnchor, RelativeDateTimeUnit, RQBDateTimeLibraryAPI } from '../types';\nimport {\n defaultRelativeDateTimeAnchors,\n defaultRelativeDateTimeToggleLabels,\n defaultRelativeDateTimeUnits,\n} from './relativeDateTimeConstants';\nimport { toggleModeController } from './relativeDateTimeModeControllers';\nimport type {\n RelativeDateTimeEditorConfig,\n RelativeDateTimeModeController,\n RelativeDateTimeToggleLabels,\n} from './types';\n\n/** Fully-resolved relative date/time editor config (no optional fields). */\nexport interface ResolvedRelativeDateTimeConfig {\n modeController: RelativeDateTimeModeController;\n anchors: FullOption<RelativeDateTimeAnchor>[];\n units: FullOption<RelativeDateTimeUnit>[];\n toggleLabels: Required<RelativeDateTimeToggleLabels>;\n dateTimeAPI: RQBDateTimeLibraryAPI;\n}\n\n/**\n * Carries {@link RelativeDateTimeEditorConfig} to the {@link RelativeDateTimeValueEditor}.\n * Provided by {@link QueryBuilderDateTime}; defaults apply when no provider is present.\n */\nexport const RelativeDateTimeConfigContext: React.Context<RelativeDateTimeEditorConfig> =\n createContext<RelativeDateTimeEditorConfig>({});\n\n/** Reads the relative date/time editor config from context, merged with defaults. */\nexport const useRelativeDateTimeConfig = (): ResolvedRelativeDateTimeConfig => {\n const config = useContext(RelativeDateTimeConfigContext);\n return useMemo(\n () => ({\n modeController: config.modeController ?? toggleModeController,\n anchors: config.anchors ?? defaultRelativeDateTimeAnchors,\n units: config.units ?? defaultRelativeDateTimeUnits,\n toggleLabels: { ...defaultRelativeDateTimeToggleLabels, ...config.toggleLabels },\n dateTimeAPI: config.dateTimeAPI ?? defaultDateTimeAPI,\n }),\n [config]\n );\n};\n","import * as React from 'react';\nimport { useCallback, useMemo } from 'react';\nimport type { FullField, Path, ValueEditorProps, ValueSelectorProps } from 'react-querybuilder';\nimport {\n clsx,\n parseNumber,\n standardClassnames,\n toArray,\n useValueEditor,\n ValueEditor,\n} from 'react-querybuilder';\nimport type { RelativeDateTimeAnchor, RelativeDateTimeUnit, RelativeDateTimeValue } from '../types';\nimport { isRelativeDateTimeValue } from '../utils';\nimport { useInheritedValueEditor } from './InheritedValueEditorContext';\nimport { DateTimeValueEditor } from './QueryBuilderDateTime';\nimport type { ResolvedRelativeDateTimeConfig } from './RelativeDateTimeConfigContext';\nimport { useRelativeDateTimeConfig } from './RelativeDateTimeConfigContext';\nimport { defaultRelativeDateTimeValue } from './relativeDateTimeConstants';\n\nconst dummyPath: Path = [];\nconst dummyFieldData: FullField = { name: '', value: '', label: '' };\n\n/** Splits a value into the from/to pair used by between/notBetween, object-safe. */\nconst toBetweenArray = (value: unknown): unknown[] =>\n Array.isArray(value) ? value : isRelativeDateTimeValue(value) ? [value] : toArray(value);\n\ninterface RelativeDateTimeSingleValueEditorProps {\n /** The original value editor props (for mode derivation and absolute rendering). */\n baseProps: ValueEditorProps;\n /** The value for this slot (the whole value, or one element of a between pair). */\n value: unknown;\n /** Emits a new value for this slot. */\n onChange: (value: unknown) => void;\n /** Operator passed to the absolute editor (forced to `=` for between slots). */\n absoluteOperator: string;\n config: ResolvedRelativeDateTimeConfig;\n SelectorComponent: React.ComponentType<ValueSelectorProps>;\n /** Themed numeric offset input: the inherited (compat) editor when present, else the default. */\n NumericEditorComponent: React.ComponentType<ValueEditorProps>;\n valueListItemClassName?: string;\n numericSchema: ValueEditorProps['schema'];\n}\n\n/**\n * Renders a single absolute-or-relative date/time value: a mode affordance (per the\n * controller) plus either an absolute date input or anchor + signed offset + unit\n * selectors. Reused once per slot so between/notBetween can mix bounds (e.g. an absolute\n * \"from\" and a relative \"to\").\n */\nconst RelativeDateTimeSingleValueEditor = ({\n baseProps,\n value,\n onChange,\n absoluteOperator,\n config,\n SelectorComponent,\n NumericEditorComponent,\n valueListItemClassName,\n numericSchema,\n}: RelativeDateTimeSingleValueEditorProps): React.JSX.Element => {\n const { schema, disabled, title, testID } = baseProps;\n const { modeController, anchors, units, toggleLabels } = config;\n\n const isRelative = modeController.isRelative({ ...baseProps, value });\n const relValue: RelativeDateTimeValue = isRelativeDateTimeValue(value)\n ? value\n : defaultRelativeDateTimeValue;\n\n const handleSetMode = useCallback(\n (mode: 'absolute' | 'relative') =>\n onChange(mode === 'relative' ? defaultRelativeDateTimeValue : ''),\n [onChange]\n );\n\n const handleChangeAnchor = useCallback(\n (anchor: string) => onChange({ ...relValue, anchor: anchor as RelativeDateTimeAnchor }),\n [onChange, relValue]\n );\n\n const handleChangeOffset = useCallback(\n (offset: unknown) =>\n onChange({\n ...relValue,\n offset: (parseNumber(offset, { parseNumbers: true }) as number) || 0,\n }),\n [onChange, relValue]\n );\n\n const handleChangeUnit = useCallback(\n (unit: string) => onChange({ ...relValue, unit: unit as RelativeDateTimeUnit }),\n [onChange, relValue]\n );\n\n const { ModeControl } = modeController;\n\n return (\n <React.Fragment>\n {ModeControl && (\n <ModeControl\n isRelative={isRelative}\n setMode={handleSetMode}\n schema={schema}\n disabled={disabled}\n className={valueListItemClassName}\n title={title}\n testID={testID}\n labels={toggleLabels}\n />\n )}\n {isRelative ? (\n <React.Fragment>\n <SelectorComponent\n schema={schema}\n testID={testID}\n title={title}\n className={valueListItemClassName}\n handleOnChange={handleChangeAnchor}\n disabled={disabled}\n value={relValue.anchor}\n options={anchors}\n multiple={false}\n listsAsArrays={false}\n path={dummyPath}\n level={0}\n />\n <NumericEditorComponent\n skipHook\n testID={testID}\n inputType=\"number\"\n title={title}\n className={valueListItemClassName}\n disabled={disabled}\n handleOnChange={handleChangeOffset}\n field={''}\n operator={''}\n value={relValue.offset}\n valueSource={'value'}\n fieldData={dummyFieldData}\n schema={numericSchema}\n path={dummyPath}\n level={0}\n rule={{ field: '', operator: '=', value: relValue.offset }}\n />\n {relValue.offset !== 0 && (\n <SelectorComponent\n schema={schema}\n testID={testID}\n title={title}\n className={valueListItemClassName}\n handleOnChange={handleChangeUnit}\n disabled={disabled}\n value={relValue.unit}\n options={units}\n multiple={false}\n listsAsArrays={false}\n path={dummyPath}\n level={0}\n />\n )}\n </React.Fragment>\n ) : (\n <DateTimeValueEditor\n {...baseProps}\n operator={absoluteOperator}\n value={value}\n handleOnChange={onChange}\n className={standardClassnames.value}\n />\n )}\n </React.Fragment>\n );\n};\n\n/**\n * Value editor with support for {@link RelativeDateTimeValue relative date/time values}\n * (e.g. \"three months ago\" or \"the beginning of this year\"). How the user switches\n * between absolute and relative modes is delegated to a pluggable\n * {@link RelativeDateTimeModeController} (default: a compact toggle), supplied via\n * {@link QueryBuilderDateTime}. In relative mode it renders anchor + signed offset + unit\n * selectors; the unit selector is hidden when the offset is `0`.\n *\n * For the `between`/`notBetween` operators it renders two independent value editors (each\n * with its own mode affordance) and stores the bounds as a two-element array, so the from\n * and to bounds can independently be absolute or relative.\n *\n * @group Components\n */\nexport const RelativeDateTimeValueEditor = (props: ValueEditorProps): React.JSX.Element => {\n const { valueListItemClassName } = useValueEditor(props);\n\n const { className, value, handleOnChange, schema, operator, separator } = props;\n const { suppressStandardClassnames } = schema;\n\n const SelectorComponent = props.selectorComponent ?? schema.controls.valueSelector;\n\n // Themed numeric offset input from the inherited (compat) editor when present, else default.\n const NumericEditorComponent = useInheritedValueEditor() ?? ValueEditor;\n\n const config = useRelativeDateTimeConfig();\n\n const numericSchema = useMemo(() => ({ ...schema, parseNumbers: true }), [schema]);\n\n const outerClassname = useMemo(\n () => clsx(suppressStandardClassnames || standardClassnames.valueDateTimeRelative, className),\n [suppressStandardClassnames, className]\n );\n\n const isBetween = operator === 'between' || operator === 'notBetween';\n\n // For between/notBetween, store the bounds as a two-element array. Relative values are\n // objects (which can't survive comma-joining), so the array is emitted directly,\n // regardless of `listsAsArrays`.\n const valueAsArray = useMemo(() => toBetweenArray(value), [value]);\n\n const handleChangeBound = useCallback(\n (index: number) => (boundValue: unknown) => {\n const next = [valueAsArray[0], valueAsArray[1]];\n next[index] = boundValue;\n handleOnChange(next);\n },\n [valueAsArray, handleOnChange]\n );\n\n if (isBetween) {\n return (\n <span className={outerClassname}>\n <RelativeDateTimeSingleValueEditor\n baseProps={props}\n value={valueAsArray[0]}\n onChange={handleChangeBound(0)}\n absoluteOperator=\"=\"\n config={config}\n SelectorComponent={SelectorComponent}\n NumericEditorComponent={NumericEditorComponent}\n valueListItemClassName={valueListItemClassName}\n numericSchema={numericSchema}\n />\n {separator}\n <RelativeDateTimeSingleValueEditor\n baseProps={props}\n value={valueAsArray[1]}\n onChange={handleChangeBound(1)}\n absoluteOperator=\"=\"\n config={config}\n SelectorComponent={SelectorComponent}\n NumericEditorComponent={NumericEditorComponent}\n valueListItemClassName={valueListItemClassName}\n numericSchema={numericSchema}\n />\n </span>\n );\n }\n\n return (\n <span className={outerClassname}>\n <RelativeDateTimeSingleValueEditor\n baseProps={props}\n value={value}\n onChange={handleOnChange}\n absoluteOperator={operator}\n config={config}\n SelectorComponent={SelectorComponent}\n NumericEditorComponent={NumericEditorComponent}\n valueListItemClassName={valueListItemClassName}\n numericSchema={numericSchema}\n />\n </span>\n );\n};\n","import * as React from 'react';\nimport { useContext, useMemo } from 'react';\nimport type { QueryBuilderContextProvider, ValueEditorProps } from 'react-querybuilder';\nimport {\n getCompatContextProvider,\n QueryBuilderContext,\n useValueEditor,\n ValueEditor,\n} from 'react-querybuilder';\nimport {\n InheritedValueEditorContext,\n useInheritedValueEditor,\n} from './InheritedValueEditorContext';\nimport {\n RelativeDateTimeConfigContext,\n useRelativeDateTimeConfig,\n} from './RelativeDateTimeConfigContext';\nimport { RelativeDateTimeValueEditor } from './RelativeDateTimeValueEditor';\nimport type { RelativeDateTimeEditorConfig } from './types';\n\n/**\n * Whether a rule should use a date/time editor, based on either the coerced input\n * type (`date`/`datetime-local`) or a date-like `datatype` (`date`/`datetime`/`timestamp`).\n */\nconst isDateTimeEditor = (props: ValueEditorProps, inputTypeCoerced: string | undefined): boolean =>\n (props.type === 'text' &&\n (inputTypeCoerced === 'date' || inputTypeCoerced === 'datetime-local')) ||\n /^(?:date|datetime|timestamp)\\b/i.test(props.fieldData?.datatype as string);\n\nconst pad2 = (n: number): string => `${n}`.padStart(2, '0');\n\n/**\n * Formats a `Date` into the local value expected by a native `date`/`datetime-local`\n * input (library-agnostic; the date library only handles parsing/validation).\n */\nconst formatDateInputValue = (d: Date, withTime: boolean): string => {\n const datePart = `${d.getFullYear()}-${pad2(d.getMonth() + 1)}-${pad2(d.getDate())}`;\n return withTime ? `${datePart}T${pad2(d.getHours())}:${pad2(d.getMinutes())}` : datePart;\n};\n\n/**\n * Renders the inherited (compat) editor when one is provided, otherwise the default\n * {@link react-querybuilder!ValueEditor ValueEditor}. The editor is received as a prop (rather\n * than read from context here) so the JSX element type stays prop-sourced and stable.\n */\nconst FallbackValueEditor = ({\n editor: Editor,\n ...props\n}: ValueEditorProps & {\n editor: React.ComponentType<ValueEditorProps> | null;\n}): React.JSX.Element => (Editor ? <Editor {...props} /> : <ValueEditor {...props} skipHook />);\n\nexport const DateTimeValueEditor = (props: ValueEditorProps): React.JSX.Element => {\n const uVE = useValueEditor(props);\n const InheritedEditor = useInheritedValueEditor();\n const { dateTimeAPI } = useRelativeDateTimeConfig();\n\n // Non-date fields and unparseable values: delegate to the inherited (compat) editor when\n // present, otherwise the default editor.\n const fallback = (p: ValueEditorProps) => <FallbackValueEditor editor={InheritedEditor} {...p} />;\n\n if (!isDateTimeEditor(props, uVE.inputTypeCoerced)) {\n return fallback(props);\n }\n\n if (dateTimeAPI.isValid(props.value)) {\n const value = formatDateInputValue(\n dateTimeAPI.toDate(props.value),\n uVE.inputTypeCoerced !== 'date'\n );\n return fallback({ ...props, value });\n }\n\n return fallback(props);\n};\n\n/**\n * Provider value editor: renders the relative-capable {@link RelativeDateTimeValueEditor}\n * for date/time fields and falls back to the inherited (compat) editor for everything else.\n */\nconst QueryBuilderDateTimeValueEditor = (props: ValueEditorProps): React.JSX.Element => {\n const uVE = useValueEditor(props);\n const InheritedEditor = useInheritedValueEditor();\n\n if (isDateTimeEditor(props, uVE.inputTypeCoerced)) {\n return <RelativeDateTimeValueEditor {...props} />;\n }\n\n return <FallbackValueEditor editor={InheritedEditor} {...props} />;\n};\n\nexport const QueryBuilderDateTimeContext: QueryBuilderContextProvider = getCompatContextProvider({\n controlElements: { valueEditor: QueryBuilderDateTimeValueEditor },\n});\n\n/** Props for {@link QueryBuilderDateTime}: {@link RelativeDateTimeEditorConfig} plus children. */\nexport interface QueryBuilderDateTimeProps extends RelativeDateTimeEditorConfig {\n children?: React.ReactNode;\n}\n\n/**\n * Context provider enabling date/time features for a wrapped\n * {@link react-querybuilder!QueryBuilder QueryBuilder}: renders the relative-capable\n * {@link RelativeDateTimeValueEditor} for date/time fields, and accepts optional\n * {@link RelativeDateTimeEditorConfig} props (mode controller, anchor/unit options, and\n * toggle labels). With no props it provides the zero-config toggle experience.\n *\n * @group Components\n */\nexport const QueryBuilderDateTime = ({\n children,\n modeController,\n anchors,\n units,\n toggleLabels,\n dateTimeAPI,\n}: QueryBuilderDateTimeProps): React.JSX.Element => {\n const config = useMemo(\n (): RelativeDateTimeEditorConfig => ({\n modeController,\n anchors,\n units,\n toggleLabels,\n dateTimeAPI,\n }),\n [modeController, anchors, units, toggleLabels, dateTimeAPI]\n );\n\n // Capture the value editor inherited from any outer compat provider (e.g. QueryBuilderMaterial)\n // _before_ QueryBuilderDateTimeContext overrides it, so date/time editors can delegate to it.\n const inheritedValueEditor = (useContext(QueryBuilderContext).controlElements?.valueEditor ??\n null) as React.ComponentType<ValueEditorProps> | null;\n\n return (\n <RelativeDateTimeConfigContext.Provider value={config}>\n <InheritedValueEditorContext.Provider value={inheritedValueEditor}>\n <QueryBuilderDateTimeContext>{children}</QueryBuilderDateTimeContext>\n </InheritedValueEditorContext.Provider>\n </RelativeDateTimeConfigContext.Provider>\n );\n};\n"],"mappings":"kaAWA,MAAa,EACX,EAA4D,IAAI,EAGrD,MACX,EAAW,CAA2B,ECR3B,EAAkC,qCAGlC,EAAsD,CACjE,KAAM,WACN,OAAQ,MACR,OAAQ,EACR,KAAM,KACR,EAGa,EAAuE,CAClF,CAAE,KAAM,MAAO,MAAO,MAAO,MAAO,KAAM,EAC1C,CAAE,KAAM,aAAc,MAAO,aAAc,MAAO,cAAe,EACjE,CAAE,KAAM,WAAY,MAAO,WAAY,MAAO,YAAa,EAC3D,CAAE,KAAM,cAAe,MAAO,cAAe,MAAO,eAAgB,EACpE,CAAE,KAAM,YAAa,MAAO,YAAa,MAAO,aAAc,EAC9D,CAAE,KAAM,eAAgB,MAAO,eAAgB,MAAO,gBAAiB,EACvE,CAAE,KAAM,aAAc,MAAO,aAAc,MAAO,cAAe,EACjE,CAAE,KAAM,cAAe,MAAO,cAAe,MAAO,eAAgB,EACpE,CAAE,KAAM,YAAa,MAAO,YAAa,MAAO,aAAc,CAChE,EAGa,EAAmE,CAC9E,CAAE,KAAM,SAAU,MAAO,SAAU,MAAO,WAAY,EACtD,CAAE,KAAM,OAAQ,MAAO,OAAQ,MAAO,SAAU,EAChD,CAAE,KAAM,MAAO,MAAO,M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