@axinom/mosaic-ui 0.35.0-rc.1 → 0.35.0-rc.2
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/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 +2 -2
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/List/ListRow/ListRow.tsx +56 -50
- package/src/components/List/useColumnsSize.ts +20 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axinom/mosaic-ui",
|
|
3
|
-
"version": "0.35.0-rc.
|
|
3
|
+
"version": "0.35.0-rc.2",
|
|
4
4
|
"description": "UI components for building Axinom Mosaic applications",
|
|
5
5
|
"author": "Axinom",
|
|
6
6
|
"license": "PROPRIETARY",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"build-storybook": "storybook build"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@axinom/mosaic-core": "^0.4.8-rc.
|
|
35
|
+
"@axinom/mosaic-core": "^0.4.8-rc.2",
|
|
36
36
|
"@faker-js/faker": "^7.4.0",
|
|
37
37
|
"@popperjs/core": "^2.9.2",
|
|
38
38
|
"clsx": "^1.1.0",
|
|
@@ -102,5 +102,5 @@
|
|
|
102
102
|
"publishConfig": {
|
|
103
103
|
"access": "public"
|
|
104
104
|
},
|
|
105
|
-
"gitHead": "
|
|
105
|
+
"gitHead": "4cb507987eae6659d8b5c829c21322f84c0b1159"
|
|
106
106
|
}
|
|
@@ -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,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,
|