@evoke-platform/ui-components 1.4.0-testing.3 → 1.4.0-testing.4
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/core/Chip/Chip.d.ts +5 -2
- package/dist/published/components/core/Chip/Chip.js +6 -3
- package/dist/published/components/custom/CriteriaBuilder/CriteriaBuilder.d.ts +1 -0
- package/dist/published/components/custom/CriteriaBuilder/CriteriaBuilder.js +2 -1
- package/dist/published/stories/Chip.stories.d.ts +4 -3
- package/dist/published/stories/Chip.stories.js +4 -2
- package/package.json +1 -1
@@ -1,4 +1,7 @@
|
|
1
|
-
import { ChipProps } from '@mui/material';
|
1
|
+
import { ChipProps as MUIChipProps } from '@mui/material';
|
2
2
|
import React from 'react';
|
3
|
-
|
3
|
+
export interface ChipProps extends MUIChipProps {
|
4
|
+
tooltip?: string;
|
5
|
+
}
|
6
|
+
declare const Chip: ({ tooltip, ...props }: ChipProps) => React.JSX.Element;
|
4
7
|
export default Chip;
|
@@ -1,8 +1,11 @@
|
|
1
1
|
import { Chip as MUIChip } from '@mui/material';
|
2
2
|
import React from 'react';
|
3
|
-
import
|
4
|
-
const Chip = (props) => {
|
5
|
-
|
3
|
+
import Tooltip from '../Tooltip';
|
4
|
+
const Chip = ({ tooltip, ...props }) => {
|
5
|
+
if (!tooltip) {
|
6
|
+
return React.createElement(MUIChip, { ...props });
|
7
|
+
}
|
8
|
+
return (React.createElement(Tooltip, { title: tooltip },
|
6
9
|
React.createElement(MUIChip, { ...props })));
|
7
10
|
};
|
8
11
|
export default Chip;
|
@@ -26,6 +26,7 @@ export type CriteriaInputProps = {
|
|
26
26
|
fetchObject?: (objectId: string) => Promise<EvokeObject | undefined>;
|
27
27
|
object: TreeViewObject;
|
28
28
|
};
|
29
|
+
rootObject?: EvokeObject;
|
29
30
|
/**
|
30
31
|
* String matching operators ('contains', 'beginsWith', 'endsWith') use regex patterns.
|
31
32
|
* Special characters like .*+?^${}()|[] are escaped (\\) by default.
|
@@ -265,7 +265,7 @@ export const valueEditor = (props) => {
|
|
265
265
|
return ValueEditor(props);
|
266
266
|
};
|
267
267
|
const CriteriaBuilder = (props) => {
|
268
|
-
const { properties, criteria, setCriteria, originalCriteria, enablePresetValues, presetValues, operators, disabled, disabledCriteria, hideBorder, presetGroupLabel, customValueEditor, treeViewOpts, disableRegexEscapeChars, } = props;
|
268
|
+
const { properties, criteria, setCriteria, originalCriteria, enablePresetValues, presetValues, operators, disabled, disabledCriteria, hideBorder, presetGroupLabel, customValueEditor, treeViewOpts, disableRegexEscapeChars, rootObject, } = props;
|
269
269
|
const [query, setQuery] = useState(undefined);
|
270
270
|
const [propertyTreeMap, setPropertyTreeMap] = useState();
|
271
271
|
useEffect(() => {
|
@@ -483,6 +483,7 @@ const CriteriaBuilder = (props) => {
|
|
483
483
|
valueEditor: customValueEditor ? customValueEditor.component : valueEditor,
|
484
484
|
}, context: {
|
485
485
|
...(customValueEditor?.props ?? {}),
|
486
|
+
rootObject,
|
486
487
|
presetValues,
|
487
488
|
enablePresetValues,
|
488
489
|
presetGroupLabel,
|
@@ -1,6 +1,7 @@
|
|
1
|
-
import { ChipProps } from '@mui/material';
|
2
1
|
import { ComponentMeta, ComponentStory } from '@storybook/react';
|
3
2
|
import React from 'react';
|
4
|
-
|
3
|
+
import { ChipProps } from '../components/core/Chip/Chip';
|
4
|
+
declare const _default: ComponentMeta<({ tooltip, ...props }: ChipProps) => React.JSX.Element>;
|
5
5
|
export default _default;
|
6
|
-
export declare const
|
6
|
+
export declare const ChipWithTooltip: ComponentStory<({ tooltip, ...props }: ChipProps) => React.JSX.Element>;
|
7
|
+
export declare const Chip: ComponentStory<({ tooltip, ...props }: ChipProps) => React.JSX.Element>;
|
@@ -1,8 +1,10 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { Chip as CustomChip } from '../index';
|
3
3
|
export default {
|
4
|
-
|
4
|
+
label: 'Data Display/Chip',
|
5
5
|
component: CustomChip,
|
6
6
|
};
|
7
|
-
const ChipTemplate = (args) => React.createElement(CustomChip, { ...args });
|
7
|
+
const ChipTemplate = (args) => (React.createElement(CustomChip, { label: "Basic Chip", ...args }));
|
8
|
+
const ChipWithToolipTemplate = (args) => (React.createElement(CustomChip, { tooltip: "Here is a tooltip", label: "Chip with Tooltip", ...args }));
|
9
|
+
export const ChipWithTooltip = ChipWithToolipTemplate.bind({});
|
8
10
|
export const Chip = ChipTemplate.bind({});
|