@react-querybuilder/datetime 8.20.2 → 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/dist/cjs/{getDatetimeRuleProcessorTanStackDB-cmGqMT0Q.js → getDatetimeRuleProcessorTanStackDB-CDEB9coD.js} +22 -19
- 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 +122 -138
- package/dist/cjs/react-querybuilder_datetime.cjs.development.date-fns.d.ts +49 -50
- package/dist/cjs/react-querybuilder_datetime.cjs.development.date-fns.js +2 -2
- package/dist/cjs/react-querybuilder_datetime.cjs.development.dayjs.d.ts +49 -50
- package/dist/cjs/react-querybuilder_datetime.cjs.development.dayjs.js +2 -2
- package/dist/cjs/react-querybuilder_datetime.cjs.development.js +3 -2
- package/dist/cjs/react-querybuilder_datetime.cjs.development.js.map +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.development.jsdate.d.ts +52 -53
- package/dist/cjs/react-querybuilder_datetime.cjs.development.jsdate.js +2 -2
- package/dist/cjs/react-querybuilder_datetime.cjs.development.luxon.d.ts +49 -50
- package/dist/cjs/react-querybuilder_datetime.cjs.development.luxon.js +2 -2
- package/dist/cjs/react-querybuilder_datetime.cjs.development.ui.d.ts +100 -114
- package/dist/cjs/react-querybuilder_datetime.cjs.development.ui.js +5 -3
- package/dist/cjs/react-querybuilder_datetime.cjs.development.ui.js.map +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.d.ts +122 -138
- package/dist/cjs/react-querybuilder_datetime.cjs.production.date-fns.d.ts +49 -50
- package/dist/cjs/react-querybuilder_datetime.cjs.production.date-fns.js +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.dayjs.d.ts +49 -50
- package/dist/cjs/react-querybuilder_datetime.cjs.production.dayjs.js +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 +52 -53
- package/dist/cjs/react-querybuilder_datetime.cjs.production.jsdate.js +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.luxon.d.ts +49 -50
- package/dist/cjs/react-querybuilder_datetime.cjs.production.luxon.js +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.ui.d.ts +100 -114
- package/dist/cjs/react-querybuilder_datetime.cjs.production.ui.js +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.ui.js.map +1 -1
- package/dist/cjs/{rqbDateTimeLibraryAPI.jsdate-ioz2B1zh.js → rqbDateTimeLibraryAPI.jsdate-BuSiVdk7.js} +2 -2
- package/dist/cjs/{rqbDateTimeLibraryAPI.jsdate-ioz2B1zh.js.map → rqbDateTimeLibraryAPI.jsdate-BuSiVdk7.js.map} +1 -1
- package/dist/cjs/{rqbDateTimeLibraryAPI.jsdate-BPEcMhhr.js → rqbDateTimeLibraryAPI.jsdate-C3jJb6ip.js} +2 -2
- package/dist/cjs/{rqbDateTimeLibraryAPI.jsdate-BPEcMhhr.js.map → rqbDateTimeLibraryAPI.jsdate-C3jJb6ip.js.map} +1 -1
- package/dist/cjs/{types-Di8kFIXV.d.ts → types-BKA1aoY6.d.ts} +82 -73
- package/dist/cjs/utils-DdBYGWHZ.js +2 -0
- package/dist/cjs/utils-DdBYGWHZ.js.map +1 -0
- package/dist/cjs/{utils-DUePrC--.js → utils-_X97pUtk.js} +13 -1
- 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-BDFJlfJh.js → getDatetimeRuleProcessorTanStackDB-BrSD2e9G.js} +22 -19
- package/dist/getDatetimeRuleProcessorTanStackDB-BrSD2e9G.js.map +1 -0
- package/dist/{getDatetimeRuleProcessorTanStackDB-B93XaPdB.mjs → getDatetimeRuleProcessorTanStackDB-DR8aYrUa.mjs} +22 -19
- package/dist/getDatetimeRuleProcessorTanStackDB-DR8aYrUa.mjs.map +1 -0
- package/dist/{objectSpread2-73AKOozq.js → objectSpread2-MqoZ2hSz.js} +13 -7
- package/dist/objectSpread2-MqoZ2hSz.js.map +1 -0
- package/dist/react-querybuilder_datetime.d.mts +122 -138
- package/dist/react-querybuilder_datetime.date-fns.d.mts +49 -50
- package/dist/react-querybuilder_datetime.date-fns.mjs +2 -2
- package/dist/react-querybuilder_datetime.dayjs.d.mts +49 -50
- package/dist/react-querybuilder_datetime.dayjs.mjs +2 -2
- package/dist/react-querybuilder_datetime.jsdate.d.mts +52 -53
- package/dist/react-querybuilder_datetime.jsdate.mjs +2 -2
- package/dist/react-querybuilder_datetime.legacy-esm.d.ts +122 -138
- package/dist/react-querybuilder_datetime.legacy-esm.date-fns.d.ts +49 -50
- package/dist/react-querybuilder_datetime.legacy-esm.date-fns.js +2 -2
- package/dist/react-querybuilder_datetime.legacy-esm.dayjs.d.ts +49 -50
- package/dist/react-querybuilder_datetime.legacy-esm.dayjs.js +2 -2
- package/dist/react-querybuilder_datetime.legacy-esm.js +3 -2
- package/dist/react-querybuilder_datetime.legacy-esm.js.map +1 -1
- package/dist/react-querybuilder_datetime.legacy-esm.jsdate.d.ts +52 -53
- package/dist/react-querybuilder_datetime.legacy-esm.jsdate.js +2 -2
- package/dist/react-querybuilder_datetime.legacy-esm.luxon.d.ts +49 -50
- package/dist/react-querybuilder_datetime.legacy-esm.luxon.js +2 -2
- package/dist/react-querybuilder_datetime.legacy-esm.ui.d.ts +100 -114
- package/dist/react-querybuilder_datetime.legacy-esm.ui.js +7 -5
- package/dist/react-querybuilder_datetime.legacy-esm.ui.js.map +1 -1
- package/dist/react-querybuilder_datetime.luxon.d.mts +49 -50
- package/dist/react-querybuilder_datetime.luxon.mjs +2 -2
- package/dist/react-querybuilder_datetime.mjs +3 -2
- package/dist/react-querybuilder_datetime.mjs.map +1 -1
- package/dist/react-querybuilder_datetime.production.d.mts +122 -138
- package/dist/react-querybuilder_datetime.production.date-fns.d.mts +49 -50
- package/dist/react-querybuilder_datetime.production.date-fns.mjs +1 -1
- package/dist/react-querybuilder_datetime.production.dayjs.d.mts +49 -50
- package/dist/react-querybuilder_datetime.production.dayjs.mjs +1 -1
- package/dist/react-querybuilder_datetime.production.jsdate.d.mts +52 -53
- package/dist/react-querybuilder_datetime.production.jsdate.mjs +1 -1
- package/dist/react-querybuilder_datetime.production.luxon.d.mts +49 -50
- package/dist/react-querybuilder_datetime.production.luxon.mjs +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 +100 -114
- package/dist/react-querybuilder_datetime.production.ui.mjs +1 -1
- package/dist/react-querybuilder_datetime.production.ui.mjs.map +1 -1
- package/dist/react-querybuilder_datetime.ui.d.mts +100 -114
- package/dist/react-querybuilder_datetime.ui.mjs +5 -3
- package/dist/react-querybuilder_datetime.ui.mjs.map +1 -1
- package/dist/{rqbDateTimeLibraryAPI.jsdate-CpGoQAje.js → rqbDateTimeLibraryAPI.jsdate-COp9qTw_.js} +2 -2
- package/dist/{rqbDateTimeLibraryAPI.jsdate-CpGoQAje.js.map → rqbDateTimeLibraryAPI.jsdate-COp9qTw_.js.map} +1 -1
- package/dist/{rqbDateTimeLibraryAPI.jsdate-CDOtydFq.mjs → rqbDateTimeLibraryAPI.jsdate-DxBmxW2C.mjs} +2 -2
- package/dist/{rqbDateTimeLibraryAPI.jsdate-CDOtydFq.mjs.map → rqbDateTimeLibraryAPI.jsdate-DxBmxW2C.mjs.map} +1 -1
- package/dist/{rqbDateTimeLibraryAPI.jsdate-D66yJ1hK.mjs → rqbDateTimeLibraryAPI.jsdate-WHnzblie.mjs} +2 -2
- package/dist/{rqbDateTimeLibraryAPI.jsdate-D66yJ1hK.mjs.map → rqbDateTimeLibraryAPI.jsdate-WHnzblie.mjs.map} +1 -1
- package/dist/{types-Di8kFIXV.d.mts → types-BKA1aoY6.d.mts} +82 -73
- package/dist/{types-Di8kFIXV.d.ts → types-BKA1aoY6.d.ts} +82 -73
- package/dist/{utils-BC2SALFm.mjs → utils-BAgUBdyf.mjs} +8 -2
- 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 +16 -16
- package/dist/cjs/getDatetimeRuleProcessorTanStackDB-BVNfYaIj.js +0 -2
- package/dist/cjs/getDatetimeRuleProcessorTanStackDB-BVNfYaIj.js.map +0 -1
- package/dist/cjs/getDatetimeRuleProcessorTanStackDB-cmGqMT0Q.js.map +0 -1
- package/dist/cjs/utils-DUePrC--.js.map +0 -1
- package/dist/cjs/utils-jkW5R1AA.js +0 -2
- package/dist/cjs/utils-jkW5R1AA.js.map +0 -1
- package/dist/getDatetimeRuleProcessorTanStackDB-B93XaPdB.mjs.map +0 -1
- package/dist/getDatetimeRuleProcessorTanStackDB-BDFJlfJh.js.map +0 -1
- package/dist/getDatetimeRuleProcessorTanStackDB-Czg9Fbb8.mjs +0 -2
- package/dist/getDatetimeRuleProcessorTanStackDB-Czg9Fbb8.mjs.map +0 -1
- package/dist/objectSpread2-73AKOozq.js.map +0 -1
- package/dist/utils-BC2SALFm.mjs.map +0 -1
- package/dist/utils-VKS8YY2D.mjs +0 -2
- package/dist/utils-VKS8YY2D.mjs.map +0 -1
|
@@ -1,104 +1,103 @@
|
|
|
1
|
-
import { g as RQBJsonLogicDateTimeOperations, i as RQBDateTimeLibraryAPI } from "./types-
|
|
1
|
+
import { g as RQBJsonLogicDateTimeOperations, i as RQBDateTimeLibraryAPI } from "./types-BKA1aoY6.mjs";
|
|
2
2
|
import { RuleProcessor, ValueProcessorByRule } from "@react-querybuilder/core";
|
|
3
|
-
|
|
4
3
|
//#region src/rqbDateTimeLibraryAPI.luxon.d.ts
|
|
5
4
|
/**
|
|
6
|
-
* {@link RQBDateTimeLibraryAPI} for Luxon
|
|
7
|
-
*/
|
|
5
|
+
* {@link RQBDateTimeLibraryAPI} for Luxon
|
|
6
|
+
*/
|
|
8
7
|
declare const rqbDateTimeLibraryAPI: RQBDateTimeLibraryAPI;
|
|
9
8
|
//#endregion
|
|
10
9
|
//#region src/index.luxon.d.ts
|
|
11
10
|
/**
|
|
12
|
-
* Custom JsonLogic date/time operations using Luxon
|
|
13
|
-
*/
|
|
11
|
+
* Custom JsonLogic date/time operations using Luxon
|
|
12
|
+
*/
|
|
14
13
|
declare const jsonLogicDateTimeOperations: RQBJsonLogicDateTimeOperations;
|
|
15
14
|
/**
|
|
16
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "sql" format using Luxon
|
|
17
|
-
*/
|
|
15
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "sql" format using Luxon
|
|
16
|
+
*/
|
|
18
17
|
declare const datetimeRuleProcessorSQL: RuleProcessor;
|
|
19
18
|
/**
|
|
20
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("ansi" preset) using Luxon
|
|
21
|
-
*/
|
|
19
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("ansi" preset) using Luxon
|
|
20
|
+
*/
|
|
22
21
|
declare const datetimeValueProcessorANSI: ValueProcessorByRule;
|
|
23
22
|
/**
|
|
24
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("mssql" preset) using Luxon
|
|
25
|
-
*/
|
|
23
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("mssql" preset) using Luxon
|
|
24
|
+
*/
|
|
26
25
|
declare const datetimeValueProcessorMSSQL: ValueProcessorByRule;
|
|
27
26
|
/**
|
|
28
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("mysql" preset) using Luxon
|
|
29
|
-
*/
|
|
27
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("mysql" preset) using Luxon
|
|
28
|
+
*/
|
|
30
29
|
declare const datetimeValueProcessorMySQL: ValueProcessorByRule;
|
|
31
30
|
/**
|
|
32
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("oracle" preset) using Luxon
|
|
33
|
-
*/
|
|
31
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("oracle" preset) using Luxon
|
|
32
|
+
*/
|
|
34
33
|
declare const datetimeValueProcessorOracle: ValueProcessorByRule;
|
|
35
34
|
/**
|
|
36
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("postgresql" preset) using Luxon
|
|
37
|
-
*/
|
|
35
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} value processor for "sql" format ("postgresql" preset) using Luxon
|
|
36
|
+
*/
|
|
38
37
|
declare const datetimeValueProcessorPostgreSQL: ValueProcessorByRule;
|
|
39
38
|
/**
|
|
40
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "cel" format using Luxon
|
|
41
|
-
*/
|
|
39
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "cel" format using Luxon
|
|
40
|
+
*/
|
|
42
41
|
declare const datetimeRuleProcessorCEL: ValueProcessorByRule;
|
|
43
42
|
/**
|
|
44
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "jsonata" format using Luxon
|
|
45
|
-
*/
|
|
43
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "jsonata" format using Luxon
|
|
44
|
+
*/
|
|
46
45
|
declare const datetimeRuleProcessorJSONata: RuleProcessor;
|
|
47
46
|
/**
|
|
48
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "mongodb_query" format using Luxon
|
|
49
|
-
*/
|
|
47
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "mongodb_query" format using Luxon
|
|
48
|
+
*/
|
|
50
49
|
declare const datetimeRuleProcessorMongoDBQuery: ValueProcessorByRule;
|
|
51
50
|
/**
|
|
52
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "natural_language" format using Luxon
|
|
53
|
-
*/
|
|
51
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "natural_language" format using Luxon
|
|
52
|
+
*/
|
|
54
53
|
declare const datetimeRuleProcessorNL: ValueProcessorByRule;
|
|
55
54
|
/**
|
|
56
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "cypher"/"gql" format using Luxon
|
|
57
|
-
*/
|
|
55
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "cypher"/"gql" format using Luxon
|
|
56
|
+
*/
|
|
58
57
|
declare const datetimeRuleProcessorCypher: ValueProcessorByRule;
|
|
59
58
|
/**
|
|
60
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "sparql" format using Luxon
|
|
61
|
-
*/
|
|
59
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "sparql" format using Luxon
|
|
60
|
+
*/
|
|
62
61
|
declare const datetimeRuleProcessorSPARQL: ValueProcessorByRule;
|
|
63
62
|
/**
|
|
64
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "parameterized"/"parameterized_named" formats
|
|
65
|
-
*/
|
|
63
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "parameterized"/"parameterized_named" formats
|
|
64
|
+
*/
|
|
66
65
|
declare const datetimeRuleProcessorParameterized: RuleProcessor;
|
|
67
66
|
/**
|
|
68
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "spel" format
|
|
69
|
-
*/
|
|
67
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "spel" format
|
|
68
|
+
*/
|
|
70
69
|
declare const datetimeRuleProcessorSpEL: RuleProcessor;
|
|
71
70
|
/**
|
|
72
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "ldap" format
|
|
73
|
-
*/
|
|
71
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "ldap" format
|
|
72
|
+
*/
|
|
74
73
|
declare const datetimeRuleProcessorLDAP: RuleProcessor;
|
|
75
74
|
/**
|
|
76
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "gremlin" format
|
|
77
|
-
*/
|
|
75
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "gremlin" format
|
|
76
|
+
*/
|
|
78
77
|
declare const datetimeRuleProcessorGremlin: RuleProcessor;
|
|
79
78
|
/**
|
|
80
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "prisma" format
|
|
81
|
-
*/
|
|
79
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "prisma" format
|
|
80
|
+
*/
|
|
82
81
|
declare const datetimeRuleProcessorPrisma: RuleProcessor;
|
|
83
82
|
/**
|
|
84
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "sequelize" format
|
|
85
|
-
*/
|
|
83
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "sequelize" format
|
|
84
|
+
*/
|
|
86
85
|
declare const datetimeRuleProcessorSequelize: RuleProcessor;
|
|
87
86
|
/**
|
|
88
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "drizzle" format
|
|
89
|
-
*/
|
|
87
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "drizzle" format
|
|
88
|
+
*/
|
|
90
89
|
declare const datetimeRuleProcessorDrizzle: RuleProcessor;
|
|
91
90
|
/**
|
|
92
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "elasticsearch" format
|
|
93
|
-
*/
|
|
91
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "elasticsearch" format
|
|
92
|
+
*/
|
|
94
93
|
declare const datetimeRuleProcessorElasticSearch: RuleProcessor;
|
|
95
94
|
/**
|
|
96
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "tanstack_db" format
|
|
97
|
-
*/
|
|
95
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for "tanstack_db" format
|
|
96
|
+
*/
|
|
98
97
|
declare const datetimeRuleProcessorTanStackDB: RuleProcessor;
|
|
99
98
|
/**
|
|
100
|
-
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for (deprecated) "mongodb" format
|
|
101
|
-
*/
|
|
99
|
+
* {@link @react-querybuilder/core!formatQuery formatQuery} rule processor for (deprecated) "mongodb" format
|
|
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,2 +1,2 @@
|
|
|
1
|
-
import{n as e}from"./utils-
|
|
1
|
+
import{n as e}from"./utils-DA8aluCt.mjs";import{C as t,S as n,T as r,_ as i,a,b as o,c as s,d as c,f as l,g as u,h as d,i as f,l as p,n as m,o as h,r as g,s as _,t as v,u as y,v as b,w as x,x as S,y as C}from"./getDatetimeRuleProcessorTanStackDB-6K1DsuEV.mjs";import{DateTime as w}from"luxon";const T=e=>typeof e==`string`?w.fromISO(e):w.fromJSDate(e),E=`yyyy-MM-dd`,D={minute:`minutes`,hour:`hours`,day:`days`,week:`weeks`,month:`months`,year:`years`},O={format:(e,t)=>T(e).toFormat(t.replace(`YYYY-MM-DD`,E)),isAfter:(e,t)=>T(e)>T(t),isBefore:(e,t)=>T(e)<T(t),isSame:(t,n)=>e(t)||e(n)?T(t).hasSame(T(n),`day`):+T(t)==+T(n),isValid:e=>T(e).isValid,toDate:e=>T(e).toJSDate(),toISOString:e=>{let t=T(e);return t.isValid?t.toJSDate().toISOString():``},toISOStringDateOnly:e=>{let t=T(e);return t.isValid?t.toFormat(E):``},startOf:(e,t)=>T(e).startOf(t).toJSDate(),endOf:(e,t)=>T(e).endOf(t).toJSDate(),add:(e,t,n)=>T(e).plus({[D[n]]:t}).toJSDate()},k=r(O),A=m(O),j=g(O),M=f(O),N=a(O),P=h(O),F=_(O),I=x(O),L=C(O),R=i(O),z=d(O),B=t(O),V=p(O),H=l(O),U=s(O),W=b(O),G=o(O),K=c(O),q=y(O),J=n(O),Y=S(O),X=v(O),Z=u(O);export{I as datetimeRuleProcessorCEL,B as datetimeRuleProcessorCypher,J as datetimeRuleProcessorDrizzle,Y as datetimeRuleProcessorElasticSearch,G as datetimeRuleProcessorGremlin,L as datetimeRuleProcessorJSONata,W as datetimeRuleProcessorLDAP,Z as datetimeRuleProcessorMongoDB,R as datetimeRuleProcessorMongoDBQuery,z as datetimeRuleProcessorNL,H as datetimeRuleProcessorParameterized,K as datetimeRuleProcessorPrisma,V as datetimeRuleProcessorSPARQL,A as datetimeRuleProcessorSQL,q as datetimeRuleProcessorSequelize,U as datetimeRuleProcessorSpEL,X as datetimeRuleProcessorTanStackDB,j as datetimeValueProcessorANSI,M as datetimeValueProcessorMSSQL,N as datetimeValueProcessorMySQL,P as datetimeValueProcessorOracle,F as datetimeValueProcessorPostgreSQL,k as jsonLogicDateTimeOperations,O as rqbDateTimeLibraryAPI};
|
|
2
2
|
//# sourceMappingURL=react-querybuilder_datetime.production.luxon.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{c as e,i as t,s as n,t as r}from"./utils-DA8aluCt.mjs";import{C as i,S as a,T as o,_ as s,a as c,b as l,c as u,d,f,g as p,h as m,i as h,l as g,m as _,n as v,o as y,p as b,r as x,s as S,t as C,u as w,v as T,w as E,x as D,y as O}from"./getDatetimeRuleProcessorTanStackDB-6K1DsuEV.mjs";import{defaultRuleProcessorJsonLogic as k,toArray as A}from"@react-querybuilder/core";const j={"!=":`dateNotOn`,"<":`dateBefore`,"<=":`dateOnOrBefore`,"=":`dateOn`,">":`dateAfter`,">=":`dateOnOrAfter`,between:`dateBetween`,in:`dateIn`,notBetween:`dateNotBetween`,notIn:`dateNotIn`},M=(i,a)=>{let o=a??{};if(!n(o.context?.isDateField,i,o)||i.valueSource===`parameter`)return k(i,o);let{field:s,value:c,valueSource:l}=i,u=e(i,o),d=l===`field`,f={var:s},p=r(o?.fieldData?.datatype),m=e=>d?{var:`${e}`}:t(e)?{dateRelative:[e.anchor,e.offset,e.unit,p]}:e;switch(u){case`<`:case`<=`:case`=`:case`!=`:case`>`:case`>=`:return{[j[u]]:[f,m(c)]};case`in`:case`notIn`:{let e=(Array.isArray(c)?c:A(c)).map(m);return{[j[u]]:[f,e]}}case`between`:case`notBetween`:{let e=(Array.isArray(c)?c:A(c)).map(m);return e.length<2?!1:{[j[u]]:[e[0],f,e[1]]}}}return k(i,a)};export{M as datetimeRuleProcessorJsonLogic,b as datetimeValueProcessorNL,_ as defaultDateTimeNLOperatorMap,o as getDatetimeJsonLogicOperations,E as getDatetimeRuleProcessorCEL,i as getDatetimeRuleProcessorCypher,a as getDatetimeRuleProcessorDrizzle,D as getDatetimeRuleProcessorElasticSearch,l as getDatetimeRuleProcessorGremlin,O as getDatetimeRuleProcessorJSONata,T as getDatetimeRuleProcessorLDAP,p as getDatetimeRuleProcessorMongoDB,s as getDatetimeRuleProcessorMongoDBQuery,m as getDatetimeRuleProcessorNL,f as getDatetimeRuleProcessorParameterized,d as getDatetimeRuleProcessorPrisma,g as getDatetimeRuleProcessorSPARQL,v as getDatetimeRuleProcessorSQL,w as getDatetimeRuleProcessorSequelize,u as getDatetimeRuleProcessorSpEL,C as getDatetimeRuleProcessorTanStackDB,x as getDatetimeValueProcessorANSI,h as getDatetimeValueProcessorMSSQL,c as getDatetimeValueProcessorMySQL,y as getDatetimeValueProcessorOracle,S as getDatetimeValueProcessorPostgreSQL};
|
|
2
2
|
//# sourceMappingURL=react-querybuilder_datetime.production.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-querybuilder_datetime.production.mjs","names":[],"sources":["../src/datetimeRuleProcessorJsonLogic.ts"],"sourcesContent":["import type { DefaultOperatorName, JsonLogicVar, RuleProcessor } from '@react-querybuilder/core';\nimport { defaultRuleProcessorJsonLogic, toArray } from '@react-querybuilder/core';\nimport type {
|
|
1
|
+
{"version":3,"file":"react-querybuilder_datetime.production.mjs","names":[],"sources":["../src/datetimeRuleProcessorJsonLogic.ts"],"sourcesContent":["import type { DefaultOperatorName, JsonLogicVar, RuleProcessor } from '@react-querybuilder/core';\nimport { defaultRuleProcessorJsonLogic, toArray } from '@react-querybuilder/core';\nimport type { RQBDateTimeJsonLogic } from './types';\nimport {\n isDateOnlyDatatype,\n isRelativeDateTimeValue,\n processIsDateField,\n resolveDatetimeOperator,\n} from './utils';\n\nconst dateOperationMap = {\n '!=': 'dateNotOn',\n '<': 'dateBefore',\n '<=': 'dateOnOrBefore',\n '=': 'dateOn',\n '>': 'dateAfter',\n '>=': 'dateOnOrAfter',\n between: 'dateBetween',\n in: 'dateIn',\n notBetween: 'dateNotBetween',\n notIn: 'dateNotIn',\n} as const satisfies Partial<Record<DefaultOperatorName, string>>;\n\n/**\n * Date/time rule processor for use by {@link @react-querybuilder/core!formatQuery formatQuery}\n * with the \"jsonlogic\" format.\n *\n * Note: Unlike other date/time rule processors from this library, this function does\n * not require a date/time library API. Instead, the date/time library API is used by\n * {@link getDatetimeJsonLogicOperations} during the evaluation process.\n */\nexport const datetimeRuleProcessorJsonLogic: RuleProcessor = (\n rule,\n options\n): RQBDateTimeJsonLogic => {\n const opts = options ?? /* v8 ignore start -- @preserve */ {}; /* v8 ignore stop -- @preserve */\n\n if (!processIsDateField(opts.context?.isDateField, rule, opts)) {\n return defaultRuleProcessorJsonLogic(rule, opts);\n }\n\n // Parameter references are named placeholders (not dates); delegate to the core default,\n // which emits the name as a literal (paradigm B).\n if (rule.valueSource === 'parameter') {\n return defaultRuleProcessorJsonLogic(rule, opts);\n }\n\n const { field, value, valueSource } = rule;\n const operator = resolveDatetimeOperator(rule, opts);\n const valueIsField = valueSource === 'field';\n const fieldObject: JsonLogicVar = { var: field };\n const dateOnly = isDateOnlyDatatype(opts?.fieldData?.datatype);\n // Relative values stay \"live\": emit a `dateRelative` op resolved at evaluation time.\n // Field-source values are field names and render as `var` references.\n const renderValue = (v: unknown) => {\n if (valueIsField) return { var: `${v}` };\n if (isRelativeDateTimeValue(v)) {\n return {\n dateRelative: [v.anchor, v.offset, v.unit, dateOnly],\n };\n }\n return v as string;\n };\n\n switch (operator) {\n case '<':\n case '<=':\n case '=':\n case '!=':\n case '>':\n case '>=':\n return {\n [dateOperationMap[operator]]: [fieldObject, renderValue(value)],\n } as RQBDateTimeJsonLogic;\n\n case 'in':\n case 'notIn': {\n const valueAsArray = (Array.isArray(value) ? value : toArray(value)).map(renderValue);\n return { [dateOperationMap[operator]]: [fieldObject, valueAsArray] } as RQBDateTimeJsonLogic;\n }\n\n case 'between':\n case 'notBetween': {\n const valueAsArray = (Array.isArray(value) ? value : toArray(value)).map(renderValue);\n\n if (valueAsArray.length < 2) return false;\n\n return {\n [dateOperationMap[operator]]: [valueAsArray[0], fieldObject, valueAsArray[1]],\n } as RQBDateTimeJsonLogic;\n }\n }\n\n return defaultRuleProcessorJsonLogic(rule, options);\n};\n"],"mappings":"wXAUA,MAAM,EAAmB,CACvB,KAAM,YACN,IAAK,aACL,KAAM,iBACN,IAAK,SACL,IAAK,YACL,KAAM,gBACN,QAAS,cACT,GAAI,SACJ,WAAY,iBACZ,MAAO,WACT,EAUa,GACX,EACA,IACyB,CACzB,IAAM,EAAO,GAA8C,CAAC,EAQ5D,GANI,CAAC,EAAmB,EAAK,SAAS,YAAa,EAAM,CAAI,GAMzD,EAAK,cAAgB,YACvB,OAAO,EAA8B,EAAM,CAAI,EAGjD,GAAM,CAAE,QAAO,QAAO,eAAgB,EAChC,EAAW,EAAwB,EAAM,CAAI,EAC7C,EAAe,IAAgB,QAC/B,EAA4B,CAAE,IAAK,CAAM,EACzC,EAAW,EAAmB,GAAM,WAAW,QAAQ,EAGvD,EAAe,GACf,EAAqB,CAAE,IAAK,GAAG,GAAI,EACnC,EAAwB,CAAC,EACpB,CACL,aAAc,CAAC,EAAE,OAAQ,EAAE,OAAQ,EAAE,KAAM,CAAQ,CACrD,EAEK,EAGT,OAAQ,EAAR,CACE,IAAK,IACL,IAAK,KACL,IAAK,IACL,IAAK,KACL,IAAK,IACL,IAAK,KACH,MAAO,EACJ,EAAiB,IAAY,CAAC,EAAa,EAAY,CAAK,CAAC,CAChE,EAEF,IAAK,KACL,IAAK,QAAS,CACZ,IAAM,GAAgB,MAAM,QAAQ,CAAK,EAAI,EAAQ,EAAQ,CAAK,EAAA,CAAG,IAAI,CAAW,EACpF,MAAO,EAAG,EAAiB,IAAY,CAAC,EAAa,CAAY,CAAE,CACrE,CAEA,IAAK,UACL,IAAK,aAAc,CACjB,IAAM,GAAgB,MAAM,QAAQ,CAAK,EAAI,EAAQ,EAAQ,CAAK,EAAA,CAAG,IAAI,CAAW,EAIpF,OAFI,EAAa,OAAS,EAAU,GAE7B,EACJ,EAAiB,IAAY,CAAC,EAAa,GAAI,EAAa,EAAa,EAAE,CAC9E,CACF,CACF,CAEA,OAAO,EAA8B,EAAM,CAAO,CACpD"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { _ as RelativeDateTimeAnchor, b as RelativeDateTimeValue, i as RQBDateTimeLibraryAPI, y as RelativeDateTimeUnit } from "./types-
|
|
1
|
+
import { _ as RelativeDateTimeAnchor, b as RelativeDateTimeValue, i as RQBDateTimeLibraryAPI, y as RelativeDateTimeUnit } from "./types-BKA1aoY6.mjs";
|
|
2
2
|
import { FullOption } from "@react-querybuilder/core";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { ComponentType, ReactNode } from "react";
|
|
5
5
|
import { FullOperator, FullOption as FullOption$1, QueryBuilderContextProvider, ValueEditorProps } from "react-querybuilder";
|
|
6
|
-
|
|
7
6
|
//#region src/ui/types.d.ts
|
|
8
7
|
/**
|
|
9
|
-
* Customizable content/labels for the absolute/relative mode toggle rendered by
|
|
10
|
-
* {@link toggleModeController}. The default glyphs come from CSS pseudo-elements, so
|
|
11
|
-
* `absoluteContent`/`relativeContent` are only needed to override them (e.g. to render
|
|
12
|
-
* an icon component or localized text).
|
|
13
|
-
*/
|
|
8
|
+
* Customizable content/labels for the absolute/relative mode toggle rendered by
|
|
9
|
+
* {@link toggleModeController}. The default glyphs come from CSS pseudo-elements, so
|
|
10
|
+
* `absoluteContent`/`relativeContent` are only needed to override them (e.g. to render
|
|
11
|
+
* an icon component or localized text).
|
|
12
|
+
*/
|
|
14
13
|
interface RelativeDateTimeToggleLabels {
|
|
15
14
|
/** Accessible label (`aria-label`) for the toggle button. */
|
|
16
15
|
label?: string;
|
|
@@ -24,10 +23,10 @@ interface RelativeDateTimeToggleLabels {
|
|
|
24
23
|
relativeContent?: ReactNode;
|
|
25
24
|
}
|
|
26
25
|
/**
|
|
27
|
-
* Props passed to a {@link RelativeDateTimeModeController}'s `ModeControl` component —
|
|
28
|
-
* the affordance (e.g. a toggle button) that switches a rule between absolute and
|
|
29
|
-
* relative date/time entry.
|
|
30
|
-
*/
|
|
26
|
+
* Props passed to a {@link RelativeDateTimeModeController}'s `ModeControl` component —
|
|
27
|
+
* the affordance (e.g. a toggle button) that switches a rule between absolute and
|
|
28
|
+
* relative date/time entry.
|
|
29
|
+
*/
|
|
31
30
|
interface RelativeDateTimeModeControlProps {
|
|
32
31
|
/** Whether the rule is currently in relative mode. */
|
|
33
32
|
isRelative: boolean;
|
|
@@ -47,30 +46,30 @@ interface RelativeDateTimeModeControlProps {
|
|
|
47
46
|
labels: Required<RelativeDateTimeToggleLabels>;
|
|
48
47
|
}
|
|
49
48
|
/**
|
|
50
|
-
* A pluggable strategy that governs how a user switches between absolute and relative
|
|
51
|
-
* date/time entry in the {@link RelativeDateTimeValueEditor}. The stored value shape is
|
|
52
|
-
* unaffected — a controller only decides the current mode and (optionally) renders an
|
|
53
|
-
* affordance to change it.
|
|
54
|
-
*
|
|
55
|
-
* Ships with {@link toggleModeController} (the zero-config default); build an
|
|
56
|
-
* operator-driven controller with {@link createOperatorModeController}, or supply a custom
|
|
57
|
-
* object to fully control the UX.
|
|
58
|
-
*/
|
|
49
|
+
* A pluggable strategy that governs how a user switches between absolute and relative
|
|
50
|
+
* date/time entry in the {@link RelativeDateTimeValueEditor}. The stored value shape is
|
|
51
|
+
* unaffected — a controller only decides the current mode and (optionally) renders an
|
|
52
|
+
* affordance to change it.
|
|
53
|
+
*
|
|
54
|
+
* Ships with {@link toggleModeController} (the zero-config default); build an
|
|
55
|
+
* operator-driven controller with {@link createOperatorModeController}, or supply a custom
|
|
56
|
+
* object to fully control the UX.
|
|
57
|
+
*/
|
|
59
58
|
interface RelativeDateTimeModeController {
|
|
60
59
|
/** Derives the current mode from the rule (its operator and/or value). */
|
|
61
60
|
isRelative: (props: ValueEditorProps) => boolean;
|
|
62
61
|
/**
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
* Optional affordance rendered inside the editor to switch modes. Omit it (as the
|
|
63
|
+
* operator-driven controller does) when the mode is selected elsewhere, e.g. via the
|
|
64
|
+
* operator selector.
|
|
65
|
+
*/
|
|
67
66
|
ModeControl?: ComponentType<RelativeDateTimeModeControlProps>;
|
|
68
67
|
}
|
|
69
68
|
/**
|
|
70
|
-
* Configuration for the {@link RelativeDateTimeValueEditor}, supplied as props to
|
|
71
|
-
* {@link QueryBuilderDateTime} (or via the relative date/time config context). Every
|
|
72
|
-
* field is optional; omitting all of them yields the zero-config toggle experience.
|
|
73
|
-
*/
|
|
69
|
+
* Configuration for the {@link RelativeDateTimeValueEditor}, supplied as props to
|
|
70
|
+
* {@link QueryBuilderDateTime} (or via the relative date/time config context). Every
|
|
71
|
+
* field is optional; omitting all of them yields the zero-config toggle experience.
|
|
72
|
+
*/
|
|
74
73
|
interface RelativeDateTimeEditorConfig {
|
|
75
74
|
/** Strategy for switching between absolute and relative modes. Defaults to {@link toggleModeController}. */
|
|
76
75
|
modeController?: RelativeDateTimeModeController;
|
|
@@ -81,28 +80,28 @@ interface RelativeDateTimeEditorConfig {
|
|
|
81
80
|
/** Content/labels for the absolute/relative toggle. */
|
|
82
81
|
toggleLabels?: RelativeDateTimeToggleLabels;
|
|
83
82
|
/**
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
83
|
+
* Date/time library adapter used by the value editor to parse/validate the rule value
|
|
84
|
+
* for the native date input. Defaults to the plain JavaScript adapter. Pass the adapter
|
|
85
|
+
* matching your chosen entry point (e.g. from `@react-querybuilder/datetime/luxon`) so the
|
|
86
|
+
* editor interprets values consistently with the rule processors.
|
|
87
|
+
*/
|
|
89
88
|
dateTimeAPI?: RQBDateTimeLibraryAPI;
|
|
90
89
|
}
|
|
91
90
|
/**
|
|
92
|
-
* Maps operator names that are used only to _signal_ relative mode (see
|
|
93
|
-
* {@link createOperatorModeController}) to the real comparison operator that should be used
|
|
94
|
-
* when exporting via `formatQuery`. Supplied through `context.relativeOperatorMap`. Operators
|
|
95
|
-
* not present in the map are exported unchanged.
|
|
96
|
-
*
|
|
97
|
-
* @example
|
|
98
|
-
* ```ts
|
|
99
|
-
* formatQuery(query, {
|
|
100
|
-
* format: 'sql',
|
|
101
|
-
* ruleProcessor: datetimeRuleProcessorSQL,
|
|
102
|
-
* context: { relativeOperatorMap: { relativeEq: '=' } },
|
|
103
|
-
* });
|
|
104
|
-
* ```
|
|
105
|
-
*/
|
|
91
|
+
* Maps operator names that are used only to _signal_ relative mode (see
|
|
92
|
+
* {@link createOperatorModeController}) to the real comparison operator that should be used
|
|
93
|
+
* when exporting via `formatQuery`. Supplied through `context.relativeOperatorMap`. Operators
|
|
94
|
+
* not present in the map are exported unchanged.
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* ```ts
|
|
98
|
+
* formatQuery(query, {
|
|
99
|
+
* format: 'sql',
|
|
100
|
+
* ruleProcessor: datetimeRuleProcessorSQL,
|
|
101
|
+
* context: { relativeOperatorMap: { relativeEq: '=' } },
|
|
102
|
+
* });
|
|
103
|
+
* ```
|
|
104
|
+
*/
|
|
106
105
|
type RelativeOperatorMap = Record<string, string>;
|
|
107
106
|
//#endregion
|
|
108
107
|
//#region src/ui/QueryBuilderDateTime.d.ts
|
|
@@ -113,22 +112,15 @@ interface QueryBuilderDateTimeProps extends RelativeDateTimeEditorConfig {
|
|
|
113
112
|
children?: React.ReactNode;
|
|
114
113
|
}
|
|
115
114
|
/**
|
|
116
|
-
* Context provider enabling date/time features for a wrapped
|
|
117
|
-
* {@link react-querybuilder!QueryBuilder QueryBuilder}: renders the relative-capable
|
|
118
|
-
* {@link RelativeDateTimeValueEditor} for date/time fields, and accepts optional
|
|
119
|
-
* {@link RelativeDateTimeEditorConfig} props (mode controller, anchor/unit options, and
|
|
120
|
-
* toggle labels). With no props it provides the zero-config toggle experience.
|
|
121
|
-
*
|
|
122
|
-
* @group Components
|
|
123
|
-
*/
|
|
124
|
-
declare const QueryBuilderDateTime: ({
|
|
125
|
-
children,
|
|
126
|
-
modeController,
|
|
127
|
-
anchors,
|
|
128
|
-
units,
|
|
129
|
-
toggleLabels,
|
|
130
|
-
dateTimeAPI
|
|
131
|
-
}: QueryBuilderDateTimeProps) => React.JSX.Element;
|
|
115
|
+
* Context provider enabling date/time features for a wrapped
|
|
116
|
+
* {@link react-querybuilder!QueryBuilder QueryBuilder}: renders the relative-capable
|
|
117
|
+
* {@link RelativeDateTimeValueEditor} for date/time fields, and accepts optional
|
|
118
|
+
* {@link RelativeDateTimeEditorConfig} props (mode controller, anchor/unit options, and
|
|
119
|
+
* toggle labels). With no props it provides the zero-config toggle experience.
|
|
120
|
+
*
|
|
121
|
+
* @group Components
|
|
122
|
+
*/
|
|
123
|
+
declare const QueryBuilderDateTime: ({ children, modeController, anchors, units, toggleLabels, dateTimeAPI }: QueryBuilderDateTimeProps) => React.JSX.Element;
|
|
132
124
|
//#endregion
|
|
133
125
|
//#region src/ui/RelativeDateTimeConfigContext.d.ts
|
|
134
126
|
/** Fully-resolved relative date/time editor config (no optional fields). */
|
|
@@ -140,35 +132,35 @@ interface ResolvedRelativeDateTimeConfig {
|
|
|
140
132
|
dateTimeAPI: RQBDateTimeLibraryAPI;
|
|
141
133
|
}
|
|
142
134
|
/**
|
|
143
|
-
* Carries {@link RelativeDateTimeEditorConfig} to the {@link RelativeDateTimeValueEditor}.
|
|
144
|
-
* Provided by {@link QueryBuilderDateTime}; defaults apply when no provider is present.
|
|
145
|
-
*/
|
|
135
|
+
* Carries {@link RelativeDateTimeEditorConfig} to the {@link RelativeDateTimeValueEditor}.
|
|
136
|
+
* Provided by {@link QueryBuilderDateTime}; defaults apply when no provider is present.
|
|
137
|
+
*/
|
|
146
138
|
declare const RelativeDateTimeConfigContext: React.Context<RelativeDateTimeEditorConfig>;
|
|
147
139
|
/** Reads the relative date/time editor config from context, merged with defaults. */
|
|
148
140
|
declare const useRelativeDateTimeConfig: () => ResolvedRelativeDateTimeConfig;
|
|
149
141
|
//#endregion
|
|
150
142
|
//#region src/ui/RelativeDateTimeValueEditor.d.ts
|
|
151
143
|
/**
|
|
152
|
-
* Value editor with support for {@link RelativeDateTimeValue relative date/time values}
|
|
153
|
-
* (e.g. "three months ago" or "the beginning of this year"). How the user switches
|
|
154
|
-
* between absolute and relative modes is delegated to a pluggable
|
|
155
|
-
* {@link RelativeDateTimeModeController} (default: a compact toggle), supplied via
|
|
156
|
-
* {@link QueryBuilderDateTime}. In relative mode it renders anchor + signed offset + unit
|
|
157
|
-
* selectors; the unit selector is hidden when the offset is `0`.
|
|
158
|
-
*
|
|
159
|
-
* For the `between`/`notBetween` operators it renders two independent value editors (each
|
|
160
|
-
* with its own mode affordance) and stores the bounds as a two-element array, so the from
|
|
161
|
-
* and to bounds can independently be absolute or relative.
|
|
162
|
-
*
|
|
163
|
-
* @group Components
|
|
164
|
-
*/
|
|
144
|
+
* Value editor with support for {@link RelativeDateTimeValue relative date/time values}
|
|
145
|
+
* (e.g. "three months ago" or "the beginning of this year"). How the user switches
|
|
146
|
+
* between absolute and relative modes is delegated to a pluggable
|
|
147
|
+
* {@link RelativeDateTimeModeController} (default: a compact toggle), supplied via
|
|
148
|
+
* {@link QueryBuilderDateTime}. In relative mode it renders anchor + signed offset + unit
|
|
149
|
+
* selectors; the unit selector is hidden when the offset is `0`.
|
|
150
|
+
*
|
|
151
|
+
* For the `between`/`notBetween` operators it renders two independent value editors (each
|
|
152
|
+
* with its own mode affordance) and stores the bounds as a two-element array, so the from
|
|
153
|
+
* and to bounds can independently be absolute or relative.
|
|
154
|
+
*
|
|
155
|
+
* @group Components
|
|
156
|
+
*/
|
|
165
157
|
declare const RelativeDateTimeValueEditor: (props: ValueEditorProps) => React.JSX.Element;
|
|
166
158
|
//#endregion
|
|
167
159
|
//#region src/ui/relativeDateTimeConstants.d.ts
|
|
168
160
|
/**
|
|
169
|
-
* Class name applied to the absolute/relative mode toggle button. Package-local (not part
|
|
170
|
-
* of the core `standardClassnames`) to avoid coupling core to this extension.
|
|
171
|
-
*/
|
|
161
|
+
* Class name applied to the absolute/relative mode toggle button. Package-local (not part
|
|
162
|
+
* of the core `standardClassnames`) to avoid coupling core to this extension.
|
|
163
|
+
*/
|
|
172
164
|
declare const relativeDateTimeToggleClassName = "rule-value-dateTimeRelative-toggle";
|
|
173
165
|
/** Default value applied when switching a rule to relative mode. */
|
|
174
166
|
declare const defaultRelativeDateTimeValue: RelativeDateTimeValue;
|
|
@@ -181,47 +173,41 @@ declare const defaultRelativeDateTimeToggleLabels: Required<RelativeDateTimeTogg
|
|
|
181
173
|
//#endregion
|
|
182
174
|
//#region src/ui/relativeDateTimeModeControllers.d.ts
|
|
183
175
|
/**
|
|
184
|
-
* Compact absolute/relative toggle rendered by {@link toggleModeController}. A
|
|
185
|
-
* `role="switch"` button whose default glyph is supplied by CSS (keyed on
|
|
186
|
-
* `aria-checked`); override via the `toggleLabels` config.
|
|
187
|
-
*
|
|
188
|
-
* @group Components
|
|
189
|
-
*/
|
|
190
|
-
declare const RelativeDateTimeModeToggle: ({
|
|
191
|
-
isRelative,
|
|
192
|
-
setMode,
|
|
193
|
-
disabled,
|
|
194
|
-
className,
|
|
195
|
-
labels
|
|
196
|
-
}: RelativeDateTimeModeControlProps) => React.JSX.Element;
|
|
176
|
+
* Compact absolute/relative toggle rendered by {@link toggleModeController}. A
|
|
177
|
+
* `role="switch"` button whose default glyph is supplied by CSS (keyed on
|
|
178
|
+
* `aria-checked`); override via the `toggleLabels` config.
|
|
179
|
+
*
|
|
180
|
+
* @group Components
|
|
181
|
+
*/
|
|
182
|
+
declare const RelativeDateTimeModeToggle: ({ isRelative, setMode, disabled, className, labels }: RelativeDateTimeModeControlProps) => React.JSX.Element;
|
|
197
183
|
/**
|
|
198
|
-
* Zero-config default {@link RelativeDateTimeModeController}: derives the mode from the
|
|
199
|
-
* value shape and renders a compact toggle button to switch between absolute and
|
|
200
|
-
* relative entry.
|
|
201
|
-
*/
|
|
184
|
+
* Zero-config default {@link RelativeDateTimeModeController}: derives the mode from the
|
|
185
|
+
* value shape and renders a compact toggle button to switch between absolute and
|
|
186
|
+
* relative entry.
|
|
187
|
+
*/
|
|
202
188
|
declare const toggleModeController: RelativeDateTimeModeController;
|
|
203
189
|
/**
|
|
204
|
-
* Builds an operator-driven {@link RelativeDateTimeModeController} that derives the mode
|
|
205
|
-
* from the rule's operator. Pass the operator name(s) (or a predicate) that should put the
|
|
206
|
-
* editor in relative mode. No toggle is rendered — the operator selector is the mode
|
|
207
|
-
* affordance.
|
|
208
|
-
*
|
|
209
|
-
* NOTE: the chosen operators only signal _mode_; the rule's value remains a
|
|
210
|
-
* {@link RelativeDateTimeValue}. For these operators to export correctly, map each one to a
|
|
211
|
-
* real comparison operator via `context.relativeOperatorMap` when calling `formatQuery`
|
|
212
|
-
* (e.g. `{ relativeEq: '=' }`). See the documentation.
|
|
213
|
-
*/
|
|
190
|
+
* Builds an operator-driven {@link RelativeDateTimeModeController} that derives the mode
|
|
191
|
+
* from the rule's operator. Pass the operator name(s) (or a predicate) that should put the
|
|
192
|
+
* editor in relative mode. No toggle is rendered — the operator selector is the mode
|
|
193
|
+
* affordance.
|
|
194
|
+
*
|
|
195
|
+
* NOTE: the chosen operators only signal _mode_; the rule's value remains a
|
|
196
|
+
* {@link RelativeDateTimeValue}. For these operators to export correctly, map each one to a
|
|
197
|
+
* real comparison operator via `context.relativeOperatorMap` when calling `formatQuery`
|
|
198
|
+
* (e.g. `{ relativeEq: '=' }`). See the documentation.
|
|
199
|
+
*/
|
|
214
200
|
declare const createOperatorModeController: (relativeOperators: string[] | ((operator: string) => boolean)) => RelativeDateTimeModeController;
|
|
215
201
|
interface FieldWithOperators {
|
|
216
202
|
operators?: FullOperator[];
|
|
217
203
|
[key: string]: unknown;
|
|
218
204
|
}
|
|
219
205
|
/**
|
|
220
|
-
* Appends the given `operators` to each field's `operators` list, so the operator-driven
|
|
221
|
-
* controller (see {@link createOperatorModeController}) has an operator to switch into
|
|
222
|
-
* relative mode. Fields without an explicit `operators` list fall back to the core
|
|
223
|
-
* `defaultOperators`.
|
|
224
|
-
*/
|
|
206
|
+
* Appends the given `operators` to each field's `operators` list, so the operator-driven
|
|
207
|
+
* controller (see {@link createOperatorModeController}) has an operator to switch into
|
|
208
|
+
* relative mode. Fields without an explicit `operators` list fall back to the core
|
|
209
|
+
* `defaultOperators`.
|
|
210
|
+
*/
|
|
225
211
|
declare const withRelativeOperators: <F extends FieldWithOperators>(fields: F[], operators: FullOperator[]) => F[];
|
|
226
212
|
//#endregion
|
|
227
213
|
export { DateTimeValueEditor, QueryBuilderDateTime, QueryBuilderDateTimeContext, QueryBuilderDateTimeProps, RelativeDateTimeConfigContext, RelativeDateTimeEditorConfig, RelativeDateTimeModeControlProps, RelativeDateTimeModeController, RelativeDateTimeModeToggle, RelativeDateTimeToggleLabels, RelativeDateTimeValueEditor, RelativeOperatorMap, ResolvedRelativeDateTimeConfig, createOperatorModeController, defaultRelativeDateTimeAnchors, defaultRelativeDateTimeToggleLabels, defaultRelativeDateTimeUnits, defaultRelativeDateTimeValue, relativeDateTimeToggleClassName, toggleModeController, useRelativeDateTimeConfig, withRelativeOperators };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as
|
|
1
|
+
import{i as e,r as t}from"./utils-DA8aluCt.mjs";import{t as n}from"./rqbDateTimeLibraryAPI.jsdate-DxBmxW2C.mjs";import*as r from"react";import{createContext as i,useCallback as a,useContext as o,useMemo as s}from"react";import{QueryBuilderContext as c,ValueEditor as l,clsx as u,defaultOperators as d,getCompatContextProvider as f,parseNumber as p,standardClassnames as m,toArray as h,useValueEditor as g}from"react-querybuilder";const _=i(null),v=()=>o(_),y=`rule-value-dateTimeRelative-toggle`,b={mode:`relative`,anchor:`now`,offset:0,unit:`day`},x=[{name:`now`,value:`now`,label:`now`},{name:`startOfDay`,value:`startOfDay`,label:`start of day`},{name:`endOfDay`,value:`endOfDay`,label:`end of day`},{name:`startOfWeek`,value:`startOfWeek`,label:`start of week`},{name:`endOfWeek`,value:`endOfWeek`,label:`end of week`},{name:`startOfMonth`,value:`startOfMonth`,label:`start of month`},{name:`endOfMonth`,value:`endOfMonth`,label:`end of month`},{name:`startOfYear`,value:`startOfYear`,label:`start of year`},{name:`endOfYear`,value:`endOfYear`,label:`end of year`}],S=[{name:`minute`,value:`minute`,label:`minute(s)`},{name:`hour`,value:`hour`,label:`hour(s)`},{name:`day`,value:`day`,label:`day(s)`},{name:`week`,value:`week`,label:`week(s)`},{name:`month`,value:`month`,label:`month(s)`},{name:`year`,value:`year`,label:`year(s)`}],C={label:`Toggle relative date/time`,absoluteTitle:`Absolute date/time (click for relative)`,relativeTitle:`Relative date/time (click for absolute)`,absoluteContent:``,relativeContent:``},w=({isRelative:e,setMode:t,disabled:n,className:i,labels:a})=>{let o=r.useCallback(()=>t(e?`absolute`:`relative`),[t,e]);return r.createElement(`button`,{type:`button`,role:`switch`,"aria-checked":e,"aria-label":a.label,title:e?a.relativeTitle:a.absoluteTitle,disabled:n,className:u(y,i),onClick:o},e?a.relativeContent:a.absoluteContent)},T={isRelative:t=>e(t.value),ModeControl:w},E=e=>({isRelative:t=>typeof e==`function`?e(t.operator):e.includes(t.operator)}),D=(e,t)=>e.map(e=>({...e,operators:[...e.operators??d,...t]})),O=i({}),k=()=>{let e=o(O);return s(()=>({modeController:e.modeController??T,anchors:e.anchors??x,units:e.units??S,toggleLabels:{...C,...e.toggleLabels},dateTimeAPI:e.dateTimeAPI??n}),[e])},A=[],j={name:``,value:``,label:``},M=t=>Array.isArray(t)?t:e(t)?[t]:h(t),N=({baseProps:t,value:n,onChange:i,absoluteOperator:o,config:s,SelectorComponent:c,NumericEditorComponent:l,valueListItemClassName:u,numericSchema:d})=>{let{schema:f,disabled:h,title:g,testID:_}=t,{modeController:v,anchors:y,units:x,toggleLabels:S}=s,C=v.isRelative({...t,value:n}),w=e(n)?n:b,T=a(e=>i(e===`relative`?b:``),[i]),E=a(e=>i({...w,anchor:e}),[i,w]),D=a(e=>i({...w,offset:p(e,{parseNumbers:!0})||0}),[i,w]),O=a(e=>i({...w,unit:e}),[i,w]),{ModeControl:k}=v;return r.createElement(r.Fragment,null,k&&r.createElement(k,{isRelative:C,setMode:T,schema:f,disabled:h,className:u,title:g,testID:_,labels:S}),C?r.createElement(r.Fragment,null,r.createElement(c,{schema:f,testID:_,title:g,className:u,handleOnChange:E,disabled:h,value:w.anchor,options:y,multiple:!1,listsAsArrays:!1,path:A,level:0}),r.createElement(l,{skipHook:!0,testID:_,inputType:`number`,title:g,className:u,disabled:h,handleOnChange:D,field:``,operator:``,value:w.offset,valueSource:`value`,fieldData:j,schema:d,path:A,level:0,rule:{field:``,operator:`=`,value:w.offset}}),w.offset!==0&&r.createElement(c,{schema:f,testID:_,title:g,className:u,handleOnChange:O,disabled:h,value:w.unit,options:x,multiple:!1,listsAsArrays:!1,path:A,level:0})):r.createElement(z,{...t,operator:o,value:n,handleOnChange:i,className:m.value}))},P=e=>{let{valueListItemClassName:t}=g(e),{className:n,value:i,handleOnChange:o,schema:c,operator:d,separator:f}=e,{suppressStandardClassnames:p}=c,h=e.selectorComponent??c.controls.valueSelector,_=v()??l,y=k(),b=s(()=>({...c,parseNumbers:!0}),[c]),x=s(()=>u(p||m.valueDateTimeRelative,n),[p,n]),S=d===`between`||d===`notBetween`,C=s(()=>M(i),[i]),w=a(e=>t=>{let n=[C[0],C[1]];n[e]=t,o(n)},[C,o]);return S?r.createElement(`span`,{className:x},r.createElement(N,{baseProps:e,value:C[0],onChange:w(0),absoluteOperator:`=`,config:y,SelectorComponent:h,NumericEditorComponent:_,valueListItemClassName:t,numericSchema:b}),f,r.createElement(N,{baseProps:e,value:C[1],onChange:w(1),absoluteOperator:`=`,config:y,SelectorComponent:h,NumericEditorComponent:_,valueListItemClassName:t,numericSchema:b})):r.createElement(`span`,{className:x},r.createElement(N,{baseProps:e,value:i,onChange:o,absoluteOperator:d,config:y,SelectorComponent:h,NumericEditorComponent:_,valueListItemClassName:t,numericSchema:b}))},F=(e,n)=>!t(e.valueSource)&&(e.type===`text`&&(n===`date`||n===`datetime-local`)||/^(?:date|datetime|timestamp)\b/i.test(e.fieldData?.datatype)),I=e=>`${e}`.padStart(2,`0`),L=(e,t)=>{let n=`${e.getFullYear()}-${I(e.getMonth()+1)}-${I(e.getDate())}`;return t?`${n}T${I(e.getHours())}:${I(e.getMinutes())}`:n},R=({editor:e,...t})=>e?r.createElement(e,t):r.createElement(l,{...t,skipHook:!0}),z=e=>{let t=g(e),n=v(),{dateTimeAPI:i}=k(),a=e=>r.createElement(R,{editor:n,...e});if(!F(e,t.inputTypeCoerced))return a(e);if(i.isValid(e.value)){let n=L(i.toDate(e.value),t.inputTypeCoerced!==`date`);return a({...e,value:n})}return a(e)},B=f({controlElements:{valueEditor:e=>{let t=g(e),n=v();return F(e,t.inputTypeCoerced)?r.createElement(P,e):r.createElement(R,{editor:n,...e})}}}),V=({children:e,modeController:t,anchors:n,units:i,toggleLabels:a,dateTimeAPI:l})=>{let u=s(()=>({modeController:t,anchors:n,units:i,toggleLabels:a,dateTimeAPI:l}),[t,n,i,a,l]),d=o(c).controlElements?.valueEditor??null;return r.createElement(O.Provider,{value:u},r.createElement(_.Provider,{value:d},r.createElement(B,null,e)))};export{z as DateTimeValueEditor,V as QueryBuilderDateTime,B as QueryBuilderDateTimeContext,O as RelativeDateTimeConfigContext,w as RelativeDateTimeModeToggle,P as RelativeDateTimeValueEditor,E as createOperatorModeController,x as defaultRelativeDateTimeAnchors,C as defaultRelativeDateTimeToggleLabels,S as defaultRelativeDateTimeUnits,b as defaultRelativeDateTimeValue,y as relativeDateTimeToggleClassName,T as toggleModeController,k as useRelativeDateTimeConfig,D as withRelativeOperators};
|
|
2
2
|
//# sourceMappingURL=react-querybuilder_datetime.production.ui.mjs.map
|