@axinom/mosaic-ui 0.66.0-rc.8 → 0.66.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/DynamicListHeader/DynamicListHeader.d.ts.map +1 -1
- package/dist/components/FieldSelection/FieldSelection.d.ts.map +1 -1
- package/dist/components/Filters/Filter/Filter.d.ts.map +1 -1
- package/dist/components/Filters/Filters.model.d.ts +5 -0
- package/dist/components/Filters/Filters.model.d.ts.map +1 -1
- package/dist/components/Filters/SelectionTypes/DateTimeFilter/DateTimeFilter.d.ts +2 -0
- package/dist/components/Filters/SelectionTypes/DateTimeFilter/DateTimeFilter.d.ts.map +1 -1
- package/dist/components/Filters/SelectionTypes/FreeTextFilter/FreeTextFilter.d.ts +2 -0
- package/dist/components/Filters/SelectionTypes/FreeTextFilter/FreeTextFilter.d.ts.map +1 -1
- package/dist/components/Filters/SelectionTypes/MultiOptionFilter/MultiOptionFilter.d.ts +2 -0
- package/dist/components/Filters/SelectionTypes/MultiOptionFilter/MultiOptionFilter.d.ts.map +1 -1
- package/dist/components/Filters/SelectionTypes/NumericTextFilter/NumericTextFilter.d.ts +2 -0
- package/dist/components/Filters/SelectionTypes/NumericTextFilter/NumericTextFilter.d.ts.map +1 -1
- package/dist/components/Filters/SelectionTypes/OptionsFilter/OptionsFilter.d.ts +2 -0
- package/dist/components/Filters/SelectionTypes/OptionsFilter/OptionsFilter.d.ts.map +1 -1
- package/dist/components/Filters/SelectionTypes/SearcheableOptionsFilter/SearcheableOptionsFilter.d.ts +2 -0
- package/dist/components/Filters/SelectionTypes/SearcheableOptionsFilter/SearcheableOptionsFilter.d.ts.map +1 -1
- package/dist/components/FormElements/Radio/Radio.d.ts.map +1 -1
- package/dist/components/FormElements/ToggleButton/ToggleButton.d.ts.map +1 -1
- package/dist/components/Hub/Tile/Tile.d.ts.map +1 -1
- package/dist/components/Icons/Icons.d.ts +4 -9
- package/dist/components/Icons/Icons.d.ts.map +1 -1
- package/dist/components/LandingPageTiles/TileLarge/TileLarge.d.ts.map +1 -1
- package/dist/components/LandingPageTiles/TileSmall/TileSmall.d.ts.map +1 -1
- package/dist/components/List/ListCheckBox/ListCheckBox.d.ts.map +1 -1
- package/dist/components/List/ListHeader/ColumnLabel/ColumnLabel.d.ts.map +1 -1
- package/dist/components/List/ListHeader/ListHeader.d.ts.map +1 -1
- package/dist/components/List/ListRow/ListRow.d.ts.map +1 -1
- package/dist/components/List/ListRow/ListRowCell/ListRowCell.d.ts +15 -0
- package/dist/components/List/ListRow/ListRowCell/ListRowCell.d.ts.map +1 -0
- package/dist/components/List/ListRow/ListRowCell/renderData.d.ts +9 -0
- package/dist/components/List/ListRow/ListRowCell/renderData.d.ts.map +1 -0
- package/dist/components/List/ListRow/Renderers/TagsRenderer/TagsRenderer.d.ts.map +1 -1
- package/dist/components/Loaders/ImageLoader/ImageLoader.d.ts.map +1 -1
- package/dist/components/PageHeader/PageHeaderAction/PageHeaderAction.d.ts.map +1 -1
- package/dist/components/Utils/Postgraphile/CreateConnectionRenderer.d.ts +1 -1
- package/dist/components/Utils/Postgraphile/CreateConnectionRenderer.d.ts.map +1 -1
- package/dist/components/VisualElements/ImgElement.d.ts +50 -0
- package/dist/components/VisualElements/ImgElement.d.ts.map +1 -0
- package/dist/components/VisualElements/SvgElement.d.ts +14 -0
- package/dist/components/VisualElements/SvgElement.d.ts.map +1 -0
- package/dist/components/VisualElements/index.d.ts +3 -0
- package/dist/components/VisualElements/index.d.ts.map +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/helpers/idleCallbackHelpers.d.ts +42 -0
- package/dist/helpers/idleCallbackHelpers.d.ts.map +1 -0
- package/dist/helpers/index.d.ts +1 -0
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/hooks/useResize/ResizeIndicator.d.ts +8 -0
- package/dist/hooks/useResize/ResizeIndicator.d.ts.map +1 -0
- package/dist/hooks/useResize/useResize.d.ts +5 -2
- package/dist/hooks/useResize/useResize.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 +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 +2 -2
- package/src/components/Accordion/Accordion.scss +1 -1
- package/src/components/Accordion/AccordionItem/AccordionItem.scss +2 -2
- package/src/components/Buttons/Button/Button.scss +5 -5
- package/src/components/Buttons/CompositeButton/CompositeButton.scss +7 -7
- package/src/components/Buttons/TextButton/TextButton.scss +6 -6
- package/src/components/ConfirmDialog/ConfirmDialog.scss +1 -1
- package/src/components/DateTime/DatePicker/DatePicker.scss +12 -12
- package/src/components/DateTime/TimePicker/ScrollColumn/ScrollColumn.scss +7 -7
- package/src/components/DateTime/TimePicker/TimePicker.scss +1 -1
- package/src/components/DynamicDataList/DynamicListHeader/DynamicListHeader.scss +2 -2
- package/src/components/DynamicDataList/DynamicListHeader/DynamicListHeader.spec.tsx +2 -0
- package/src/components/DynamicDataList/DynamicListHeader/DynamicListHeader.tsx +62 -50
- package/src/components/DynamicDataList/DynamicListRow/DynamicListRow.scss +2 -2
- package/src/components/FieldSelection/FieldSelection.scss +4 -0
- package/src/components/FieldSelection/FieldSelection.tsx +1 -0
- package/src/components/Filters/Filter/Filter.scss +34 -15
- package/src/components/Filters/Filter/Filter.spec.tsx +1 -1
- package/src/components/Filters/Filter/Filter.tsx +46 -34
- package/src/components/Filters/Filters.model.ts +6 -0
- package/src/components/Filters/SelectionTypes/DateTimeFilter/DateTimeFilter.tsx +5 -0
- package/src/components/Filters/SelectionTypes/FreeTextFilter/FreeTextFilter.tsx +4 -0
- package/src/components/Filters/SelectionTypes/MultiOptionFilter/MultiOptionFilter.scss +1 -1
- package/src/components/Filters/SelectionTypes/MultiOptionFilter/MultiOptionFilter.tsx +9 -1
- package/src/components/Filters/SelectionTypes/NumericTextFilter/NumericTextFilter.tsx +5 -0
- package/src/components/Filters/SelectionTypes/OptionsFilter/OptionsFilter.scss +6 -10
- package/src/components/Filters/SelectionTypes/OptionsFilter/OptionsFilter.tsx +8 -0
- package/src/components/Filters/SelectionTypes/SearcheableOptionsFilter/SearcheableOptionsFilter.tsx +6 -1
- package/src/components/FormElements/Checkbox/Checkbox.scss +4 -4
- package/src/components/FormElements/CustomTags/CustomTags.scss +1 -1
- package/src/components/FormElements/FileUploadControl/FileUploadControl.scss +4 -4
- package/src/components/FormElements/Radio/Radio.scss +5 -5
- package/src/components/FormElements/Radio/Radio.tsx +3 -2
- package/src/components/FormElements/Select/Select.scss +11 -6
- package/src/components/FormElements/ToggleButton/ToggleButton.scss +7 -7
- package/src/components/FormElements/ToggleButton/ToggleButton.tsx +32 -27
- package/src/components/Hub/Hub.stories.tsx +3 -2
- package/src/components/Hub/Tile/Tile.spec.tsx +7 -2
- package/src/components/Hub/Tile/Tile.tsx +2 -1
- package/src/components/Icons/Icons.scss +1 -0
- package/src/components/Icons/Icons.spec.tsx +90 -41
- package/src/components/Icons/Icons.tsx +357 -765
- package/src/components/InfoTooltip/InfoTooltip.scss +1 -1
- package/src/components/InlineMenu/InlineMenu.scss +2 -2
- package/src/components/LandingPageTiles/LandingPageTiles.stories.tsx +3 -2
- package/src/components/LandingPageTiles/TileLarge/TileLarge.spec.tsx +5 -1
- package/src/components/LandingPageTiles/TileLarge/TileLarge.tsx +2 -1
- package/src/components/LandingPageTiles/TileSmall/TileSmall.spec.tsx +7 -2
- package/src/components/LandingPageTiles/TileSmall/TileSmall.tsx +2 -1
- package/src/components/List/List.scss +4 -4
- package/src/components/List/ListCheckBox/ListCheckBox.tsx +1 -0
- package/src/components/List/ListHeader/ColumnLabel/ColumnLabel.spec.tsx +6 -6
- package/src/components/List/ListHeader/ColumnLabel/ColumnLabel.tsx +10 -13
- package/src/components/List/ListHeader/ListHeader.scss +2 -3
- package/src/components/List/ListHeader/ListHeader.spec.tsx +2 -0
- package/src/components/List/ListHeader/ListHeader.tsx +57 -51
- package/src/components/List/ListRow/ListRow.scss +1 -28
- package/src/components/List/ListRow/ListRow.spec.tsx +10 -8
- package/src/components/List/ListRow/ListRow.tsx +20 -152
- package/src/components/List/ListRow/ListRowCell/ListRowCell.scss +26 -0
- package/src/components/List/ListRow/ListRowCell/ListRowCell.spec.tsx +491 -0
- package/src/components/List/ListRow/ListRowCell/ListRowCell.tsx +57 -0
- package/src/components/List/ListRow/ListRowCell/renderData.tsx +124 -0
- package/src/components/List/ListRow/Renderers/TagsRenderer/TagsRenderer.spec.tsx +191 -80
- package/src/components/List/ListRow/Renderers/TagsRenderer/TagsRenderer.tsx +63 -34
- package/src/components/Loaders/ImageLoader/ImageLoader.spec.tsx +13 -14
- package/src/components/Loaders/ImageLoader/ImageLoader.tsx +5 -3
- package/src/components/PageHeader/PageHeader.scss +1 -1
- package/src/components/PageHeader/PageHeaderAction/PageHeaderAction.tsx +13 -2
- package/src/components/Tabs/Tab/CustomTab.scss +4 -4
- package/src/components/Tabs/TabList/CustomTabList.scss +2 -2
- package/src/components/Utils/Postgraphile/CreateConnectionRenderer.spec.ts +48 -12
- package/src/components/Utils/Postgraphile/CreateConnectionRenderer.tsx +5 -4
- package/src/components/VisualElements/ImgElement.spec.tsx +92 -0
- package/src/components/VisualElements/ImgElement.tsx +72 -0
- package/src/components/VisualElements/SvgElement.spec.tsx +160 -0
- package/src/components/VisualElements/SvgElement.tsx +40 -0
- package/src/components/VisualElements/index.ts +7 -0
- package/src/components/index.ts +1 -0
- package/src/helpers/idleCallbackHelpers.ts +66 -0
- package/src/helpers/index.ts +5 -0
- package/src/hooks/useResize/ResizeIndicator.scss +7 -0
- package/src/hooks/useResize/ResizeIndicator.tsx +39 -0
- package/src/hooks/useResize/{useResize.ts → useResize.tsx} +38 -6
- package/src/index.ts +2 -0
- package/src/styles/branding.scss +89 -0
- package/src/styles/variables.scss +245 -187
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import clsx from 'clsx';
|
|
2
|
-
import React, {
|
|
3
|
-
PropsWithChildren,
|
|
4
|
-
ReactNode,
|
|
5
|
-
useEffect,
|
|
6
|
-
useRef,
|
|
7
|
-
useState,
|
|
8
|
-
} from 'react';
|
|
2
|
+
import React, { PropsWithChildren, ReactNode, useState } from 'react';
|
|
9
3
|
import { assertNever } from '../../../helpers/utils';
|
|
10
4
|
import { Data } from '../../../types/data';
|
|
11
5
|
import { Button, ButtonContext } from '../../Buttons';
|
|
@@ -58,18 +52,16 @@ export const Filter = <T extends Data>({
|
|
|
58
52
|
}: PropsWithChildren<FilterProps<T>>): JSX.Element => {
|
|
59
53
|
const [isExpanded, setIsExpanded] = useState<boolean>(false);
|
|
60
54
|
const [hasError, setHasError] = useState<boolean>(false);
|
|
61
|
-
const [contentHeight, setContentHeight] = useState<number>(0);
|
|
62
55
|
const [stringValue, setStringValue] = useState<string | undefined>();
|
|
63
56
|
|
|
64
|
-
const
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}, [isExpanded, hasError, value]);
|
|
57
|
+
const inputId = `${String(options.property)}-filter-input`;
|
|
58
|
+
const labelId = `${String(options.property)}-filter-label`;
|
|
59
|
+
const inputBasedFilter = [
|
|
60
|
+
FilterTypes.FreeText,
|
|
61
|
+
FilterTypes.Numeric,
|
|
62
|
+
FilterTypes.Date,
|
|
63
|
+
FilterTypes.DateTime,
|
|
64
|
+
];
|
|
73
65
|
|
|
74
66
|
const onFilterValueChange = (
|
|
75
67
|
prop: keyof T,
|
|
@@ -135,6 +127,7 @@ export const Filter = <T extends Data>({
|
|
|
135
127
|
onError={onError}
|
|
136
128
|
onValidate={onValidate}
|
|
137
129
|
selectOnFocus={selectOnFocus}
|
|
130
|
+
inputId={inputId}
|
|
138
131
|
/>
|
|
139
132
|
);
|
|
140
133
|
|
|
@@ -147,6 +140,7 @@ export const Filter = <T extends Data>({
|
|
|
147
140
|
}
|
|
148
141
|
onError={onError}
|
|
149
142
|
onValidate={onValidate}
|
|
143
|
+
inputId={inputId}
|
|
150
144
|
/>
|
|
151
145
|
);
|
|
152
146
|
|
|
@@ -158,6 +152,7 @@ export const Filter = <T extends Data>({
|
|
|
158
152
|
onSelect={(value: FilterValue) =>
|
|
159
153
|
onFilterValueChange(options.property, value)
|
|
160
154
|
}
|
|
155
|
+
labelId={labelId}
|
|
161
156
|
/>
|
|
162
157
|
);
|
|
163
158
|
|
|
@@ -169,6 +164,7 @@ export const Filter = <T extends Data>({
|
|
|
169
164
|
onSelect={(value: FilterValue) =>
|
|
170
165
|
onFilterValueChange(options.property, value?.toString())
|
|
171
166
|
}
|
|
167
|
+
labelId={labelId}
|
|
172
168
|
/>
|
|
173
169
|
);
|
|
174
170
|
case FilterTypes.SearcheableOptions:
|
|
@@ -181,6 +177,8 @@ export const Filter = <T extends Data>({
|
|
|
181
177
|
onFilterValueChange(options.property, value, stringValue)
|
|
182
178
|
}
|
|
183
179
|
maxItems={options.maxItems}
|
|
180
|
+
inputId={inputId}
|
|
181
|
+
labelId={labelId}
|
|
184
182
|
/>
|
|
185
183
|
);
|
|
186
184
|
|
|
@@ -194,6 +192,7 @@ export const Filter = <T extends Data>({
|
|
|
194
192
|
modifyTime={false}
|
|
195
193
|
onError={onError}
|
|
196
194
|
onValidate={onValidate}
|
|
195
|
+
inputId={inputId}
|
|
197
196
|
/>
|
|
198
197
|
);
|
|
199
198
|
|
|
@@ -207,6 +206,7 @@ export const Filter = <T extends Data>({
|
|
|
207
206
|
modifyTime={true}
|
|
208
207
|
onError={onError}
|
|
209
208
|
onValidate={onValidate}
|
|
209
|
+
inputId={inputId}
|
|
210
210
|
/>
|
|
211
211
|
);
|
|
212
212
|
|
|
@@ -220,6 +220,7 @@ export const Filter = <T extends Data>({
|
|
|
220
220
|
}}
|
|
221
221
|
onError={onError}
|
|
222
222
|
onValidate={onValidate}
|
|
223
|
+
labelId={labelId}
|
|
223
224
|
/>
|
|
224
225
|
);
|
|
225
226
|
|
|
@@ -229,9 +230,16 @@ export const Filter = <T extends Data>({
|
|
|
229
230
|
}
|
|
230
231
|
};
|
|
231
232
|
|
|
233
|
+
const hasValue = value !== undefined && value !== '';
|
|
234
|
+
|
|
232
235
|
return (
|
|
233
236
|
<div
|
|
234
|
-
className={clsx(
|
|
237
|
+
className={clsx(
|
|
238
|
+
classes.container,
|
|
239
|
+
{ [classes.hasValue]: hasValue },
|
|
240
|
+
'filter-container',
|
|
241
|
+
className,
|
|
242
|
+
)}
|
|
235
243
|
data-test-id={`filter:${options.property as string}`}
|
|
236
244
|
data-test-type={FilterTypes[options.type]}
|
|
237
245
|
onClick={() => onFilterClicked()}
|
|
@@ -241,31 +249,36 @@ export const Filter = <T extends Data>({
|
|
|
241
249
|
setIsExpanded(!isExpanded);
|
|
242
250
|
setHasError(false);
|
|
243
251
|
}}
|
|
244
|
-
className={clsx(
|
|
245
|
-
classes.
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
)}
|
|
252
|
+
className={clsx(classes.title, {
|
|
253
|
+
[classes.hasValue]: hasValue,
|
|
254
|
+
[classes.active]: isActive && isExpanded,
|
|
255
|
+
[classes.hasError]: hasError,
|
|
256
|
+
})}
|
|
250
257
|
data-test-id="filter-button-toggle"
|
|
251
258
|
>
|
|
252
|
-
<
|
|
259
|
+
<label
|
|
260
|
+
id={labelId}
|
|
261
|
+
{...(inputBasedFilter.includes(options.type)
|
|
262
|
+
? {}
|
|
263
|
+
: { htmlFor: inputId })}
|
|
264
|
+
data-test-id="filter-label"
|
|
265
|
+
>
|
|
266
|
+
{options.label}
|
|
267
|
+
</label>
|
|
253
268
|
<Button
|
|
254
|
-
icon={IconName.
|
|
255
|
-
className={clsx(classes.button
|
|
269
|
+
icon={IconName.ChevronRight}
|
|
270
|
+
className={clsx(classes.button, {
|
|
271
|
+
[classes.rotated]: isExpanded || hasValue,
|
|
272
|
+
})}
|
|
256
273
|
buttonContext={ButtonContext.None}
|
|
257
274
|
/>
|
|
258
275
|
</div>
|
|
259
276
|
<div
|
|
260
|
-
className={clsx(classes.content)}
|
|
261
|
-
style={{
|
|
262
|
-
maxHeight: contentHeight,
|
|
263
|
-
}}
|
|
277
|
+
className={clsx(classes.content, { [classes.expanded]: isExpanded })}
|
|
264
278
|
>
|
|
265
|
-
{
|
|
279
|
+
{hasValue && !isExpanded && (
|
|
266
280
|
<div
|
|
267
281
|
className={clsx(classes.selectedValue)}
|
|
268
|
-
ref={valueRef}
|
|
269
282
|
onClick={() => {
|
|
270
283
|
setIsExpanded(!isExpanded);
|
|
271
284
|
}}
|
|
@@ -285,7 +298,6 @@ export const Filter = <T extends Data>({
|
|
|
285
298
|
)}
|
|
286
299
|
{isExpanded && (
|
|
287
300
|
<div
|
|
288
|
-
ref={contentRef}
|
|
289
301
|
data-test-id="filter-content"
|
|
290
302
|
className={clsx({ [classes.active]: isActive })}
|
|
291
303
|
>
|
|
@@ -78,6 +78,12 @@ export interface CustomFilterProps {
|
|
|
78
78
|
/** Wether or not the filter is active (default: false) */
|
|
79
79
|
active?: boolean;
|
|
80
80
|
|
|
81
|
+
/**
|
|
82
|
+
* Optional id for the label element.
|
|
83
|
+
* Assign to the label's `id` and reference from the input or group via `aria-labelledby`.
|
|
84
|
+
*/
|
|
85
|
+
labelId?: string;
|
|
86
|
+
|
|
81
87
|
/** Callback triggered when a new filter value is selected */
|
|
82
88
|
onSelect: (
|
|
83
89
|
value: FilterValue,
|
|
@@ -31,6 +31,9 @@ export interface DateTimeFilterProps {
|
|
|
31
31
|
|
|
32
32
|
/** CSS Class name for additional styles */
|
|
33
33
|
className?: string;
|
|
34
|
+
|
|
35
|
+
/** Optional id for the input field */
|
|
36
|
+
inputId?: string;
|
|
34
37
|
}
|
|
35
38
|
|
|
36
39
|
export const DateTimeFilter: React.FC<DateTimeFilterProps> = ({
|
|
@@ -40,6 +43,7 @@ export const DateTimeFilter: React.FC<DateTimeFilterProps> = ({
|
|
|
40
43
|
onError = noop,
|
|
41
44
|
onValidate: customValidate,
|
|
42
45
|
className = '',
|
|
46
|
+
inputId,
|
|
43
47
|
}) => {
|
|
44
48
|
const container = useRef<HTMLDivElement>(null);
|
|
45
49
|
const [showPicker, setShowPicker] = useState(false);
|
|
@@ -111,6 +115,7 @@ export const DateTimeFilter: React.FC<DateTimeFilterProps> = ({
|
|
|
111
115
|
ref={container}
|
|
112
116
|
>
|
|
113
117
|
<input
|
|
118
|
+
id={inputId}
|
|
114
119
|
autoFocus
|
|
115
120
|
className={clsx(classes.inputValue)}
|
|
116
121
|
onKeyDown={handleKeyDown}
|
|
@@ -19,6 +19,8 @@ export interface FreeTextFilterProps {
|
|
|
19
19
|
className?: string;
|
|
20
20
|
/** Select text on focus if true (default: true) */
|
|
21
21
|
selectOnFocus?: boolean;
|
|
22
|
+
/** Optional id for the input field */
|
|
23
|
+
inputId?: string;
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
export const FreeTextFilter: React.FC<FreeTextFilterProps> = ({
|
|
@@ -28,6 +30,7 @@ export const FreeTextFilter: React.FC<FreeTextFilterProps> = ({
|
|
|
28
30
|
onValidate: customValidate,
|
|
29
31
|
className = '',
|
|
30
32
|
selectOnFocus = true,
|
|
33
|
+
inputId,
|
|
31
34
|
}) => {
|
|
32
35
|
const [errorMsg, setErrorMsg] = useState<string>();
|
|
33
36
|
const ENTER_KEY = 'Enter';
|
|
@@ -68,6 +71,7 @@ export const FreeTextFilter: React.FC<FreeTextFilterProps> = ({
|
|
|
68
71
|
)}
|
|
69
72
|
>
|
|
70
73
|
<input
|
|
74
|
+
id={inputId}
|
|
71
75
|
ref={inputRef}
|
|
72
76
|
autoFocus
|
|
73
77
|
className={clsx(classes.inputValue, errorMsg && classes.hasError)}
|
|
@@ -17,19 +17,27 @@ export interface MultiOptionFilterProps {
|
|
|
17
17
|
|
|
18
18
|
/** CSS Class name for additional styles */
|
|
19
19
|
className?: string;
|
|
20
|
+
|
|
21
|
+
/** ID for the label */
|
|
22
|
+
labelId?: string;
|
|
20
23
|
}
|
|
21
24
|
|
|
22
25
|
export const MultiOptionsFilter: React.FC<MultiOptionFilterProps> = ({
|
|
23
26
|
value,
|
|
24
27
|
options,
|
|
25
28
|
onSelect,
|
|
29
|
+
labelId,
|
|
26
30
|
}) => {
|
|
27
31
|
const [selectedOptionList, setSelectedOptionList] = useState<string[]>(
|
|
28
32
|
value ? value.split(',') : [],
|
|
29
33
|
);
|
|
30
34
|
|
|
31
35
|
return (
|
|
32
|
-
<div
|
|
36
|
+
<div
|
|
37
|
+
className={classes.multiFilterContainer}
|
|
38
|
+
role="group"
|
|
39
|
+
aria-labelledby={labelId}
|
|
40
|
+
>
|
|
33
41
|
{options?.map((option: Option) => (
|
|
34
42
|
<Checkbox
|
|
35
43
|
className={clsx(
|
|
@@ -18,6 +18,9 @@ export interface NumericTextFilterProps {
|
|
|
18
18
|
|
|
19
19
|
/** CSS Class name for additional styles */
|
|
20
20
|
className?: string;
|
|
21
|
+
|
|
22
|
+
/** Optional id for the input field */
|
|
23
|
+
inputId?: string;
|
|
21
24
|
}
|
|
22
25
|
|
|
23
26
|
export const NumericTextFilter: React.FC<NumericTextFilterProps> = ({
|
|
@@ -26,6 +29,7 @@ export const NumericTextFilter: React.FC<NumericTextFilterProps> = ({
|
|
|
26
29
|
onError = noop,
|
|
27
30
|
onValidate: customValidate,
|
|
28
31
|
className = '',
|
|
32
|
+
inputId,
|
|
29
33
|
}) => {
|
|
30
34
|
const [errorMsg, setErrorMsg] = useState<string>();
|
|
31
35
|
const ENTER_KEY = 'Enter';
|
|
@@ -64,6 +68,7 @@ export const NumericTextFilter: React.FC<NumericTextFilterProps> = ({
|
|
|
64
68
|
)}
|
|
65
69
|
>
|
|
66
70
|
<input
|
|
71
|
+
id={inputId}
|
|
67
72
|
autoFocus
|
|
68
73
|
value={valueLocal}
|
|
69
74
|
className={clsx(classes.inputValue, errorMsg && classes.hasError)}
|
|
@@ -4,11 +4,7 @@
|
|
|
4
4
|
@include boxSizing;
|
|
5
5
|
|
|
6
6
|
display: grid;
|
|
7
|
-
grid-auto-rows:
|
|
8
|
-
background-color: var(
|
|
9
|
-
--filter-controller-background-color,
|
|
10
|
-
$filter-controller-background-color
|
|
11
|
-
);
|
|
7
|
+
grid-auto-rows: 40px;
|
|
12
8
|
gap: 1px;
|
|
13
9
|
border-top: unset;
|
|
14
10
|
|
|
@@ -18,7 +14,7 @@
|
|
|
18
14
|
|
|
19
15
|
span {
|
|
20
16
|
font-size: var(--filter-font-size, $filter-font-size);
|
|
21
|
-
color: var(--
|
|
17
|
+
color: var(--popper-text-color, $popper-text-color);
|
|
22
18
|
display: grid;
|
|
23
19
|
place-items: center left;
|
|
24
20
|
padding: 0 20px;
|
|
@@ -27,15 +23,15 @@
|
|
|
27
23
|
|
|
28
24
|
&:hover {
|
|
29
25
|
background-color: var(
|
|
30
|
-
--
|
|
31
|
-
$
|
|
26
|
+
--popper-item-hover-color,
|
|
27
|
+
$popper-item-hover-color
|
|
32
28
|
);
|
|
33
29
|
}
|
|
34
30
|
|
|
35
31
|
&.selected {
|
|
36
32
|
background-color: var(
|
|
37
|
-
--
|
|
38
|
-
$
|
|
33
|
+
--popper-background-selected-color,
|
|
34
|
+
$popper-background-selected-color
|
|
39
35
|
);
|
|
40
36
|
}
|
|
41
37
|
}
|
|
@@ -14,6 +14,9 @@ export interface OptionFilterProps {
|
|
|
14
14
|
|
|
15
15
|
/** CSS Class name for additional styles */
|
|
16
16
|
className?: string;
|
|
17
|
+
|
|
18
|
+
/** Optional id for the label element */
|
|
19
|
+
labelId?: string;
|
|
17
20
|
}
|
|
18
21
|
|
|
19
22
|
export const OptionsFilter: React.FC<OptionFilterProps> = ({
|
|
@@ -21,9 +24,12 @@ export const OptionsFilter: React.FC<OptionFilterProps> = ({
|
|
|
21
24
|
options,
|
|
22
25
|
onSelect,
|
|
23
26
|
className = '',
|
|
27
|
+
labelId,
|
|
24
28
|
}) => {
|
|
25
29
|
return (
|
|
26
30
|
<div
|
|
31
|
+
role="radiogroup"
|
|
32
|
+
aria-labelledby={labelId}
|
|
27
33
|
className={clsx(classes.container, 'options-filter-container', className)}
|
|
28
34
|
>
|
|
29
35
|
{options?.map((option: Option) => (
|
|
@@ -32,6 +38,8 @@ export const OptionsFilter: React.FC<OptionFilterProps> = ({
|
|
|
32
38
|
onClick={() => onSelect(option.value)}
|
|
33
39
|
key={option.label}
|
|
34
40
|
data-test-value={option.value as string}
|
|
41
|
+
role="radio"
|
|
42
|
+
aria-checked={value === option.value}
|
|
35
43
|
>
|
|
36
44
|
<span
|
|
37
45
|
className={clsx(value === option.value && classes.selected)}
|
package/src/components/Filters/SelectionTypes/SearcheableOptionsFilter/SearcheableOptionsFilter.tsx
CHANGED
|
@@ -14,6 +14,9 @@ interface SearcheableOptionFilterProps
|
|
|
14
14
|
searchInputPlaceholder?: string;
|
|
15
15
|
maxItems?: number;
|
|
16
16
|
onSelect: (value: string, stringValue?: string) => void;
|
|
17
|
+
|
|
18
|
+
/** Optional id for the input field */
|
|
19
|
+
inputId?: string;
|
|
17
20
|
}
|
|
18
21
|
|
|
19
22
|
export const SearcheableOptionsFilter: React.FC<
|
|
@@ -24,6 +27,7 @@ export const SearcheableOptionsFilter: React.FC<
|
|
|
24
27
|
maxItems = 10,
|
|
25
28
|
onSelect,
|
|
26
29
|
className,
|
|
30
|
+
inputId,
|
|
27
31
|
...rest
|
|
28
32
|
}) => {
|
|
29
33
|
const [options, setOptions] = useState<Option[]>([]);
|
|
@@ -56,9 +60,10 @@ export const SearcheableOptionsFilter: React.FC<
|
|
|
56
60
|
)}
|
|
57
61
|
>
|
|
58
62
|
<input
|
|
63
|
+
id={inputId}
|
|
59
64
|
autoFocus
|
|
60
65
|
onChange={debounce(onChangeHandler, 500)}
|
|
61
|
-
className={
|
|
66
|
+
className={classes.inputValue}
|
|
62
67
|
placeholder={searchInputPlaceholder}
|
|
63
68
|
/>
|
|
64
69
|
</div>
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
// transition: background-color 0.15s ease-in-out 0s;
|
|
27
27
|
|
|
28
28
|
&.hasConfirm {
|
|
29
|
-
border: 1px solid
|
|
29
|
+
border: 1px solid var(--ax-warning);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
&.hasError {
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
box-shadow: 0 0 0 2px var(--input-hover-color, $input-hover-color);
|
|
55
55
|
|
|
56
56
|
&.hasConfirm {
|
|
57
|
-
border: 1px solid
|
|
58
|
-
box-shadow: 0 0 0 2px
|
|
57
|
+
border: 1px solid var(--ax-warning);
|
|
58
|
+
box-shadow: 0 0 0 2px var(--ax-warning);
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
&.hasError {
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
background-color: var(--input-hover-color, $input-hover-color);
|
|
71
71
|
|
|
72
72
|
&.hasConfirm {
|
|
73
|
-
background-color:
|
|
73
|
+
background-color: var(--ax-warning);
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
&.hasError {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
|
|
20
20
|
margin-left: -50px;
|
|
21
21
|
border: none;
|
|
22
|
-
background-color:
|
|
22
|
+
background-color: var(--ax-primary);
|
|
23
23
|
|
|
24
24
|
transition: box-shadow 0.15s ease-in-out 0s;
|
|
25
25
|
|
|
@@ -35,16 +35,16 @@
|
|
|
35
35
|
|
|
36
36
|
&:hover {
|
|
37
37
|
border: none;
|
|
38
|
-
background-color:
|
|
38
|
+
background-color: color-mix(in srgb, var(--ax-primary) 75%, transparent);
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
&.disabled {
|
|
42
42
|
border: none;
|
|
43
|
-
background-color:
|
|
43
|
+
background-color: var(--ax-neutral);
|
|
44
44
|
cursor: default;
|
|
45
45
|
|
|
46
46
|
svg * {
|
|
47
|
-
stroke:
|
|
47
|
+
stroke: color-mix(in srgb, white 50%, transparent);
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
}
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
grid: 1fr / 30px 1fr;
|
|
28
28
|
column-gap: 8px;
|
|
29
29
|
|
|
30
|
-
color:
|
|
30
|
+
color: var(--ax-neutral-dark);
|
|
31
31
|
font-size: 16px;
|
|
32
32
|
font-weight: unset;
|
|
33
33
|
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
|
|
38
38
|
&.disabled {
|
|
39
39
|
.radioOutline {
|
|
40
|
-
fill:
|
|
40
|
+
fill: var(--ax-neutral-lighter);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
.checked {
|
|
44
44
|
.radioDot {
|
|
45
|
-
fill:
|
|
45
|
+
fill: var(--ax-neutral-light);
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
}
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
|
|
61
61
|
.radioOutline {
|
|
62
62
|
fill: none;
|
|
63
|
-
stroke:
|
|
63
|
+
stroke: var(--ax-neutral);
|
|
64
64
|
stroke-width: 1;
|
|
65
65
|
}
|
|
66
66
|
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
|
|
88
88
|
&.hasConfirm {
|
|
89
89
|
.radioOutline {
|
|
90
|
-
stroke:
|
|
90
|
+
stroke: var(--ax-warning);
|
|
91
91
|
stroke-width: 3;
|
|
92
92
|
}
|
|
93
93
|
}
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
ConfirmationConfig,
|
|
6
6
|
ConfirmationMode,
|
|
7
7
|
} from '../../ConfirmDialog';
|
|
8
|
+
import { SvgElement } from '../../VisualElements/SvgElement';
|
|
8
9
|
import { BaseFormControl, BaseInputEvents } from '../Form.models';
|
|
9
10
|
import { FormElementContainer } from '../FormElementContainer';
|
|
10
11
|
import classes from './Radio.scss';
|
|
@@ -42,7 +43,7 @@ export const RadioButton: React.FC<RadioButtonProps> = ({
|
|
|
42
43
|
confirmValue,
|
|
43
44
|
disabled = false,
|
|
44
45
|
}) => (
|
|
45
|
-
<
|
|
46
|
+
<SvgElement
|
|
46
47
|
className={clsx(classes.buttonContainer, {
|
|
47
48
|
[classes.checked]: checked,
|
|
48
49
|
[classes.hasError]: hasError,
|
|
@@ -59,7 +60,7 @@ export const RadioButton: React.FC<RadioButtonProps> = ({
|
|
|
59
60
|
>
|
|
60
61
|
<circle className={classes.radioOutline} cx="17" cy="17" r="15" />
|
|
61
62
|
<circle className={classes.radioDot} cx="17" cy="17" r="7.5" />
|
|
62
|
-
</
|
|
63
|
+
</SvgElement>
|
|
63
64
|
);
|
|
64
65
|
|
|
65
66
|
/**
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
ul {
|
|
95
95
|
display: grid;
|
|
96
96
|
row-gap: 1px;
|
|
97
|
-
background-color:
|
|
97
|
+
background-color: white;
|
|
98
98
|
padding: 0px;
|
|
99
99
|
margin-top: 1px;
|
|
100
100
|
margin-bottom: 1px;
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
li {
|
|
106
106
|
display: grid;
|
|
107
107
|
place-items: center left;
|
|
108
|
-
height:
|
|
108
|
+
height: 40px;
|
|
109
109
|
font-size: var(--popper-item-font-size, $popper-item-font-size);
|
|
110
110
|
color: var(--popper-text-color, $popper-text-color);
|
|
111
111
|
background-color: white;
|
|
@@ -116,18 +116,23 @@
|
|
|
116
116
|
&:hover {
|
|
117
117
|
cursor: pointer;
|
|
118
118
|
background-color: var(
|
|
119
|
-
--popper-
|
|
120
|
-
$popper-
|
|
119
|
+
--popper-item-hover-color,
|
|
120
|
+
$popper-item-hover-color
|
|
121
121
|
);
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
&[aria-selected='true']
|
|
125
|
-
&[class='Mui-focused Mui-focusVisible'] {
|
|
124
|
+
&[aria-selected='true'] {
|
|
126
125
|
background-color: var(
|
|
127
126
|
--popper-background-selected-color,
|
|
128
127
|
$popper-background-selected-color
|
|
129
128
|
);
|
|
130
129
|
}
|
|
130
|
+
&[class='Mui-focused Mui-focusVisible'] {
|
|
131
|
+
background-color: var(
|
|
132
|
+
--popper-item-selected-color,
|
|
133
|
+
$popper-item-selected-color
|
|
134
|
+
);
|
|
135
|
+
}
|
|
131
136
|
}
|
|
132
137
|
}
|
|
133
138
|
}
|
|
@@ -94,13 +94,13 @@
|
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
&.off {
|
|
97
|
-
border-top: 1px solid
|
|
98
|
-
border-bottom: 1px solid
|
|
99
|
-
border-left: 1px solid
|
|
97
|
+
border-top: 1px solid var(--ax-warning);
|
|
98
|
+
border-bottom: 1px solid var(--ax-warning);
|
|
99
|
+
border-left: 1px solid var(--ax-warning);
|
|
100
100
|
transition: border $confirmation-transition linear;
|
|
101
101
|
}
|
|
102
102
|
&.on {
|
|
103
|
-
border: 1px solid
|
|
103
|
+
border: 1px solid var(--ax-warning);
|
|
104
104
|
transition: border $confirmation-transition linear;
|
|
105
105
|
}
|
|
106
106
|
}
|
|
@@ -108,19 +108,19 @@
|
|
|
108
108
|
div.active.off {
|
|
109
109
|
svg {
|
|
110
110
|
.svgText {
|
|
111
|
-
fill:
|
|
111
|
+
fill: var(--ax-warning);
|
|
112
112
|
transition: fill $confirmation-transition linear;
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
div.active.on {
|
|
118
|
-
background-color:
|
|
118
|
+
background-color: var(--ax-warning) !important;
|
|
119
119
|
transition: background-color $confirmation-transition linear;
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
&:hover {
|
|
123
|
-
box-shadow: 0 0 0 2px
|
|
123
|
+
box-shadow: 0 0 0 2px var(--ax-warning);
|
|
124
124
|
transition: box-shadow $confirmation-transition linear;
|
|
125
125
|
}
|
|
126
126
|
}
|