@axinom/mosaic-ui 0.35.0-rc.0 → 0.35.0-rc.10
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/DynamicDataList/DynamicDataList.d.ts +5 -14
- package/dist/components/DynamicDataList/DynamicDataList.d.ts.map +1 -1
- package/dist/components/DynamicDataList/DynamicListDataEntry/DynamicListDataEntry.d.ts +3 -1
- package/dist/components/DynamicDataList/DynamicListDataEntry/DynamicListDataEntry.d.ts.map +1 -1
- package/dist/components/DynamicDataList/DynamicListHeader/DynamicListHeader.d.ts +5 -1
- package/dist/components/DynamicDataList/DynamicListHeader/DynamicListHeader.d.ts.map +1 -1
- package/dist/components/DynamicDataList/DynamicListRow/DynamicListRow.d.ts +9 -10
- package/dist/components/DynamicDataList/DynamicListRow/DynamicListRow.d.ts.map +1 -1
- package/dist/components/DynamicDataList/helpers/DynamicListReducer/DynamicListReducer.actions.d.ts +5 -0
- package/dist/components/DynamicDataList/helpers/DynamicListReducer/DynamicListReducer.actions.d.ts.map +1 -0
- package/dist/components/DynamicDataList/helpers/DynamicListReducer/DynamicListReducer.d.ts +4 -0
- package/dist/components/DynamicDataList/helpers/DynamicListReducer/DynamicListReducer.d.ts.map +1 -0
- package/dist/components/DynamicDataList/helpers/DynamicListReducer/DynamicListReducer.init.d.ts +4 -0
- package/dist/components/DynamicDataList/helpers/DynamicListReducer/DynamicListReducer.init.d.ts.map +1 -0
- package/dist/components/DynamicDataList/helpers/DynamicListReducer/DynamicListReducer.types.d.ts +38 -0
- package/dist/components/DynamicDataList/helpers/DynamicListReducer/DynamicListReducer.types.d.ts.map +1 -0
- package/dist/components/DynamicDataList/helpers/DynamicListReducer/index.d.ts +4 -0
- package/dist/components/DynamicDataList/helpers/DynamicListReducer/index.d.ts.map +1 -0
- package/dist/components/DynamicDataList/helpers/generateId.d.ts +6 -0
- package/dist/components/DynamicDataList/helpers/generateId.d.ts.map +1 -0
- package/dist/components/DynamicDataList/helpers/useColumnDefs.d.ts +14 -0
- package/dist/components/DynamicDataList/helpers/useColumnDefs.d.ts.map +1 -0
- package/dist/components/DynamicDataList/helpers/useDataHandler.d.ts +9 -0
- package/dist/components/DynamicDataList/helpers/useDataHandler.d.ts.map +1 -0
- package/dist/components/DynamicDataList/helpers/useRowAnimation.d.ts +12 -0
- package/dist/components/DynamicDataList/helpers/useRowAnimation.d.ts.map +1 -0
- package/dist/components/DynamicDataList/index.d.ts +1 -1
- package/dist/components/DynamicDataList/index.d.ts.map +1 -1
- package/dist/components/List/ListRow/ListRow.d.ts.map +1 -1
- package/dist/components/List/useColumnsSize.d.ts +1 -0
- package/dist/components/List/useColumnsSize.d.ts.map +1 -1
- package/dist/index.es.js +11 -3
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +11 -3
- package/dist/index.js.map +1 -1
- package/package.json +5 -3
- package/src/components/DynamicDataList/DynamicDataList.scss +0 -61
- package/src/components/DynamicDataList/DynamicDataList.spec.tsx +126 -393
- package/src/components/DynamicDataList/DynamicDataList.stories.tsx +0 -5
- package/src/components/DynamicDataList/DynamicDataList.tsx +133 -600
- package/src/components/DynamicDataList/DynamicListDataEntry/DynamicListDataEntry.scss +4 -2
- package/src/components/DynamicDataList/DynamicListDataEntry/DynamicListDataEntry.spec.tsx +17 -44
- package/src/components/DynamicDataList/DynamicListDataEntry/DynamicListDataEntry.tsx +15 -22
- package/src/components/DynamicDataList/DynamicListHeader/DynamicListHeader.scss +15 -10
- package/src/components/DynamicDataList/DynamicListHeader/DynamicListHeader.spec.tsx +4 -1
- package/src/components/DynamicDataList/DynamicListHeader/DynamicListHeader.tsx +16 -14
- package/src/components/DynamicDataList/DynamicListRow/DynamicListRow.scss +16 -24
- package/src/components/DynamicDataList/DynamicListRow/DynamicListRow.spec.tsx +26 -253
- package/src/components/DynamicDataList/DynamicListRow/DynamicListRow.tsx +45 -139
- package/src/components/DynamicDataList/helpers/DynamicListReducer/DynamicListReducer.actions.spec.ts +276 -0
- package/src/components/DynamicDataList/helpers/DynamicListReducer/DynamicListReducer.actions.ts +86 -0
- package/src/components/DynamicDataList/helpers/DynamicListReducer/DynamicListReducer.init.spec.ts +118 -0
- package/src/components/DynamicDataList/helpers/DynamicListReducer/DynamicListReducer.init.ts +40 -0
- package/src/components/DynamicDataList/helpers/DynamicListReducer/DynamicListReducer.spec.ts +89 -0
- package/src/components/DynamicDataList/helpers/DynamicListReducer/DynamicListReducer.ts +42 -0
- package/src/components/DynamicDataList/helpers/DynamicListReducer/DynamicListReducer.types.ts +46 -0
- package/src/components/DynamicDataList/helpers/DynamicListReducer/index.ts +3 -0
- package/src/components/DynamicDataList/helpers/generateId.ts +10 -0
- package/src/components/DynamicDataList/helpers/useColumnDefs.ts +56 -0
- package/src/components/DynamicDataList/helpers/useDataHandler.ts +77 -0
- package/src/components/DynamicDataList/helpers/useRowAnimation.tsx +38 -0
- package/src/components/DynamicDataList/index.ts +2 -2
- package/src/components/FormElements/BooleanView/BooleanViewField.scss +2 -2
- package/src/components/FormStation/FormStation.scss +4 -0
- package/src/components/FormStation/FormStation.tsx +2 -2
- package/src/components/List/List.tsx +1 -1
- package/src/components/List/ListRow/ListRow.tsx +56 -50
- package/src/components/List/ListRow/Renderers/BooleanDotRenderer/BooleanDotRenderer.scss +6 -9
- package/src/components/List/ListRow/Renderers/BooleanDotRenderer/BooleanDotRenderer.spec.tsx +2 -2
- package/src/components/List/ListRow/Renderers/BooleanDotRenderer/BooleanDotRenderer.tsx +1 -1
- package/src/components/List/useColumnsSize.ts +20 -3
- package/src/styles/variables.scss +0 -5
- package/src/components/DynamicDataList/DynamicDataList.reposition.spec.tsx +0 -816
|
@@ -249,58 +249,64 @@ export const ListRow = <T extends Data>({
|
|
|
249
249
|
{generateCells}
|
|
250
250
|
</div>
|
|
251
251
|
)}
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
252
|
+
{(inlineMenuActions ||
|
|
253
|
+
showActionButton ||
|
|
254
|
+
showCheckMark ||
|
|
255
|
+
showItemCheckbox) && (
|
|
256
|
+
<div className={classes.actions}>
|
|
257
|
+
{inlineMenuActions &&
|
|
258
|
+
inlineActionMenuData &&
|
|
259
|
+
inlineActionMenuData.length > 0 && (
|
|
260
|
+
<InlineMenu
|
|
261
|
+
actions={inlineActionMenuData}
|
|
262
|
+
showArrow={false}
|
|
263
|
+
placement="bottom-end"
|
|
264
|
+
/>
|
|
265
|
+
)}
|
|
266
|
+
{showActionButton && selectionMode === ListSelectMode.None && (
|
|
267
|
+
<>
|
|
268
|
+
{showActionButton &&
|
|
269
|
+
(typeof onItemClicked !== 'function' ? (
|
|
270
|
+
<Button
|
|
271
|
+
icon={IconName.ChevronRight}
|
|
272
|
+
height={actionSize}
|
|
273
|
+
width={actionSize}
|
|
274
|
+
path={onItemClicked}
|
|
275
|
+
dataTestId="list-entry-action"
|
|
276
|
+
/>
|
|
277
|
+
) : (
|
|
278
|
+
<Button
|
|
279
|
+
icon={IconName.ChevronRight}
|
|
280
|
+
height={actionSize}
|
|
281
|
+
width={actionSize}
|
|
282
|
+
onButtonClicked={() => onItemClickedHandler(data)}
|
|
283
|
+
dataTestId="list-entry-action"
|
|
284
|
+
/>
|
|
285
|
+
))}
|
|
286
|
+
</>
|
|
261
287
|
)}
|
|
262
|
-
{showActionButton && selectionMode === ListSelectMode.None && (
|
|
263
|
-
<>
|
|
264
|
-
{showActionButton &&
|
|
265
|
-
(typeof onItemClicked !== 'function' ? (
|
|
266
|
-
<Button
|
|
267
|
-
icon={IconName.ChevronRight}
|
|
268
|
-
height={actionSize}
|
|
269
|
-
width={actionSize}
|
|
270
|
-
path={onItemClicked}
|
|
271
|
-
dataTestId="list-entry-action"
|
|
272
|
-
/>
|
|
273
|
-
) : (
|
|
274
|
-
<Button
|
|
275
|
-
icon={IconName.ChevronRight}
|
|
276
|
-
height={actionSize}
|
|
277
|
-
width={actionSize}
|
|
278
|
-
dataTestId="list-entry-action"
|
|
279
|
-
/>
|
|
280
|
-
))}
|
|
281
|
-
</>
|
|
282
|
-
)}
|
|
283
288
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
289
|
+
{showCheckMark && (
|
|
290
|
+
<Button
|
|
291
|
+
icon={IconName.Checkmark}
|
|
292
|
+
height={actionSize}
|
|
293
|
+
width={actionSize}
|
|
294
|
+
dataTestId="list-entry-select-button"
|
|
295
|
+
className={classes.selectionCheckMark}
|
|
296
|
+
onButtonClicked={() => onItemClickedHandler(data)}
|
|
297
|
+
/>
|
|
298
|
+
)}
|
|
299
|
+
{showItemCheckbox && (
|
|
300
|
+
<ListCheckBox
|
|
301
|
+
height={actionSize}
|
|
302
|
+
width={actionSize}
|
|
303
|
+
onCheckBoxToggled={() => onItemClickedHandler(data)}
|
|
304
|
+
isChecked={itemSelected}
|
|
305
|
+
isDisabled={isRowDisabled}
|
|
306
|
+
/>
|
|
307
|
+
)}
|
|
308
|
+
</div>
|
|
309
|
+
)}
|
|
304
310
|
</div>
|
|
305
311
|
);
|
|
306
312
|
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
@import '../../../../../styles/common.scss';
|
|
2
2
|
|
|
3
3
|
.circle {
|
|
4
|
-
height:
|
|
5
|
-
width:
|
|
6
|
-
min-width: var(--boolean-dot-size, $boolean-dot-size);
|
|
7
|
-
min-height: var(--boolean-dot-size, $boolean-dot-size);
|
|
8
|
-
border-radius: 100%;
|
|
4
|
+
height: 20px;
|
|
5
|
+
width: 20px;
|
|
9
6
|
|
|
10
|
-
&.
|
|
11
|
-
background-
|
|
7
|
+
&.true {
|
|
8
|
+
background-image: url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath vector-effect='non-scaling-stroke' fill='none' stroke='%23707070' stroke-width='2' d='M20,2c9.9,0,18,8.1,18,18s-8.1,18-18,18S2,29.9,2,20S10.1,2,20,2z M29,13.5 L17.8,26.3L11,19.1'/%3E%3C/svg%3E%0A");
|
|
12
9
|
}
|
|
13
10
|
|
|
14
|
-
&.
|
|
15
|
-
background-
|
|
11
|
+
&.false {
|
|
12
|
+
background-image: url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath vector-effect='non-scaling-stroke' fill='none' stroke='%23B7B7B7' stroke-width='2' d='M20,2c9.9,0,18,8.1,18,18s-8.1,18-18,18S2,29.9,2,20S10.1,2,20,2z M11,20h18'/%3E%3C/svg%3E");
|
|
16
13
|
}
|
|
17
14
|
}
|
package/src/components/List/ListRow/Renderers/BooleanDotRenderer/BooleanDotRenderer.spec.tsx
CHANGED
|
@@ -29,13 +29,13 @@ describe('BooleanDotRenderer', () => {
|
|
|
29
29
|
const wrapper = shallow(
|
|
30
30
|
<RendererWrapper {...defaultProps} value={false} />,
|
|
31
31
|
);
|
|
32
|
-
const dot = wrapper.find('.
|
|
32
|
+
const dot = wrapper.find('.false');
|
|
33
33
|
expect(dot).toHaveLength(1);
|
|
34
34
|
});
|
|
35
35
|
|
|
36
36
|
it('renders the green dot when true is passed', () => {
|
|
37
37
|
const wrapper = shallow(<RendererWrapper {...defaultProps} value={true} />);
|
|
38
|
-
const dot = wrapper.find('.
|
|
38
|
+
const dot = wrapper.find('.true');
|
|
39
39
|
expect(dot).toHaveLength(1);
|
|
40
40
|
});
|
|
41
41
|
});
|
|
@@ -17,6 +17,6 @@ import classes from './BooleanDotRenderer.scss';
|
|
|
17
17
|
*/
|
|
18
18
|
export const BooleanDotRenderer = (val: unknown): JSX.Element => (
|
|
19
19
|
<div
|
|
20
|
-
className={clsx(classes.circle, val ? [classes.
|
|
20
|
+
className={clsx(classes.circle, val ? [classes.true] : [classes.false])}
|
|
21
21
|
></div>
|
|
22
22
|
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useEffect, useState } from 'react';
|
|
1
|
+
import { SetStateAction, useEffect, useState } from 'react';
|
|
2
2
|
import { Data } from '../../types';
|
|
3
3
|
import { Column, ListSelectMode } from './List.model';
|
|
4
4
|
|
|
@@ -73,6 +73,8 @@ export const useColumnsSize = <T extends Data>(
|
|
|
73
73
|
setColumnSizes: React.Dispatch<React.SetStateAction<string>>;
|
|
74
74
|
hasActionColumn: boolean;
|
|
75
75
|
} => {
|
|
76
|
+
const [isResized, setIsResized] = useState<boolean>(false);
|
|
77
|
+
|
|
76
78
|
const [orgColumnSizes, setOrgColumnSizes] = useState<string>(
|
|
77
79
|
getColumnsSizeDefinition(
|
|
78
80
|
columns,
|
|
@@ -81,6 +83,7 @@ export const useColumnsSize = <T extends Data>(
|
|
|
81
83
|
showInlineMenu,
|
|
82
84
|
),
|
|
83
85
|
);
|
|
86
|
+
|
|
84
87
|
const [columnSizes, setColumnSizes] = useState<string>(orgColumnSizes);
|
|
85
88
|
|
|
86
89
|
useEffect(() => {
|
|
@@ -92,16 +95,30 @@ export const useColumnsSize = <T extends Data>(
|
|
|
92
95
|
showInlineMenu,
|
|
93
96
|
),
|
|
94
97
|
);
|
|
95
|
-
|
|
98
|
+
if (!isResized) {
|
|
99
|
+
setColumnSizes(orgColumnSizes);
|
|
100
|
+
}
|
|
101
|
+
}, [
|
|
102
|
+
columns,
|
|
103
|
+
isResized,
|
|
104
|
+
orgColumnSizes,
|
|
105
|
+
selectMode,
|
|
106
|
+
showActionButton,
|
|
107
|
+
showInlineMenu,
|
|
108
|
+
]);
|
|
96
109
|
|
|
97
110
|
const resetColumnSizes = (): void => {
|
|
98
111
|
setColumnSizes(orgColumnSizes);
|
|
112
|
+
setIsResized(false);
|
|
99
113
|
};
|
|
100
114
|
|
|
101
115
|
return {
|
|
102
116
|
columnSizes,
|
|
103
117
|
resetColumnSizes,
|
|
104
|
-
setColumnSizes
|
|
118
|
+
setColumnSizes: (newColumnSizes: SetStateAction<string>) => {
|
|
119
|
+
setIsResized(true);
|
|
120
|
+
setColumnSizes(newColumnSizes);
|
|
121
|
+
},
|
|
105
122
|
hasActionColumn: hasActionColumn(
|
|
106
123
|
selectMode,
|
|
107
124
|
showActionButton,
|
|
@@ -248,11 +248,6 @@ $actions-border-color: white;
|
|
|
248
248
|
$background: #ccc;
|
|
249
249
|
$fallback-image-bg-color: #efefef;
|
|
250
250
|
|
|
251
|
-
/* ListRow Renderers */
|
|
252
|
-
$boolean-dot-true-color: $green;
|
|
253
|
-
$boolean-dot-false-color: $red;
|
|
254
|
-
$boolean-dot-size: 20px;
|
|
255
|
-
|
|
256
251
|
/* Modal */
|
|
257
252
|
$modal-back-drop-color: rgba(169, 169, 169, 0.75);
|
|
258
253
|
$modal-back-drop-color-hidden: rgba(169, 169, 169, 0);
|