@axinom/mosaic-ui 0.55.0-rc.9 → 0.55.0
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.model.d.ts +4 -4
- package/dist/components/DynamicDataList/DynamicDataList.model.d.ts.map +1 -1
- package/dist/components/FormElements/Select/Select.d.ts.map +1 -1
- package/dist/components/FormElements/SingleLineText/SingleLineText.d.ts.map +1 -1
- package/dist/components/List/List.model.d.ts +4 -4
- package/dist/components/List/List.model.d.ts.map +1 -1
- package/dist/components/Loaders/ImageLoader/ImageLoader.d.ts.map +1 -1
- package/dist/index.es.js +4 -4
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/DynamicDataList/DynamicDataList.model.ts +5 -5
- package/src/components/DynamicDataList/DynamicListDataEntry/Renderers/createSelectRenderer/createSelectRenderer.scss +3 -3
- package/src/components/FormElements/FileUploadControl/FileUploadControl.scss +2 -3
- package/src/components/FormElements/FileUploadControl/FileUploadControl.stories.tsx +0 -1
- package/src/components/FormElements/FileUploadControl/FileUploadControl.tsx +2 -2
- package/src/components/FormElements/Select/Select.scss +29 -24
- package/src/components/FormElements/Select/Select.tsx +3 -1
- package/src/components/FormElements/SingleLineText/SingleLineText.tsx +2 -1
- package/src/components/List/List.model.ts +4 -4
- package/src/components/Loaders/ImageLoader/ImageLoader.tsx +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axinom/mosaic-ui",
|
|
3
|
-
"version": "0.55.0
|
|
3
|
+
"version": "0.55.0",
|
|
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.28
|
|
35
|
+
"@axinom/mosaic-core": "^0.4.28",
|
|
36
36
|
"@faker-js/faker": "^7.4.0",
|
|
37
37
|
"@geoffcox/react-splitter": "^2.1.2",
|
|
38
38
|
"@mui/base": "5.0.0-beta.40",
|
|
@@ -107,5 +107,5 @@
|
|
|
107
107
|
"publishConfig": {
|
|
108
108
|
"access": "public"
|
|
109
109
|
},
|
|
110
|
-
"gitHead": "
|
|
110
|
+
"gitHead": "24e3244dacdb6273fd4e6a85f492b95133fa9636"
|
|
111
111
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Data } from '../../types/data';
|
|
2
2
|
import { ColumnRenderer } from '../List/List.model';
|
|
3
3
|
|
|
4
|
-
interface
|
|
4
|
+
interface DDLUnboundColumn<T extends Data> extends DDLBaseColumn<T> {
|
|
5
5
|
/** The name of the property on the Data object that should be rendered in that column. */
|
|
6
6
|
propertyName?: keyof T;
|
|
7
7
|
/**
|
|
@@ -16,7 +16,7 @@ interface UnboundColumn<T extends Data> extends BaseColumn<T> {
|
|
|
16
16
|
key: string;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
interface
|
|
19
|
+
interface DDLBoundColumn<T extends Data> extends DDLBaseColumn<T> {
|
|
20
20
|
/** The name of the property on the Data object that should be rendered in that column. */
|
|
21
21
|
propertyName: keyof T;
|
|
22
22
|
|
|
@@ -32,7 +32,7 @@ interface BoundColumn<T extends Data> extends BaseColumn<T> {
|
|
|
32
32
|
key?: string;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
export interface
|
|
35
|
+
export interface DDLBaseColumn<T extends Data> {
|
|
36
36
|
/** The width of the column as CSS size (default: 1fr) */
|
|
37
37
|
size?: string;
|
|
38
38
|
/** Column's header label */
|
|
@@ -63,8 +63,8 @@ export interface BaseColumn<T extends Data> {
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
export type DynamicListColumn<T extends Data> =
|
|
66
|
-
|
|
|
67
|
-
|
|
|
66
|
+
| DDLUnboundColumn<T>
|
|
67
|
+
| DDLBoundColumn<T>;
|
|
68
68
|
|
|
69
69
|
export type DynamicListDataEntryRenderer = (
|
|
70
70
|
/** Value to render. */
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
display: grid;
|
|
54
54
|
align-content: center;
|
|
55
55
|
color: var(--input-disabled-font-color, $input-disabled-font-color);
|
|
56
|
-
border: 1px
|
|
56
|
+
border: 1px dashed var(--file-upload-input, $file-upload-input);
|
|
57
57
|
background-color: var(
|
|
58
58
|
--read-only-text-background-color,
|
|
59
59
|
$read-only-text-background-color
|
|
@@ -80,13 +80,12 @@
|
|
|
80
80
|
display: grid;
|
|
81
81
|
align-content: center;
|
|
82
82
|
text-align: center;
|
|
83
|
-
border: 1px dashed var(--
|
|
83
|
+
border: 1px dashed var(--file-upload-input, $file-upload-input);
|
|
84
84
|
grid-column: 1 / span 2;
|
|
85
85
|
height: 100px;
|
|
86
86
|
width: 650px;
|
|
87
87
|
z-index: 9999;
|
|
88
88
|
|
|
89
|
-
background-color: white;
|
|
90
89
|
transition: box-shadow 0.15s ease-in-out 0s;
|
|
91
90
|
|
|
92
91
|
&:hover {
|
|
@@ -34,7 +34,7 @@ export const FileUploadControl: React.FC<FileUploadProps> = ({
|
|
|
34
34
|
onFileSelected,
|
|
35
35
|
error,
|
|
36
36
|
id = 'file',
|
|
37
|
-
placeholder,
|
|
37
|
+
placeholder = 'Browse or drag your file here',
|
|
38
38
|
value,
|
|
39
39
|
accept,
|
|
40
40
|
className = '',
|
|
@@ -138,7 +138,7 @@ export const FileUploadControl: React.FC<FileUploadProps> = ({
|
|
|
138
138
|
<div className={clsx(classes.content)}>
|
|
139
139
|
{dragging && !disabled ? (
|
|
140
140
|
<div className={clsx(classes.dropTarget)} onDrop={handleDrop}>
|
|
141
|
-
|
|
141
|
+
Drag & Drop your file here
|
|
142
142
|
</div>
|
|
143
143
|
) : (
|
|
144
144
|
<>
|
|
@@ -2,32 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
.container {
|
|
4
4
|
.inputWrapper {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
right: 0;
|
|
11
|
-
top: 0;
|
|
12
|
-
|
|
13
|
-
svg {
|
|
14
|
-
height: 50%;
|
|
15
|
-
* {
|
|
16
|
-
stroke: var(
|
|
17
|
-
--popper-trigger-button-color,
|
|
18
|
-
$popper-trigger-button-color
|
|
19
|
-
);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
&:disabled {
|
|
24
|
-
svg * {
|
|
25
|
-
stroke: var(--select-arrow-color, $select-disabled-arrow-color);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
5
|
+
display: grid;
|
|
6
|
+
grid-template-columns: 1fr auto;
|
|
7
|
+
align-items: center;
|
|
8
|
+
max-width: var(--select-max-width, $select-max-width);
|
|
9
|
+
width: var(--select-max-width, $select-max-width);
|
|
29
10
|
|
|
30
11
|
input {
|
|
12
|
+
grid-column: 1/2;
|
|
31
13
|
color: var(--input-color, $input-color);
|
|
32
14
|
border: 1px solid var(--input-border-color, $input-border-color);
|
|
33
15
|
padding: 0 48px 0 12px;
|
|
@@ -82,6 +64,29 @@
|
|
|
82
64
|
}
|
|
83
65
|
}
|
|
84
66
|
}
|
|
67
|
+
|
|
68
|
+
.button {
|
|
69
|
+
grid-column: 2/3;
|
|
70
|
+
margin-left: -50px;
|
|
71
|
+
svg {
|
|
72
|
+
height: 50%;
|
|
73
|
+
* {
|
|
74
|
+
stroke: var(
|
|
75
|
+
--popper-trigger-button-color,
|
|
76
|
+
$popper-trigger-button-color
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&:disabled {
|
|
82
|
+
svg * {
|
|
83
|
+
stroke: var(
|
|
84
|
+
--select-disabled-arrow-color,
|
|
85
|
+
$select-disabled-arrow-color
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
85
90
|
}
|
|
86
91
|
}
|
|
87
92
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Popper, useAutocomplete, UseAutocompleteProps } from '@mui/base';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import React, { ChangeEvent } from 'react';
|
|
4
|
+
import { noop } from '../../../helpers/utils';
|
|
4
5
|
import { Button, ButtonContext } from '../../Buttons';
|
|
5
6
|
import { IconName } from '../../Icons';
|
|
6
7
|
import { BaseFormControl, BaseInputEvents } from '../Form.models';
|
|
@@ -65,7 +66,7 @@ export const Select: React.FC<SelectProps> = (props) => {
|
|
|
65
66
|
id,
|
|
66
67
|
disabled,
|
|
67
68
|
value:
|
|
68
|
-
autoCompleteProps.options
|
|
69
|
+
autoCompleteProps.options?.find((option) => option.value === value) ??
|
|
69
70
|
null,
|
|
70
71
|
onChange: ({ target: _, ...event }, value) => {
|
|
71
72
|
onChange?.({
|
|
@@ -76,6 +77,7 @@ export const Select: React.FC<SelectProps> = (props) => {
|
|
|
76
77
|
name,
|
|
77
78
|
value: value?.value ?? '',
|
|
78
79
|
},
|
|
80
|
+
preventDefault: noop,
|
|
79
81
|
} as ChangeEvent<HTMLInputElement>);
|
|
80
82
|
},
|
|
81
83
|
disableClearable: !addEmptyOption,
|
|
@@ -74,7 +74,8 @@ export const SingleLineText: React.FC<SingleLineTextProps> = ({
|
|
|
74
74
|
|
|
75
75
|
useEffect(() => {
|
|
76
76
|
if (innerRef.current) {
|
|
77
|
-
|
|
77
|
+
const isTruthyValue = value === 0 || Boolean(value);
|
|
78
|
+
innerRef.current.value = isTruthyValue ? String(value) : '';
|
|
78
79
|
}
|
|
79
80
|
}, [innerRef, value]);
|
|
80
81
|
|
|
@@ -18,7 +18,7 @@ export interface ColumnSortKeys {
|
|
|
18
18
|
descending: string;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
interface
|
|
21
|
+
interface ListUnboundColumn<T extends Data> extends ListBaseColumn<T> {
|
|
22
22
|
/** The name of the property on the Data object that should be rendered in that column. */
|
|
23
23
|
propertyName?: keyof T;
|
|
24
24
|
/**
|
|
@@ -34,7 +34,7 @@ interface UnboundColumn<T extends Data> extends BaseColumn<T> {
|
|
|
34
34
|
key: string;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
interface
|
|
37
|
+
interface ListBoundColumn<T extends Data> extends ListBaseColumn<T> {
|
|
38
38
|
/** The name of the property on the Data object that should be rendered in that column. */
|
|
39
39
|
propertyName: keyof T;
|
|
40
40
|
|
|
@@ -51,7 +51,7 @@ interface BoundColumn<T extends Data> extends BaseColumn<T> {
|
|
|
51
51
|
key?: string;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
interface
|
|
54
|
+
interface ListBaseColumn<T extends Data> {
|
|
55
55
|
/** The width of the column as CSS size (default: 1fr) */
|
|
56
56
|
size?: string;
|
|
57
57
|
/** Column's header label */
|
|
@@ -82,7 +82,7 @@ interface BaseColumn<T extends Data> {
|
|
|
82
82
|
disableResizing?: boolean;
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
export type Column<T extends Data> =
|
|
85
|
+
export type Column<T extends Data> = ListUnboundColumn<T> | ListBoundColumn<T>;
|
|
86
86
|
|
|
87
87
|
export interface ColumnMap {
|
|
88
88
|
[key: string]: string;
|