@axinom/mosaic-ui 0.33.0-rc.1 → 0.33.0-rc.19
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/Actions/Actions.models.d.ts +0 -13
- package/dist/components/Actions/Actions.models.d.ts.map +1 -1
- package/dist/components/DynamicDataList/DynamicDataList.d.ts.map +1 -1
- package/dist/components/DynamicDataList/DynamicListRow/DynamicListRow.d.ts +3 -1
- package/dist/components/DynamicDataList/DynamicListRow/DynamicListRow.d.ts.map +1 -1
- package/dist/components/FormElements/CustomTags/CustomTags.d.ts.map +1 -1
- package/dist/components/FormElements/FileUploadControl/FileUploadControl.d.ts.map +1 -1
- package/dist/components/FormElements/Radio/Radio.d.ts.map +1 -1
- package/dist/components/FormElements/Tags/Tags.d.ts.map +1 -1
- package/dist/components/FormElements/formStoryHelper.d.ts.map +1 -1
- package/dist/components/FormStation/FormStation.d.ts.map +1 -1
- package/dist/components/InfoPanel/InfoImage/InfoImage.d.ts.map +1 -1
- package/dist/components/List/List.d.ts.map +1 -1
- package/dist/components/Loaders/ImageLoader/ImageLoader.d.ts +2 -0
- package/dist/components/Loaders/ImageLoader/ImageLoader.d.ts.map +1 -1
- package/dist/components/PageHeader/PageHeaderAction/PageHeaderAction.model.d.ts +1 -11
- package/dist/components/PageHeader/PageHeaderAction/PageHeaderAction.model.d.ts.map +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +3 -3
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/initialize.d.ts +7 -4
- package/dist/initialize.d.ts.map +1 -1
- package/dist/utils/ErrorMapper/ApolloClient/ApolloErrorMapper.d.ts +9 -0
- package/dist/utils/ErrorMapper/ApolloClient/ApolloErrorMapper.d.ts.map +1 -0
- package/dist/utils/ErrorMapper/ErrorMapper.d.ts +15 -0
- package/dist/utils/ErrorMapper/ErrorMapper.d.ts.map +1 -0
- package/dist/utils/ErrorMapper/ErrorMapper.type.d.ts +11 -0
- package/dist/utils/ErrorMapper/ErrorMapper.type.d.ts.map +1 -0
- package/dist/utils/ErrorMapper/index.d.ts +4 -0
- package/dist/utils/ErrorMapper/index.d.ts.map +1 -0
- package/dist/utils/ErrorTypeToStationError.d.ts +1 -1
- package/dist/utils/ErrorTypeToStationError.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/components/Accordion/Accordion.scss +1 -1
- package/src/components/Accordion/AccordionItem/AccordionItem.scss +1 -1
- package/src/components/Actions/Action/Action.scss +0 -2
- package/src/components/Actions/Actions.models.ts +0 -14
- package/src/components/Actions/Actions.stories.tsx +4 -1
- package/src/components/Buttons/Button/Button.scss +66 -20
- package/src/components/Buttons/CompositeButton/CompositeButton.scss +50 -18
- package/src/components/Buttons/TextButton/TextButton.scss +45 -16
- package/src/components/DateTime/DatePicker/DatePicker.scss +15 -6
- package/src/components/DateTime/DateTimePicker.scss +6 -2
- package/src/components/DynamicDataList/DynamicDataList.tsx +1 -0
- package/src/components/DynamicDataList/DynamicListDataEntry/DynamicListDataEntry.scss +15 -5
- package/src/components/DynamicDataList/DynamicListDataEntry/Renderers/createInputRenderer/createInputRenderer.tsx +1 -1
- package/src/components/DynamicDataList/DynamicListDataEntry/Renderers/createSelectRenderer/createSelectRenderer.scss +36 -12
- package/src/components/DynamicDataList/DynamicListDataEntry/Renderers/createSelectRenderer/createSelectRenderer.tsx +2 -2
- package/src/components/DynamicDataList/DynamicListRow/DynamicListRow.scss +26 -0
- package/src/components/DynamicDataList/DynamicListRow/DynamicListRow.tsx +7 -1
- package/src/components/Filters/Filter/Filter.scss +8 -2
- package/src/components/Filters/SelectionTypes/DateTimeFilter/DateTimeFilter.scss +4 -1
- package/src/components/FormElements/Checkbox/Checkbox.scss +20 -0
- package/src/components/FormElements/CustomTags/CustomTags.scss +24 -0
- package/src/components/FormElements/CustomTags/CustomTags.tsx +8 -2
- package/src/components/FormElements/DateTimeField/DateTimeText.spec.tsx +1 -1
- package/src/components/FormElements/DateTimeField/DateTimeText.tsx +1 -1
- package/src/components/FormElements/FileUploadControl/FileUploadControl.scss +4 -2
- package/src/components/FormElements/FileUploadControl/FileUploadControl.tsx +12 -3
- package/src/components/FormElements/Radio/Radio.scss +18 -3
- package/src/components/FormElements/Radio/Radio.tsx +2 -2
- package/src/components/FormElements/Select/Select.scss +10 -0
- package/src/components/FormElements/SingleLineText/SingleLineText.spec.tsx +2 -2
- package/src/components/FormElements/SingleLineText/SingleLineText.tsx +1 -1
- package/src/components/FormElements/Tags/Tags.scss +14 -0
- package/src/components/FormElements/Tags/Tags.tsx +5 -1
- package/src/components/FormElements/TextArea/TextArea.spec.tsx +2 -2
- package/src/components/FormElements/TextArea/TextArea.tsx +1 -1
- package/src/components/FormElements/formStoryHelper.tsx +163 -97
- package/src/components/FormStation/FormStation.spec.tsx +13 -3
- package/src/components/FormStation/FormStation.tsx +13 -3
- package/src/components/InfoPanel/InfoImage/InfoImage.scss +8 -3
- package/src/components/InfoPanel/InfoImage/InfoImage.tsx +1 -0
- package/src/components/List/List.tsx +3 -1
- package/src/components/List/ListCheckBox/ListCheckBox.scss +8 -3
- package/src/components/List/ListRow/ListRow.scss +0 -4
- package/src/components/Loaders/ImageLoader/ImageLoader.scss +27 -21
- package/src/components/Loaders/ImageLoader/ImageLoader.spec.tsx +8 -12
- package/src/components/Loaders/ImageLoader/ImageLoader.tsx +8 -3
- package/src/components/PageHeader/PageHeaderAction/PageHeaderAction.model.ts +0 -10
- package/src/components/PageHeader/PageHeaderAction/PageHeaderAction.scss +0 -1
- package/src/components/PageHeader/PageHeaderAction/PageHeaderAction.stories.tsx +5 -0
- package/src/components/index.ts +1 -1
- package/src/index.ts +1 -0
- package/src/initialize.ts +15 -12
- package/src/styles/variables.scss +32 -2
- package/src/utils/ErrorMapper/ApolloClient/ApolloErrorMapper.spec.ts +32 -0
- package/src/utils/ErrorMapper/ApolloClient/ApolloErrorMapper.tsx +33 -0
- package/src/utils/ErrorMapper/ErrorMapper.spec.ts +67 -0
- package/src/utils/ErrorMapper/ErrorMapper.ts +31 -0
- package/src/utils/ErrorMapper/ErrorMapper.type.ts +11 -0
- package/src/utils/ErrorMapper/index.ts +3 -0
- package/src/utils/ErrorTypeToStationError.spec.tsx +12 -0
- package/src/utils/ErrorTypeToStationError.tsx +5 -1
|
@@ -46,10 +46,10 @@
|
|
|
46
46
|
display: grid;
|
|
47
47
|
grid-template-rows: 1fr;
|
|
48
48
|
grid-template-columns: 1fr;
|
|
49
|
+
}
|
|
49
50
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
51
|
+
.actionButton svg {
|
|
52
|
+
height: 60%;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
.position {
|
|
@@ -60,11 +60,12 @@
|
|
|
60
60
|
justify-items: start;
|
|
61
61
|
align-items: center;
|
|
62
62
|
|
|
63
|
-
opacity: 0.5;
|
|
63
|
+
//opacity: 0.5;
|
|
64
64
|
|
|
65
65
|
svg {
|
|
66
|
+
stroke: var(--input-disabled-border-color, $input-disabled-border-color);
|
|
66
67
|
rect {
|
|
67
|
-
fill: var(--input-border-color, $input-border-color);
|
|
68
|
+
fill: var(--input-disabled-border-color, $input-disabled-border-color);
|
|
68
69
|
}
|
|
69
70
|
}
|
|
70
71
|
|
|
@@ -77,6 +78,15 @@
|
|
|
77
78
|
|
|
78
79
|
padding: 4px;
|
|
79
80
|
border: 1px solid var(--input-border-color, $input-border-color);
|
|
81
|
+
|
|
82
|
+
&:disabled {
|
|
83
|
+
color: var(--input-disabled-font-color, $input-disabled-font-color);
|
|
84
|
+
|
|
85
|
+
border-color: var(
|
|
86
|
+
--input-disabled-border-color,
|
|
87
|
+
$input-disabled-border-color
|
|
88
|
+
);
|
|
89
|
+
}
|
|
80
90
|
}
|
|
81
91
|
|
|
82
92
|
/* remove arrows from input
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
@import '../../../../../styles/common.scss';
|
|
2
2
|
|
|
3
|
+
@function svg-arrow-glyph($color) {
|
|
4
|
+
@return url('data:image/svg+xml;utf8,<svg stroke="' + $color + '" version="1.1" xmlns="http://www.w3.org/2000/svg" width="40px" height="20px" viewBox="0 0 40 40"><path vector-effect="non-scaling-stroke" fill="none" stroke-width="2" d="M38.5,9.5L20,30.5L1.5,9.5" /></svg>');
|
|
5
|
+
}
|
|
6
|
+
|
|
3
7
|
.container {
|
|
4
8
|
height: 100%;
|
|
5
9
|
width: 100%;
|
|
@@ -26,7 +30,10 @@
|
|
|
26
30
|
border: 1px solid var(--input-border-color, $input-border-color);
|
|
27
31
|
outline: none;
|
|
28
32
|
|
|
29
|
-
background-image:
|
|
33
|
+
background-image: svg-arrow-glyph(
|
|
34
|
+
var(--select-arrow-color, encodecolor($select-arrow-color))
|
|
35
|
+
);
|
|
36
|
+
//background-image: url('data:image/svg+xml;utf8,<svg stroke="%231478af" version="1.1" xmlns="http://www.w3.org/2000/svg" width="40px" height="20px" viewBox="0 0 40 40"><path vector-effect="non-scaling-stroke" fill="none" stroke-width="2" d="M38.5,9.5L20,30.5L1.5,9.5" /></svg>');
|
|
30
37
|
background-repeat: no-repeat;
|
|
31
38
|
background-position: center;
|
|
32
39
|
background-position-x: 100%;
|
|
@@ -39,18 +46,28 @@
|
|
|
39
46
|
border: 1px solid
|
|
40
47
|
var(--input-invalid-border-color, $input-invalid-border-color);
|
|
41
48
|
}
|
|
42
|
-
}
|
|
43
49
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
+
&:disabled {
|
|
51
|
+
border-color: var(
|
|
52
|
+
--input-disabled-border-color,
|
|
53
|
+
$input-disabled-border-color
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
cursor: default;
|
|
50
57
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
58
|
+
background-image: svg-arrow-glyph(
|
|
59
|
+
var(--select-arrow-color, encodecolor($select-disabled-arrow-color))
|
|
60
|
+
);
|
|
61
|
+
background-color: var(
|
|
62
|
+
--input-disabled-background-color,
|
|
63
|
+
$input-disabled-background-color
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&:not(:disabled):hover {
|
|
68
|
+
border: 1px solid var(--input-hover-color, $input-hover-color);
|
|
69
|
+
box-shadow: 0 0 0 2px var(--input-hover-color, $input-hover-color);
|
|
70
|
+
}
|
|
54
71
|
|
|
55
72
|
&.hasError {
|
|
56
73
|
border: 1px solid
|
|
@@ -60,7 +77,14 @@
|
|
|
60
77
|
}
|
|
61
78
|
}
|
|
62
79
|
|
|
63
|
-
|
|
80
|
+
select,
|
|
81
|
+
option {
|
|
82
|
+
overflow: hidden;
|
|
83
|
+
white-space: nowrap;
|
|
84
|
+
text-overflow: ellipsis;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
select > small {
|
|
64
88
|
padding: 6px 0;
|
|
65
89
|
white-space: normal;
|
|
66
90
|
color: var(--input-invalid-color, $input-invalid-color);
|
|
@@ -42,7 +42,7 @@ export const createSelectRenderer = ({
|
|
|
42
42
|
<select
|
|
43
43
|
id={id}
|
|
44
44
|
name={name}
|
|
45
|
-
placeholder={placeholder}
|
|
45
|
+
placeholder={disabled ? undefined : placeholder}
|
|
46
46
|
value={(currentValue as string) ?? ''}
|
|
47
47
|
onChange={onChangeHandler}
|
|
48
48
|
className={clsx({ [classes.hasError]: error !== undefined })}
|
|
@@ -50,7 +50,7 @@ export const createSelectRenderer = ({
|
|
|
50
50
|
>
|
|
51
51
|
{placeholder && (
|
|
52
52
|
<option value="" disabled>
|
|
53
|
-
{placeholder}
|
|
53
|
+
{disabled ? '' : placeholder}
|
|
54
54
|
</option>
|
|
55
55
|
)}
|
|
56
56
|
{options.map((option) => (
|
|
@@ -33,6 +33,22 @@
|
|
|
33
33
|
);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
&.disabled {
|
|
37
|
+
.position {
|
|
38
|
+
.draggable {
|
|
39
|
+
cursor: default;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.dragIcon {
|
|
44
|
+
stroke: $light-gray;
|
|
45
|
+
|
|
46
|
+
rect {
|
|
47
|
+
fill: $light-gray;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
36
52
|
.position {
|
|
37
53
|
display: grid;
|
|
38
54
|
grid-template-rows: 1fr;
|
|
@@ -58,6 +74,16 @@
|
|
|
58
74
|
border: 1px solid var(--input-border-color, $input-border-color);
|
|
59
75
|
|
|
60
76
|
transition: box-shadow 0.15s ease-in-out 0s;
|
|
77
|
+
|
|
78
|
+
&:disabled {
|
|
79
|
+
background-color: var(
|
|
80
|
+
--input-disabled-background-color,
|
|
81
|
+
$input-disabled-background-color
|
|
82
|
+
);
|
|
83
|
+
border: 1px solid
|
|
84
|
+
var(--input-disabled-border-color, $input-disabled-border-color);
|
|
85
|
+
color: var(--input-disabled-font-color, $input-disabled-font-color);
|
|
86
|
+
}
|
|
61
87
|
}
|
|
62
88
|
|
|
63
89
|
input:hover:enabled,
|
|
@@ -42,6 +42,8 @@ export interface DynamicListRowProps<T extends Data> {
|
|
|
42
42
|
allowDragging?: boolean;
|
|
43
43
|
/** Determines if there is currently an on-going drag event (default: undefined) */
|
|
44
44
|
dragging?: boolean;
|
|
45
|
+
/** Whether or not the DDL is disabled (default: false) */
|
|
46
|
+
disabled?: boolean;
|
|
45
47
|
/** Emits when row dragging event starts. Event and current position are supplied as parameters */
|
|
46
48
|
onDragStart?: (e: React.DragEvent<HTMLDivElement>, position: number) => void;
|
|
47
49
|
/** Emits when the row has dropped. Event and new position target are supplied as parameters */
|
|
@@ -80,6 +82,7 @@ export const DynamicListRow = <T extends Data>({
|
|
|
80
82
|
positionKey,
|
|
81
83
|
allowDragging,
|
|
82
84
|
dragging,
|
|
85
|
+
disabled,
|
|
83
86
|
onDragStart = noop,
|
|
84
87
|
onDrop = noop,
|
|
85
88
|
onDragEnd = noop,
|
|
@@ -194,13 +197,14 @@ export const DynamicListRow = <T extends Data>({
|
|
|
194
197
|
[classes.draggedAbove]: draggedOver === 'above',
|
|
195
198
|
[classes.draggedBelow]: draggedOver === 'below',
|
|
196
199
|
[classes.dragging]: dragging,
|
|
200
|
+
[classes.disabled]: disabled,
|
|
197
201
|
},
|
|
198
202
|
'dynamic-list-row-container',
|
|
199
203
|
className,
|
|
200
204
|
rowClassNameProvider ? rowClassNameProvider(data) : '',
|
|
201
205
|
)}
|
|
202
206
|
style={customStyles}
|
|
203
|
-
draggable={Boolean(allowDragging && allowReordering)}
|
|
207
|
+
draggable={Boolean(!disabled && allowDragging && allowReordering)}
|
|
204
208
|
onDragStart={onDragStartHandler}
|
|
205
209
|
onDragEnter={onDragEnterHandler}
|
|
206
210
|
onDragOver={onDragOverHandler}
|
|
@@ -232,6 +236,7 @@ export const DynamicListRow = <T extends Data>({
|
|
|
232
236
|
}
|
|
233
237
|
}}
|
|
234
238
|
value={position}
|
|
239
|
+
disabled={disabled}
|
|
235
240
|
onKeyDown={(event) =>
|
|
236
241
|
event.key === 'Enter' &&
|
|
237
242
|
onPositionInputChangedHandler(
|
|
@@ -284,6 +289,7 @@ export const DynamicListRow = <T extends Data>({
|
|
|
284
289
|
buttonContext={ButtonContext.Icon}
|
|
285
290
|
height={actionSize}
|
|
286
291
|
width={actionSize}
|
|
292
|
+
disabled={disabled}
|
|
287
293
|
onButtonClicked={() => {
|
|
288
294
|
onActionClicked(data);
|
|
289
295
|
}}
|
|
@@ -56,7 +56,10 @@ $input-inactive: 1px solid var(--input-border-color, $input-border-color);
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
svg * {
|
|
59
|
-
stroke:
|
|
59
|
+
stroke: var(
|
|
60
|
+
--filter-context-button-color,
|
|
61
|
+
$filter-context-button-color
|
|
62
|
+
);
|
|
60
63
|
}
|
|
61
64
|
}
|
|
62
65
|
|
|
@@ -80,7 +83,10 @@ $input-inactive: 1px solid var(--input-border-color, $input-border-color);
|
|
|
80
83
|
}
|
|
81
84
|
|
|
82
85
|
svg * {
|
|
83
|
-
stroke:
|
|
86
|
+
stroke: var(
|
|
87
|
+
--filter-context-button-color,
|
|
88
|
+
$filter-context-button-color
|
|
89
|
+
);
|
|
84
90
|
}
|
|
85
91
|
}
|
|
86
92
|
|
|
@@ -37,6 +37,16 @@
|
|
|
37
37
|
&:enabled {
|
|
38
38
|
cursor: pointer;
|
|
39
39
|
}
|
|
40
|
+
|
|
41
|
+
&:disabled {
|
|
42
|
+
background-color: var(
|
|
43
|
+
--input-disabled-background-color,
|
|
44
|
+
$input-disabled-background-color
|
|
45
|
+
);
|
|
46
|
+
color: var(--input-disabled-font-color, $input-disabled-font-color);
|
|
47
|
+
border: 1px solid
|
|
48
|
+
var(--input-disabled-border-color, $input-disabled-border-color);
|
|
49
|
+
}
|
|
40
50
|
}
|
|
41
51
|
|
|
42
52
|
input:hover:enabled {
|
|
@@ -69,6 +79,13 @@
|
|
|
69
79
|
$input-invalid-border-color
|
|
70
80
|
);
|
|
71
81
|
}
|
|
82
|
+
|
|
83
|
+
&:disabled {
|
|
84
|
+
background-color: var(
|
|
85
|
+
--input-disabled-background-color,
|
|
86
|
+
$input-disabled-background-color
|
|
87
|
+
);
|
|
88
|
+
}
|
|
72
89
|
}
|
|
73
90
|
|
|
74
91
|
input:checked:after {
|
|
@@ -80,6 +97,9 @@
|
|
|
80
97
|
align-content: center;
|
|
81
98
|
color: #ffffff;
|
|
82
99
|
}
|
|
100
|
+
input:checked:disabled:after {
|
|
101
|
+
color: var(--input-disabled-border-color, $input-disabled-border-color);
|
|
102
|
+
}
|
|
83
103
|
|
|
84
104
|
.confirmDialog {
|
|
85
105
|
@include confirmDialogFadeIn;
|
|
@@ -21,6 +21,10 @@
|
|
|
21
21
|
font-size: var(--label-font-size, $label-font-size);
|
|
22
22
|
color: $tag-font-color;
|
|
23
23
|
}
|
|
24
|
+
|
|
25
|
+
&.disabled span {
|
|
26
|
+
color: var(--input-disabled-font-color, $input-disabled-font-color);
|
|
27
|
+
}
|
|
24
28
|
}
|
|
25
29
|
|
|
26
30
|
.inputWrapper {
|
|
@@ -29,6 +33,13 @@
|
|
|
29
33
|
width: 320px;
|
|
30
34
|
position: relative;
|
|
31
35
|
|
|
36
|
+
input:disabled + .plusButton:disabled {
|
|
37
|
+
background-color: var(
|
|
38
|
+
--input-disabled-background-color,
|
|
39
|
+
$input-disabled-background-color
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
32
43
|
input {
|
|
33
44
|
height: 50px;
|
|
34
45
|
width: 100%;
|
|
@@ -41,6 +52,18 @@
|
|
|
41
52
|
border: 1px solid var(--input-border-color, $input-border-color);
|
|
42
53
|
transition: box-shadow 0.15s ease-in-out 0s;
|
|
43
54
|
|
|
55
|
+
&:disabled {
|
|
56
|
+
border-color: var(
|
|
57
|
+
--input-disabled-border-color,
|
|
58
|
+
$input-disabled-border-color
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
background-color: var(
|
|
62
|
+
--input-disabled-background-color,
|
|
63
|
+
$input-disabled-background-color
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
44
67
|
&.hasError {
|
|
45
68
|
border: 1px solid
|
|
46
69
|
var(--input-invalid-border-color, $input-invalid-border-color);
|
|
@@ -120,6 +143,7 @@
|
|
|
120
143
|
stroke: rgba($gray, 0.5);
|
|
121
144
|
}
|
|
122
145
|
}
|
|
146
|
+
|
|
123
147
|
&:enabled {
|
|
124
148
|
&:hover {
|
|
125
149
|
border: 1px solid $blue;
|
|
@@ -308,7 +308,7 @@ export const CustomTags: React.FC<CustomTagsProps> = ({
|
|
|
308
308
|
value={val}
|
|
309
309
|
type={type}
|
|
310
310
|
disabled={disabled}
|
|
311
|
-
placeholder={placeholder}
|
|
311
|
+
placeholder={disabled ? undefined : placeholder}
|
|
312
312
|
autoFocus={autoFocus}
|
|
313
313
|
autoComplete={'off'}
|
|
314
314
|
onChange={(e) => setVal(e.currentTarget.value)}
|
|
@@ -361,7 +361,13 @@ export const CustomTags: React.FC<CustomTagsProps> = ({
|
|
|
361
361
|
setShouldAnimate(false);
|
|
362
362
|
}}
|
|
363
363
|
>
|
|
364
|
-
<span
|
|
364
|
+
<span
|
|
365
|
+
className={clsx({
|
|
366
|
+
[classes.selectedItem]: true,
|
|
367
|
+
[classes.disabled]: disabled,
|
|
368
|
+
})}
|
|
369
|
+
data-test-id="tag"
|
|
370
|
+
>
|
|
365
371
|
<span>{tag}</span>
|
|
366
372
|
<Button
|
|
367
373
|
type="button"
|
|
@@ -98,7 +98,7 @@ export const DateTimeText: React.FC<DateTimeTextProps> = ({
|
|
|
98
98
|
type={'text'}
|
|
99
99
|
value={display}
|
|
100
100
|
disabled={disabled}
|
|
101
|
-
placeholder={placeholder}
|
|
101
|
+
placeholder={disabled ? undefined : placeholder}
|
|
102
102
|
autoFocus={autoFocus}
|
|
103
103
|
autoComplete={autoComplete}
|
|
104
104
|
onChange={(e) => setDisplay(e.target.value)}
|
|
@@ -38,6 +38,7 @@ export const FileUploadControl: React.FC<FileUploadProps> = ({
|
|
|
38
38
|
value,
|
|
39
39
|
accept,
|
|
40
40
|
className = '',
|
|
41
|
+
disabled,
|
|
41
42
|
...rest
|
|
42
43
|
}) => {
|
|
43
44
|
const [fileName, setFileName] = useState<string>(value?.file.name ?? '');
|
|
@@ -135,7 +136,7 @@ export const FileUploadControl: React.FC<FileUploadProps> = ({
|
|
|
135
136
|
dataTestFieldType="FileUpload"
|
|
136
137
|
>
|
|
137
138
|
<div className={clsx(classes.content)}>
|
|
138
|
-
{dragging ? (
|
|
139
|
+
{dragging && !disabled ? (
|
|
139
140
|
<div className={clsx(classes.dropTarget)} onDrop={handleDrop}>
|
|
140
141
|
DROP YOUR FILE HERE!
|
|
141
142
|
</div>
|
|
@@ -148,15 +149,23 @@ export const FileUploadControl: React.FC<FileUploadProps> = ({
|
|
|
148
149
|
})}
|
|
149
150
|
value={fileName}
|
|
150
151
|
onChange={noop}
|
|
151
|
-
placeholder={placeholder}
|
|
152
|
+
placeholder={disabled ? undefined : placeholder}
|
|
153
|
+
disabled={true}
|
|
152
154
|
/>
|
|
153
|
-
<label
|
|
155
|
+
<label
|
|
156
|
+
className={clsx({
|
|
157
|
+
[classes.fileuploadbutton]: true,
|
|
158
|
+
[classes.disabled]: disabled,
|
|
159
|
+
})}
|
|
160
|
+
htmlFor={id}
|
|
161
|
+
>
|
|
154
162
|
<Icons icon={IconName.File} />
|
|
155
163
|
</label>
|
|
156
164
|
<input
|
|
157
165
|
id={id}
|
|
158
166
|
type="file"
|
|
159
167
|
accept={accept}
|
|
168
|
+
disabled={disabled}
|
|
160
169
|
onChange={(event) => {
|
|
161
170
|
const file = event.target.files?.item(0);
|
|
162
171
|
file && fileSelected(file);
|
|
@@ -16,6 +16,10 @@
|
|
|
16
16
|
label,
|
|
17
17
|
input {
|
|
18
18
|
cursor: pointer;
|
|
19
|
+
|
|
20
|
+
&.disabled {
|
|
21
|
+
cursor: default;
|
|
22
|
+
}
|
|
19
23
|
}
|
|
20
24
|
|
|
21
25
|
label {
|
|
@@ -32,7 +36,15 @@
|
|
|
32
36
|
user-select: none;
|
|
33
37
|
|
|
34
38
|
&.disabled {
|
|
35
|
-
|
|
39
|
+
.radioOutline {
|
|
40
|
+
fill: $light-gray-2;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.checked {
|
|
44
|
+
.radioDot {
|
|
45
|
+
fill: $light-gray;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
36
48
|
}
|
|
37
49
|
}
|
|
38
50
|
|
|
@@ -58,15 +70,18 @@
|
|
|
58
70
|
|
|
59
71
|
&:hover:not(.unSelectable):not(.hasConfirm) {
|
|
60
72
|
.radioOutline {
|
|
61
|
-
stroke: $
|
|
73
|
+
stroke: var(--radio-hover-stroke-color, $radio-hover-stroke-color);
|
|
62
74
|
stroke-width: 3;
|
|
63
75
|
transition: stroke-width 0.15s ease-in-out 0s;
|
|
64
76
|
}
|
|
65
77
|
}
|
|
66
78
|
|
|
67
79
|
&.checked {
|
|
80
|
+
.radioOutline {
|
|
81
|
+
fill: var(--radio-checked-fill-color, $radio-checked-fill-color);
|
|
82
|
+
}
|
|
68
83
|
.radioDot {
|
|
69
|
-
fill:
|
|
84
|
+
fill: white;
|
|
70
85
|
}
|
|
71
86
|
}
|
|
72
87
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import clsx from 'clsx';
|
|
2
2
|
import React, { useRef, useState } from 'react';
|
|
3
3
|
import {
|
|
4
|
+
ConfirmDialog,
|
|
4
5
|
ConfirmationConfig,
|
|
5
6
|
ConfirmationMode,
|
|
6
|
-
ConfirmDialog,
|
|
7
7
|
} from '../../ConfirmDialog';
|
|
8
8
|
import { BaseFormControl, BaseInputEvents } from '../Form.models';
|
|
9
9
|
import { FormElementContainer } from '../FormElementContainer';
|
|
@@ -58,7 +58,7 @@ export const RadioButton: React.FC<RadioButtonProps> = ({
|
|
|
58
58
|
viewBox="0 0 34 34"
|
|
59
59
|
>
|
|
60
60
|
<circle className={classes.radioOutline} cx="17" cy="17" r="15" />
|
|
61
|
-
<circle className={classes.radioDot} cx="17" cy="17" r="
|
|
61
|
+
<circle className={classes.radioDot} cx="17" cy="17" r="7.5" />
|
|
62
62
|
</svg>
|
|
63
63
|
);
|
|
64
64
|
|
|
@@ -39,10 +39,20 @@
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
&:disabled {
|
|
42
|
+
border-color: var(
|
|
43
|
+
--input-disabled-border-color,
|
|
44
|
+
$input-disabled-border-color
|
|
45
|
+
);
|
|
46
|
+
|
|
42
47
|
cursor: default;
|
|
48
|
+
|
|
43
49
|
background-image: svg-arrow-glyph(
|
|
44
50
|
var(--select-arrow-color, encodecolor($select-disabled-arrow-color))
|
|
45
51
|
);
|
|
52
|
+
background-color: var(
|
|
53
|
+
--input-disabled-background-color,
|
|
54
|
+
$input-disabled-background-color
|
|
55
|
+
);
|
|
46
56
|
}
|
|
47
57
|
}
|
|
48
58
|
|
|
@@ -2,7 +2,7 @@ import { mount, shallow } from 'enzyme';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { SingleLineText } from './SingleLineText';
|
|
4
4
|
|
|
5
|
-
describe('
|
|
5
|
+
describe('SingleLineText', () => {
|
|
6
6
|
it('renders the component without crashing', () => {
|
|
7
7
|
const wrapper = shallow(<SingleLineText name={'test-name'} />);
|
|
8
8
|
|
|
@@ -43,7 +43,7 @@ describe('TextField', () => {
|
|
|
43
43
|
autoComplete: 'on',
|
|
44
44
|
autoFocus: true,
|
|
45
45
|
className: '',
|
|
46
|
-
disabled:
|
|
46
|
+
disabled: false,
|
|
47
47
|
id: 'test-id',
|
|
48
48
|
name: 'test-name',
|
|
49
49
|
placeholder: 'test-placeholder',
|
|
@@ -102,7 +102,7 @@ export const SingleLineText: React.FC<SingleLineTextProps> = ({
|
|
|
102
102
|
value={value}
|
|
103
103
|
defaultValue={defaultValue}
|
|
104
104
|
disabled={disabled}
|
|
105
|
-
placeholder={placeholder}
|
|
105
|
+
placeholder={disabled ? undefined : placeholder}
|
|
106
106
|
autoFocus={autoFocus}
|
|
107
107
|
autoComplete={autoComplete}
|
|
108
108
|
onChange={onChange}
|
|
@@ -25,6 +25,10 @@
|
|
|
25
25
|
color: $tag-font-color;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
&.disabled span {
|
|
29
|
+
color: var(--input-disabled-font-color, $input-disabled-font-color);
|
|
30
|
+
}
|
|
31
|
+
|
|
28
32
|
span.required {
|
|
29
33
|
border: 1px solid var(--tag-border-color-1, $tag-border-color-1);
|
|
30
34
|
}
|
|
@@ -74,10 +78,20 @@
|
|
|
74
78
|
}
|
|
75
79
|
|
|
76
80
|
&:disabled {
|
|
81
|
+
border-color: var(
|
|
82
|
+
--input-disabled-border-color,
|
|
83
|
+
$input-disabled-border-color
|
|
84
|
+
);
|
|
85
|
+
|
|
77
86
|
cursor: default;
|
|
87
|
+
|
|
78
88
|
background-image: svg-arrow-glyph(
|
|
79
89
|
var(--select-arrow-color, encodecolor($select-disabled-arrow-color))
|
|
80
90
|
);
|
|
91
|
+
background-color: var(
|
|
92
|
+
--input-disabled-background-color,
|
|
93
|
+
$input-disabled-background-color
|
|
94
|
+
);
|
|
81
95
|
}
|
|
82
96
|
}
|
|
83
97
|
|
|
@@ -189,7 +189,10 @@ export const Tags = <T,>({
|
|
|
189
189
|
>
|
|
190
190
|
<span
|
|
191
191
|
key={tag}
|
|
192
|
-
className={clsx(
|
|
192
|
+
className={clsx({
|
|
193
|
+
[classes.selectedItem]: true,
|
|
194
|
+
[classes.disabled]: disabled,
|
|
195
|
+
})}
|
|
193
196
|
data-test-id="tag"
|
|
194
197
|
>
|
|
195
198
|
<span>{getDisplayValue(tag)}</span>
|
|
@@ -200,6 +203,7 @@ export const Tags = <T,>({
|
|
|
200
203
|
e.persist();
|
|
201
204
|
removeTag(idx, e);
|
|
202
205
|
}}
|
|
206
|
+
disabled={disabled}
|
|
203
207
|
buttonContext={ButtonContext.Icon}
|
|
204
208
|
dataTestId="tags-delete"
|
|
205
209
|
></Button>
|
|
@@ -2,7 +2,7 @@ import { shallow } from 'enzyme';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { TextArea } from './TextArea';
|
|
4
4
|
|
|
5
|
-
describe('
|
|
5
|
+
describe('TextArea', () => {
|
|
6
6
|
it('renders the component without crashing', () => {
|
|
7
7
|
const wrapper = shallow(<TextArea name={'test-name'} />);
|
|
8
8
|
|
|
@@ -40,7 +40,7 @@ describe('TextField', () => {
|
|
|
40
40
|
const mockProps = {
|
|
41
41
|
autoFocus: true,
|
|
42
42
|
className: '',
|
|
43
|
-
disabled:
|
|
43
|
+
disabled: false,
|
|
44
44
|
id: 'test-id',
|
|
45
45
|
name: 'test-name',
|
|
46
46
|
onBlur: () => null,
|