@react-querybuilder/datetime 8.8.4 → 8.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/date-fns.d.ts +1 -0
- package/dist/cjs/dayjs.d.ts +1 -0
- package/dist/cjs/getDatetimeRuleProcessorSQL-D95jgDK6.js +2 -0
- package/dist/cjs/getDatetimeRuleProcessorSQL-D95jgDK6.js.map +1 -0
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/jsdate.d.ts +1 -0
- package/dist/cjs/luxon.d.ts +1 -0
- package/dist/cjs/react-querybuilder_datetime.cjs.development.d.ts +108 -0
- package/dist/cjs/react-querybuilder_datetime.cjs.development.date-fns.d.ts +53 -0
- package/dist/cjs/react-querybuilder_datetime.cjs.development.date-fns.js +12 -11
- 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 +53 -0
- package/dist/cjs/react-querybuilder_datetime.cjs.development.dayjs.js +12 -11
- package/dist/cjs/react-querybuilder_datetime.cjs.development.dayjs.js.map +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.development.js +5 -4
- package/dist/cjs/react-querybuilder_datetime.cjs.development.js.map +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.development.jsdate.d.ts +56 -0
- package/dist/cjs/react-querybuilder_datetime.cjs.development.jsdate.js +10 -10
- package/dist/cjs/react-querybuilder_datetime.cjs.development.jsdate.js.map +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.development.luxon.d.ts +53 -0
- package/dist/cjs/react-querybuilder_datetime.cjs.development.luxon.js +12 -11
- package/dist/cjs/react-querybuilder_datetime.cjs.development.luxon.js.map +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.d.ts +108 -0
- package/dist/cjs/react-querybuilder_datetime.cjs.production.date-fns.d.ts +53 -0
- 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 +53 -0
- 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 +56 -0
- 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 +53 -0
- 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/types-QCQUGVZa.d.ts +1694 -0
- package/dist/{getDatetimeRuleProcessorSQL-CutYTD23.js → getDatetimeRuleProcessorSQL-CN80oEFK.js} +23 -29
- package/dist/getDatetimeRuleProcessorSQL-CN80oEFK.js.map +1 -0
- package/dist/{getDatetimeRuleProcessorSQL-CocyaiI5.mjs → getDatetimeRuleProcessorSQL-KYRPP9qd.mjs} +17 -23
- package/dist/getDatetimeRuleProcessorSQL-KYRPP9qd.mjs.map +1 -0
- package/dist/react-querybuilder_datetime.d.mts +108 -0
- package/dist/react-querybuilder_datetime.date-fns.d.mts +53 -0
- package/dist/react-querybuilder_datetime.date-fns.mjs +10 -10
- package/dist/react-querybuilder_datetime.date-fns.mjs.map +1 -1
- package/dist/react-querybuilder_datetime.dayjs.d.mts +53 -0
- package/dist/react-querybuilder_datetime.dayjs.mjs +10 -10
- package/dist/react-querybuilder_datetime.dayjs.mjs.map +1 -1
- package/dist/react-querybuilder_datetime.jsdate.d.mts +56 -0
- package/dist/react-querybuilder_datetime.jsdate.mjs +10 -10
- package/dist/react-querybuilder_datetime.jsdate.mjs.map +1 -1
- package/dist/react-querybuilder_datetime.legacy-esm.d.ts +108 -0
- package/dist/react-querybuilder_datetime.legacy-esm.date-fns.d.ts +53 -0
- package/dist/react-querybuilder_datetime.legacy-esm.date-fns.js +10 -10
- package/dist/react-querybuilder_datetime.legacy-esm.date-fns.js.map +1 -1
- package/dist/react-querybuilder_datetime.legacy-esm.dayjs.d.ts +53 -0
- package/dist/react-querybuilder_datetime.legacy-esm.dayjs.js +10 -10
- package/dist/react-querybuilder_datetime.legacy-esm.dayjs.js.map +1 -1
- package/dist/react-querybuilder_datetime.legacy-esm.js +4 -4
- package/dist/react-querybuilder_datetime.legacy-esm.js.map +1 -1
- package/dist/react-querybuilder_datetime.legacy-esm.jsdate.d.ts +56 -0
- package/dist/react-querybuilder_datetime.legacy-esm.jsdate.js +11 -11
- package/dist/react-querybuilder_datetime.legacy-esm.jsdate.js.map +1 -1
- package/dist/react-querybuilder_datetime.legacy-esm.luxon.d.ts +53 -0
- package/dist/react-querybuilder_datetime.legacy-esm.luxon.js +10 -10
- package/dist/react-querybuilder_datetime.legacy-esm.luxon.js.map +1 -1
- package/dist/react-querybuilder_datetime.luxon.d.mts +53 -0
- package/dist/react-querybuilder_datetime.luxon.mjs +10 -10
- package/dist/react-querybuilder_datetime.luxon.mjs.map +1 -1
- package/dist/react-querybuilder_datetime.mjs +3 -3
- package/dist/react-querybuilder_datetime.mjs.map +1 -1
- package/dist/react-querybuilder_datetime.production.d.mts +108 -0
- package/dist/react-querybuilder_datetime.production.date-fns.d.mts +53 -0
- 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 +53 -0
- 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 +56 -0
- 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 +53 -0
- 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/types-CDEkL2M_.d.mts +1694 -0
- package/dist/types-EgfSemtR.d.ts +1694 -0
- package/package.json +23 -23
- package/dist/cjs/getDatetimeRuleProcessorSQL-npwUe9aM.js +0 -2
- package/dist/cjs/getDatetimeRuleProcessorSQL-npwUe9aM.js.map +0 -1
- package/dist/getDatetimeRuleProcessorSQL-CocyaiI5.mjs.map +0 -1
- package/dist/getDatetimeRuleProcessorSQL-CutYTD23.js.map +0 -1
- package/dist/types/QueryBuilderDateTime.d.ts +0 -4
- package/dist/types/datetimeRuleProcessorJsonLogic.d.ts +0 -10
- package/dist/types/getDatetimeJsonLogicOperations.d.ts +0 -6
- package/dist/types/getDatetimeRuleProcessorCEL.d.ts +0 -7
- package/dist/types/getDatetimeRuleProcessorJSONata.d.ts +0 -7
- package/dist/types/getDatetimeRuleProcessorMongoDBQuery.d.ts +0 -7
- package/dist/types/getDatetimeRuleProcessorNL.d.ts +0 -13
- package/dist/types/getDatetimeRuleProcessorSQL.d.ts +0 -32
- package/dist/types/index.d.ts +0 -8
- package/dist/types/index.date-fns.d.ts +0 -48
- package/dist/types/index.dayjs.d.ts +0 -48
- package/dist/types/index.jsdate.d.ts +0 -48
- package/dist/types/index.luxon.d.ts +0 -48
- package/dist/types/rqbDateTimeLibraryAPI.date-fns.d.ts +0 -5
- package/dist/types/rqbDateTimeLibraryAPI.dayjs.d.ts +0 -5
- package/dist/types/rqbDateTimeLibraryAPI.jsdate.d.ts +0 -8
- package/dist/types/rqbDateTimeLibraryAPI.luxon.d.ts +0 -5
- package/dist/types/types.d.ts +0 -111
- package/dist/types/utils.d.ts +0 -5
- package/dist/types-esm/QueryBuilderDateTime.d.mts +0 -4
- package/dist/types-esm/datetimeRuleProcessorJsonLogic.d.mts +0 -10
- package/dist/types-esm/getDatetimeJsonLogicOperations.d.mts +0 -6
- package/dist/types-esm/getDatetimeRuleProcessorCEL.d.mts +0 -7
- package/dist/types-esm/getDatetimeRuleProcessorJSONata.d.mts +0 -7
- package/dist/types-esm/getDatetimeRuleProcessorMongoDBQuery.d.mts +0 -7
- package/dist/types-esm/getDatetimeRuleProcessorNL.d.mts +0 -13
- package/dist/types-esm/getDatetimeRuleProcessorSQL.d.mts +0 -32
- package/dist/types-esm/index.d.mts +0 -8
- package/dist/types-esm/index.date-fns.d.mts +0 -48
- package/dist/types-esm/index.dayjs.d.mts +0 -48
- package/dist/types-esm/index.jsdate.d.mts +0 -48
- package/dist/types-esm/index.luxon.d.mts +0 -48
- package/dist/types-esm/rqbDateTimeLibraryAPI.date-fns.d.mts +0 -5
- package/dist/types-esm/rqbDateTimeLibraryAPI.dayjs.d.mts +0 -5
- package/dist/types-esm/rqbDateTimeLibraryAPI.jsdate.d.mts +0 -8
- package/dist/types-esm/rqbDateTimeLibraryAPI.luxon.d.mts +0 -5
- package/dist/types-esm/types.d.mts +0 -111
- package/dist/types-esm/utils.d.mts +0 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-querybuilder_datetime.cjs.production.dayjs.js","names":["rqbDateTimeLibraryAPI: RQBDateTimeLibraryAPI","isISOStringDateOnly","jsonLogicDateTimeOperations: RQBJsonLogicDateTimeOperations","getDatetimeJsonLogicOperations","datetimeRuleProcessorSQL: RuleProcessor","getDatetimeRuleProcessorSQL","datetimeValueProcessorANSI: ValueProcessorByRule","getDatetimeValueProcessorANSI","datetimeValueProcessorMSSQL: ValueProcessorByRule","getDatetimeValueProcessorMSSQL","datetimeValueProcessorMySQL: ValueProcessorByRule","getDatetimeValueProcessorMySQL","datetimeValueProcessorOracle: ValueProcessorByRule","getDatetimeValueProcessorOracle","datetimeValueProcessorPostgreSQL: ValueProcessorByRule","getDatetimeValueProcessorPostgreSQL","datetimeRuleProcessorCEL: ValueProcessorByRule","getDatetimeRuleProcessorCEL","datetimeRuleProcessorMongoDBQuery: ValueProcessorByRule","getDatetimeRuleProcessorMongoDBQuery","datetimeRuleProcessorNL: ValueProcessorByRule","getDatetimeRuleProcessorNL"],"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};\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';\nimport { getDatetimeJsonLogicOperations } from './getDatetimeJsonLogicOperations';\nimport { getDatetimeRuleProcessorCEL } from './getDatetimeRuleProcessorCEL';\nimport { getDatetimeRuleProcessorMongoDBQuery } from './getDatetimeRuleProcessorMongoDBQuery';\nimport { getDatetimeRuleProcessorNL } from './getDatetimeRuleProcessorNL';\nimport {\n getDatetimeRuleProcessorSQL,\n getDatetimeValueProcessorANSI,\n getDatetimeValueProcessorMSSQL,\n getDatetimeValueProcessorMySQL,\n getDatetimeValueProcessorOracle,\n getDatetimeValueProcessorPostgreSQL,\n} from './getDatetimeRuleProcessorSQL';\nimport { rqbDateTimeLibraryAPI } from './rqbDateTimeLibraryAPI.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!
|
|
1
|
+
{"version":3,"file":"react-querybuilder_datetime.cjs.production.dayjs.js","names":["rqbDateTimeLibraryAPI: RQBDateTimeLibraryAPI","isISOStringDateOnly","jsonLogicDateTimeOperations: RQBJsonLogicDateTimeOperations","getDatetimeJsonLogicOperations","datetimeRuleProcessorSQL: RuleProcessor","getDatetimeRuleProcessorSQL","datetimeValueProcessorANSI: ValueProcessorByRule","getDatetimeValueProcessorANSI","datetimeValueProcessorMSSQL: ValueProcessorByRule","getDatetimeValueProcessorMSSQL","datetimeValueProcessorMySQL: ValueProcessorByRule","getDatetimeValueProcessorMySQL","datetimeValueProcessorOracle: ValueProcessorByRule","getDatetimeValueProcessorOracle","datetimeValueProcessorPostgreSQL: ValueProcessorByRule","getDatetimeValueProcessorPostgreSQL","datetimeRuleProcessorCEL: ValueProcessorByRule","getDatetimeRuleProcessorCEL","datetimeRuleProcessorMongoDBQuery: ValueProcessorByRule","getDatetimeRuleProcessorMongoDBQuery","datetimeRuleProcessorNL: ValueProcessorByRule","getDatetimeRuleProcessorNL"],"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};\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';\nimport { getDatetimeJsonLogicOperations } from './getDatetimeJsonLogicOperations';\nimport { getDatetimeRuleProcessorCEL } from './getDatetimeRuleProcessorCEL';\nimport { getDatetimeRuleProcessorMongoDBQuery } from './getDatetimeRuleProcessorMongoDBQuery';\nimport { getDatetimeRuleProcessorNL } from './getDatetimeRuleProcessorNL';\nimport {\n getDatetimeRuleProcessorSQL,\n getDatetimeValueProcessorANSI,\n getDatetimeValueProcessorMSSQL,\n getDatetimeValueProcessorMySQL,\n getDatetimeValueProcessorOracle,\n getDatetimeValueProcessorPostgreSQL,\n} from './getDatetimeRuleProcessorSQL';\nimport { rqbDateTimeLibraryAPI } from './rqbDateTimeLibraryAPI.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 \"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\nexport * from './rqbDateTimeLibraryAPI.dayjs';\n"],"mappings":"mGAOA,MAAaA,EAA+C,CAC1D,QAAS,EAAG,KAAA,EAAA,EAAA,SAAc,EAAE,CAAC,OAAO,EAAI,CACxC,SAAU,EAAG,KAAA,EAAA,EAAA,SAAY,EAAE,CAAC,QAAQ,EAAE,CACtC,UAAW,EAAG,KAAA,EAAA,EAAA,SAAY,EAAE,CAAC,SAAS,EAAE,CACxC,QAAS,EAAG,KAAA,EAAA,EAAA,SACJ,EAAE,CAAC,OAAO,EAAGC,EAAAA,oBAAoB,EAAE,EAAIA,EAAAA,oBAAoB,EAAE,CAAG,IAAM,KAAK,CACnF,QAAS,IAAA,EAAA,EAAA,SAAW,EAAE,CAAC,SAAS,CAChC,OAAQ,IAAA,EAAA,EAAA,SAAW,EAAE,CAAC,QAAQ,CAC9B,YAAa,GAAK,CAChB,IAAM,GAAA,EAAA,EAAA,SAAgB,EAAE,CACxB,OAAO,EAAQ,SAAS,CAAG,EAAQ,aAAa,CAAG,IAErD,oBAAqB,GAAK,CACxB,IAAM,GAAA,EAAA,EAAA,SAAgB,EAAE,CACxB,OAAO,EAAQ,SAAS,CAAG,EAAQ,OAAO,aAAa,CAAG,IAE7D,CCEYC,EACXC,EAAAA,+BAA+B,EAAsB,CAK1CC,EACXC,EAAAA,4BAA4B,EAAsB,CAIvCC,EACXC,EAAAA,8BAA8B,EAAsB,CAIzCC,EACXC,EAAAA,+BAA+B,EAAsB,CAI1CC,EACXC,EAAAA,+BAA+B,EAAsB,CAI1CC,EACXC,EAAAA,gCAAgC,EAAsB,CAI3CC,EACXC,EAAAA,oCAAoC,EAAsB,CAK/CC,EACXC,EAAAA,4BAA4B,EAAsB,CAKvCC,EACXC,EAAAA,qCAAqC,EAAsB,CAKhDC,EACXC,EAAAA,2BAA2B,EAAsB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require(`./getDatetimeRuleProcessorSQL-
|
|
1
|
+
const e=require(`./getDatetimeRuleProcessorSQL-D95jgDK6.js`);let t=require(`react-querybuilder`);t=e.__toESM(t);const n={"!=":`dateNotOn`,"<":`dateBefore`,"<=":`dateOnOrBefore`,"=":`dateOn`,">":`dateAfter`,">=":`dateOnOrAfter`,between:`dateBetween`,in:`dateIn`,notBetween:`dateNotBetween`,notIn:`dateNotIn`},r=(r,i)=>{let a=i??{};if(!e.processIsDateField(a.context?.isDateField,r,a))return(0,t.defaultRuleProcessorJsonLogic)(r,a);let{field:o,operator:s,value:c,valueSource:l}=r,u=l===`field`,d={var:o},f=e=>u?{var:`${e}`}:e;switch(s){case`<`:case`<=`:case`=`:case`!=`:case`>`:case`>=`:return{[n[s]]:[d,f(c)]};case`in`:case`notIn`:{let e=(0,t.toArray)(c).map(e=>f(e));return{[n[s]]:[d,e]}}case`between`:case`notBetween`:{let e=(0,t.toArray)(c).map(e=>f(e));return e.length<2?!1:{[n[s]]:[e[0],d,e[1]]}}}return(0,t.defaultRuleProcessorJsonLogic)(r,i)},i=e=>/^(does)?not/i.test(e),a=(e,t)=>t?`$not(${e})`:`${e}`,o=n=>(r,o)=>{let s=o??{},{context:c={}}=s,{quoteFieldNamesWith:l=[``,``],fieldIdentifierSeparator:u=``}=s,{field:d,operator:f,value:p,valueSource:m}=r;if(!e.processIsDateField(c.isDateField,r,s))return(0,t.defaultRuleProcessorJSONata)(r,s);let h=m===`field`,g=e=>`$toMillis(${(0,t.getQuotedFieldName)(e,{quoteFieldNamesWith:l,fieldIdentifierSeparator:u})})`,_=e=>`$toMillis("${n.toISOString(e)}")`;switch(f){case`<`:case`<=`:case`=`:case`!=`:case`>`:case`>=`:return`${g(d)} ${f} ${h?g(p):_(p)}`}let v=(0,t.toArray)(r.value,{retainEmptyStrings:!1}),y=v.map(e=>n.toDate(e)).filter(e=>n.isValid(e));switch(f){case`in`:case`notIn`:return h?v.length===0?``:a(`${g(d)} in [${v.map(e=>g(e)).join(`, `)}]`,i(f)):y.length===0?``:a(`${g(d)} in [${y.map(e=>_(e)).join(`, `)}]`,i(f));case`between`:case`notBetween`:{if(v.length<2||(0,t.nullOrUndefinedOrEmpty)(v[0])||(0,t.nullOrUndefinedOrEmpty)(v[1])||!h&&y.length<2)return``;if(h){let[e,t]=v,n=`${g(d)} >= ${g(e)} and ${g(d)} <= ${g(t)}`;return f===`between`?`(${n})`:a(n,!0)}let[e,r]=y,[i,o]=n.isBefore(e,r)?[e,r]:[r,e],s=`${g(d)} >= ${_(i)} and ${g(d)} <= ${_(o)}`;return f===`between`?`(${s})`:a(s,!0)}}return(0,t.defaultRuleProcessorJSONata)(r,s)};exports.datetimeRuleProcessorJsonLogic=r,exports.datetimeValueProcessorNL=e.datetimeValueProcessorNL,exports.defaultDateTimeNLOperatorMap=e.defaultDateTimeNLOperatorMap,exports.getDatetimeJsonLogicOperations=e.getDatetimeJsonLogicOperations,exports.getDatetimeRuleProcessorCEL=e.getDatetimeRuleProcessorCEL,exports.getDatetimeRuleProcessorJSONata=o,exports.getDatetimeRuleProcessorMongoDBQuery=e.getDatetimeRuleProcessorMongoDBQuery,exports.getDatetimeRuleProcessorNL=e.getDatetimeRuleProcessorNL,exports.getDatetimeRuleProcessorSQL=e.getDatetimeRuleProcessorSQL,exports.getDatetimeValueProcessorANSI=e.getDatetimeValueProcessorANSI,exports.getDatetimeValueProcessorMSSQL=e.getDatetimeValueProcessorMSSQL,exports.getDatetimeValueProcessorMySQL=e.getDatetimeValueProcessorMySQL,exports.getDatetimeValueProcessorOracle=e.getDatetimeValueProcessorOracle,exports.getDatetimeValueProcessorPostgreSQL=e.getDatetimeValueProcessorPostgreSQL;
|
|
2
2
|
//# sourceMappingURL=react-querybuilder_datetime.cjs.production.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-querybuilder_datetime.cjs.production.js","names":["datetimeRuleProcessorJsonLogic: RuleProcessor","processIsDateField","fieldObject: JsonLogicVar","negate","processIsDateField","valueAsArray: string[]","expression"],"sources":["../../src/datetimeRuleProcessorJsonLogic.ts","../../src/getDatetimeRuleProcessorJSONata.ts"],"sourcesContent":["import type { DefaultOperatorName, JsonLogicVar, RuleProcessor } from 'react-querybuilder';\nimport { defaultRuleProcessorJsonLogic, toArray } from 'react-querybuilder';\nimport type { RQBDateTimeJsonLogic } from './types';\nimport { processIsDateField } 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!
|
|
1
|
+
{"version":3,"file":"react-querybuilder_datetime.cjs.production.js","names":["datetimeRuleProcessorJsonLogic: RuleProcessor","processIsDateField","fieldObject: JsonLogicVar","negate","processIsDateField","valueAsArray: string[]","expression"],"sources":["../../src/datetimeRuleProcessorJsonLogic.ts","../../src/getDatetimeRuleProcessorJSONata.ts"],"sourcesContent":["import type { DefaultOperatorName, JsonLogicVar, RuleProcessor } from 'react-querybuilder';\nimport { defaultRuleProcessorJsonLogic, toArray } from 'react-querybuilder';\nimport type { RQBDateTimeJsonLogic } from './types';\nimport { processIsDateField } 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 ?? /* istanbul ignore next */ {};\n\n if (!processIsDateField(opts.context?.isDateField, rule, opts)) {\n return defaultRuleProcessorJsonLogic(rule, opts);\n }\n\n const { field, operator, value, valueSource } = rule;\n const valueIsField = valueSource === 'field';\n const fieldObject: JsonLogicVar = { var: field };\n const maybeFieldRenderer = (v: string) => (valueIsField ? { var: `${v}` } : v);\n\n switch (operator) {\n case '<':\n case '<=':\n case '=':\n case '!=':\n case '>':\n case '>=':\n return {\n [dateOperationMap[operator]]: [fieldObject, maybeFieldRenderer(value)],\n } as RQBDateTimeJsonLogic;\n\n case 'in':\n case 'notIn': {\n const valueAsArray = toArray(value).map(v => maybeFieldRenderer(v));\n return { [dateOperationMap[operator]]: [fieldObject, valueAsArray] } as RQBDateTimeJsonLogic;\n }\n\n case 'between':\n case 'notBetween': {\n const valueAsArray = toArray(value).map(v => maybeFieldRenderer(v));\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 { RuleProcessor } from 'react-querybuilder';\nimport {\n defaultRuleProcessorJSONata,\n getQuotedFieldName,\n nullOrUndefinedOrEmpty,\n toArray,\n} from 'react-querybuilder';\nimport type { RQBDateTimeLibraryAPI } from './types';\nimport { processIsDateField } from './utils';\n\nconst shouldNegate = (op: string) => /^(does)?not/i.test(op);\n\nconst negate = (clause: string, negate: boolean) => (negate ? `$not(${clause})` : `${clause}`);\n\n/**\n * Generates a rule processor with date/time features for use by\n * {@link @react-querybuilder/core!formatQuery formatQuery} with the \"jsonata\" format.\n */\nexport const getDatetimeRuleProcessorJSONata =\n (apiFns: RQBDateTimeLibraryAPI): RuleProcessor =>\n (rule, options) => {\n const opts = options ?? /* istanbul ignore next */ {};\n const { context = {} } = opts;\n\n // istanbul ignore next\n const { quoteFieldNamesWith = ['', ''] as [string, string], fieldIdentifierSeparator = '' } =\n opts;\n const { field, operator, value, valueSource } = rule;\n\n if (!processIsDateField(context.isDateField, rule, opts)) {\n return defaultRuleProcessorJSONata(rule, opts);\n }\n\n const valueIsField = valueSource === 'field';\n\n const fldToMs = (f: string) =>\n `$toMillis(${getQuotedFieldName(f, { quoteFieldNamesWith, fieldIdentifierSeparator })})`;\n const valToMs = (v: string | Date) => `$toMillis(\"${apiFns.toISOString(v)}\")`;\n\n switch (operator) {\n case '<':\n case '<=':\n case '=':\n case '!=':\n case '>':\n case '>=':\n return `${fldToMs(field)} ${operator} ${valueIsField ? fldToMs(value) : valToMs(value)}`;\n }\n\n const valueAsArray: string[] = toArray(rule.value, { retainEmptyStrings: false });\n const valueAsDateArray = valueAsArray\n .map(v => apiFns.toDate(v))\n .filter(dateVal => apiFns.isValid(dateVal));\n\n switch (operator) {\n case 'in':\n case 'notIn': {\n if (valueIsField) {\n if (valueAsArray.length === 0) return '';\n return negate(\n `${fldToMs(field)} in [${valueAsArray.map(val => fldToMs(val)).join(', ')}]`,\n shouldNegate(operator)\n );\n }\n if (valueAsDateArray.length === 0) return '';\n return negate(\n `${fldToMs(field)} in [${valueAsDateArray.map(val => valToMs(val)).join(', ')}]`,\n shouldNegate(operator)\n );\n }\n\n case 'between':\n case 'notBetween': {\n if (\n valueAsArray.length < 2 ||\n nullOrUndefinedOrEmpty(valueAsArray[0]) ||\n nullOrUndefinedOrEmpty(valueAsArray[1]) ||\n (!valueIsField && valueAsDateArray.length < 2)\n ) {\n return '';\n }\n\n if (valueIsField) {\n const [firstValue, secondValue] = valueAsArray;\n const expression = `${fldToMs(field)} >= ${fldToMs(firstValue)} and ${fldToMs(field)} <= ${fldToMs(secondValue)}`;\n return operator === 'between' ? `(${expression})` : negate(expression, true);\n }\n\n const [first, second] = valueAsDateArray;\n const [firstDate, secondDate] = apiFns.isBefore(first, second)\n ? [first, second]\n : [second, first];\n const expression = `${fldToMs(field)} >= ${valToMs(firstDate)} and ${fldToMs(field)} <= ${valToMs(secondDate)}`;\n return operator === 'between' ? `(${expression})` : negate(expression, true);\n }\n }\n\n return defaultRuleProcessorJSONata(rule, opts);\n };\n"],"mappings":"gHAKA,MAAM,EAAmB,CACvB,KAAM,YACN,IAAK,aACL,KAAM,iBACN,IAAK,SACL,IAAK,YACL,KAAM,gBACN,QAAS,cACT,GAAI,SACJ,WAAY,iBACZ,MAAO,YACR,CAUYA,GACX,EACA,IACyB,CACzB,IAAM,EAAO,GAAsC,EAAE,CAErD,GAAI,CAACI,EAAAA,mBAAmB,EAAK,SAAS,YAAa,EAAM,EAAK,CAC5D,OAAA,EAAA,EAAA,+BAAqC,EAAM,EAAK,CAGlD,GAAM,CAAE,QAAO,WAAU,QAAO,eAAgB,EAC1C,EAAe,IAAgB,QAC/BF,EAA4B,CAAE,IAAK,EAAO,CAC1C,EAAsB,GAAe,EAAe,CAAE,IAAK,GAAG,IAAK,CAAG,EAE5E,OAAQ,EAAR,CACE,IAAK,IACL,IAAK,KACL,IAAK,IACL,IAAK,KACL,IAAK,IACL,IAAK,KACH,MAAO,EACJ,EAAiB,IAAY,CAAC,EAAa,EAAmB,EAAM,CAAC,CACvE,CAEH,IAAK,KACL,IAAK,QAAS,CACZ,IAAM,GAAA,EAAA,EAAA,SAAuB,EAAM,CAAC,IAAI,GAAK,EAAmB,EAAE,CAAC,CACnE,MAAO,EAAG,EAAiB,IAAY,CAAC,EAAa,EAAa,CAAE,CAGtE,IAAK,UACL,IAAK,aAAc,CACjB,IAAM,GAAA,EAAA,EAAA,SAAuB,EAAM,CAAC,IAAI,GAAK,EAAmB,EAAE,CAAC,CAInE,OAFI,EAAa,OAAS,EAAU,GAE7B,EACJ,EAAiB,IAAY,CAAC,EAAa,GAAI,EAAa,EAAa,GAAG,CAC9E,EAIL,OAAA,EAAA,EAAA,+BAAqC,EAAM,EAAQ,EC5D/C,EAAgB,GAAe,eAAe,KAAK,EAAG,CAEtD,GAAU,EAAgB,IAAqBC,EAAS,QAAQ,EAAO,GAAK,GAAG,IAMxE,EACV,IACA,EAAM,IAAY,CACjB,IAAM,EAAO,GAAsC,EAAE,CAC/C,CAAE,UAAU,EAAE,EAAK,EAGnB,CAAE,sBAAsB,CAAC,GAAI,GAAG,CAAsB,2BAA2B,IACrF,EACI,CAAE,QAAO,WAAU,QAAO,eAAgB,EAEhD,GAAI,CAACC,EAAAA,mBAAmB,EAAQ,YAAa,EAAM,EAAK,CACtD,OAAA,EAAA,EAAA,6BAAmC,EAAM,EAAK,CAGhD,IAAM,EAAe,IAAgB,QAE/B,EAAW,GACf,cAAA,EAAA,EAAA,oBAAgC,EAAG,CAAE,sBAAqB,2BAA0B,CAAC,CAAC,GAClF,EAAW,GAAqB,cAAc,EAAO,YAAY,EAAE,CAAC,IAE1E,OAAQ,EAAR,CACE,IAAK,IACL,IAAK,KACL,IAAK,IACL,IAAK,KACL,IAAK,IACL,IAAK,KACH,MAAO,GAAG,EAAQ,EAAM,CAAC,GAAG,EAAS,GAAG,EAAe,EAAQ,EAAM,CAAG,EAAQ,EAAM,GAG1F,IAAMC,GAAAA,EAAAA,EAAAA,SAAiC,EAAK,MAAO,CAAE,mBAAoB,GAAO,CAAC,CAC3E,EAAmB,EACtB,IAAI,GAAK,EAAO,OAAO,EAAE,CAAC,CAC1B,OAAO,GAAW,EAAO,QAAQ,EAAQ,CAAC,CAE7C,OAAQ,EAAR,CACE,IAAK,KACL,IAAK,QASH,OARI,EACE,EAAa,SAAW,EAAU,GAC/B,EACL,GAAG,EAAQ,EAAM,CAAC,OAAO,EAAa,IAAI,GAAO,EAAQ,EAAI,CAAC,CAAC,KAAK,KAAK,CAAC,GAC1E,EAAa,EAAS,CACvB,CAEC,EAAiB,SAAW,EAAU,GACnC,EACL,GAAG,EAAQ,EAAM,CAAC,OAAO,EAAiB,IAAI,GAAO,EAAQ,EAAI,CAAC,CAAC,KAAK,KAAK,CAAC,GAC9E,EAAa,EAAS,CACvB,CAGH,IAAK,UACL,IAAK,aAAc,CACjB,GACE,EAAa,OAAS,IAAA,EAAA,EAAA,wBACC,EAAa,GAAG,GAAA,EAAA,EAAA,wBAChB,EAAa,GAAG,EACtC,CAAC,GAAgB,EAAiB,OAAS,EAE5C,MAAO,GAGT,GAAI,EAAc,CAChB,GAAM,CAAC,EAAY,GAAe,EAC5BC,EAAa,GAAG,EAAQ,EAAM,CAAC,MAAM,EAAQ,EAAW,CAAC,OAAO,EAAQ,EAAM,CAAC,MAAM,EAAQ,EAAY,GAC/G,OAAO,IAAa,UAAY,IAAIA,EAAW,GAAK,EAAOA,EAAY,GAAK,CAG9E,GAAM,CAAC,EAAO,GAAU,EAClB,CAAC,EAAW,GAAc,EAAO,SAAS,EAAO,EAAO,CAC1D,CAAC,EAAO,EAAO,CACf,CAAC,EAAQ,EAAM,CACb,EAAa,GAAG,EAAQ,EAAM,CAAC,MAAM,EAAQ,EAAU,CAAC,OAAO,EAAQ,EAAM,CAAC,MAAM,EAAQ,EAAW,GAC7G,OAAO,IAAa,UAAY,IAAI,EAAW,GAAK,EAAO,EAAY,GAAK,EAIhF,OAAA,EAAA,EAAA,6BAAmC,EAAM,EAAK"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { RQBDateTimeLibraryAPI, RQBJsonLogicDateTimeOperations, RuleProcessor, ValueProcessorByRule } from "./types-QCQUGVZa.js";
|
|
2
|
+
|
|
3
|
+
//#region src/rqbDateTimeLibraryAPI.jsdate.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* {@link RQBDateTimeLibraryAPI} for JavaScript `Date`
|
|
7
|
+
*
|
|
8
|
+
* @deprecated This API will not be removed, but we recommend using one of the other
|
|
9
|
+
* {@link RQBDateTimeLibraryAPI}s based on a popular library instead.
|
|
10
|
+
*/
|
|
11
|
+
declare const rqbDateTimeLibraryAPI: RQBDateTimeLibraryAPI;
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/index.jsdate.d.ts
|
|
14
|
+
/**
|
|
15
|
+
* Custom JsonLogic date/time operations using JavaScript `Date`.
|
|
16
|
+
*/
|
|
17
|
+
declare const jsonLogicDateTimeOperations: RQBJsonLogicDateTimeOperations;
|
|
18
|
+
/**
|
|
19
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "sql" format using JavaScript `Date`
|
|
20
|
+
*/
|
|
21
|
+
declare const datetimeRuleProcessorSQL: RuleProcessor;
|
|
22
|
+
/**
|
|
23
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("ansi" preset) using JavaScript `Date`
|
|
24
|
+
*/
|
|
25
|
+
declare const datetimeValueProcessorANSI: ValueProcessorByRule;
|
|
26
|
+
/**
|
|
27
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("mssql" preset) using JavaScript `Date`
|
|
28
|
+
*/
|
|
29
|
+
declare const datetimeValueProcessorMSSQL: ValueProcessorByRule;
|
|
30
|
+
/**
|
|
31
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("mysql" preset) using JavaScript `Date`
|
|
32
|
+
*/
|
|
33
|
+
declare const datetimeValueProcessorMySQL: ValueProcessorByRule;
|
|
34
|
+
/**
|
|
35
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("oracle" preset) using JavaScript `Date`
|
|
36
|
+
*/
|
|
37
|
+
declare const datetimeValueProcessorOracle: ValueProcessorByRule;
|
|
38
|
+
/**
|
|
39
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("postgresql" preset) using JavaScript `Date`
|
|
40
|
+
*/
|
|
41
|
+
declare const datetimeValueProcessorPostgreSQL: ValueProcessorByRule;
|
|
42
|
+
/**
|
|
43
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "cel" format using JavaScript `Date`
|
|
44
|
+
*/
|
|
45
|
+
declare const datetimeRuleProcessorCEL: RuleProcessor;
|
|
46
|
+
/**
|
|
47
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "mongodb_query" format using JavaScript `Date`
|
|
48
|
+
*/
|
|
49
|
+
declare const datetimeRuleProcessorMongoDBQuery: RuleProcessor;
|
|
50
|
+
/**
|
|
51
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "natural_language" format using JavaScript `Date`
|
|
52
|
+
*/
|
|
53
|
+
declare const datetimeRuleProcessorNL: ValueProcessorByRule;
|
|
54
|
+
//#endregion
|
|
55
|
+
export { datetimeRuleProcessorCEL, datetimeRuleProcessorMongoDBQuery, datetimeRuleProcessorNL, datetimeRuleProcessorSQL, datetimeValueProcessorANSI, datetimeValueProcessorMSSQL, datetimeValueProcessorMySQL, datetimeValueProcessorOracle, datetimeValueProcessorPostgreSQL, jsonLogicDateTimeOperations, rqbDateTimeLibraryAPI };
|
|
56
|
+
//# sourceMappingURL=react-querybuilder_datetime.cjs.production.jsdate.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require(`./getDatetimeRuleProcessorSQL-
|
|
1
|
+
const e=require(`./getDatetimeRuleProcessorSQL-D95jgDK6.js`),t=new Date(NaN),n=/^(\d{4})-(\d{2})-(\d{2})([T ](\d{2}):(\d{2}):(\d{2})(\.(\d{1,3}))?)?/,r=e=>{if(e instanceof Date)return e;let r=n.exec(e);if(!r)return t;let[i,a,o,s,c,l,u,d,f,p]=r,[m,h,g,_,v,y,b]=[a,o,s,l,u,d,p??`0`].filter(Boolean).map(Number),x=h-1;return l?new Date(Date.UTC(m,x,g,_,v,y,b)):new Date(m,x,g)},i=e=>{let t=r(e);return t instanceof Date&&!Number.isNaN(t.getTime())},a=e=>{let t=r(e);return i(t)?t.toISOString().slice(0,10):``},o={format:e=>r(e).toISOString(),isAfter:(e,t)=>{let n=r(e).getTime(),i=r(t).getTime();return!Number.isNaN(n)&&!Number.isNaN(i)&&n>i},isBefore:(e,t)=>{let n=r(e).getTime(),i=r(t).getTime();return!Number.isNaN(n)&&!Number.isNaN(i)&&n<i},isSame:(t,n)=>{let i=r(t),o=r(n);return e.isISOStringDateOnly(t)||e.isISOStringDateOnly(n)?a(t)===a(n):i.getTime()===o.getTime()},isValid:i,toDate:r,toISOString:e=>{let t=r(e);return i(t)?t.toISOString():``},toISOStringDateOnly:a},s=e.getDatetimeJsonLogicOperations(o),c=e.getDatetimeRuleProcessorSQL(o),l=e.getDatetimeValueProcessorANSI(o),u=e.getDatetimeValueProcessorMSSQL(o),d=e.getDatetimeValueProcessorMySQL(o),f=e.getDatetimeValueProcessorOracle(o),p=e.getDatetimeValueProcessorPostgreSQL(o),m=e.getDatetimeRuleProcessorCEL(o),h=e.getDatetimeRuleProcessorMongoDBQuery(o),g=e.getDatetimeRuleProcessorNL(o);exports.datetimeRuleProcessorCEL=m,exports.datetimeRuleProcessorMongoDBQuery=h,exports.datetimeRuleProcessorNL=g,exports.datetimeRuleProcessorSQL=c,exports.datetimeValueProcessorANSI=l,exports.datetimeValueProcessorMSSQL=u,exports.datetimeValueProcessorMySQL=d,exports.datetimeValueProcessorOracle=f,exports.datetimeValueProcessorPostgreSQL=p,exports.jsonLogicDateTimeOperations=s,exports.rqbDateTimeLibraryAPI=o;
|
|
2
2
|
//# sourceMappingURL=react-querybuilder_datetime.cjs.production.jsdate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-querybuilder_datetime.cjs.production.jsdate.js","names":["rqbDateTimeLibraryAPI: RQBDateTimeLibraryAPI","isISOStringDateOnly","jsonLogicDateTimeOperations: RQBJsonLogicDateTimeOperations","getDatetimeJsonLogicOperations","datetimeRuleProcessorSQL: RuleProcessor","getDatetimeRuleProcessorSQL","datetimeValueProcessorANSI: ValueProcessorByRule","getDatetimeValueProcessorANSI","datetimeValueProcessorMSSQL: ValueProcessorByRule","getDatetimeValueProcessorMSSQL","datetimeValueProcessorMySQL: ValueProcessorByRule","getDatetimeValueProcessorMySQL","datetimeValueProcessorOracle: ValueProcessorByRule","getDatetimeValueProcessorOracle","datetimeValueProcessorPostgreSQL: ValueProcessorByRule","getDatetimeValueProcessorPostgreSQL","datetimeRuleProcessorCEL: RuleProcessor","getDatetimeRuleProcessorCEL","datetimeRuleProcessorMongoDBQuery: RuleProcessor","getDatetimeRuleProcessorMongoDBQuery","datetimeRuleProcessorNL: ValueProcessorByRule","getDatetimeRuleProcessorNL"],"sources":["../../src/rqbDateTimeLibraryAPI.jsdate.ts","../../src/index.jsdate.ts"],"sourcesContent":["import type { RQBDateTimeLibraryAPI } from './types';\nimport { isISOStringDateOnly } from './utils';\n\nconst invalidDate = new Date(Number.NaN);\n\nconst dateRegExp = /^(\\d{4})-(\\d{2})-(\\d{2})([T ](\\d{2}):(\\d{2}):(\\d{2})(\\.(\\d{1,3}))?)?/;\n\nconst toDate = (d: string | Date) => {\n if (d instanceof Date) return d;\n\n const reMatch = dateRegExp.exec(d);\n\n if (!reMatch) return invalidDate;\n\n const [_all, yyyy, mm, dd, _time, hh, mi, ss, _decimal, sss] = reMatch;\n const [year, month, day, hours, minutes, seconds, ms] = [yyyy, mm, dd, hh, mi, ss, sss ?? '0']\n .filter(Boolean)\n .map(Number);\n\n const monthIndex = month - 1;\n\n return hh\n ? new Date(Date.UTC(year, monthIndex, day, hours, minutes, seconds, ms))\n : new Date(year, monthIndex, day);\n};\n\nconst isValid = (d: string | Date) => {\n const dToDate = toDate(d);\n return dToDate instanceof Date && !Number.isNaN(dToDate.getTime());\n};\n\nconst toISOStringDateOnly = (d: string | Date) => {\n const dToDate = toDate(d);\n return isValid(dToDate) ? dToDate.toISOString().slice(0, 10) : '';\n};\n\n/**\n * {@link RQBDateTimeLibraryAPI} for JavaScript `Date`\n *\n * @deprecated This API will not be removed, but we recommend using one of the other\n * {@link RQBDateTimeLibraryAPI}s based on a popular library instead.\n */\nexport const rqbDateTimeLibraryAPI: RQBDateTimeLibraryAPI = {\n format: d => toDate(d).toISOString(),\n isAfter: (a, b) => {\n const dateA = toDate(a).getTime();\n const dateB = toDate(b).getTime();\n return !Number.isNaN(dateA) && !Number.isNaN(dateB) && dateA > dateB;\n },\n isBefore: (a, b) => {\n const dateA = toDate(a).getTime();\n const dateB = toDate(b).getTime();\n return !Number.isNaN(dateA) && !Number.isNaN(dateB) && dateA < dateB;\n },\n isSame: (a, b) => {\n const aToDate = toDate(a);\n const bToDate = toDate(b);\n return isISOStringDateOnly(a) || isISOStringDateOnly(b)\n ? toISOStringDateOnly(a) === toISOStringDateOnly(b)\n : aToDate.getTime() === bToDate.getTime();\n },\n isValid,\n toDate,\n toISOString: d => {\n const dToDate = toDate(d);\n return isValid(dToDate) ? dToDate.toISOString() : '';\n },\n toISOStringDateOnly,\n};\n","/**\n * Import from `\"@react-querybuilder/datetime/jsdate\"` for enhanced date/time support using a custom JavaScript `Date`-based library.\n *\n * @module jsdate\n */\n\nimport type { RuleProcessor, ValueProcessorByRule } from 'react-querybuilder';\nimport { getDatetimeJsonLogicOperations } from './getDatetimeJsonLogicOperations';\nimport { getDatetimeRuleProcessorCEL } from './getDatetimeRuleProcessorCEL';\nimport { getDatetimeRuleProcessorMongoDBQuery } from './getDatetimeRuleProcessorMongoDBQuery';\nimport { getDatetimeRuleProcessorNL } from './getDatetimeRuleProcessorNL';\nimport {\n getDatetimeRuleProcessorSQL,\n getDatetimeValueProcessorANSI,\n getDatetimeValueProcessorMSSQL,\n getDatetimeValueProcessorMySQL,\n getDatetimeValueProcessorOracle,\n getDatetimeValueProcessorPostgreSQL,\n} from './getDatetimeRuleProcessorSQL';\nimport { rqbDateTimeLibraryAPI } from './rqbDateTimeLibraryAPI.jsdate';\nimport type { RQBJsonLogicDateTimeOperations } from './types';\n\n/**\n * Custom JsonLogic date/time operations using JavaScript `Date`.\n */\nexport const jsonLogicDateTimeOperations: RQBJsonLogicDateTimeOperations =\n getDatetimeJsonLogicOperations(rqbDateTimeLibraryAPI);\n\n/**\n * {@link react-querybuilder!
|
|
1
|
+
{"version":3,"file":"react-querybuilder_datetime.cjs.production.jsdate.js","names":["rqbDateTimeLibraryAPI: RQBDateTimeLibraryAPI","isISOStringDateOnly","jsonLogicDateTimeOperations: RQBJsonLogicDateTimeOperations","getDatetimeJsonLogicOperations","datetimeRuleProcessorSQL: RuleProcessor","getDatetimeRuleProcessorSQL","datetimeValueProcessorANSI: ValueProcessorByRule","getDatetimeValueProcessorANSI","datetimeValueProcessorMSSQL: ValueProcessorByRule","getDatetimeValueProcessorMSSQL","datetimeValueProcessorMySQL: ValueProcessorByRule","getDatetimeValueProcessorMySQL","datetimeValueProcessorOracle: ValueProcessorByRule","getDatetimeValueProcessorOracle","datetimeValueProcessorPostgreSQL: ValueProcessorByRule","getDatetimeValueProcessorPostgreSQL","datetimeRuleProcessorCEL: RuleProcessor","getDatetimeRuleProcessorCEL","datetimeRuleProcessorMongoDBQuery: RuleProcessor","getDatetimeRuleProcessorMongoDBQuery","datetimeRuleProcessorNL: ValueProcessorByRule","getDatetimeRuleProcessorNL"],"sources":["../../src/rqbDateTimeLibraryAPI.jsdate.ts","../../src/index.jsdate.ts"],"sourcesContent":["import type { RQBDateTimeLibraryAPI } from './types';\nimport { isISOStringDateOnly } from './utils';\n\nconst invalidDate = new Date(Number.NaN);\n\nconst dateRegExp = /^(\\d{4})-(\\d{2})-(\\d{2})([T ](\\d{2}):(\\d{2}):(\\d{2})(\\.(\\d{1,3}))?)?/;\n\nconst toDate = (d: string | Date) => {\n if (d instanceof Date) return d;\n\n const reMatch = dateRegExp.exec(d);\n\n if (!reMatch) return invalidDate;\n\n const [_all, yyyy, mm, dd, _time, hh, mi, ss, _decimal, sss] = reMatch;\n const [year, month, day, hours, minutes, seconds, ms] = [yyyy, mm, dd, hh, mi, ss, sss ?? '0']\n .filter(Boolean)\n .map(Number);\n\n const monthIndex = month - 1;\n\n return hh\n ? new Date(Date.UTC(year, monthIndex, day, hours, minutes, seconds, ms))\n : new Date(year, monthIndex, day);\n};\n\nconst isValid = (d: string | Date) => {\n const dToDate = toDate(d);\n return dToDate instanceof Date && !Number.isNaN(dToDate.getTime());\n};\n\nconst toISOStringDateOnly = (d: string | Date) => {\n const dToDate = toDate(d);\n return isValid(dToDate) ? dToDate.toISOString().slice(0, 10) : '';\n};\n\n/**\n * {@link RQBDateTimeLibraryAPI} for JavaScript `Date`\n *\n * @deprecated This API will not be removed, but we recommend using one of the other\n * {@link RQBDateTimeLibraryAPI}s based on a popular library instead.\n */\nexport const rqbDateTimeLibraryAPI: RQBDateTimeLibraryAPI = {\n format: d => toDate(d).toISOString(),\n isAfter: (a, b) => {\n const dateA = toDate(a).getTime();\n const dateB = toDate(b).getTime();\n return !Number.isNaN(dateA) && !Number.isNaN(dateB) && dateA > dateB;\n },\n isBefore: (a, b) => {\n const dateA = toDate(a).getTime();\n const dateB = toDate(b).getTime();\n return !Number.isNaN(dateA) && !Number.isNaN(dateB) && dateA < dateB;\n },\n isSame: (a, b) => {\n const aToDate = toDate(a);\n const bToDate = toDate(b);\n return isISOStringDateOnly(a) || isISOStringDateOnly(b)\n ? toISOStringDateOnly(a) === toISOStringDateOnly(b)\n : aToDate.getTime() === bToDate.getTime();\n },\n isValid,\n toDate,\n toISOString: d => {\n const dToDate = toDate(d);\n return isValid(dToDate) ? dToDate.toISOString() : '';\n },\n toISOStringDateOnly,\n};\n","/**\n * Import from `\"@react-querybuilder/datetime/jsdate\"` for enhanced date/time support using a custom JavaScript `Date`-based library.\n *\n * @module jsdate\n */\n\nimport type { RuleProcessor, ValueProcessorByRule } from 'react-querybuilder';\nimport { getDatetimeJsonLogicOperations } from './getDatetimeJsonLogicOperations';\nimport { getDatetimeRuleProcessorCEL } from './getDatetimeRuleProcessorCEL';\nimport { getDatetimeRuleProcessorMongoDBQuery } from './getDatetimeRuleProcessorMongoDBQuery';\nimport { getDatetimeRuleProcessorNL } from './getDatetimeRuleProcessorNL';\nimport {\n getDatetimeRuleProcessorSQL,\n getDatetimeValueProcessorANSI,\n getDatetimeValueProcessorMSSQL,\n getDatetimeValueProcessorMySQL,\n getDatetimeValueProcessorOracle,\n getDatetimeValueProcessorPostgreSQL,\n} from './getDatetimeRuleProcessorSQL';\nimport { rqbDateTimeLibraryAPI } from './rqbDateTimeLibraryAPI.jsdate';\nimport type { RQBJsonLogicDateTimeOperations } from './types';\n\n/**\n * Custom JsonLogic date/time operations using JavaScript `Date`.\n */\nexport const jsonLogicDateTimeOperations: RQBJsonLogicDateTimeOperations =\n getDatetimeJsonLogicOperations(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"sql\" format using JavaScript `Date`\n */\nexport const datetimeRuleProcessorSQL: RuleProcessor =\n getDatetimeRuleProcessorSQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"ansi\" preset) using JavaScript `Date`\n */\nexport const datetimeValueProcessorANSI: ValueProcessorByRule =\n getDatetimeValueProcessorANSI(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"mssql\" preset) using JavaScript `Date`\n */\nexport const datetimeValueProcessorMSSQL: ValueProcessorByRule =\n getDatetimeValueProcessorMSSQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"mysql\" preset) using JavaScript `Date`\n */\nexport const datetimeValueProcessorMySQL: ValueProcessorByRule =\n getDatetimeValueProcessorMySQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"oracle\" preset) using JavaScript `Date`\n */\nexport const datetimeValueProcessorOracle: ValueProcessorByRule =\n getDatetimeValueProcessorOracle(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"postgresql\" preset) using JavaScript `Date`\n */\nexport const datetimeValueProcessorPostgreSQL: ValueProcessorByRule =\n getDatetimeValueProcessorPostgreSQL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"cel\" format using JavaScript `Date`\n */\nexport const datetimeRuleProcessorCEL: RuleProcessor =\n getDatetimeRuleProcessorCEL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"mongodb_query\" format using JavaScript `Date`\n */\nexport const datetimeRuleProcessorMongoDBQuery: RuleProcessor =\n getDatetimeRuleProcessorMongoDBQuery(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"natural_language\" format using JavaScript `Date`\n */\nexport const datetimeRuleProcessorNL: ValueProcessorByRule =\n getDatetimeRuleProcessorNL(rqbDateTimeLibraryAPI);\n\nexport * from './rqbDateTimeLibraryAPI.jsdate';\n"],"mappings":"6DAGM,EAAc,IAAI,KAAK,IAAW,CAElC,EAAa,uEAEb,EAAU,GAAqB,CACnC,GAAI,aAAa,KAAM,OAAO,EAE9B,IAAM,EAAU,EAAW,KAAK,EAAE,CAElC,GAAI,CAAC,EAAS,OAAO,EAErB,GAAM,CAAC,EAAM,EAAM,EAAI,EAAI,EAAO,EAAI,EAAI,EAAI,EAAU,GAAO,EACzD,CAAC,EAAM,EAAO,EAAK,EAAO,EAAS,EAAS,GAAM,CAAC,EAAM,EAAI,EAAI,EAAI,EAAI,EAAI,GAAO,IAAI,CAC3F,OAAO,QAAQ,CACf,IAAI,OAAO,CAER,EAAa,EAAQ,EAE3B,OAAO,EACH,IAAI,KAAK,KAAK,IAAI,EAAM,EAAY,EAAK,EAAO,EAAS,EAAS,EAAG,CAAC,CACtE,IAAI,KAAK,EAAM,EAAY,EAAI,EAG/B,EAAW,GAAqB,CACpC,IAAM,EAAU,EAAO,EAAE,CACzB,OAAO,aAAmB,MAAQ,CAAC,OAAO,MAAM,EAAQ,SAAS,CAAC,EAG9D,EAAuB,GAAqB,CAChD,IAAM,EAAU,EAAO,EAAE,CACzB,OAAO,EAAQ,EAAQ,CAAG,EAAQ,aAAa,CAAC,MAAM,EAAG,GAAG,CAAG,IASpDA,EAA+C,CAC1D,OAAQ,GAAK,EAAO,EAAE,CAAC,aAAa,CACpC,SAAU,EAAG,IAAM,CACjB,IAAM,EAAQ,EAAO,EAAE,CAAC,SAAS,CAC3B,EAAQ,EAAO,EAAE,CAAC,SAAS,CACjC,MAAO,CAAC,OAAO,MAAM,EAAM,EAAI,CAAC,OAAO,MAAM,EAAM,EAAI,EAAQ,GAEjE,UAAW,EAAG,IAAM,CAClB,IAAM,EAAQ,EAAO,EAAE,CAAC,SAAS,CAC3B,EAAQ,EAAO,EAAE,CAAC,SAAS,CACjC,MAAO,CAAC,OAAO,MAAM,EAAM,EAAI,CAAC,OAAO,MAAM,EAAM,EAAI,EAAQ,GAEjE,QAAS,EAAG,IAAM,CAChB,IAAM,EAAU,EAAO,EAAE,CACnB,EAAU,EAAO,EAAE,CACzB,OAAOC,EAAAA,oBAAoB,EAAE,EAAIA,EAAAA,oBAAoB,EAAE,CACnD,EAAoB,EAAE,GAAK,EAAoB,EAAE,CACjD,EAAQ,SAAS,GAAK,EAAQ,SAAS,EAE7C,UACA,SACA,YAAa,GAAK,CAChB,IAAM,EAAU,EAAO,EAAE,CACzB,OAAO,EAAQ,EAAQ,CAAG,EAAQ,aAAa,CAAG,IAEpD,sBACD,CC3CYC,EACXC,EAAAA,+BAA+B,EAAsB,CAK1CC,EACXC,EAAAA,4BAA4B,EAAsB,CAIvCC,EACXC,EAAAA,8BAA8B,EAAsB,CAIzCC,EACXC,EAAAA,+BAA+B,EAAsB,CAI1CC,EACXC,EAAAA,+BAA+B,EAAsB,CAI1CC,EACXC,EAAAA,gCAAgC,EAAsB,CAI3CC,EACXC,EAAAA,oCAAoC,EAAsB,CAK/CC,EACXC,EAAAA,4BAA4B,EAAsB,CAKvCC,EACXC,EAAAA,qCAAqC,EAAsB,CAKhDC,EACXC,EAAAA,2BAA2B,EAAsB"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { RQBDateTimeLibraryAPI, RQBJsonLogicDateTimeOperations, RuleProcessor, ValueProcessorByRule } from "./types-QCQUGVZa.js";
|
|
2
|
+
|
|
3
|
+
//#region src/rqbDateTimeLibraryAPI.luxon.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* {@link RQBDateTimeLibraryAPI} for Luxon
|
|
7
|
+
*/
|
|
8
|
+
declare const rqbDateTimeLibraryAPI: RQBDateTimeLibraryAPI;
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region src/index.luxon.d.ts
|
|
11
|
+
/**
|
|
12
|
+
* Custom JsonLogic date/time operations using Luxon
|
|
13
|
+
*/
|
|
14
|
+
declare const jsonLogicDateTimeOperations: RQBJsonLogicDateTimeOperations;
|
|
15
|
+
/**
|
|
16
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "sql" format using Luxon
|
|
17
|
+
*/
|
|
18
|
+
declare const datetimeRuleProcessorSQL: RuleProcessor;
|
|
19
|
+
/**
|
|
20
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("ansi" preset) using Luxon
|
|
21
|
+
*/
|
|
22
|
+
declare const datetimeValueProcessorANSI: ValueProcessorByRule;
|
|
23
|
+
/**
|
|
24
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("mssql" preset) using Luxon
|
|
25
|
+
*/
|
|
26
|
+
declare const datetimeValueProcessorMSSQL: ValueProcessorByRule;
|
|
27
|
+
/**
|
|
28
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("mysql" preset) using Luxon
|
|
29
|
+
*/
|
|
30
|
+
declare const datetimeValueProcessorMySQL: ValueProcessorByRule;
|
|
31
|
+
/**
|
|
32
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("oracle" preset) using Luxon
|
|
33
|
+
*/
|
|
34
|
+
declare const datetimeValueProcessorOracle: ValueProcessorByRule;
|
|
35
|
+
/**
|
|
36
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("postgresql" preset) using Luxon
|
|
37
|
+
*/
|
|
38
|
+
declare const datetimeValueProcessorPostgreSQL: ValueProcessorByRule;
|
|
39
|
+
/**
|
|
40
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "cel" format using Luxon
|
|
41
|
+
*/
|
|
42
|
+
declare const datetimeRuleProcessorCEL: ValueProcessorByRule;
|
|
43
|
+
/**
|
|
44
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "mongodb_query" format using Luxon
|
|
45
|
+
*/
|
|
46
|
+
declare const datetimeRuleProcessorMongoDBQuery: ValueProcessorByRule;
|
|
47
|
+
/**
|
|
48
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "natural_language" format using Luxon
|
|
49
|
+
*/
|
|
50
|
+
declare const datetimeRuleProcessorNL: ValueProcessorByRule;
|
|
51
|
+
//#endregion
|
|
52
|
+
export { datetimeRuleProcessorCEL, datetimeRuleProcessorMongoDBQuery, datetimeRuleProcessorNL, datetimeRuleProcessorSQL, datetimeValueProcessorANSI, datetimeValueProcessorMSSQL, datetimeValueProcessorMySQL, datetimeValueProcessorOracle, datetimeValueProcessorPostgreSQL, jsonLogicDateTimeOperations, rqbDateTimeLibraryAPI };
|
|
53
|
+
//# sourceMappingURL=react-querybuilder_datetime.cjs.production.luxon.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require(`./getDatetimeRuleProcessorSQL-
|
|
1
|
+
const e=require(`./getDatetimeRuleProcessorSQL-D95jgDK6.js`);let t=require(`luxon`);t=e.__toESM(t);const n=e=>typeof e==`string`?t.DateTime.fromISO(e):t.DateTime.fromJSDate(e),r=`yyyy-MM-dd`,i={format:(e,t)=>n(e).toFormat(t.replace(`YYYY-MM-DD`,r)),isAfter:(e,t)=>n(e)>n(t),isBefore:(e,t)=>n(e)<n(t),isSame:(t,r)=>e.isISOStringDateOnly(t)||e.isISOStringDateOnly(r)?n(t).hasSame(n(r),`day`):+n(t)==+n(r),isValid:e=>n(e).isValid,toDate:e=>n(e).toJSDate(),toISOString:e=>{let t=n(e);return t.isValid?t.toJSDate().toISOString():``},toISOStringDateOnly:e=>{let t=n(e);return t.isValid?t.toFormat(r):``}},a=e.getDatetimeJsonLogicOperations(i),o=e.getDatetimeRuleProcessorSQL(i),s=e.getDatetimeValueProcessorANSI(i),c=e.getDatetimeValueProcessorMSSQL(i),l=e.getDatetimeValueProcessorMySQL(i),u=e.getDatetimeValueProcessorOracle(i),d=e.getDatetimeValueProcessorPostgreSQL(i),f=e.getDatetimeRuleProcessorCEL(i),p=e.getDatetimeRuleProcessorMongoDBQuery(i),m=e.getDatetimeRuleProcessorNL(i);exports.datetimeRuleProcessorCEL=f,exports.datetimeRuleProcessorMongoDBQuery=p,exports.datetimeRuleProcessorNL=m,exports.datetimeRuleProcessorSQL=o,exports.datetimeValueProcessorANSI=s,exports.datetimeValueProcessorMSSQL=c,exports.datetimeValueProcessorMySQL=l,exports.datetimeValueProcessorOracle=u,exports.datetimeValueProcessorPostgreSQL=d,exports.jsonLogicDateTimeOperations=a,exports.rqbDateTimeLibraryAPI=i;
|
|
2
2
|
//# sourceMappingURL=react-querybuilder_datetime.cjs.production.luxon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-querybuilder_datetime.cjs.production.luxon.js","names":["DateTime","rqbDateTimeLibraryAPI: RQBDateTimeLibraryAPI","isISOStringDateOnly","jsonLogicDateTimeOperations: RQBJsonLogicDateTimeOperations","getDatetimeJsonLogicOperations","datetimeRuleProcessorSQL: RuleProcessor","getDatetimeRuleProcessorSQL","datetimeValueProcessorANSI: ValueProcessorByRule","getDatetimeValueProcessorANSI","datetimeValueProcessorMSSQL: ValueProcessorByRule","getDatetimeValueProcessorMSSQL","datetimeValueProcessorMySQL: ValueProcessorByRule","getDatetimeValueProcessorMySQL","datetimeValueProcessorOracle: ValueProcessorByRule","getDatetimeValueProcessorOracle","datetimeValueProcessorPostgreSQL: ValueProcessorByRule","getDatetimeValueProcessorPostgreSQL","datetimeRuleProcessorCEL: ValueProcessorByRule","getDatetimeRuleProcessorCEL","datetimeRuleProcessorMongoDBQuery: ValueProcessorByRule","getDatetimeRuleProcessorMongoDBQuery","datetimeRuleProcessorNL: ValueProcessorByRule","getDatetimeRuleProcessorNL"],"sources":["../../src/rqbDateTimeLibraryAPI.luxon.ts","../../src/index.luxon.ts"],"sourcesContent":["import { DateTime } from 'luxon';\nimport type { RQBDateTimeLibraryAPI } from './types';\nimport { isISOStringDateOnly } from './utils';\n\nconst toDateTime = (a: string | Date) =>\n typeof a === 'string' ? DateTime.fromISO(a) : DateTime.fromJSDate(a);\nconst iso8601DateOnly = 'yyyy-MM-dd';\n\n/**\n * {@link RQBDateTimeLibraryAPI} for Luxon\n */\nexport const rqbDateTimeLibraryAPI: RQBDateTimeLibraryAPI = {\n format: (d, fmt) => toDateTime(d).toFormat(fmt.replace('YYYY-MM-DD', iso8601DateOnly)),\n isAfter: (a, b) => toDateTime(a) > toDateTime(b),\n isBefore: (a, b) => toDateTime(a) < toDateTime(b),\n isSame: (a, b) =>\n isISOStringDateOnly(a) || isISOStringDateOnly(b)\n ? toDateTime(a).hasSame(toDateTime(b), 'day')\n : +toDateTime(a) === +toDateTime(b),\n isValid: d => toDateTime(d).isValid,\n toDate: d => toDateTime(d).toJSDate(),\n toISOString: d => {\n const dToDate = toDateTime(d);\n return dToDate.isValid ? dToDate.toJSDate().toISOString() : '';\n },\n toISOStringDateOnly: d => {\n const dToDate = toDateTime(d);\n return dToDate.isValid ? dToDate.toFormat(iso8601DateOnly) : '';\n },\n};\n","/**\n * Import from `\"@react-querybuilder/datetime/luxon\"` for enhanced date/time support using [Luxon](https://moment.github.io/luxon/).\n *\n * @module luxon\n */\n\nimport type { RuleProcessor, ValueProcessorByRule } from 'react-querybuilder';\nimport { getDatetimeJsonLogicOperations } from './getDatetimeJsonLogicOperations';\nimport { getDatetimeRuleProcessorCEL } from './getDatetimeRuleProcessorCEL';\nimport { getDatetimeRuleProcessorMongoDBQuery } from './getDatetimeRuleProcessorMongoDBQuery';\nimport { getDatetimeRuleProcessorNL } from './getDatetimeRuleProcessorNL';\nimport {\n getDatetimeRuleProcessorSQL,\n getDatetimeValueProcessorANSI,\n getDatetimeValueProcessorMSSQL,\n getDatetimeValueProcessorMySQL,\n getDatetimeValueProcessorOracle,\n getDatetimeValueProcessorPostgreSQL,\n} from './getDatetimeRuleProcessorSQL';\nimport { rqbDateTimeLibraryAPI } from './rqbDateTimeLibraryAPI.luxon';\nimport type { RQBJsonLogicDateTimeOperations } from './types';\n\n/**\n * Custom JsonLogic date/time operations using Luxon\n */\nexport const jsonLogicDateTimeOperations: RQBJsonLogicDateTimeOperations =\n getDatetimeJsonLogicOperations(rqbDateTimeLibraryAPI);\n\n/**\n * {@link react-querybuilder!
|
|
1
|
+
{"version":3,"file":"react-querybuilder_datetime.cjs.production.luxon.js","names":["DateTime","rqbDateTimeLibraryAPI: RQBDateTimeLibraryAPI","isISOStringDateOnly","jsonLogicDateTimeOperations: RQBJsonLogicDateTimeOperations","getDatetimeJsonLogicOperations","datetimeRuleProcessorSQL: RuleProcessor","getDatetimeRuleProcessorSQL","datetimeValueProcessorANSI: ValueProcessorByRule","getDatetimeValueProcessorANSI","datetimeValueProcessorMSSQL: ValueProcessorByRule","getDatetimeValueProcessorMSSQL","datetimeValueProcessorMySQL: ValueProcessorByRule","getDatetimeValueProcessorMySQL","datetimeValueProcessorOracle: ValueProcessorByRule","getDatetimeValueProcessorOracle","datetimeValueProcessorPostgreSQL: ValueProcessorByRule","getDatetimeValueProcessorPostgreSQL","datetimeRuleProcessorCEL: ValueProcessorByRule","getDatetimeRuleProcessorCEL","datetimeRuleProcessorMongoDBQuery: ValueProcessorByRule","getDatetimeRuleProcessorMongoDBQuery","datetimeRuleProcessorNL: ValueProcessorByRule","getDatetimeRuleProcessorNL"],"sources":["../../src/rqbDateTimeLibraryAPI.luxon.ts","../../src/index.luxon.ts"],"sourcesContent":["import { DateTime } from 'luxon';\nimport type { RQBDateTimeLibraryAPI } from './types';\nimport { isISOStringDateOnly } from './utils';\n\nconst toDateTime = (a: string | Date) =>\n typeof a === 'string' ? DateTime.fromISO(a) : DateTime.fromJSDate(a);\nconst iso8601DateOnly = 'yyyy-MM-dd';\n\n/**\n * {@link RQBDateTimeLibraryAPI} for Luxon\n */\nexport const rqbDateTimeLibraryAPI: RQBDateTimeLibraryAPI = {\n format: (d, fmt) => toDateTime(d).toFormat(fmt.replace('YYYY-MM-DD', iso8601DateOnly)),\n isAfter: (a, b) => toDateTime(a) > toDateTime(b),\n isBefore: (a, b) => toDateTime(a) < toDateTime(b),\n isSame: (a, b) =>\n isISOStringDateOnly(a) || isISOStringDateOnly(b)\n ? toDateTime(a).hasSame(toDateTime(b), 'day')\n : +toDateTime(a) === +toDateTime(b),\n isValid: d => toDateTime(d).isValid,\n toDate: d => toDateTime(d).toJSDate(),\n toISOString: d => {\n const dToDate = toDateTime(d);\n return dToDate.isValid ? dToDate.toJSDate().toISOString() : '';\n },\n toISOStringDateOnly: d => {\n const dToDate = toDateTime(d);\n return dToDate.isValid ? dToDate.toFormat(iso8601DateOnly) : '';\n },\n};\n","/**\n * Import from `\"@react-querybuilder/datetime/luxon\"` for enhanced date/time support using [Luxon](https://moment.github.io/luxon/).\n *\n * @module luxon\n */\n\nimport type { RuleProcessor, ValueProcessorByRule } from 'react-querybuilder';\nimport { getDatetimeJsonLogicOperations } from './getDatetimeJsonLogicOperations';\nimport { getDatetimeRuleProcessorCEL } from './getDatetimeRuleProcessorCEL';\nimport { getDatetimeRuleProcessorMongoDBQuery } from './getDatetimeRuleProcessorMongoDBQuery';\nimport { getDatetimeRuleProcessorNL } from './getDatetimeRuleProcessorNL';\nimport {\n getDatetimeRuleProcessorSQL,\n getDatetimeValueProcessorANSI,\n getDatetimeValueProcessorMSSQL,\n getDatetimeValueProcessorMySQL,\n getDatetimeValueProcessorOracle,\n getDatetimeValueProcessorPostgreSQL,\n} from './getDatetimeRuleProcessorSQL';\nimport { rqbDateTimeLibraryAPI } from './rqbDateTimeLibraryAPI.luxon';\nimport type { RQBJsonLogicDateTimeOperations } from './types';\n\n/**\n * Custom JsonLogic date/time operations using Luxon\n */\nexport const jsonLogicDateTimeOperations: RQBJsonLogicDateTimeOperations =\n getDatetimeJsonLogicOperations(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"sql\" format using Luxon\n */\nexport const datetimeRuleProcessorSQL: RuleProcessor =\n getDatetimeRuleProcessorSQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"ansi\" preset) using Luxon\n */\nexport const datetimeValueProcessorANSI: ValueProcessorByRule =\n getDatetimeValueProcessorANSI(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"mssql\" preset) using Luxon\n */\nexport const datetimeValueProcessorMSSQL: ValueProcessorByRule =\n getDatetimeValueProcessorMSSQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"mysql\" preset) using Luxon\n */\nexport const datetimeValueProcessorMySQL: ValueProcessorByRule =\n getDatetimeValueProcessorMySQL(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"oracle\" preset) using Luxon\n */\nexport const datetimeValueProcessorOracle: ValueProcessorByRule =\n getDatetimeValueProcessorOracle(rqbDateTimeLibraryAPI);\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} value processor for \"sql\" format (\"postgresql\" preset) using Luxon\n */\nexport const datetimeValueProcessorPostgreSQL: ValueProcessorByRule =\n getDatetimeValueProcessorPostgreSQL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"cel\" format using Luxon\n */\nexport const datetimeRuleProcessorCEL: ValueProcessorByRule =\n getDatetimeRuleProcessorCEL(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"mongodb_query\" format using Luxon\n */\nexport const datetimeRuleProcessorMongoDBQuery: ValueProcessorByRule =\n getDatetimeRuleProcessorMongoDBQuery(rqbDateTimeLibraryAPI);\n\n/**\n * {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for \"natural_language\" format using Luxon\n */\nexport const datetimeRuleProcessorNL: ValueProcessorByRule =\n getDatetimeRuleProcessorNL(rqbDateTimeLibraryAPI);\n\nexport * from './rqbDateTimeLibraryAPI.luxon';\n"],"mappings":"mGAIA,MAAM,EAAc,GAClB,OAAO,GAAM,SAAWA,EAAAA,SAAS,QAAQ,EAAE,CAAGA,EAAAA,SAAS,WAAW,EAAE,CAChE,EAAkB,aAKXC,EAA+C,CAC1D,QAAS,EAAG,IAAQ,EAAW,EAAE,CAAC,SAAS,EAAI,QAAQ,aAAc,EAAgB,CAAC,CACtF,SAAU,EAAG,IAAM,EAAW,EAAE,CAAG,EAAW,EAAE,CAChD,UAAW,EAAG,IAAM,EAAW,EAAE,CAAG,EAAW,EAAE,CACjD,QAAS,EAAG,IACVC,EAAAA,oBAAoB,EAAE,EAAIA,EAAAA,oBAAoB,EAAE,CAC5C,EAAW,EAAE,CAAC,QAAQ,EAAW,EAAE,CAAE,MAAM,CAC3C,CAAC,EAAW,EAAE,EAAK,CAAC,EAAW,EAAE,CACvC,QAAS,GAAK,EAAW,EAAE,CAAC,QAC5B,OAAQ,GAAK,EAAW,EAAE,CAAC,UAAU,CACrC,YAAa,GAAK,CAChB,IAAM,EAAU,EAAW,EAAE,CAC7B,OAAO,EAAQ,QAAU,EAAQ,UAAU,CAAC,aAAa,CAAG,IAE9D,oBAAqB,GAAK,CACxB,IAAM,EAAU,EAAW,EAAE,CAC7B,OAAO,EAAQ,QAAU,EAAQ,SAAS,EAAgB,CAAG,IAEhE,CCJYC,EACXC,EAAAA,+BAA+B,EAAsB,CAK1CC,EACXC,EAAAA,4BAA4B,EAAsB,CAIvCC,EACXC,EAAAA,8BAA8B,EAAsB,CAIzCC,EACXC,EAAAA,+BAA+B,EAAsB,CAI1CC,EACXC,EAAAA,+BAA+B,EAAsB,CAI1CC,EACXC,EAAAA,gCAAgC,EAAsB,CAI3CC,EACXC,EAAAA,oCAAoC,EAAsB,CAK/CC,EACXC,EAAAA,4BAA4B,EAAsB,CAKvCC,EACXC,EAAAA,qCAAqC,EAAsB,CAKhDC,EACXC,EAAAA,2BAA2B,EAAsB"}
|