@axinom/mosaic-ui 0.63.0-rc.2 → 0.63.0-rc.3
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/components/Explorer/Explorer.d.ts.map +1 -1
- package/dist/components/FieldSelection/FieldSelection.d.ts.map +1 -1
- package/dist/index.es.js +2 -2
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/Explorer/Explorer.tsx +1 -0
- package/src/components/FieldSelection/FieldSelection.scss +7 -0
- package/src/components/FieldSelection/FieldSelection.spec.tsx +0 -2
- package/src/components/FieldSelection/FieldSelection.tsx +4 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axinom/mosaic-ui",
|
|
3
|
-
"version": "0.63.0-rc.
|
|
3
|
+
"version": "0.63.0-rc.3",
|
|
4
4
|
"description": "UI components for building Axinom Mosaic applications",
|
|
5
5
|
"author": "Axinom",
|
|
6
6
|
"license": "PROPRIETARY",
|
|
@@ -112,5 +112,5 @@
|
|
|
112
112
|
"publishConfig": {
|
|
113
113
|
"access": "public"
|
|
114
114
|
},
|
|
115
|
-
"gitHead": "
|
|
115
|
+
"gitHead": "a78369cc85ef82dad007c3fa8ff8f0b8b0cb149b"
|
|
116
116
|
}
|
|
@@ -487,6 +487,7 @@ export const Explorer = React.forwardRef(function Explorer<T extends Data>(
|
|
|
487
487
|
onItemSelected={itemSelectedHandler}
|
|
488
488
|
onRequestMoreData={onRequestMoreData}
|
|
489
489
|
onSortChanged={(sortData: SortData<T>) => {
|
|
490
|
+
listRef.current?.resetSelection();
|
|
490
491
|
onSortChanged(sortData);
|
|
491
492
|
setSortOrder(sortData);
|
|
492
493
|
}}
|
|
@@ -34,7 +34,6 @@ describe('FieldSelection', () => {
|
|
|
34
34
|
target: { value: 'field1' },
|
|
35
35
|
});
|
|
36
36
|
fireEvent.click(screen.getByText('Field 1'));
|
|
37
|
-
fireEvent.click(screen.getByTestId('add-field-button'));
|
|
38
37
|
|
|
39
38
|
expect(screen.getByTestId('field-field1')).toBeInTheDocument();
|
|
40
39
|
});
|
|
@@ -51,7 +50,6 @@ describe('FieldSelection', () => {
|
|
|
51
50
|
target: { value: 'field1' },
|
|
52
51
|
});
|
|
53
52
|
fireEvent.click(screen.getByText('Field 1'));
|
|
54
|
-
fireEvent.click(screen.getByTestId('add-field-button'));
|
|
55
53
|
|
|
56
54
|
expect(screen.getByTestId('field-field1')).toBeInTheDocument();
|
|
57
55
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
2
|
import { Accordion, AccordionItem } from '../Accordion';
|
|
3
3
|
import { Button, ButtonContext } from '../Buttons';
|
|
4
4
|
import { Select } from '../FormElements';
|
|
@@ -105,7 +105,7 @@ const FieldSelectionHeader: React.FC<{
|
|
|
105
105
|
}> = ({ fields, onAddField }) => {
|
|
106
106
|
const [value, setValue] = React.useState<string>();
|
|
107
107
|
|
|
108
|
-
|
|
108
|
+
useEffect(() => {
|
|
109
109
|
if (value) {
|
|
110
110
|
onAddField(value);
|
|
111
111
|
setValue(undefined);
|
|
@@ -113,22 +113,17 @@ const FieldSelectionHeader: React.FC<{
|
|
|
113
113
|
}, [onAddField, value]);
|
|
114
114
|
|
|
115
115
|
return (
|
|
116
|
-
<div className={classes.
|
|
116
|
+
<div className={classes.selectionHeader}>
|
|
117
117
|
<Select
|
|
118
118
|
label="Field"
|
|
119
119
|
name="field"
|
|
120
120
|
placeholder="Select Field"
|
|
121
121
|
options={fields}
|
|
122
|
+
disabled={fields.length === 0}
|
|
122
123
|
inlineMode={true}
|
|
123
124
|
onChange={(e) => setValue(e.currentTarget.value)}
|
|
124
125
|
value={value}
|
|
125
126
|
/>
|
|
126
|
-
<Button
|
|
127
|
-
icon={IconName.Plus}
|
|
128
|
-
buttonContext={value ? ButtonContext.Active : ButtonContext.Icon}
|
|
129
|
-
onButtonClicked={handleButtonClicked}
|
|
130
|
-
dataTestId="add-field-button"
|
|
131
|
-
/>
|
|
132
127
|
</div>
|
|
133
128
|
);
|
|
134
129
|
};
|