@olenbetong/appframe-core 2.12.0 → 2.13.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/esm/af.common.js +9 -3
- package/dist/esm/af.common.legacy.js +9 -3
- package/dist/esm/af.common.legacy.min.js +2 -2
- package/dist/esm/af.common.legacy.min.js.map +1 -1
- package/dist/esm/af.common.min.js +2 -2
- package/dist/esm/af.common.min.js.map +1 -1
- package/dist/iife/af.common.js +9 -3
- package/dist/iife/af.common.legacy.js +9 -3
- package/dist/iife/af.common.legacy.min.js +2 -2
- package/dist/iife/af.common.legacy.min.js.map +1 -1
- package/dist/iife/af.common.min.js +2 -2
- package/dist/iife/af.common.min.js.map +1 -1
- package/es/filter/operators.js +8 -2
- package/es/filter/operators.test.js +2 -1
- package/es/filter/tree.test.js +1 -1
- package/es/index.js +1 -1
- package/package.json +1 -1
- package/src/filter/operators.test.ts +2 -1
- package/src/filter/operators.ts +8 -2
- package/src/filter/tree.test.ts +1 -1
package/es/filter/operators.js
CHANGED
|
@@ -100,13 +100,19 @@ const OPERATORS_BY_TYPE = {
|
|
|
100
100
|
string: [...EQUALITY, ...STRING_CHECKS, ...LIST_CHECKS, ...RANGE, ...COMPARISONS],
|
|
101
101
|
uniqueidentifier: [...EQUALITY, ...STRING_CHECKS, ...LIST_CHECKS, ...RANGE, ...COMPARISONS],
|
|
102
102
|
};
|
|
103
|
-
/**
|
|
103
|
+
/**
|
|
104
|
+
* Default operator per field type.
|
|
105
|
+
*
|
|
106
|
+
* Text defaults to `contains` because a substring search is what people
|
|
107
|
+
* reach for when they type into a filter box without picking an operator —
|
|
108
|
+
* `beginswith` silently misses matches in the middle of the value.
|
|
109
|
+
*/
|
|
104
110
|
const DEFAULT_OPERATOR_BY_TYPE = {
|
|
105
111
|
date: "equals",
|
|
106
112
|
datetime: "equals",
|
|
107
113
|
number: "equals",
|
|
108
114
|
boolean: "istrue",
|
|
109
|
-
string: "
|
|
115
|
+
string: "contains",
|
|
110
116
|
uniqueidentifier: "beginswith",
|
|
111
117
|
};
|
|
112
118
|
/**
|
|
@@ -29,7 +29,8 @@ describe("getOperatorsForField", () => {
|
|
|
29
29
|
});
|
|
30
30
|
describe("getDefaultOperator", () => {
|
|
31
31
|
test.each([
|
|
32
|
-
["string", "
|
|
32
|
+
["string", "contains"],
|
|
33
|
+
["uniqueidentifier", "beginswith"],
|
|
33
34
|
["number", "equals"],
|
|
34
35
|
["date", "equals"],
|
|
35
36
|
["datetime", "equals"],
|
package/es/filter/tree.test.js
CHANGED
package/es/index.js
CHANGED
|
@@ -19,4 +19,4 @@ export { UserSession };
|
|
|
19
19
|
export { alert, ConfirmButtons, confirm, openAlertDialog, waitForDialog } from "./alert.js";
|
|
20
20
|
export { getSettings, saveSettings } from "./settings.js";
|
|
21
21
|
// oxlint-disable-next-line no-use-before-define -- this is injected build time
|
|
22
|
-
export const version = "2.
|
|
22
|
+
export const version = "2.12.0";
|
package/package.json
CHANGED
|
@@ -49,7 +49,8 @@ describe("getOperatorsForField", () => {
|
|
|
49
49
|
|
|
50
50
|
describe("getDefaultOperator", () => {
|
|
51
51
|
test.each([
|
|
52
|
-
["string", "
|
|
52
|
+
["string", "contains"],
|
|
53
|
+
["uniqueidentifier", "beginswith"],
|
|
53
54
|
["number", "equals"],
|
|
54
55
|
["date", "equals"],
|
|
55
56
|
["datetime", "equals"],
|
package/src/filter/operators.ts
CHANGED
|
@@ -112,13 +112,19 @@ const OPERATORS_BY_TYPE: Record<FilterFieldType, FilterOperator[]> = {
|
|
|
112
112
|
uniqueidentifier: [...EQUALITY, ...STRING_CHECKS, ...LIST_CHECKS, ...RANGE, ...COMPARISONS],
|
|
113
113
|
};
|
|
114
114
|
|
|
115
|
-
/**
|
|
115
|
+
/**
|
|
116
|
+
* Default operator per field type.
|
|
117
|
+
*
|
|
118
|
+
* Text defaults to `contains` because a substring search is what people
|
|
119
|
+
* reach for when they type into a filter box without picking an operator —
|
|
120
|
+
* `beginswith` silently misses matches in the middle of the value.
|
|
121
|
+
*/
|
|
116
122
|
const DEFAULT_OPERATOR_BY_TYPE: Record<FilterFieldType, FilterOperator> = {
|
|
117
123
|
date: "equals",
|
|
118
124
|
datetime: "equals",
|
|
119
125
|
number: "equals",
|
|
120
126
|
boolean: "istrue",
|
|
121
|
-
string: "
|
|
127
|
+
string: "contains",
|
|
122
128
|
uniqueidentifier: "beginswith",
|
|
123
129
|
};
|
|
124
130
|
|
package/src/filter/tree.test.ts
CHANGED
|
@@ -135,7 +135,7 @@ describe("createExpression", () => {
|
|
|
135
135
|
expect(createExpression({ name: "Name", type: "string" })).toEqual({
|
|
136
136
|
type: "expression",
|
|
137
137
|
column: "Name",
|
|
138
|
-
operator: "
|
|
138
|
+
operator: "contains",
|
|
139
139
|
value: "",
|
|
140
140
|
valueType: "string",
|
|
141
141
|
});
|