@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.
- package/README.md +9 -3
- package/dist/cjs/{getDatetimeRuleProcessorTanStackDB-CL79A1_x.js → getDatetimeRuleProcessorTanStackDB-CDEB9coD.js} +88 -218
- package/dist/cjs/getDatetimeRuleProcessorTanStackDB-CDEB9coD.js.map +1 -0
- package/dist/cjs/getDatetimeRuleProcessorTanStackDB-X6tZv7yV.js +2 -0
- package/dist/cjs/getDatetimeRuleProcessorTanStackDB-X6tZv7yV.js.map +1 -0
- package/dist/cjs/react-querybuilder_datetime.cjs.development.d.ts +124 -260
- package/dist/cjs/react-querybuilder_datetime.cjs.development.date-fns.d.ts +50 -51
- 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 +50 -51
- 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 +11 -467
- package/dist/cjs/react-querybuilder_datetime.cjs.development.js.map +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.development.jsdate.d.ts +53 -54
- 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 +50 -51
- 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 +214 -0
- package/dist/cjs/react-querybuilder_datetime.cjs.development.ui.js +466 -0
- package/dist/cjs/react-querybuilder_datetime.cjs.development.ui.js.map +1 -0
- package/dist/cjs/react-querybuilder_datetime.cjs.production.d.ts +124 -260
- package/dist/cjs/react-querybuilder_datetime.cjs.production.date-fns.d.ts +50 -51
- 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 +50 -51
- 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 +53 -54
- 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 +50 -51
- 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 +214 -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-BuSiVdk7.js +2 -0
- package/dist/cjs/rqbDateTimeLibraryAPI.jsdate-BuSiVdk7.js.map +1 -0
- package/dist/cjs/rqbDateTimeLibraryAPI.jsdate-C3jJb6ip.js +128 -0
- package/dist/cjs/rqbDateTimeLibraryAPI.jsdate-C3jJb6ip.js.map +1 -0
- package/dist/cjs/types-BKA1aoY6.d.ts +174 -0
- package/dist/cjs/ui.d.ts +1 -0
- package/dist/cjs/ui.js +6 -0
- package/dist/cjs/utils-DdBYGWHZ.js +2 -0
- package/dist/cjs/utils-DdBYGWHZ.js.map +1 -0
- package/dist/cjs/utils-_X97pUtk.js +166 -0
- package/dist/cjs/utils-_X97pUtk.js.map +1 -0
- package/dist/getDatetimeRuleProcessorTanStackDB-6K1DsuEV.mjs +2 -0
- package/dist/getDatetimeRuleProcessorTanStackDB-6K1DsuEV.mjs.map +1 -0
- package/dist/{getDatetimeRuleProcessorTanStackDB-BL8mbdbl.js → getDatetimeRuleProcessorTanStackDB-BrSD2e9G.js} +24 -198
- package/dist/getDatetimeRuleProcessorTanStackDB-BrSD2e9G.js.map +1 -0
- package/dist/{getDatetimeRuleProcessorTanStackDB-BcOC-o2A.mjs → getDatetimeRuleProcessorTanStackDB-DR8aYrUa.mjs} +24 -124
- package/dist/getDatetimeRuleProcessorTanStackDB-DR8aYrUa.mjs.map +1 -0
- package/dist/objectSpread2-MqoZ2hSz.js +187 -0
- package/dist/objectSpread2-MqoZ2hSz.js.map +1 -0
- package/dist/react-querybuilder_datetime.d.mts +124 -260
- package/dist/react-querybuilder_datetime.date-fns.d.mts +50 -51
- 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 +50 -51
- 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 +53 -54
- 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 +124 -260
- package/dist/react-querybuilder_datetime.legacy-esm.date-fns.d.ts +50 -51
- 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 +50 -51
- 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 +5 -449
- package/dist/react-querybuilder_datetime.legacy-esm.js.map +1 -1
- package/dist/react-querybuilder_datetime.legacy-esm.jsdate.d.ts +53 -54
- 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 +50 -51
- 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 +214 -0
- package/dist/react-querybuilder_datetime.legacy-esm.ui.js +453 -0
- package/dist/react-querybuilder_datetime.legacy-esm.ui.js.map +1 -0
- package/dist/react-querybuilder_datetime.luxon.d.mts +50 -51
- 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 +5 -446
- package/dist/react-querybuilder_datetime.mjs.map +1 -1
- package/dist/react-querybuilder_datetime.production.d.mts +124 -260
- package/dist/react-querybuilder_datetime.production.date-fns.d.mts +50 -51
- 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 +50 -51
- 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 +53 -54
- 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 +50 -51
- 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 +214 -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 +214 -0
- package/dist/react-querybuilder_datetime.ui.mjs +450 -0
- package/dist/react-querybuilder_datetime.ui.mjs.map +1 -0
- package/dist/rqbDateTimeLibraryAPI.jsdate-COp9qTw_.js +123 -0
- package/dist/rqbDateTimeLibraryAPI.jsdate-COp9qTw_.js.map +1 -0
- package/dist/rqbDateTimeLibraryAPI.jsdate-DxBmxW2C.mjs +2 -0
- package/dist/rqbDateTimeLibraryAPI.jsdate-DxBmxW2C.mjs.map +1 -0
- package/dist/rqbDateTimeLibraryAPI.jsdate-WHnzblie.mjs +123 -0
- package/dist/rqbDateTimeLibraryAPI.jsdate-WHnzblie.mjs.map +1 -0
- package/dist/types-BKA1aoY6.d.mts +174 -0
- package/dist/types-BKA1aoY6.d.ts +174 -0
- package/dist/utils-BAgUBdyf.mjs +113 -0
- package/dist/utils-BAgUBdyf.mjs.map +1 -0
- package/dist/utils-DA8aluCt.mjs +2 -0
- package/dist/utils-DA8aluCt.mjs.map +1 -0
- package/package.json +36 -17
- 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/cjs/types-XYMw0jFT.d.ts +0 -265
- 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
- package/dist/types-CdjHqQ0k.d.mts +0 -265
- package/dist/types-CdjHqQ0k.d.ts +0 -265
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-querybuilder_datetime.date-fns.mjs","names":["toDate","dateFnsToDate","dateFnsAdd"],"sources":["../src/rqbDateTimeLibraryAPI.date-fns.ts","../src/index.date-fns.ts"],"sourcesContent":["import {\n toDate as dateFnsToDate,\n add as dateFnsAdd,\n endOfDay,\n endOfMonth,\n endOfWeek,\n endOfYear,\n format,\n isAfter,\n isBefore,\n isSameDay,\n isValid,\n parseISO,\n startOfDay,\n startOfMonth,\n startOfWeek,\n startOfYear,\n} from 'date-fns';\nimport type { Duration } from 'date-fns';\nimport type {\n RelativeDateTimeTruncationUnit,\n RelativeDateTimeUnit,\n RQBDateTimeLibraryAPI,\n} from './types';\nimport { isISOStringDateOnly } from './utils';\n\nconst toDate: typeof dateFnsToDate = a => (typeof a === 'string' ? parseISO(a) : dateFnsToDate(a));\nconst iso8601DateOnly = 'yyyy-MM-dd';\n\nconst startOfMap: Record<RelativeDateTimeTruncationUnit, (d: Date) => Date> = {\n day: startOfDay,\n week: startOfWeek,\n month: startOfMonth,\n year: startOfYear,\n};\nconst endOfMap: Record<RelativeDateTimeTruncationUnit, (d: Date) => Date> = {\n day: endOfDay,\n week: endOfWeek,\n month: endOfMonth,\n year: endOfYear,\n};\nconst durationKeyMap: Record<RelativeDateTimeUnit, keyof Duration> = {\n minute: 'minutes',\n hour: 'hours',\n day: 'days',\n week: 'weeks',\n month: 'months',\n year: 'years',\n};\n\n/**\n * {@link RQBDateTimeLibraryAPI} for date-fns\n */\nexport const rqbDateTimeLibraryAPI: RQBDateTimeLibraryAPI = {\n format: (d, fmt) => format(toDate(d), fmt.replace('YYYY-MM-DD', iso8601DateOnly)),\n isAfter,\n isBefore,\n isSame: (a, b) => {\n const aToDate = toDate(a);\n const bToDate = toDate(b);\n return isISOStringDateOnly(a) || isISOStringDateOnly(b)\n ? isSameDay(aToDate, bToDate)\n : aToDate.getTime() === bToDate.getTime();\n },\n isValid: d => isValid(toDate(d)),\n toDate,\n toISOString: d => {\n const dToDate = toDate(d);\n return isValid(dToDate) ? dToDate.toISOString() : '';\n },\n toISOStringDateOnly: d => {\n const dToDate = toDate(d);\n return isValid(dToDate) ? format(dToDate, iso8601DateOnly) : '';\n },\n startOf: (d, unit) => startOfMap[unit](toDate(d)),\n endOf: (d, unit) => endOfMap[unit](toDate(d)),\n add: (d, amount, unit) => dateFnsAdd(toDate(d), { [durationKeyMap[unit]]: amount }),\n};\n","/**\n * Import from `\"@react-querybuilder/datetime/date-fns\"` for enhanced date/time support using [date-fns](https://date-fns.org/).\n *\n * @module date-fns\n */\n\nimport type { RuleProcessor, ValueProcessorByRule } from 'react-querybuilder';\nimport { getDatetimeJsonLogicOperations } from './getDatetimeJsonLogicOperations';\nimport { getDatetimeRuleProcessorCEL } from './getDatetimeRuleProcessorCEL';\nimport { getDatetimeRuleProcessorCypher } from './getDatetimeRuleProcessorCypher';\nimport { getDatetimeRuleProcessorDrizzle } from './getDatetimeRuleProcessorDrizzle';\nimport { getDatetimeRuleProcessorElasticSearch } from './getDatetimeRuleProcessorElasticSearch';\nimport { getDatetimeRuleProcessorGremlin } from './getDatetimeRuleProcessorGremlin';\nimport { getDatetimeRuleProcessorJSONata } from './getDatetimeRuleProcessorJSONata';\nimport { getDatetimeRuleProcessorLDAP } from './getDatetimeRuleProcessorLDAP';\nimport { getDatetimeRuleProcessorMongoDB } from './getDatetimeRuleProcessorMongoDB';\nimport { getDatetimeRuleProcessorMongoDBQuery } from './getDatetimeRuleProcessorMongoDBQuery';\nimport { getDatetimeRuleProcessorNL } from './getDatetimeRuleProcessorNL';\nimport { getDatetimeRuleProcessorParameterized } from './getDatetimeRuleProcessorParameterized';\nimport { getDatetimeRuleProcessorPrisma } from './getDatetimeRuleProcessorPrisma';\nimport { getDatetimeRuleProcessorSequelize } from './getDatetimeRuleProcessorSequelize';\nimport { getDatetimeRuleProcessorSPARQL } from './getDatetimeRuleProcessorSPARQL';\nimport { getDatetimeRuleProcessorSpEL } from './getDatetimeRuleProcessorSpEL';\nimport {\n getDatetimeRuleProcessorSQL,\n getDatetimeValueProcessorANSI,\n getDatetimeValueProcessorMSSQL,\n getDatetimeValueProcessorMySQL,\n getDatetimeValueProcessorOracle,\n getDatetimeValueProcessorPostgreSQL,\n} from './getDatetimeRuleProcessorSQL';\nimport { getDatetimeRuleProcessorTanStackDB } from './getDatetimeRuleProcessorTanStackDB';\nimport { rqbDateTimeLibraryAPI } from './rqbDateTimeLibraryAPI.date-fns';\nimport type { RQBJsonLogicDateTimeOperations } from './types';\n\n/**\n * Custom JsonLogic date/time operations using date-fns\n */\nexport const jsonLogicDateTimeOperations: RQBJsonLogicDateTimeOperations =\n getDatetimeJsonLogicOperations(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"sql\" format using date-fns\n */\nexport const datetimeRuleProcessorSQL: RuleProcessor =\n getDatetimeRuleProcessorSQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"ansi\" preset) using date-fns\n */\nexport const datetimeValueProcessorANSI: ValueProcessorByRule =\n getDatetimeValueProcessorANSI(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"mssql\" preset) using date-fns\n */\nexport const datetimeValueProcessorMSSQL: ValueProcessorByRule =\n getDatetimeValueProcessorMSSQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"mysql\" preset) using date-fns\n */\nexport const datetimeValueProcessorMySQL: ValueProcessorByRule =\n getDatetimeValueProcessorMySQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"oracle\" preset) using date-fns\n */\nexport const datetimeValueProcessorOracle: ValueProcessorByRule =\n getDatetimeValueProcessorOracle(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"postgresql\" preset) using date-fns\n */\nexport const datetimeValueProcessorPostgreSQL: ValueProcessorByRule =\n getDatetimeValueProcessorPostgreSQL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"cel\" format using date-fns\n */\nexport const datetimeRuleProcessorCEL: ValueProcessorByRule =\n getDatetimeRuleProcessorCEL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"jsonata\" format using date-fns\n */\nexport const datetimeRuleProcessorJSONata: RuleProcessor =\n getDatetimeRuleProcessorJSONata(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"mongodb_query\" format using date-fns\n */\nexport const datetimeRuleProcessorMongoDBQuery: ValueProcessorByRule =\n getDatetimeRuleProcessorMongoDBQuery(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"natural_language\" format using date-fns\n */\nexport const datetimeRuleProcessorNL: ValueProcessorByRule =\n getDatetimeRuleProcessorNL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"cypher\"/\"gql\" format using date-fns\n */\nexport const datetimeRuleProcessorCypher: ValueProcessorByRule =\n getDatetimeRuleProcessorCypher(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"sparql\" format using date-fns\n */\nexport const datetimeRuleProcessorSPARQL: ValueProcessorByRule =\n getDatetimeRuleProcessorSPARQL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"parameterized\"/\"parameterized_named\" formats\n */\nexport const datetimeRuleProcessorParameterized: RuleProcessor =\n getDatetimeRuleProcessorParameterized(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"spel\" format\n */\nexport const datetimeRuleProcessorSpEL: RuleProcessor =\n getDatetimeRuleProcessorSpEL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"ldap\" format\n */\nexport const datetimeRuleProcessorLDAP: RuleProcessor =\n getDatetimeRuleProcessorLDAP(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"gremlin\" format\n */\nexport const datetimeRuleProcessorGremlin: RuleProcessor =\n getDatetimeRuleProcessorGremlin(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"prisma\" format\n */\nexport const datetimeRuleProcessorPrisma: RuleProcessor =\n getDatetimeRuleProcessorPrisma(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"sequelize\" format\n */\nexport const datetimeRuleProcessorSequelize: RuleProcessor =\n getDatetimeRuleProcessorSequelize(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"drizzle\" format\n */\nexport const datetimeRuleProcessorDrizzle: RuleProcessor =\n getDatetimeRuleProcessorDrizzle(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"elasticsearch\" format\n */\nexport const datetimeRuleProcessorElasticSearch: RuleProcessor =\n getDatetimeRuleProcessorElasticSearch(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"tanstack_db\" format\n */\nexport const datetimeRuleProcessorTanStackDB: RuleProcessor =\n getDatetimeRuleProcessorTanStackDB(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for (deprecated) \"mongodb\" format\n */\nexport const datetimeRuleProcessorMongoDB: RuleProcessor =\n getDatetimeRuleProcessorMongoDB(rqbDateTimeLibraryAPI);\n\nexport * from './rqbDateTimeLibraryAPI.date-fns';\n"],"mappings":";;;AA0BA,MAAMA,YAA+B,MAAM,OAAO,MAAM,WAAW,SAAS,CAAC,IAAIC,OAAc,CAAC;AAChG,MAAM,kBAAkB;AAExB,MAAM,aAAwE;CAC5E,KAAK;CACL,MAAM;CACN,OAAO;CACP,MAAM;AACR;AACA,MAAM,WAAsE;CAC1E,KAAK;CACL,MAAM;CACN,OAAO;CACP,MAAM;AACR;AACA,MAAM,iBAA+D;CACnE,QAAQ;CACR,MAAM;CACN,KAAK;CACL,MAAM;CACN,OAAO;CACP,MAAM;AACR;;;;AAKA,MAAa,wBAA+C;CAC1D,SAAS,GAAG,QAAQ,OAAOD,SAAO,CAAC,GAAG,IAAI,QAAQ,cAAc,eAAe,CAAC;CAChF;CACA;CACA,SAAS,GAAG,MAAM;EAChB,MAAM,UAAUA,SAAO,CAAC;EACxB,MAAM,UAAUA,SAAO,CAAC;EACxB,OAAO,oBAAoB,CAAC,KAAK,oBAAoB,CAAC,IAClD,UAAU,SAAS,OAAO,IAC1B,QAAQ,QAAQ,MAAM,QAAQ,QAAQ;CAC5C;CACA,UAAS,MAAK,QAAQA,SAAO,CAAC,CAAC;CAC/B,QAAA;CACA,cAAa,MAAK;EAChB,MAAM,UAAUA,SAAO,CAAC;EACxB,OAAO,QAAQ,OAAO,IAAI,QAAQ,YAAY,IAAI;CACpD;CACA,sBAAqB,MAAK;EACxB,MAAM,UAAUA,SAAO,CAAC;EACxB,OAAO,QAAQ,OAAO,IAAI,OAAO,SAAS,eAAe,IAAI;CAC/D;CACA,UAAU,GAAG,SAAS,WAAW,KAAK,CAACA,SAAO,CAAC,CAAC;CAChD,QAAQ,GAAG,SAAS,SAAS,KAAK,CAACA,SAAO,CAAC,CAAC;CAC5C,MAAM,GAAG,QAAQ,SAASE,IAAWF,SAAO,CAAC,GAAG,GAAG,eAAe,QAAQ,OAAO,CAAC;AACpF;;;;;;ACvCA,MAAa,8BACX,+BAA+B,qBAAqB;;;;AAKtD,MAAa,2BACX,4BAA4B,qBAAqB;;;;AAInD,MAAa,6BACX,8BAA8B,qBAAqB;;;;AAIrD,MAAa,8BACX,+BAA+B,qBAAqB;;;;AAItD,MAAa,8BACX,+BAA+B,qBAAqB;;;;AAItD,MAAa,+BACX,gCAAgC,qBAAqB;;;;AAIvD,MAAa,mCACX,oCAAoC,qBAAqB;;;;AAK3D,MAAa,2BACX,4BAA4B,qBAAqB;;;;AAKnD,MAAa,+BACX,gCAAgC,qBAAqB;;;;AAKvD,MAAa,oCACX,qCAAqC,qBAAqB;;;;AAK5D,MAAa,0BACX,2BAA2B,qBAAqB;;;;AAKlD,MAAa,8BACX,+BAA+B,qBAAqB;;;;AAKtD,MAAa,8BACX,+BAA+B,qBAAqB;;;;AAKtD,MAAa,qCACX,sCAAsC,qBAAqB;;;;AAK7D,MAAa,4BACX,6BAA6B,qBAAqB;;;;AAKpD,MAAa,4BACX,6BAA6B,qBAAqB;;;;AAKpD,MAAa,+BACX,gCAAgC,qBAAqB;;;;AAKvD,MAAa,8BACX,+BAA+B,qBAAqB;;;;AAKtD,MAAa,iCACX,kCAAkC,qBAAqB;;;;AAKzD,MAAa,+BACX,gCAAgC,qBAAqB;;;;AAKvD,MAAa,qCACX,sCAAsC,qBAAqB;;;;AAK7D,MAAa,kCACX,mCAAmC,qBAAqB;;;;AAK1D,MAAa,+BACX,gCAAgC,qBAAqB"}
|
|
1
|
+
{"version":3,"file":"react-querybuilder_datetime.date-fns.mjs","names":["toDate","dateFnsToDate","dateFnsAdd"],"sources":["../src/rqbDateTimeLibraryAPI.date-fns.ts","../src/index.date-fns.ts"],"sourcesContent":["import {\n toDate as dateFnsToDate,\n add as dateFnsAdd,\n endOfDay,\n endOfMonth,\n endOfWeek,\n endOfYear,\n format,\n isAfter,\n isBefore,\n isSameDay,\n isValid,\n parseISO,\n startOfDay,\n startOfMonth,\n startOfWeek,\n startOfYear,\n} from 'date-fns';\nimport type { Duration } from 'date-fns';\nimport type {\n RelativeDateTimeTruncationUnit,\n RelativeDateTimeUnit,\n RQBDateTimeLibraryAPI,\n} from './types';\nimport { isISOStringDateOnly } from './utils';\n\nconst toDate: typeof dateFnsToDate = a => (typeof a === 'string' ? parseISO(a) : dateFnsToDate(a));\nconst iso8601DateOnly = 'yyyy-MM-dd';\n\nconst startOfMap: Record<RelativeDateTimeTruncationUnit, (d: Date) => Date> = {\n day: startOfDay,\n week: startOfWeek,\n month: startOfMonth,\n year: startOfYear,\n};\nconst endOfMap: Record<RelativeDateTimeTruncationUnit, (d: Date) => Date> = {\n day: endOfDay,\n week: endOfWeek,\n month: endOfMonth,\n year: endOfYear,\n};\nconst durationKeyMap: Record<RelativeDateTimeUnit, keyof Duration> = {\n minute: 'minutes',\n hour: 'hours',\n day: 'days',\n week: 'weeks',\n month: 'months',\n year: 'years',\n};\n\n/**\n * {@link RQBDateTimeLibraryAPI} for date-fns\n */\nexport const rqbDateTimeLibraryAPI: RQBDateTimeLibraryAPI = {\n format: (d, fmt) => format(toDate(d), fmt.replace('YYYY-MM-DD', iso8601DateOnly)),\n isAfter,\n isBefore,\n isSame: (a, b) => {\n const aToDate = toDate(a);\n const bToDate = toDate(b);\n return isISOStringDateOnly(a) || isISOStringDateOnly(b)\n ? isSameDay(aToDate, bToDate)\n : aToDate.getTime() === bToDate.getTime();\n },\n isValid: d => isValid(toDate(d)),\n toDate,\n toISOString: d => {\n const dToDate = toDate(d);\n return isValid(dToDate) ? dToDate.toISOString() : '';\n },\n toISOStringDateOnly: d => {\n const dToDate = toDate(d);\n return isValid(dToDate) ? format(dToDate, iso8601DateOnly) : '';\n },\n startOf: (d, unit) => startOfMap[unit](toDate(d)),\n endOf: (d, unit) => endOfMap[unit](toDate(d)),\n add: (d, amount, unit) => dateFnsAdd(toDate(d), { [durationKeyMap[unit]]: amount }),\n};\n","/**\n * Import from `\"@react-querybuilder/datetime/date-fns\"` for enhanced date/time support using [date-fns](https://date-fns.org/).\n *\n * @module date-fns\n */\n\nimport type { RuleProcessor, ValueProcessorByRule } from '@react-querybuilder/core';\nimport { getDatetimeJsonLogicOperations } from './getDatetimeJsonLogicOperations';\nimport { getDatetimeRuleProcessorCEL } from './getDatetimeRuleProcessorCEL';\nimport { getDatetimeRuleProcessorCypher } from './getDatetimeRuleProcessorCypher';\nimport { getDatetimeRuleProcessorDrizzle } from './getDatetimeRuleProcessorDrizzle';\nimport { getDatetimeRuleProcessorElasticSearch } from './getDatetimeRuleProcessorElasticSearch';\nimport { getDatetimeRuleProcessorGremlin } from './getDatetimeRuleProcessorGremlin';\nimport { getDatetimeRuleProcessorJSONata } from './getDatetimeRuleProcessorJSONata';\nimport { getDatetimeRuleProcessorLDAP } from './getDatetimeRuleProcessorLDAP';\nimport { getDatetimeRuleProcessorMongoDB } from './getDatetimeRuleProcessorMongoDB';\nimport { getDatetimeRuleProcessorMongoDBQuery } from './getDatetimeRuleProcessorMongoDBQuery';\nimport { getDatetimeRuleProcessorNL } from './getDatetimeRuleProcessorNL';\nimport { getDatetimeRuleProcessorParameterized } from './getDatetimeRuleProcessorParameterized';\nimport { getDatetimeRuleProcessorPrisma } from './getDatetimeRuleProcessorPrisma';\nimport { getDatetimeRuleProcessorSequelize } from './getDatetimeRuleProcessorSequelize';\nimport { getDatetimeRuleProcessorSPARQL } from './getDatetimeRuleProcessorSPARQL';\nimport { getDatetimeRuleProcessorSpEL } from './getDatetimeRuleProcessorSpEL';\nimport {\n getDatetimeRuleProcessorSQL,\n getDatetimeValueProcessorANSI,\n getDatetimeValueProcessorMSSQL,\n getDatetimeValueProcessorMySQL,\n getDatetimeValueProcessorOracle,\n getDatetimeValueProcessorPostgreSQL,\n} from './getDatetimeRuleProcessorSQL';\nimport { getDatetimeRuleProcessorTanStackDB } from './getDatetimeRuleProcessorTanStackDB';\nimport { rqbDateTimeLibraryAPI } from './rqbDateTimeLibraryAPI.date-fns';\nimport type { RQBJsonLogicDateTimeOperations } from './types';\n\n/**\n * Custom JsonLogic date/time operations using date-fns\n */\nexport const jsonLogicDateTimeOperations: RQBJsonLogicDateTimeOperations =\n getDatetimeJsonLogicOperations(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"sql\" format using date-fns\n */\nexport const datetimeRuleProcessorSQL: RuleProcessor =\n getDatetimeRuleProcessorSQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"ansi\" preset) using date-fns\n */\nexport const datetimeValueProcessorANSI: ValueProcessorByRule =\n getDatetimeValueProcessorANSI(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"mssql\" preset) using date-fns\n */\nexport const datetimeValueProcessorMSSQL: ValueProcessorByRule =\n getDatetimeValueProcessorMSSQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"mysql\" preset) using date-fns\n */\nexport const datetimeValueProcessorMySQL: ValueProcessorByRule =\n getDatetimeValueProcessorMySQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"oracle\" preset) using date-fns\n */\nexport const datetimeValueProcessorOracle: ValueProcessorByRule =\n getDatetimeValueProcessorOracle(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"postgresql\" preset) using date-fns\n */\nexport const datetimeValueProcessorPostgreSQL: ValueProcessorByRule =\n getDatetimeValueProcessorPostgreSQL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"cel\" format using date-fns\n */\nexport const datetimeRuleProcessorCEL: ValueProcessorByRule =\n getDatetimeRuleProcessorCEL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"jsonata\" format using date-fns\n */\nexport const datetimeRuleProcessorJSONata: RuleProcessor =\n getDatetimeRuleProcessorJSONata(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"mongodb_query\" format using date-fns\n */\nexport const datetimeRuleProcessorMongoDBQuery: ValueProcessorByRule =\n getDatetimeRuleProcessorMongoDBQuery(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"natural_language\" format using date-fns\n */\nexport const datetimeRuleProcessorNL: ValueProcessorByRule =\n getDatetimeRuleProcessorNL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"cypher\"/\"gql\" format using date-fns\n */\nexport const datetimeRuleProcessorCypher: ValueProcessorByRule =\n getDatetimeRuleProcessorCypher(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"sparql\" format using date-fns\n */\nexport const datetimeRuleProcessorSPARQL: ValueProcessorByRule =\n getDatetimeRuleProcessorSPARQL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"parameterized\"/\"parameterized_named\" formats\n */\nexport const datetimeRuleProcessorParameterized: RuleProcessor =\n getDatetimeRuleProcessorParameterized(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"spel\" format\n */\nexport const datetimeRuleProcessorSpEL: RuleProcessor =\n getDatetimeRuleProcessorSpEL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"ldap\" format\n */\nexport const datetimeRuleProcessorLDAP: RuleProcessor =\n getDatetimeRuleProcessorLDAP(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"gremlin\" format\n */\nexport const datetimeRuleProcessorGremlin: RuleProcessor =\n getDatetimeRuleProcessorGremlin(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"prisma\" format\n */\nexport const datetimeRuleProcessorPrisma: RuleProcessor =\n getDatetimeRuleProcessorPrisma(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"sequelize\" format\n */\nexport const datetimeRuleProcessorSequelize: RuleProcessor =\n getDatetimeRuleProcessorSequelize(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"drizzle\" format\n */\nexport const datetimeRuleProcessorDrizzle: RuleProcessor =\n getDatetimeRuleProcessorDrizzle(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"elasticsearch\" format\n */\nexport const datetimeRuleProcessorElasticSearch: RuleProcessor =\n getDatetimeRuleProcessorElasticSearch(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"tanstack_db\" format\n */\nexport const datetimeRuleProcessorTanStackDB: RuleProcessor =\n getDatetimeRuleProcessorTanStackDB(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for (deprecated) \"mongodb\" format\n */\nexport const datetimeRuleProcessorMongoDB: RuleProcessor =\n getDatetimeRuleProcessorMongoDB(rqbDateTimeLibraryAPI);\n\nexport * from './rqbDateTimeLibraryAPI.date-fns';\n"],"mappings":";;;;AA0BA,MAAMA,YAA+B,MAAM,OAAO,MAAM,WAAW,SAAS,CAAC,IAAIC,OAAc,CAAC;AAChG,MAAM,kBAAkB;AAExB,MAAM,aAAwE;CAC5E,KAAK;CACL,MAAM;CACN,OAAO;CACP,MAAM;AACR;AACA,MAAM,WAAsE;CAC1E,KAAK;CACL,MAAM;CACN,OAAO;CACP,MAAM;AACR;AACA,MAAM,iBAA+D;CACnE,QAAQ;CACR,MAAM;CACN,KAAK;CACL,MAAM;CACN,OAAO;CACP,MAAM;AACR;;;;AAKA,MAAa,wBAA+C;CAC1D,SAAS,GAAG,QAAQ,OAAOD,SAAO,CAAC,GAAG,IAAI,QAAQ,cAAc,eAAe,CAAC;CAChF;CACA;CACA,SAAS,GAAG,MAAM;EAChB,MAAM,UAAUA,SAAO,CAAC;EACxB,MAAM,UAAUA,SAAO,CAAC;EACxB,OAAO,oBAAoB,CAAC,KAAK,oBAAoB,CAAC,IAClD,UAAU,SAAS,OAAO,IAC1B,QAAQ,QAAQ,MAAM,QAAQ,QAAQ;CAC5C;CACA,UAAS,MAAK,QAAQA,SAAO,CAAC,CAAC;CAC/B,QAAA;CACA,cAAa,MAAK;EAChB,MAAM,UAAUA,SAAO,CAAC;EACxB,OAAO,QAAQ,OAAO,IAAI,QAAQ,YAAY,IAAI;CACpD;CACA,sBAAqB,MAAK;EACxB,MAAM,UAAUA,SAAO,CAAC;EACxB,OAAO,QAAQ,OAAO,IAAI,OAAO,SAAS,eAAe,IAAI;CAC/D;CACA,UAAU,GAAG,SAAS,WAAW,KAAK,CAACA,SAAO,CAAC,CAAC;CAChD,QAAQ,GAAG,SAAS,SAAS,KAAK,CAACA,SAAO,CAAC,CAAC;CAC5C,MAAM,GAAG,QAAQ,SAASE,IAAWF,SAAO,CAAC,GAAG,GAAG,eAAe,QAAQ,OAAO,CAAC;AACpF;;;;;;ACvCA,MAAa,8BACX,+BAA+B,qBAAqB;;;;AAKtD,MAAa,2BACX,4BAA4B,qBAAqB;;;;AAInD,MAAa,6BACX,8BAA8B,qBAAqB;;;;AAIrD,MAAa,8BACX,+BAA+B,qBAAqB;;;;AAItD,MAAa,8BACX,+BAA+B,qBAAqB;;;;AAItD,MAAa,+BACX,gCAAgC,qBAAqB;;;;AAIvD,MAAa,mCACX,oCAAoC,qBAAqB;;;;AAK3D,MAAa,2BACX,4BAA4B,qBAAqB;;;;AAKnD,MAAa,+BACX,gCAAgC,qBAAqB;;;;AAKvD,MAAa,oCACX,qCAAqC,qBAAqB;;;;AAK5D,MAAa,0BACX,2BAA2B,qBAAqB;;;;AAKlD,MAAa,8BACX,+BAA+B,qBAAqB;;;;AAKtD,MAAa,8BACX,+BAA+B,qBAAqB;;;;AAKtD,MAAa,qCACX,sCAAsC,qBAAqB;;;;AAK7D,MAAa,4BACX,6BAA6B,qBAAqB;;;;AAKpD,MAAa,4BACX,6BAA6B,qBAAqB;;;;AAKpD,MAAa,+BACX,gCAAgC,qBAAqB;;;;AAKvD,MAAa,8BACX,+BAA+B,qBAAqB;;;;AAKtD,MAAa,iCACX,kCAAkC,qBAAqB;;;;AAKzD,MAAa,+BACX,gCAAgC,qBAAqB;;;;AAKvD,MAAa,qCACX,sCAAsC,qBAAqB;;;;AAK7D,MAAa,kCACX,mCAAmC,qBAAqB;;;;AAK1D,MAAa,+BACX,gCAAgC,qBAAqB"}
|
|
@@ -1,104 +1,103 @@
|
|
|
1
|
-
import { g as RQBJsonLogicDateTimeOperations, i as RQBDateTimeLibraryAPI } from "./types-
|
|
2
|
-
import { RuleProcessor, ValueProcessorByRule } from "react-querybuilder";
|
|
3
|
-
|
|
1
|
+
import { g as RQBJsonLogicDateTimeOperations, i as RQBDateTimeLibraryAPI } from "./types-BKA1aoY6.mjs";
|
|
2
|
+
import { RuleProcessor, ValueProcessorByRule } from "@react-querybuilder/core";
|
|
4
3
|
//#region src/rqbDateTimeLibraryAPI.dayjs.d.ts
|
|
5
4
|
/**
|
|
6
|
-
* {@link RQBDateTimeLibraryAPI} for Day.js
|
|
7
|
-
*/
|
|
5
|
+
* {@link RQBDateTimeLibraryAPI} for Day.js
|
|
6
|
+
*/
|
|
8
7
|
declare const rqbDateTimeLibraryAPI: RQBDateTimeLibraryAPI;
|
|
9
8
|
//#endregion
|
|
10
9
|
//#region src/index.dayjs.d.ts
|
|
11
10
|
/**
|
|
12
|
-
* Custom JsonLogic date/time operations using Day.js
|
|
13
|
-
*/
|
|
11
|
+
* Custom JsonLogic date/time operations using Day.js
|
|
12
|
+
*/
|
|
14
13
|
declare const jsonLogicDateTimeOperations: RQBJsonLogicDateTimeOperations;
|
|
15
14
|
/**
|
|
16
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "sql" format using Day.js
|
|
17
|
-
*/
|
|
15
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "sql" format using Day.js
|
|
16
|
+
*/
|
|
18
17
|
declare const datetimeRuleProcessorSQL: RuleProcessor;
|
|
19
18
|
/**
|
|
20
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("ansi" preset) using Day.js
|
|
21
|
-
*/
|
|
19
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("ansi" preset) using Day.js
|
|
20
|
+
*/
|
|
22
21
|
declare const datetimeValueProcessorANSI: ValueProcessorByRule;
|
|
23
22
|
/**
|
|
24
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("mssql" preset) using Day.js
|
|
25
|
-
*/
|
|
23
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("mssql" preset) using Day.js
|
|
24
|
+
*/
|
|
26
25
|
declare const datetimeValueProcessorMSSQL: ValueProcessorByRule;
|
|
27
26
|
/**
|
|
28
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("mysql" preset) using Day.js
|
|
29
|
-
*/
|
|
27
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("mysql" preset) using Day.js
|
|
28
|
+
*/
|
|
30
29
|
declare const datetimeValueProcessorMySQL: ValueProcessorByRule;
|
|
31
30
|
/**
|
|
32
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("oracle" preset) using Day.js
|
|
33
|
-
*/
|
|
31
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("oracle" preset) using Day.js
|
|
32
|
+
*/
|
|
34
33
|
declare const datetimeValueProcessorOracle: ValueProcessorByRule;
|
|
35
34
|
/**
|
|
36
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("postgresql" preset) using Day.js
|
|
37
|
-
*/
|
|
35
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("postgresql" preset) using Day.js
|
|
36
|
+
*/
|
|
38
37
|
declare const datetimeValueProcessorPostgreSQL: ValueProcessorByRule;
|
|
39
38
|
/**
|
|
40
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "cel" format using Day.js
|
|
41
|
-
*/
|
|
39
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "cel" format using Day.js
|
|
40
|
+
*/
|
|
42
41
|
declare const datetimeRuleProcessorCEL: ValueProcessorByRule;
|
|
43
42
|
/**
|
|
44
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "jsonata" format using Day.js
|
|
45
|
-
*/
|
|
43
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "jsonata" format using Day.js
|
|
44
|
+
*/
|
|
46
45
|
declare const datetimeRuleProcessorJSONata: RuleProcessor;
|
|
47
46
|
/**
|
|
48
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "mongodb_query" format using Day.js
|
|
49
|
-
*/
|
|
47
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "mongodb_query" format using Day.js
|
|
48
|
+
*/
|
|
50
49
|
declare const datetimeRuleProcessorMongoDBQuery: ValueProcessorByRule;
|
|
51
50
|
/**
|
|
52
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "natural_language" format using Day.js
|
|
53
|
-
*/
|
|
51
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "natural_language" format using Day.js
|
|
52
|
+
*/
|
|
54
53
|
declare const datetimeRuleProcessorNL: ValueProcessorByRule;
|
|
55
54
|
/**
|
|
56
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "cypher"/"gql" format using Day.js
|
|
57
|
-
*/
|
|
55
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "cypher"/"gql" format using Day.js
|
|
56
|
+
*/
|
|
58
57
|
declare const datetimeRuleProcessorCypher: ValueProcessorByRule;
|
|
59
58
|
/**
|
|
60
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "sparql" format using Day.js
|
|
61
|
-
*/
|
|
59
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "sparql" format using Day.js
|
|
60
|
+
*/
|
|
62
61
|
declare const datetimeRuleProcessorSPARQL: ValueProcessorByRule;
|
|
63
62
|
/**
|
|
64
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "parameterized"/"parameterized_named" formats using Day.js
|
|
65
|
-
*/
|
|
63
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "parameterized"/"parameterized_named" formats using Day.js
|
|
64
|
+
*/
|
|
66
65
|
declare const datetimeRuleProcessorParameterized: RuleProcessor;
|
|
67
66
|
/**
|
|
68
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "spel" format using Day.js
|
|
69
|
-
*/
|
|
67
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "spel" format using Day.js
|
|
68
|
+
*/
|
|
70
69
|
declare const datetimeRuleProcessorSpEL: RuleProcessor;
|
|
71
70
|
/**
|
|
72
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "ldap" format using Day.js
|
|
73
|
-
*/
|
|
71
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "ldap" format using Day.js
|
|
72
|
+
*/
|
|
74
73
|
declare const datetimeRuleProcessorLDAP: RuleProcessor;
|
|
75
74
|
/**
|
|
76
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "gremlin" format using Day.js
|
|
77
|
-
*/
|
|
75
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "gremlin" format using Day.js
|
|
76
|
+
*/
|
|
78
77
|
declare const datetimeRuleProcessorGremlin: RuleProcessor;
|
|
79
78
|
/**
|
|
80
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "prisma" format using Day.js
|
|
81
|
-
*/
|
|
79
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "prisma" format using Day.js
|
|
80
|
+
*/
|
|
82
81
|
declare const datetimeRuleProcessorPrisma: RuleProcessor;
|
|
83
82
|
/**
|
|
84
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "sequelize" format using Day.js
|
|
85
|
-
*/
|
|
83
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "sequelize" format using Day.js
|
|
84
|
+
*/
|
|
86
85
|
declare const datetimeRuleProcessorSequelize: RuleProcessor;
|
|
87
86
|
/**
|
|
88
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "drizzle" format using Day.js
|
|
89
|
-
*/
|
|
87
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "drizzle" format using Day.js
|
|
88
|
+
*/
|
|
90
89
|
declare const datetimeRuleProcessorDrizzle: RuleProcessor;
|
|
91
90
|
/**
|
|
92
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "elasticsearch" format using Day.js
|
|
93
|
-
*/
|
|
91
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "elasticsearch" format using Day.js
|
|
92
|
+
*/
|
|
94
93
|
declare const datetimeRuleProcessorElasticSearch: RuleProcessor;
|
|
95
94
|
/**
|
|
96
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "tanstack_db" format using Day.js
|
|
97
|
-
*/
|
|
95
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "tanstack_db" format using Day.js
|
|
96
|
+
*/
|
|
98
97
|
declare const datetimeRuleProcessorTanStackDB: RuleProcessor;
|
|
99
98
|
/**
|
|
100
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for (deprecated) "mongodb" format using Day.js
|
|
101
|
-
*/
|
|
99
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for (deprecated) "mongodb" format using Day.js
|
|
100
|
+
*/
|
|
102
101
|
declare const datetimeRuleProcessorMongoDB: RuleProcessor;
|
|
103
102
|
//#endregion
|
|
104
103
|
export { datetimeRuleProcessorCEL, datetimeRuleProcessorCypher, datetimeRuleProcessorDrizzle, datetimeRuleProcessorElasticSearch, datetimeRuleProcessorGremlin, datetimeRuleProcessorJSONata, datetimeRuleProcessorLDAP, datetimeRuleProcessorMongoDB, datetimeRuleProcessorMongoDBQuery, datetimeRuleProcessorNL, datetimeRuleProcessorParameterized, datetimeRuleProcessorPrisma, datetimeRuleProcessorSPARQL, datetimeRuleProcessorSQL, datetimeRuleProcessorSequelize, datetimeRuleProcessorSpEL, datetimeRuleProcessorTanStackDB, datetimeValueProcessorANSI, datetimeValueProcessorMSSQL, datetimeValueProcessorMySQL, datetimeValueProcessorOracle, datetimeValueProcessorPostgreSQL, jsonLogicDateTimeOperations, rqbDateTimeLibraryAPI };
|
|
@@ -1,5 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as
|
|
1
|
+
import { n as isISOStringDateOnly } from "./utils-BAgUBdyf.mjs";
|
|
2
|
+
import { C as getDatetimeRuleProcessorCypher, S as getDatetimeRuleProcessorDrizzle, T as getDatetimeJsonLogicOperations, _ as getDatetimeRuleProcessorMongoDBQuery, a as getDatetimeValueProcessorMySQL, b as getDatetimeRuleProcessorGremlin, c as getDatetimeRuleProcessorSpEL, d as getDatetimeRuleProcessorPrisma, f as getDatetimeRuleProcessorParameterized, g as getDatetimeRuleProcessorMongoDB, h as getDatetimeRuleProcessorNL, i as getDatetimeValueProcessorMSSQL, l as getDatetimeRuleProcessorSPARQL, n as getDatetimeRuleProcessorSQL, o as getDatetimeValueProcessorOracle, r as getDatetimeValueProcessorANSI, s as getDatetimeValueProcessorPostgreSQL, t as getDatetimeRuleProcessorTanStackDB, u as getDatetimeRuleProcessorSequelize, v as getDatetimeRuleProcessorLDAP, w as getDatetimeRuleProcessorCEL, x as getDatetimeRuleProcessorElasticSearch, y as getDatetimeRuleProcessorJSONata } from "./getDatetimeRuleProcessorTanStackDB-DR8aYrUa.mjs";
|
|
3
|
+
import dayjs from "dayjs";
|
|
4
|
+
//#region src/rqbDateTimeLibraryAPI.dayjs.ts
|
|
5
|
+
/**
|
|
6
|
+
* {@link RQBDateTimeLibraryAPI} for Day.js
|
|
7
|
+
*/
|
|
8
|
+
const rqbDateTimeLibraryAPI = {
|
|
9
|
+
format: (d, fmt) => dayjs(d).format(fmt),
|
|
10
|
+
isAfter: (a, b) => dayjs(a).isAfter(b),
|
|
11
|
+
isBefore: (a, b) => dayjs(a).isBefore(b),
|
|
12
|
+
isSame: (a, b) => dayjs(a).isSame(b, isISOStringDateOnly(a) || isISOStringDateOnly(b) ? "d" : "ms"),
|
|
13
|
+
isValid: (d) => dayjs(d).isValid(),
|
|
14
|
+
toDate: (d) => dayjs(d).toDate(),
|
|
15
|
+
toISOString: (d) => {
|
|
16
|
+
const dToDate = dayjs(d);
|
|
17
|
+
return dToDate.isValid() ? dToDate.toISOString() : "";
|
|
18
|
+
},
|
|
19
|
+
toISOStringDateOnly: (d) => {
|
|
20
|
+
const dToDate = dayjs(d);
|
|
21
|
+
return dToDate.isValid() ? dToDate.format("YYYY-MM-DD") : "";
|
|
22
|
+
},
|
|
23
|
+
startOf: (d, unit) => dayjs(d).startOf(unit).toDate(),
|
|
24
|
+
endOf: (d, unit) => dayjs(d).endOf(unit).toDate(),
|
|
25
|
+
add: (d, amount, unit) => dayjs(d).add(amount, unit).toDate()
|
|
26
|
+
};
|
|
27
|
+
//#endregion
|
|
3
28
|
//#region src/index.dayjs.ts
|
|
4
29
|
/**
|
|
5
30
|
* Custom JsonLogic date/time operations using Day.js
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-querybuilder_datetime.dayjs.mjs","names":[],"sources":["../src/index.dayjs.ts"],"sourcesContent":["/**\n * Import from `\"@react-querybuilder/datetime/dayjs\"` for enhanced date/time support using [Day.js](https://day.js.org/).\n *\n * @module dayjs\n */\n\nimport type { RuleProcessor, ValueProcessorByRule } from 'react-querybuilder';\nimport { getDatetimeJsonLogicOperations } from './getDatetimeJsonLogicOperations';\nimport { getDatetimeRuleProcessorCEL } from './getDatetimeRuleProcessorCEL';\nimport { getDatetimeRuleProcessorCypher } from './getDatetimeRuleProcessorCypher';\nimport { getDatetimeRuleProcessorDrizzle } from './getDatetimeRuleProcessorDrizzle';\nimport { getDatetimeRuleProcessorElasticSearch } from './getDatetimeRuleProcessorElasticSearch';\nimport { getDatetimeRuleProcessorGremlin } from './getDatetimeRuleProcessorGremlin';\nimport { getDatetimeRuleProcessorJSONata } from './getDatetimeRuleProcessorJSONata';\nimport { getDatetimeRuleProcessorLDAP } from './getDatetimeRuleProcessorLDAP';\nimport { getDatetimeRuleProcessorMongoDB } from './getDatetimeRuleProcessorMongoDB';\nimport { getDatetimeRuleProcessorMongoDBQuery } from './getDatetimeRuleProcessorMongoDBQuery';\nimport { getDatetimeRuleProcessorNL } from './getDatetimeRuleProcessorNL';\nimport { getDatetimeRuleProcessorParameterized } from './getDatetimeRuleProcessorParameterized';\nimport { getDatetimeRuleProcessorPrisma } from './getDatetimeRuleProcessorPrisma';\nimport { getDatetimeRuleProcessorSequelize } from './getDatetimeRuleProcessorSequelize';\nimport { getDatetimeRuleProcessorSPARQL } from './getDatetimeRuleProcessorSPARQL';\nimport { getDatetimeRuleProcessorSpEL } from './getDatetimeRuleProcessorSpEL';\nimport {\n getDatetimeRuleProcessorSQL,\n getDatetimeValueProcessorANSI,\n getDatetimeValueProcessorMSSQL,\n getDatetimeValueProcessorMySQL,\n getDatetimeValueProcessorOracle,\n getDatetimeValueProcessorPostgreSQL,\n} from './getDatetimeRuleProcessorSQL';\nimport { getDatetimeRuleProcessorTanStackDB } from './getDatetimeRuleProcessorTanStackDB';\nimport { rqbDateTimeLibraryAPI } from './rqbDateTimeLibraryAPI.dayjs';\nimport type { RQBJsonLogicDateTimeOperations } from './types';\n\n/**\n * Custom JsonLogic date/time operations using Day.js\n */\nexport const jsonLogicDateTimeOperations: RQBJsonLogicDateTimeOperations =\n getDatetimeJsonLogicOperations(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"sql\" format using Day.js\n */\nexport const datetimeRuleProcessorSQL: RuleProcessor =\n getDatetimeRuleProcessorSQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"ansi\" preset) using Day.js\n */\nexport const datetimeValueProcessorANSI: ValueProcessorByRule =\n getDatetimeValueProcessorANSI(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"mssql\" preset) using Day.js\n */\nexport const datetimeValueProcessorMSSQL: ValueProcessorByRule =\n getDatetimeValueProcessorMSSQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"mysql\" preset) using Day.js\n */\nexport const datetimeValueProcessorMySQL: ValueProcessorByRule =\n getDatetimeValueProcessorMySQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"oracle\" preset) using Day.js\n */\nexport const datetimeValueProcessorOracle: ValueProcessorByRule =\n getDatetimeValueProcessorOracle(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"postgresql\" preset) using Day.js\n */\nexport const datetimeValueProcessorPostgreSQL: ValueProcessorByRule =\n getDatetimeValueProcessorPostgreSQL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"cel\" format using Day.js\n */\nexport const datetimeRuleProcessorCEL: ValueProcessorByRule =\n getDatetimeRuleProcessorCEL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"jsonata\" format using Day.js\n */\nexport const datetimeRuleProcessorJSONata: RuleProcessor =\n getDatetimeRuleProcessorJSONata(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"mongodb_query\" format using Day.js\n */\nexport const datetimeRuleProcessorMongoDBQuery: ValueProcessorByRule =\n getDatetimeRuleProcessorMongoDBQuery(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"natural_language\" format using Day.js\n */\nexport const datetimeRuleProcessorNL: ValueProcessorByRule =\n getDatetimeRuleProcessorNL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"cypher\"/\"gql\" format using Day.js\n */\nexport const datetimeRuleProcessorCypher: ValueProcessorByRule =\n getDatetimeRuleProcessorCypher(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"sparql\" format using Day.js\n */\nexport const datetimeRuleProcessorSPARQL: ValueProcessorByRule =\n getDatetimeRuleProcessorSPARQL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"parameterized\"/\"parameterized_named\" formats using Day.js\n */\nexport const datetimeRuleProcessorParameterized: RuleProcessor =\n getDatetimeRuleProcessorParameterized(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"spel\" format using Day.js\n */\nexport const datetimeRuleProcessorSpEL: RuleProcessor =\n getDatetimeRuleProcessorSpEL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"ldap\" format using Day.js\n */\nexport const datetimeRuleProcessorLDAP: RuleProcessor =\n getDatetimeRuleProcessorLDAP(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"gremlin\" format using Day.js\n */\nexport const datetimeRuleProcessorGremlin: RuleProcessor =\n getDatetimeRuleProcessorGremlin(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"prisma\" format using Day.js\n */\nexport const datetimeRuleProcessorPrisma: RuleProcessor =\n getDatetimeRuleProcessorPrisma(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"sequelize\" format using Day.js\n */\nexport const datetimeRuleProcessorSequelize: RuleProcessor =\n getDatetimeRuleProcessorSequelize(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"drizzle\" format using Day.js\n */\nexport const datetimeRuleProcessorDrizzle: RuleProcessor =\n getDatetimeRuleProcessorDrizzle(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"elasticsearch\" format using Day.js\n */\nexport const datetimeRuleProcessorElasticSearch: RuleProcessor =\n getDatetimeRuleProcessorElasticSearch(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"tanstack_db\" format using Day.js\n */\nexport const datetimeRuleProcessorTanStackDB: RuleProcessor =\n getDatetimeRuleProcessorTanStackDB(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for (deprecated) \"mongodb\" format using Day.js\n */\nexport const datetimeRuleProcessorMongoDB: RuleProcessor =\n getDatetimeRuleProcessorMongoDB(rqbDateTimeLibraryAPI);\n\nexport * from './rqbDateTimeLibraryAPI.dayjs';\n"],"mappings":";;;;;;AAsCA,MAAa,8BACX,+BAA+B,qBAAqB;;;;AAKtD,MAAa,2BACX,4BAA4B,qBAAqB;;;;AAInD,MAAa,6BACX,8BAA8B,qBAAqB;;;;AAIrD,MAAa,8BACX,+BAA+B,qBAAqB;;;;AAItD,MAAa,8BACX,+BAA+B,qBAAqB;;;;AAItD,MAAa,+BACX,gCAAgC,qBAAqB;;;;AAIvD,MAAa,mCACX,oCAAoC,qBAAqB;;;;AAK3D,MAAa,2BACX,4BAA4B,qBAAqB;;;;AAKnD,MAAa,+BACX,gCAAgC,qBAAqB;;;;AAKvD,MAAa,oCACX,qCAAqC,qBAAqB;;;;AAK5D,MAAa,0BACX,2BAA2B,qBAAqB;;;;AAKlD,MAAa,8BACX,+BAA+B,qBAAqB;;;;AAKtD,MAAa,8BACX,+BAA+B,qBAAqB;;;;AAKtD,MAAa,qCACX,sCAAsC,qBAAqB;;;;AAK7D,MAAa,4BACX,6BAA6B,qBAAqB;;;;AAKpD,MAAa,4BACX,6BAA6B,qBAAqB;;;;AAKpD,MAAa,+BACX,gCAAgC,qBAAqB;;;;AAKvD,MAAa,8BACX,+BAA+B,qBAAqB;;;;AAKtD,MAAa,iCACX,kCAAkC,qBAAqB;;;;AAKzD,MAAa,+BACX,gCAAgC,qBAAqB;;;;AAKvD,MAAa,qCACX,sCAAsC,qBAAqB;;;;AAK7D,MAAa,kCACX,mCAAmC,qBAAqB;;;;AAK1D,MAAa,+BACX,gCAAgC,qBAAqB"}
|
|
1
|
+
{"version":3,"file":"react-querybuilder_datetime.dayjs.mjs","names":[],"sources":["../src/rqbDateTimeLibraryAPI.dayjs.ts","../src/index.dayjs.ts"],"sourcesContent":["import dayjs from 'dayjs';\nimport type { RQBDateTimeLibraryAPI } from './types';\nimport { isISOStringDateOnly } from './utils';\n\n/**\n * {@link RQBDateTimeLibraryAPI} for Day.js\n */\nexport const rqbDateTimeLibraryAPI: RQBDateTimeLibraryAPI = {\n format: (d, fmt) => dayjs(d).format(fmt),\n isAfter: (a, b) => dayjs(a).isAfter(b),\n isBefore: (a, b) => dayjs(a).isBefore(b),\n isSame: (a, b) =>\n dayjs(a).isSame(b, isISOStringDateOnly(a) || isISOStringDateOnly(b) ? 'd' : 'ms'),\n isValid: d => dayjs(d).isValid(),\n toDate: d => dayjs(d).toDate(),\n toISOString: d => {\n const dToDate = dayjs(d);\n return dToDate.isValid() ? dToDate.toISOString() : '';\n },\n toISOStringDateOnly: d => {\n const dToDate = dayjs(d);\n return dToDate.isValid() ? dToDate.format('YYYY-MM-DD') : '';\n },\n 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","/**\n * Import from `\"@react-querybuilder/datetime/dayjs\"` for enhanced date/time support using [Day.js](https://day.js.org/).\n *\n * @module dayjs\n */\n\nimport type { RuleProcessor, ValueProcessorByRule } from '@react-querybuilder/core';\nimport { getDatetimeJsonLogicOperations } from './getDatetimeJsonLogicOperations';\nimport { getDatetimeRuleProcessorCEL } from './getDatetimeRuleProcessorCEL';\nimport { getDatetimeRuleProcessorCypher } from './getDatetimeRuleProcessorCypher';\nimport { getDatetimeRuleProcessorDrizzle } from './getDatetimeRuleProcessorDrizzle';\nimport { getDatetimeRuleProcessorElasticSearch } from './getDatetimeRuleProcessorElasticSearch';\nimport { getDatetimeRuleProcessorGremlin } from './getDatetimeRuleProcessorGremlin';\nimport { getDatetimeRuleProcessorJSONata } from './getDatetimeRuleProcessorJSONata';\nimport { getDatetimeRuleProcessorLDAP } from './getDatetimeRuleProcessorLDAP';\nimport { getDatetimeRuleProcessorMongoDB } from './getDatetimeRuleProcessorMongoDB';\nimport { getDatetimeRuleProcessorMongoDBQuery } from './getDatetimeRuleProcessorMongoDBQuery';\nimport { getDatetimeRuleProcessorNL } from './getDatetimeRuleProcessorNL';\nimport { getDatetimeRuleProcessorParameterized } from './getDatetimeRuleProcessorParameterized';\nimport { getDatetimeRuleProcessorPrisma } from './getDatetimeRuleProcessorPrisma';\nimport { getDatetimeRuleProcessorSequelize } from './getDatetimeRuleProcessorSequelize';\nimport { getDatetimeRuleProcessorSPARQL } from './getDatetimeRuleProcessorSPARQL';\nimport { getDatetimeRuleProcessorSpEL } from './getDatetimeRuleProcessorSpEL';\nimport {\n getDatetimeRuleProcessorSQL,\n getDatetimeValueProcessorANSI,\n getDatetimeValueProcessorMSSQL,\n getDatetimeValueProcessorMySQL,\n getDatetimeValueProcessorOracle,\n getDatetimeValueProcessorPostgreSQL,\n} from './getDatetimeRuleProcessorSQL';\nimport { getDatetimeRuleProcessorTanStackDB } from './getDatetimeRuleProcessorTanStackDB';\nimport { rqbDateTimeLibraryAPI } from './rqbDateTimeLibraryAPI.dayjs';\nimport type { RQBJsonLogicDateTimeOperations } from './types';\n\n/**\n * Custom JsonLogic date/time operations using Day.js\n */\nexport const jsonLogicDateTimeOperations: RQBJsonLogicDateTimeOperations =\n getDatetimeJsonLogicOperations(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"sql\" format using Day.js\n */\nexport const datetimeRuleProcessorSQL: RuleProcessor =\n getDatetimeRuleProcessorSQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"ansi\" preset) using Day.js\n */\nexport const datetimeValueProcessorANSI: ValueProcessorByRule =\n getDatetimeValueProcessorANSI(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"mssql\" preset) using Day.js\n */\nexport const datetimeValueProcessorMSSQL: ValueProcessorByRule =\n getDatetimeValueProcessorMSSQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"mysql\" preset) using Day.js\n */\nexport const datetimeValueProcessorMySQL: ValueProcessorByRule =\n getDatetimeValueProcessorMySQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"oracle\" preset) using Day.js\n */\nexport const datetimeValueProcessorOracle: ValueProcessorByRule =\n getDatetimeValueProcessorOracle(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"postgresql\" preset) using Day.js\n */\nexport const datetimeValueProcessorPostgreSQL: ValueProcessorByRule =\n getDatetimeValueProcessorPostgreSQL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"cel\" format using Day.js\n */\nexport const datetimeRuleProcessorCEL: ValueProcessorByRule =\n getDatetimeRuleProcessorCEL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"jsonata\" format using Day.js\n */\nexport const datetimeRuleProcessorJSONata: RuleProcessor =\n getDatetimeRuleProcessorJSONata(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"mongodb_query\" format using Day.js\n */\nexport const datetimeRuleProcessorMongoDBQuery: ValueProcessorByRule =\n getDatetimeRuleProcessorMongoDBQuery(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"natural_language\" format using Day.js\n */\nexport const datetimeRuleProcessorNL: ValueProcessorByRule =\n getDatetimeRuleProcessorNL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"cypher\"/\"gql\" format using Day.js\n */\nexport const datetimeRuleProcessorCypher: ValueProcessorByRule =\n getDatetimeRuleProcessorCypher(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"sparql\" format using Day.js\n */\nexport const datetimeRuleProcessorSPARQL: ValueProcessorByRule =\n getDatetimeRuleProcessorSPARQL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"parameterized\"/\"parameterized_named\" formats using Day.js\n */\nexport const datetimeRuleProcessorParameterized: RuleProcessor =\n getDatetimeRuleProcessorParameterized(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"spel\" format using Day.js\n */\nexport const datetimeRuleProcessorSpEL: RuleProcessor =\n getDatetimeRuleProcessorSpEL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"ldap\" format using Day.js\n */\nexport const datetimeRuleProcessorLDAP: RuleProcessor =\n getDatetimeRuleProcessorLDAP(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"gremlin\" format using Day.js\n */\nexport const datetimeRuleProcessorGremlin: RuleProcessor =\n getDatetimeRuleProcessorGremlin(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"prisma\" format using Day.js\n */\nexport const datetimeRuleProcessorPrisma: RuleProcessor =\n getDatetimeRuleProcessorPrisma(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"sequelize\" format using Day.js\n */\nexport const datetimeRuleProcessorSequelize: RuleProcessor =\n getDatetimeRuleProcessorSequelize(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"drizzle\" format using Day.js\n */\nexport const datetimeRuleProcessorDrizzle: RuleProcessor =\n getDatetimeRuleProcessorDrizzle(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"elasticsearch\" format using Day.js\n */\nexport const datetimeRuleProcessorElasticSearch: RuleProcessor =\n getDatetimeRuleProcessorElasticSearch(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"tanstack_db\" format using Day.js\n */\nexport const datetimeRuleProcessorTanStackDB: RuleProcessor =\n getDatetimeRuleProcessorTanStackDB(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for (deprecated) \"mongodb\" format using Day.js\n */\nexport const datetimeRuleProcessorMongoDB: RuleProcessor =\n getDatetimeRuleProcessorMongoDB(rqbDateTimeLibraryAPI);\n\nexport * from './rqbDateTimeLibraryAPI.dayjs';\n"],"mappings":";;;;;;;AAOA,MAAa,wBAA+C;CAC1D,SAAS,GAAG,QAAQ,MAAM,CAAC,CAAC,CAAC,OAAO,GAAG;CACvC,UAAU,GAAG,MAAM,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC;CACrC,WAAW,GAAG,MAAM,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;CACvC,SAAS,GAAG,MACV,MAAM,CAAC,CAAC,CAAC,OAAO,GAAG,oBAAoB,CAAC,KAAK,oBAAoB,CAAC,IAAI,MAAM,IAAI;CAClF,UAAS,MAAK,MAAM,CAAC,CAAC,CAAC,QAAQ;CAC/B,SAAQ,MAAK,MAAM,CAAC,CAAC,CAAC,OAAO;CAC7B,cAAa,MAAK;EAChB,MAAM,UAAU,MAAM,CAAC;EACvB,OAAO,QAAQ,QAAQ,IAAI,QAAQ,YAAY,IAAI;CACrD;CACA,sBAAqB,MAAK;EACxB,MAAM,UAAU,MAAM,CAAC;EACvB,OAAO,QAAQ,QAAQ,IAAI,QAAQ,OAAO,YAAY,IAAI;CAC5D;CACA,UAAU,GAAG,SAAS,MAAM,CAAC,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,OAAO;CACpD,QAAQ,GAAG,SAAS,MAAM,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,OAAO;CAChD,MAAM,GAAG,QAAQ,SAAS,MAAM,CAAC,CAAC,CAAC,IAAI,QAAQ,IAAI,CAAC,CAAC,OAAO;AAC9D;;;;;;ACYA,MAAa,8BACX,+BAA+B,qBAAqB;;;;AAKtD,MAAa,2BACX,4BAA4B,qBAAqB;;;;AAInD,MAAa,6BACX,8BAA8B,qBAAqB;;;;AAIrD,MAAa,8BACX,+BAA+B,qBAAqB;;;;AAItD,MAAa,8BACX,+BAA+B,qBAAqB;;;;AAItD,MAAa,+BACX,gCAAgC,qBAAqB;;;;AAIvD,MAAa,mCACX,oCAAoC,qBAAqB;;;;AAK3D,MAAa,2BACX,4BAA4B,qBAAqB;;;;AAKnD,MAAa,+BACX,gCAAgC,qBAAqB;;;;AAKvD,MAAa,oCACX,qCAAqC,qBAAqB;;;;AAK5D,MAAa,0BACX,2BAA2B,qBAAqB;;;;AAKlD,MAAa,8BACX,+BAA+B,qBAAqB;;;;AAKtD,MAAa,8BACX,+BAA+B,qBAAqB;;;;AAKtD,MAAa,qCACX,sCAAsC,qBAAqB;;;;AAK7D,MAAa,4BACX,6BAA6B,qBAAqB;;;;AAKpD,MAAa,4BACX,6BAA6B,qBAAqB;;;;AAKpD,MAAa,+BACX,gCAAgC,qBAAqB;;;;AAKvD,MAAa,8BACX,+BAA+B,qBAAqB;;;;AAKtD,MAAa,iCACX,kCAAkC,qBAAqB;;;;AAKzD,MAAa,+BACX,gCAAgC,qBAAqB;;;;AAKvD,MAAa,qCACX,sCAAsC,qBAAqB;;;;AAK7D,MAAa,kCACX,mCAAmC,qBAAqB;;;;AAK1D,MAAa,+BACX,gCAAgC,qBAAqB"}
|
|
@@ -1,107 +1,106 @@
|
|
|
1
|
-
import { g as RQBJsonLogicDateTimeOperations, i as RQBDateTimeLibraryAPI } from "./types-
|
|
2
|
-
import { RuleProcessor, ValueProcessorByRule } from "react-querybuilder";
|
|
3
|
-
|
|
1
|
+
import { g as RQBJsonLogicDateTimeOperations, i as RQBDateTimeLibraryAPI } from "./types-BKA1aoY6.mjs";
|
|
2
|
+
import { RuleProcessor, ValueProcessorByRule } from "@react-querybuilder/core";
|
|
4
3
|
//#region src/rqbDateTimeLibraryAPI.jsdate.d.ts
|
|
5
4
|
/**
|
|
6
|
-
* {@link RQBDateTimeLibraryAPI} for JavaScript `Date`
|
|
7
|
-
*
|
|
8
|
-
* @deprecated This API will not be removed, but we recommend using one of the other
|
|
9
|
-
* {@link RQBDateTimeLibraryAPI}s based on a popular library instead.
|
|
10
|
-
*/
|
|
5
|
+
* {@link RQBDateTimeLibraryAPI} for JavaScript `Date`
|
|
6
|
+
*
|
|
7
|
+
* @deprecated This API will not be removed, but we recommend using one of the other
|
|
8
|
+
* {@link RQBDateTimeLibraryAPI}s based on a popular library instead.
|
|
9
|
+
*/
|
|
11
10
|
declare const rqbDateTimeLibraryAPI: RQBDateTimeLibraryAPI;
|
|
12
11
|
//#endregion
|
|
13
12
|
//#region src/index.jsdate.d.ts
|
|
14
13
|
/**
|
|
15
|
-
* Custom JsonLogic date/time operations using JavaScript `Date`.
|
|
16
|
-
*/
|
|
14
|
+
* Custom JsonLogic date/time operations using JavaScript `Date`.
|
|
15
|
+
*/
|
|
17
16
|
declare const jsonLogicDateTimeOperations: RQBJsonLogicDateTimeOperations;
|
|
18
17
|
/**
|
|
19
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "sql" format using JavaScript `Date`
|
|
20
|
-
*/
|
|
18
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "sql" format using JavaScript `Date`
|
|
19
|
+
*/
|
|
21
20
|
declare const datetimeRuleProcessorSQL: RuleProcessor;
|
|
22
21
|
/**
|
|
23
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("ansi" preset) using JavaScript `Date`
|
|
24
|
-
*/
|
|
22
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("ansi" preset) using JavaScript `Date`
|
|
23
|
+
*/
|
|
25
24
|
declare const datetimeValueProcessorANSI: ValueProcessorByRule;
|
|
26
25
|
/**
|
|
27
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("mssql" preset) using JavaScript `Date`
|
|
28
|
-
*/
|
|
26
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("mssql" preset) using JavaScript `Date`
|
|
27
|
+
*/
|
|
29
28
|
declare const datetimeValueProcessorMSSQL: ValueProcessorByRule;
|
|
30
29
|
/**
|
|
31
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("mysql" preset) using JavaScript `Date`
|
|
32
|
-
*/
|
|
30
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("mysql" preset) using JavaScript `Date`
|
|
31
|
+
*/
|
|
33
32
|
declare const datetimeValueProcessorMySQL: ValueProcessorByRule;
|
|
34
33
|
/**
|
|
35
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("oracle" preset) using JavaScript `Date`
|
|
36
|
-
*/
|
|
34
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("oracle" preset) using JavaScript `Date`
|
|
35
|
+
*/
|
|
37
36
|
declare const datetimeValueProcessorOracle: ValueProcessorByRule;
|
|
38
37
|
/**
|
|
39
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("postgresql" preset) using JavaScript `Date`
|
|
40
|
-
*/
|
|
38
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("postgresql" preset) using JavaScript `Date`
|
|
39
|
+
*/
|
|
41
40
|
declare const datetimeValueProcessorPostgreSQL: ValueProcessorByRule;
|
|
42
41
|
/**
|
|
43
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "cel" format using JavaScript `Date`
|
|
44
|
-
*/
|
|
42
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "cel" format using JavaScript `Date`
|
|
43
|
+
*/
|
|
45
44
|
declare const datetimeRuleProcessorCEL: RuleProcessor;
|
|
46
45
|
/**
|
|
47
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "jsonata" format using JavaScript `Date`
|
|
48
|
-
*/
|
|
46
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "jsonata" format using JavaScript `Date`
|
|
47
|
+
*/
|
|
49
48
|
declare const datetimeRuleProcessorJSONata: RuleProcessor;
|
|
50
49
|
/**
|
|
51
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "mongodb_query" format using JavaScript `Date`
|
|
52
|
-
*/
|
|
50
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "mongodb_query" format using JavaScript `Date`
|
|
51
|
+
*/
|
|
53
52
|
declare const datetimeRuleProcessorMongoDBQuery: RuleProcessor;
|
|
54
53
|
/**
|
|
55
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "natural_language" format using JavaScript `Date`
|
|
56
|
-
*/
|
|
54
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "natural_language" format using JavaScript `Date`
|
|
55
|
+
*/
|
|
57
56
|
declare const datetimeRuleProcessorNL: ValueProcessorByRule;
|
|
58
57
|
/**
|
|
59
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "cypher"/"gql" format using JavaScript `Date`
|
|
60
|
-
*/
|
|
58
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "cypher"/"gql" format using JavaScript `Date`
|
|
59
|
+
*/
|
|
61
60
|
declare const datetimeRuleProcessorCypher: RuleProcessor;
|
|
62
61
|
/**
|
|
63
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "sparql" format using JavaScript `Date`
|
|
64
|
-
*/
|
|
62
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "sparql" format using JavaScript `Date`
|
|
63
|
+
*/
|
|
65
64
|
declare const datetimeRuleProcessorSPARQL: RuleProcessor;
|
|
66
65
|
/**
|
|
67
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "parameterized"/"parameterized_named" formats
|
|
68
|
-
*/
|
|
66
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "parameterized"/"parameterized_named" formats
|
|
67
|
+
*/
|
|
69
68
|
declare const datetimeRuleProcessorParameterized: RuleProcessor;
|
|
70
69
|
/**
|
|
71
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "spel" format
|
|
72
|
-
*/
|
|
70
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "spel" format
|
|
71
|
+
*/
|
|
73
72
|
declare const datetimeRuleProcessorSpEL: RuleProcessor;
|
|
74
73
|
/**
|
|
75
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "ldap" format
|
|
76
|
-
*/
|
|
74
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "ldap" format
|
|
75
|
+
*/
|
|
77
76
|
declare const datetimeRuleProcessorLDAP: RuleProcessor;
|
|
78
77
|
/**
|
|
79
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "gremlin" format
|
|
80
|
-
*/
|
|
78
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "gremlin" format
|
|
79
|
+
*/
|
|
81
80
|
declare const datetimeRuleProcessorGremlin: RuleProcessor;
|
|
82
81
|
/**
|
|
83
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "prisma" format
|
|
84
|
-
*/
|
|
82
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "prisma" format
|
|
83
|
+
*/
|
|
85
84
|
declare const datetimeRuleProcessorPrisma: RuleProcessor;
|
|
86
85
|
/**
|
|
87
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "sequelize" format
|
|
88
|
-
*/
|
|
86
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "sequelize" format
|
|
87
|
+
*/
|
|
89
88
|
declare const datetimeRuleProcessorSequelize: RuleProcessor;
|
|
90
89
|
/**
|
|
91
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "drizzle" format
|
|
92
|
-
*/
|
|
90
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "drizzle" format
|
|
91
|
+
*/
|
|
93
92
|
declare const datetimeRuleProcessorDrizzle: RuleProcessor;
|
|
94
93
|
/**
|
|
95
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "elasticsearch" format
|
|
96
|
-
*/
|
|
94
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "elasticsearch" format
|
|
95
|
+
*/
|
|
97
96
|
declare const datetimeRuleProcessorElasticSearch: RuleProcessor;
|
|
98
97
|
/**
|
|
99
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "tanstack_db" format
|
|
100
|
-
*/
|
|
98
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "tanstack_db" format
|
|
99
|
+
*/
|
|
101
100
|
declare const datetimeRuleProcessorTanStackDB: RuleProcessor;
|
|
102
101
|
/**
|
|
103
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for (deprecated) "mongodb" format
|
|
104
|
-
*/
|
|
102
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for (deprecated) "mongodb" format
|
|
103
|
+
*/
|
|
105
104
|
declare const datetimeRuleProcessorMongoDB: RuleProcessor;
|
|
106
105
|
//#endregion
|
|
107
106
|
export { datetimeRuleProcessorCEL, datetimeRuleProcessorCypher, datetimeRuleProcessorDrizzle, datetimeRuleProcessorElasticSearch, datetimeRuleProcessorGremlin, datetimeRuleProcessorJSONata, datetimeRuleProcessorLDAP, datetimeRuleProcessorMongoDB, datetimeRuleProcessorMongoDBQuery, datetimeRuleProcessorNL, datetimeRuleProcessorParameterized, datetimeRuleProcessorPrisma, datetimeRuleProcessorSPARQL, datetimeRuleProcessorSQL, datetimeRuleProcessorSequelize, datetimeRuleProcessorSpEL, datetimeRuleProcessorTanStackDB, datetimeValueProcessorANSI, datetimeValueProcessorMSSQL, datetimeValueProcessorMySQL, datetimeValueProcessorOracle, datetimeValueProcessorPostgreSQL, jsonLogicDateTimeOperations, rqbDateTimeLibraryAPI };
|
|
@@ -1,123 +1,5 @@
|
|
|
1
|
-
import { C as getDatetimeRuleProcessorCypher,
|
|
2
|
-
|
|
3
|
-
const invalidDate = /* @__PURE__ */ new Date(NaN);
|
|
4
|
-
const dateRegExp = /^(\d{4})-(\d{2})-(\d{2})([T ](\d{2}):(\d{2}):(\d{2})(\.(\d{1,3}))?)?/;
|
|
5
|
-
const toDate = (d) => {
|
|
6
|
-
if (d instanceof Date) return d;
|
|
7
|
-
const reMatch = dateRegExp.exec(d);
|
|
8
|
-
if (!reMatch) return invalidDate;
|
|
9
|
-
const [_all, yyyy, mm, dd, _time, hh, mi, ss, _decimal, sss] = reMatch;
|
|
10
|
-
const [year, month, day, hours, minutes, seconds, ms] = [
|
|
11
|
-
yyyy,
|
|
12
|
-
mm,
|
|
13
|
-
dd,
|
|
14
|
-
hh,
|
|
15
|
-
mi,
|
|
16
|
-
ss,
|
|
17
|
-
sss ?? "0"
|
|
18
|
-
].filter(Boolean).map(Number);
|
|
19
|
-
const monthIndex = month - 1;
|
|
20
|
-
return hh ? new Date(Date.UTC(year, monthIndex, day, hours, minutes, seconds, ms)) : new Date(year, monthIndex, day);
|
|
21
|
-
};
|
|
22
|
-
const isValid = (d) => {
|
|
23
|
-
const dToDate = toDate(d);
|
|
24
|
-
return dToDate instanceof Date && !Number.isNaN(dToDate.getTime());
|
|
25
|
-
};
|
|
26
|
-
const toISOStringDateOnly = (d) => {
|
|
27
|
-
const dToDate = toDate(d);
|
|
28
|
-
return isValid(dToDate) ? dToDate.toISOString().slice(0, 10) : "";
|
|
29
|
-
};
|
|
30
|
-
const startOf = (d, unit) => {
|
|
31
|
-
const r = new Date(toDate(d).getTime());
|
|
32
|
-
r.setHours(0, 0, 0, 0);
|
|
33
|
-
switch (unit) {
|
|
34
|
-
case "week":
|
|
35
|
-
r.setDate(r.getDate() - r.getDay());
|
|
36
|
-
break;
|
|
37
|
-
case "month":
|
|
38
|
-
r.setDate(1);
|
|
39
|
-
break;
|
|
40
|
-
case "year":
|
|
41
|
-
r.setMonth(0, 1);
|
|
42
|
-
break;
|
|
43
|
-
}
|
|
44
|
-
return r;
|
|
45
|
-
};
|
|
46
|
-
const endOf = (d, unit) => {
|
|
47
|
-
const r = new Date(toDate(d).getTime());
|
|
48
|
-
r.setHours(23, 59, 59, 999);
|
|
49
|
-
switch (unit) {
|
|
50
|
-
case "week":
|
|
51
|
-
r.setDate(r.getDate() + (6 - r.getDay()));
|
|
52
|
-
break;
|
|
53
|
-
case "month":
|
|
54
|
-
r.setMonth(r.getMonth() + 1, 0);
|
|
55
|
-
break;
|
|
56
|
-
case "year":
|
|
57
|
-
r.setMonth(11, 31);
|
|
58
|
-
break;
|
|
59
|
-
}
|
|
60
|
-
return r;
|
|
61
|
-
};
|
|
62
|
-
const add = (d, amount, unit) => {
|
|
63
|
-
const r = new Date(toDate(d).getTime());
|
|
64
|
-
switch (unit) {
|
|
65
|
-
case "minute":
|
|
66
|
-
r.setMinutes(r.getMinutes() + amount);
|
|
67
|
-
break;
|
|
68
|
-
case "hour":
|
|
69
|
-
r.setHours(r.getHours() + amount);
|
|
70
|
-
break;
|
|
71
|
-
case "day":
|
|
72
|
-
r.setDate(r.getDate() + amount);
|
|
73
|
-
break;
|
|
74
|
-
case "week":
|
|
75
|
-
r.setDate(r.getDate() + amount * 7);
|
|
76
|
-
break;
|
|
77
|
-
case "month":
|
|
78
|
-
r.setMonth(r.getMonth() + amount);
|
|
79
|
-
break;
|
|
80
|
-
case "year":
|
|
81
|
-
r.setFullYear(r.getFullYear() + amount);
|
|
82
|
-
break;
|
|
83
|
-
}
|
|
84
|
-
return r;
|
|
85
|
-
};
|
|
86
|
-
/**
|
|
87
|
-
* {@link RQBDateTimeLibraryAPI} for JavaScript `Date`
|
|
88
|
-
*
|
|
89
|
-
* @deprecated This API will not be removed, but we recommend using one of the other
|
|
90
|
-
* {@link RQBDateTimeLibraryAPI}s based on a popular library instead.
|
|
91
|
-
*/
|
|
92
|
-
const rqbDateTimeLibraryAPI = {
|
|
93
|
-
format: (d) => toDate(d).toISOString(),
|
|
94
|
-
isAfter: (a, b) => {
|
|
95
|
-
const dateA = toDate(a).getTime();
|
|
96
|
-
const dateB = toDate(b).getTime();
|
|
97
|
-
return !Number.isNaN(dateA) && !Number.isNaN(dateB) && dateA > dateB;
|
|
98
|
-
},
|
|
99
|
-
isBefore: (a, b) => {
|
|
100
|
-
const dateA = toDate(a).getTime();
|
|
101
|
-
const dateB = toDate(b).getTime();
|
|
102
|
-
return !Number.isNaN(dateA) && !Number.isNaN(dateB) && dateA < dateB;
|
|
103
|
-
},
|
|
104
|
-
isSame: (a, b) => {
|
|
105
|
-
const aToDate = toDate(a);
|
|
106
|
-
const bToDate = toDate(b);
|
|
107
|
-
return isISOStringDateOnly(a) || isISOStringDateOnly(b) ? toISOStringDateOnly(a) === toISOStringDateOnly(b) : aToDate.getTime() === bToDate.getTime();
|
|
108
|
-
},
|
|
109
|
-
isValid,
|
|
110
|
-
toDate,
|
|
111
|
-
toISOString: (d) => {
|
|
112
|
-
const dToDate = toDate(d);
|
|
113
|
-
return isValid(dToDate) ? dToDate.toISOString() : "";
|
|
114
|
-
},
|
|
115
|
-
toISOStringDateOnly,
|
|
116
|
-
startOf,
|
|
117
|
-
endOf,
|
|
118
|
-
add
|
|
119
|
-
};
|
|
120
|
-
//#endregion
|
|
1
|
+
import { C as getDatetimeRuleProcessorCypher, S as getDatetimeRuleProcessorDrizzle, T as getDatetimeJsonLogicOperations, _ as getDatetimeRuleProcessorMongoDBQuery, a as getDatetimeValueProcessorMySQL, b as getDatetimeRuleProcessorGremlin, c as getDatetimeRuleProcessorSpEL, d as getDatetimeRuleProcessorPrisma, f as getDatetimeRuleProcessorParameterized, g as getDatetimeRuleProcessorMongoDB, h as getDatetimeRuleProcessorNL, i as getDatetimeValueProcessorMSSQL, l as getDatetimeRuleProcessorSPARQL, n as getDatetimeRuleProcessorSQL, o as getDatetimeValueProcessorOracle, r as getDatetimeValueProcessorANSI, s as getDatetimeValueProcessorPostgreSQL, t as getDatetimeRuleProcessorTanStackDB, u as getDatetimeRuleProcessorSequelize, v as getDatetimeRuleProcessorLDAP, w as getDatetimeRuleProcessorCEL, x as getDatetimeRuleProcessorElasticSearch, y as getDatetimeRuleProcessorJSONata } from "./getDatetimeRuleProcessorTanStackDB-DR8aYrUa.mjs";
|
|
2
|
+
import { t as rqbDateTimeLibraryAPI } from "./rqbDateTimeLibraryAPI.jsdate-WHnzblie.mjs";
|
|
121
3
|
//#region src/index.jsdate.ts
|
|
122
4
|
/**
|
|
123
5
|
* Custom JsonLogic date/time operations using JavaScript `Date`.
|