@evoke-platform/ui-components 1.0.0-dev.256 → 1.0.0-dev.258
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/published/components/custom/CriteriaBuilder/CriteriaBuilder.d.ts +9 -0
- package/dist/published/components/custom/CriteriaBuilder/CriteriaBuilder.js +5 -2
- package/dist/published/components/custom/CriteriaBuilder/utils.js +1 -1
- package/dist/published/stories/CriteriaBuilder.stories.js +1 -1
- package/package.json +2 -2
@@ -27,6 +27,15 @@ export type CriteriaInputProps = {
|
|
27
27
|
fetchObject?: (objectId: string) => Promise<EvokeObject | undefined>;
|
28
28
|
object: TreeViewObject;
|
29
29
|
};
|
30
|
+
/**
|
31
|
+
* String matching operators ('contains', 'beginsWith', 'endsWith') use regex patterns.
|
32
|
+
* Special characters like .*+?^${}()|[] are escaped (\\) by default.
|
33
|
+
* Set to true to treat these characters as normal text instead.
|
34
|
+
* @example
|
35
|
+
* // Default: input "hello.*" becomes "hello\.\*" in the query
|
36
|
+
* // With disableRegexEscapeChars=true: "hello.*" stays as "hello.*" in the query
|
37
|
+
*/
|
38
|
+
disableRegexEscapeChars?: boolean;
|
30
39
|
};
|
31
40
|
export declare const valueEditor: (props: ValueEditorProps) => JSX.Element;
|
32
41
|
declare const CriteriaBuilder: (props: CriteriaInputProps) => JSX.Element;
|
@@ -264,7 +264,7 @@ export const valueEditor = (props) => {
|
|
264
264
|
return ValueEditor(props);
|
265
265
|
};
|
266
266
|
const CriteriaBuilder = (props) => {
|
267
|
-
const { properties, criteria, setCriteria, originalCriteria, enablePresetValues, presetValues, operators, dynamicContentInput, disabled, disabledCriteria, hideBorder, presetGroupLabel, treeViewOpts, } = props;
|
267
|
+
const { properties, criteria, setCriteria, originalCriteria, enablePresetValues, presetValues, operators, dynamicContentInput, disabled, disabledCriteria, hideBorder, presetGroupLabel, treeViewOpts, disableRegexEscapeChars, } = props;
|
268
268
|
const [query, setQuery] = useState(undefined);
|
269
269
|
const [propertyTreeMap, setPropertyTreeMap] = useState({});
|
270
270
|
useEffect(() => {
|
@@ -332,7 +332,10 @@ const CriteriaBuilder = (props) => {
|
|
332
332
|
format: 'mongodb',
|
333
333
|
ruleProcessor: (rule, options) => {
|
334
334
|
let newRule = rule;
|
335
|
-
|
335
|
+
const isPresetValue = typeof rule.value === 'string' && rule.value.startsWith('{{') && rule.value.endsWith('}}');
|
336
|
+
if (!disableRegexEscapeChars &&
|
337
|
+
['contains', 'beginsWith', 'endsWith'].includes(rule.operator) &&
|
338
|
+
!isPresetValue) {
|
336
339
|
newRule = { ...rule, value: escape(rule.value) };
|
337
340
|
}
|
338
341
|
return defaultRuleProcessorMongoDB(newRule, options);
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@evoke-platform/ui-components",
|
3
|
-
"version": "1.0.0-dev.
|
3
|
+
"version": "1.0.0-dev.258",
|
4
4
|
"description": "",
|
5
5
|
"main": "dist/published/index.js",
|
6
6
|
"module": "dist/published/index.js",
|
@@ -29,7 +29,7 @@
|
|
29
29
|
"prettier:fix": "npm run prettier:cli -- --write",
|
30
30
|
"eslint": "eslint src",
|
31
31
|
"eslint:fix": "npm run eslint -- --fix",
|
32
|
-
"release": "commit-and-tag-version --
|
32
|
+
"release": "commit-and-tag-version --releaseCommitMessageFormat \"chore(release): {{currentTag}} [skip ci]\"",
|
33
33
|
"prepare": "husky install"
|
34
34
|
},
|
35
35
|
"author": "",
|