@axinom/mosaic-ui 0.33.0-rc.9 → 0.34.0-rc.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.
Files changed (89) hide show
  1. package/dist/components/DynamicDataList/DynamicDataList.d.ts.map +1 -1
  2. package/dist/components/DynamicDataList/DynamicListRow/DynamicListRow.d.ts +3 -1
  3. package/dist/components/DynamicDataList/DynamicListRow/DynamicListRow.d.ts.map +1 -1
  4. package/dist/components/FormElements/CustomTags/CustomTags.d.ts.map +1 -1
  5. package/dist/components/FormElements/FileUploadControl/FileUploadControl.d.ts.map +1 -1
  6. package/dist/components/FormElements/Radio/Radio.d.ts.map +1 -1
  7. package/dist/components/FormElements/Tags/Tags.d.ts.map +1 -1
  8. package/dist/components/FormElements/formStoryHelper.d.ts.map +1 -1
  9. package/dist/components/FormStation/FormStation.d.ts.map +1 -1
  10. package/dist/components/InfoPanel/InfoImage/InfoImage.d.ts.map +1 -1
  11. package/dist/components/List/List.d.ts.map +1 -1
  12. package/dist/components/Loaders/ImageLoader/ImageLoader.d.ts +2 -0
  13. package/dist/components/Loaders/ImageLoader/ImageLoader.d.ts.map +1 -1
  14. package/dist/components/index.d.ts +1 -1
  15. package/dist/components/index.d.ts.map +1 -1
  16. package/dist/index.d.ts +1 -0
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.es.js +3 -3
  19. package/dist/index.es.js.map +1 -1
  20. package/dist/index.js +3 -3
  21. package/dist/index.js.map +1 -1
  22. package/dist/initialize.d.ts +7 -4
  23. package/dist/initialize.d.ts.map +1 -1
  24. package/dist/utils/ErrorMapper/ApolloClient/ApolloErrorMapper.d.ts +9 -0
  25. package/dist/utils/ErrorMapper/ApolloClient/ApolloErrorMapper.d.ts.map +1 -0
  26. package/dist/utils/ErrorMapper/ErrorMapper.d.ts +15 -0
  27. package/dist/utils/ErrorMapper/ErrorMapper.d.ts.map +1 -0
  28. package/dist/utils/ErrorMapper/ErrorMapper.type.d.ts +11 -0
  29. package/dist/utils/ErrorMapper/ErrorMapper.type.d.ts.map +1 -0
  30. package/dist/utils/ErrorMapper/index.d.ts +4 -0
  31. package/dist/utils/ErrorMapper/index.d.ts.map +1 -0
  32. package/dist/utils/ErrorTypeToStationError.d.ts +1 -1
  33. package/dist/utils/ErrorTypeToStationError.d.ts.map +1 -1
  34. package/package.json +3 -3
  35. package/src/components/Accordion/Accordion.scss +1 -1
  36. package/src/components/Accordion/AccordionItem/AccordionItem.scss +1 -1
  37. package/src/components/Actions/Action/Action.scss +0 -2
  38. package/src/components/Buttons/Button/Button.scss +66 -20
  39. package/src/components/Buttons/CompositeButton/CompositeButton.scss +50 -18
  40. package/src/components/Buttons/TextButton/TextButton.scss +45 -16
  41. package/src/components/DateTime/DatePicker/DatePicker.scss +15 -6
  42. package/src/components/DateTime/DateTimePicker.scss +6 -2
  43. package/src/components/DynamicDataList/DynamicDataList.tsx +1 -0
  44. package/src/components/DynamicDataList/DynamicListDataEntry/DynamicListDataEntry.scss +15 -5
  45. package/src/components/DynamicDataList/DynamicListDataEntry/Renderers/createInputRenderer/createInputRenderer.tsx +1 -1
  46. package/src/components/DynamicDataList/DynamicListDataEntry/Renderers/createSelectRenderer/createSelectRenderer.scss +36 -12
  47. package/src/components/DynamicDataList/DynamicListDataEntry/Renderers/createSelectRenderer/createSelectRenderer.tsx +2 -2
  48. package/src/components/DynamicDataList/DynamicListRow/DynamicListRow.scss +26 -0
  49. package/src/components/DynamicDataList/DynamicListRow/DynamicListRow.tsx +7 -1
  50. package/src/components/Filters/Filter/Filter.scss +8 -2
  51. package/src/components/Filters/SelectionTypes/DateTimeFilter/DateTimeFilter.scss +4 -1
  52. package/src/components/FormElements/Checkbox/Checkbox.scss +20 -0
  53. package/src/components/FormElements/CustomTags/CustomTags.scss +24 -0
  54. package/src/components/FormElements/CustomTags/CustomTags.tsx +8 -2
  55. package/src/components/FormElements/DateTimeField/DateTimeText.spec.tsx +1 -1
  56. package/src/components/FormElements/DateTimeField/DateTimeText.tsx +1 -1
  57. package/src/components/FormElements/FileUploadControl/FileUploadControl.scss +4 -2
  58. package/src/components/FormElements/FileUploadControl/FileUploadControl.tsx +12 -3
  59. package/src/components/FormElements/Radio/Radio.scss +18 -3
  60. package/src/components/FormElements/Radio/Radio.tsx +2 -2
  61. package/src/components/FormElements/Select/Select.scss +10 -0
  62. package/src/components/FormElements/SingleLineText/SingleLineText.spec.tsx +2 -2
  63. package/src/components/FormElements/SingleLineText/SingleLineText.tsx +1 -1
  64. package/src/components/FormElements/Tags/Tags.scss +14 -0
  65. package/src/components/FormElements/Tags/Tags.tsx +5 -1
  66. package/src/components/FormElements/TextArea/TextArea.spec.tsx +2 -2
  67. package/src/components/FormElements/TextArea/TextArea.tsx +1 -1
  68. package/src/components/FormElements/formStoryHelper.tsx +163 -97
  69. package/src/components/FormStation/FormStation.spec.tsx +13 -3
  70. package/src/components/FormStation/FormStation.tsx +13 -3
  71. package/src/components/InfoPanel/InfoImage/InfoImage.scss +8 -3
  72. package/src/components/InfoPanel/InfoImage/InfoImage.tsx +1 -0
  73. package/src/components/List/List.tsx +3 -1
  74. package/src/components/List/ListCheckBox/ListCheckBox.scss +8 -3
  75. package/src/components/List/ListRow/ListRow.scss +0 -4
  76. package/src/components/Loaders/ImageLoader/ImageLoader.tsx +5 -0
  77. package/src/components/PageHeader/PageHeaderAction/PageHeaderAction.scss +0 -1
  78. package/src/components/index.ts +1 -1
  79. package/src/index.ts +1 -0
  80. package/src/initialize.ts +15 -12
  81. package/src/styles/variables.scss +32 -2
  82. package/src/utils/ErrorMapper/ApolloClient/ApolloErrorMapper.spec.ts +32 -0
  83. package/src/utils/ErrorMapper/ApolloClient/ApolloErrorMapper.tsx +33 -0
  84. package/src/utils/ErrorMapper/ErrorMapper.spec.ts +67 -0
  85. package/src/utils/ErrorMapper/ErrorMapper.ts +31 -0
  86. package/src/utils/ErrorMapper/ErrorMapper.type.ts +11 -0
  87. package/src/utils/ErrorMapper/index.ts +3 -0
  88. package/src/utils/ErrorTypeToStationError.spec.tsx +12 -0
  89. package/src/utils/ErrorTypeToStationError.tsx +5 -1
@@ -1,7 +1,18 @@
1
1
  import { faker } from '@faker-js/faker';
2
2
  import React, { useState } from 'react';
3
- import { CustomTags, ReadOnlyField, Select, SingleLineText, Tags } from '.';
3
+ import {
4
+ Checkbox,
5
+ CustomTags,
6
+ Divider,
7
+ FileUploadControl,
8
+ Radio,
9
+ ReadOnlyField,
10
+ Select,
11
+ SingleLineText,
12
+ Tags,
13
+ } from '.';
4
14
  import { generateItemArray } from '../../helpers/storybook';
15
+ import { TextButton } from '../Buttons';
5
16
  import { DynamicListColumn } from '../DynamicDataList/DynamicDataList.model';
6
17
  import {
7
18
  createInputRenderer,
@@ -10,6 +21,8 @@ import {
10
21
  import { formatDateTime } from '../Utils';
11
22
  import { BooleanViewField } from './BooleanView/BooleanViewField';
12
23
  import { DynamicDataListControl } from './DynamicDataListControl/DynamicDataListControl';
24
+ import { FileUpload } from './FileUploadControl/FileUploadControl';
25
+ import { TextArea } from './TextArea/TextArea';
13
26
 
14
27
  interface DynamicListStoryData {
15
28
  position: number;
@@ -67,13 +80,13 @@ const dataListColumns: DynamicListColumn<DynamicListStoryData>[] = [
67
80
  ];
68
81
 
69
82
  export const SampleForm: React.FC = () => useCreateForm().form;
70
-
71
83
  export const useCreateForm = (): {
72
84
  form: JSX.Element;
73
85
  title: string;
74
86
  } => {
75
87
  const [id] = useState(faker.datatype.uuid());
76
88
  const [title, setTitle] = useState(`The ${generateTitle()}`);
89
+ const [title2, setTitle2] = useState(`The ${generateTitle()}`);
77
90
  const [genres, setGenres] = useState<string[]>(['Crime', 'Drama']);
78
91
  const [ratings, setRatings] = useState<
79
92
  string | number | string[] | undefined
@@ -94,104 +107,157 @@ export const useCreateForm = (): {
94
107
  country: faker.address.country(),
95
108
  })),
96
109
  );
110
+ const [radio, setRadio] = useState(1);
111
+ const [check, setCheck] = useState<boolean>();
112
+ const [file, setFile] = useState<FileUpload>();
113
+
114
+ const [disabled, setDisabled] = useState<boolean>(false);
97
115
 
98
116
  return {
99
117
  form: (
100
- <form
101
- style={{
102
- display: 'grid',
103
- gridAutoRows: 'max-content',
104
- gridTemplateColumns: '1fr',
105
- rowGap: '20px',
106
- }}
107
- >
108
- <ReadOnlyField label="Id" value={id} />
109
- <SingleLineText
110
- name="title"
111
- label="Title"
112
- value={title}
113
- onChange={(e) => setTitle(e.currentTarget.value)}
114
- />
115
- <ReadOnlyField label="Publish State" value="PUBLISHED" />
116
- <BooleanViewField
117
- label="Status"
118
- value={status}
119
- trueLabel="Enabled"
120
- falseLabel="Disabled"
121
- />
122
- <Tags
123
- name="genres"
124
- label="Genre(s)"
125
- value={genres}
126
- tagsOptions={genresOptions}
127
- onChange={(e) =>
128
- setGenres(e.currentTarget.value as unknown as string[])
129
- }
130
- />
131
- <Select
132
- name="ratings"
133
- label="Rating"
134
- value={ratings}
135
- options={selectOptions}
136
- onChange={(e) => setRatings(e.currentTarget.value)}
137
- />
138
- <SingleLineText
139
- name="shortDescription"
140
- label="Short Description"
141
- value={shortDescription}
142
- placeholder="Enter a short description..."
143
- onChange={(e) => setShortDescription(e.currentTarget.value)}
144
- />
145
- <SingleLineText
146
- name="longDescription"
147
- label="Long Description"
148
- value={longDescription}
149
- placeholder="Enter a description..."
150
- onChange={(e) => setLongDescription(e.currentTarget.value)}
151
- />
152
- <CustomTags
153
- name="cast"
154
- value={cast}
155
- label="Cast"
156
- onChange={(e) =>
157
- setCast(e.currentTarget.value as unknown as string[])
158
- }
159
- />
160
- <CustomTags
161
- name="directors"
162
- value={directors}
163
- label="Director(s)"
164
- onChange={(e) =>
165
- setDirectors(e.currentTarget.value as unknown as string[])
166
- }
167
- />
168
- <Tags
169
- name="locales"
170
- value={locales}
171
- label="Locale(s)"
172
- tagsOptions={['en_US', 'pt_PT', 'zh_CN']}
173
- onChange={(e) =>
174
- setLocales(e.currentTarget.value as unknown as string[])
175
- }
176
- />
177
- <DynamicDataListControl
178
- name={'dataList'}
179
- label={'Subtitles'}
180
- columns={dataListColumns}
181
- value={dataList}
182
- positionPropertyName={'position'}
183
- allowReordering={true}
184
- allowRowDragging={true}
185
- allowNewData={true}
186
- onChange={(e) => setDataList(e as DynamicListStoryData[])}
187
- />
188
- <ReadOnlyField
189
- label="Created At"
190
- value={createdTime.toISOString()}
191
- transform={formatDateTime}
192
- />
193
- <ReadOnlyField label="Writer(s)" value={writers} />
194
- </form>
118
+ <>
119
+ <div style={{ marginBottom: 10 }}>
120
+ <TextButton
121
+ onButtonClicked={() => setDisabled(!disabled)}
122
+ text="Toggle Disabled"
123
+ />
124
+ </div>
125
+ <Divider />
126
+ <form
127
+ style={{
128
+ display: 'grid',
129
+ gridAutoRows: 'max-content',
130
+ gridTemplateColumns: '1fr',
131
+ rowGap: '20px',
132
+ }}
133
+ >
134
+ <ReadOnlyField label="Id" value={id} />
135
+ <SingleLineText
136
+ name="title"
137
+ label="Title"
138
+ value={title}
139
+ disabled={disabled}
140
+ onChange={(e) => setTitle(e.currentTarget.value)}
141
+ />
142
+ <ReadOnlyField label="Publish State" value="PUBLISHED" />
143
+ <BooleanViewField
144
+ label="Status"
145
+ value={status}
146
+ trueLabel="Enabled"
147
+ falseLabel="Disabled"
148
+ />
149
+ <Tags
150
+ name="genres"
151
+ label="Genre(s)"
152
+ value={genres}
153
+ tagsOptions={genresOptions}
154
+ onChange={(e) =>
155
+ setGenres(e.currentTarget.value as unknown as string[])
156
+ }
157
+ disabled={disabled}
158
+ />
159
+ <Select
160
+ name="ratings"
161
+ label="Rating"
162
+ value={ratings}
163
+ options={selectOptions}
164
+ onChange={(e) => setRatings(e.currentTarget.value)}
165
+ disabled={disabled}
166
+ />
167
+ <SingleLineText
168
+ name="shortDescription"
169
+ label="Short Description"
170
+ value={shortDescription}
171
+ placeholder="Enter a short description..."
172
+ onChange={(e) => setShortDescription(e.currentTarget.value)}
173
+ disabled={disabled}
174
+ />
175
+ <TextArea
176
+ name="longDescription"
177
+ label="Long Description"
178
+ value={longDescription}
179
+ placeholder="Enter a description..."
180
+ onChange={(e) => setLongDescription(e.currentTarget.value)}
181
+ disabled={disabled}
182
+ />
183
+ <CustomTags
184
+ name="cast"
185
+ value={cast}
186
+ label="Cast"
187
+ onChange={(e) =>
188
+ setCast(e.currentTarget.value as unknown as string[])
189
+ }
190
+ disabled={disabled}
191
+ />
192
+ <CustomTags
193
+ name="directors"
194
+ value={directors}
195
+ label="Director(s)"
196
+ onChange={(e) =>
197
+ setDirectors(e.currentTarget.value as unknown as string[])
198
+ }
199
+ disabled={disabled}
200
+ />
201
+ <Tags
202
+ name="locales"
203
+ value={locales}
204
+ label="Locale(s)"
205
+ tagsOptions={['en_US', 'pt_PT', 'zh_CN']}
206
+ onChange={(e) =>
207
+ setLocales(e.currentTarget.value as unknown as string[])
208
+ }
209
+ disabled={disabled}
210
+ />
211
+ <DynamicDataListControl
212
+ name={'dataList'}
213
+ label={'Subtitles'}
214
+ columns={dataListColumns}
215
+ value={dataList}
216
+ positionPropertyName={'position'}
217
+ allowReordering={true}
218
+ allowRowDragging={true}
219
+ allowNewData={true}
220
+ onChange={(e) => setDataList(e as DynamicListStoryData[])}
221
+ disabled={disabled}
222
+ />
223
+
224
+ <Radio
225
+ value={radio}
226
+ onChange={(e) => setRadio(Number(e.currentTarget.value))}
227
+ options={[
228
+ { value: 1, label: 'A' },
229
+ { value: 2, label: 'B' },
230
+ { value: 3, label: 'C' },
231
+ ]}
232
+ name={'radio'}
233
+ label={'Category'}
234
+ disabled={disabled}
235
+ />
236
+
237
+ <Checkbox
238
+ value={check}
239
+ onChange={setCheck}
240
+ name={'check'}
241
+ label={'Is Premium?'}
242
+ disabled={disabled}
243
+ />
244
+
245
+ <FileUploadControl
246
+ name={'file'}
247
+ value={file}
248
+ onFileSelected={(file) => setFile(file)}
249
+ placeholder={'Select a file'}
250
+ label={'File'}
251
+ disabled={disabled}
252
+ />
253
+ <ReadOnlyField
254
+ label="Created At"
255
+ value={createdTime.toISOString()}
256
+ transform={formatDateTime}
257
+ />
258
+ <ReadOnlyField label="Writer(s)" value={writers} />
259
+ </form>
260
+ </>
195
261
  ),
196
262
  title,
197
263
  };
@@ -5,7 +5,7 @@ import { act } from 'react-dom/test-utils';
5
5
  import { MemoryRouter, Route } from 'react-router-dom';
6
6
  import * as Yup from 'yup';
7
7
  import { noop } from '../../helpers/utils';
8
- import { hideSaveIndicator, showSaveIndicator } from '../../initialize';
8
+ import { IndicatorType, setSaveIndicator } from '../../initialize';
9
9
  import { ActionData, Actions } from '../Actions';
10
10
  import { Action } from '../Actions/Action';
11
11
  import { MessageBar } from '../MessageBar/MessageBar';
@@ -675,6 +675,11 @@ describe('Details', () => {
675
675
  </FormStation>
676
676
  </MemoryRouter>,
677
677
  );
678
+ expect(setSaveIndicator).toHaveBeenNthCalledWith(
679
+ 1,
680
+ IndicatorType.Inactive,
681
+ ); // 1. inactive 2. dirty
682
+ expect(setSaveIndicator).toHaveBeenNthCalledWith(2, IndicatorType.Dirty); // 1. inactive 2. dirty
678
683
 
679
684
  // submit form
680
685
  const actionSelected = wrapper
@@ -692,7 +697,7 @@ describe('Details', () => {
692
697
 
693
698
  wrapper.update();
694
699
 
695
- expect(showSaveIndicator).toHaveBeenCalledTimes(1);
700
+ expect(setSaveIndicator).toHaveBeenNthCalledWith(3, IndicatorType.Saving);
696
701
 
697
702
  // complete form submission
698
703
  await act(async () => {
@@ -700,7 +705,12 @@ describe('Details', () => {
700
705
  });
701
706
  wrapper.update();
702
707
 
703
- expect(hideSaveIndicator).toHaveBeenCalledTimes(1);
708
+ expect(setSaveIndicator).toHaveBeenNthCalledWith(
709
+ 4,
710
+ IndicatorType.Inactive,
711
+ );
712
+
713
+ console.warn((setSaveIndicator as jest.Mock).mock.calls);
704
714
  });
705
715
  });
706
716
  });
@@ -16,7 +16,7 @@ import React, {
16
16
  } from 'react';
17
17
  import { useHistory } from 'react-router-dom';
18
18
  import { OptionalObjectSchema } from 'yup/lib/object';
19
- import { hideSaveIndicator, showSaveIndicator } from '../../initialize';
19
+ import { IndicatorType, setSaveIndicator } from '../../initialize';
20
20
  import { Data } from '../../types/data';
21
21
  import { ErrorTypeToStationError } from '../../utils/ErrorTypeToStationError';
22
22
  import { Actions, ActionsProps } from '../Actions';
@@ -155,7 +155,7 @@ export const FormStation = <TValues extends Data, TSubmitResponse = unknown>({
155
155
 
156
156
  try {
157
157
  setIsFormSubmitting(true);
158
- showSaveIndicator();
158
+ setSaveIndicator(IndicatorType.Saving);
159
159
  setStationError(undefined);
160
160
  if (!initialData.loading && saveData) {
161
161
  const response = await saveData(values, initialData, formikHelpers);
@@ -171,13 +171,14 @@ export const FormStation = <TValues extends Data, TSubmitResponse = unknown>({
171
171
  ),
172
172
  );
173
173
 
174
+ setSaveIndicator(IndicatorType.Dirty);
175
+
174
176
  // We still throw the error, to make sure that navigation or action execution
175
177
  // will not continue after a failed save.
176
178
  throw error;
177
179
  } finally {
178
180
  formikHelpers.setSubmitting(false);
179
181
  setIsFormSubmitting(false);
180
- hideSaveIndicator();
181
182
  }
182
183
  },
183
184
  [isFormSubmitting, initialData, saveData, setStationError],
@@ -445,6 +446,15 @@ const FormStationHeader: React.FC<
445
446
  > = ({ titleProperty, defaultTitle, subtitle, cancelNavigationUrl }) => {
446
447
  const { dirty, resetForm, values } = useFormikContext<FormikValues>();
447
448
 
449
+ useEffect(() => {
450
+ // Set the save indicator to dirty depending on the form state
451
+ if (dirty) {
452
+ setSaveIndicator(IndicatorType.Dirty);
453
+ } else {
454
+ setSaveIndicator(IndicatorType.Inactive);
455
+ }
456
+ }, [dirty]);
457
+
448
458
  const history = useHistory();
449
459
 
450
460
  const title =
@@ -9,10 +9,15 @@
9
9
 
10
10
  place-items: center;
11
11
 
12
+ .image,
12
13
  .inlineMenu {
13
- position: absolute;
14
- bottom: 0;
15
- right: 0;
14
+ grid-row: 1;
15
+ grid-column: 1;
16
+ align-self: end;
17
+ }
18
+
19
+ .inlineMenu {
20
+ justify-self: end;
16
21
  }
17
22
 
18
23
  img {
@@ -36,6 +36,7 @@ export const InfoImage: React.FC<InfoImageProps> = ({
36
36
  data-test-id="info-image"
37
37
  >
38
38
  <ImageLoader
39
+ imageClassName={classes.image}
39
40
  imgSrc={imgSrc}
40
41
  height={420}
41
42
  width={419} /*1px border*/
@@ -320,7 +320,9 @@ export const List = <T extends Data>({
320
320
  horizontalTextAlign={horizontalTextAlign}
321
321
  verticalTextAlign={verticalTextAlign}
322
322
  showItemCheckbox={
323
- enableSelectAll && selectionMode === ListSelectMode.Multi
323
+ enableSelectAll &&
324
+ selectionMode === ListSelectMode.Multi &&
325
+ listItems.length > 0
324
326
  }
325
327
  isCheckboxDisabled={listItems.length === 0}
326
328
  onCheckboxToggled={headerCheckboxHandler}
@@ -9,8 +9,13 @@
9
9
 
10
10
  .disabled {
11
11
  background-color: var(
12
- --page-header-action-context-background-color,
13
- $page-header-action-context-background-color
14
- ) !important;
12
+ --actions-disabled-bg-color,
13
+ $actions-disabled-bg-color
14
+ );
15
+
16
+ // background-color: var(
17
+ // --page-header-action-context-background-color,
18
+ // $page-header-action-context-background-color
19
+ // ) !important;
15
20
  }
16
21
  }
@@ -30,10 +30,6 @@
30
30
  }
31
31
  }
32
32
 
33
- &.disabled {
34
- cursor: not-allowed;
35
- }
36
-
37
33
  .cell {
38
34
  white-space: nowrap;
39
35
  text-overflow: ellipsis;
@@ -40,6 +40,9 @@ export interface ImageLoaderProps {
40
40
  onImageClick?: (
41
41
  event: React.MouseEvent<HTMLImageElement, MouseEvent>,
42
42
  ) => void;
43
+
44
+ /** CSS Class name for additional img element styles */
45
+ imageClassName?: string;
43
46
  }
44
47
 
45
48
  /**
@@ -65,6 +68,7 @@ export const ImageLoader: React.FC<ImageLoaderProps> = ({
65
68
  onError = noop,
66
69
  onImageClick = noop,
67
70
  children,
71
+ imageClassName = '',
68
72
  }) => {
69
73
  const actualViewBox = viewBox || `0 0 ${width} ${height}`;
70
74
 
@@ -135,6 +139,7 @@ export const ImageLoader: React.FC<ImageLoaderProps> = ({
135
139
  onError={onErrorHandler}
136
140
  onClick={onImageClick}
137
141
  data-test-id="image-loader-img"
142
+ className={imageClassName}
138
143
  />
139
144
  {fallBack &&
140
145
  (!fallbackSrc ? (
@@ -145,7 +145,6 @@
145
145
  --actions-disabled-bg-color,
146
146
  $actions-disabled-bg-color
147
147
  );
148
- cursor: not-allowed;
149
148
 
150
149
  .pageHeaderActionsIcons {
151
150
  polygon,
@@ -19,8 +19,8 @@ export * from './List';
19
19
  export * from './Loaders';
20
20
  export * from './MessageBar';
21
21
  export * from './Modal';
22
- export * from './models';
23
22
  export * from './NavigationAwareStation';
24
23
  export * from './PageHeader';
25
24
  export * from './ProgressBar';
26
25
  export * from './Utils';
26
+ export * from './models';
package/src/index.ts CHANGED
@@ -4,5 +4,6 @@ export * from './helpers';
4
4
  export * from './hooks';
5
5
  export * from './initialize';
6
6
  export * from './types';
7
+ export * from './utils/ErrorMapper';
7
8
  export { ErrorTypeToStationError } from './utils/ErrorTypeToStationError';
8
9
  export * from './validators';
package/src/initialize.ts CHANGED
@@ -5,6 +5,12 @@ import {
5
5
  ShowNotification,
6
6
  } from './types/ui-config';
7
7
 
8
+ export enum IndicatorType {
9
+ Saving = 'saving',
10
+ Inactive = 'inactive',
11
+ Dirty = 'dirty',
12
+ }
13
+
8
14
  export let showNotification: ShowNotification | (() => void) =
9
15
  polyfill('showNotification');
10
16
 
@@ -15,9 +21,8 @@ export let removeIndicator: RemoveIndicator | (() => void) =
15
21
 
16
22
  export let on: CustomEventEmitter['on'] | (() => void) = polyfill('on');
17
23
 
18
- export let showSaveIndicator: () => void = polyfill('showSaveIndicator');
19
-
20
- export let hideSaveIndicator: () => void = polyfill('hideSaveIndicator');
24
+ export let setSaveIndicator: (type: IndicatorType) => void =
25
+ polyfill('showSaveIndicator');
21
26
 
22
27
  /**
23
28
  * Passes the PiralApi methods to the UI library.
@@ -25,12 +30,11 @@ export let hideSaveIndicator: () => void = polyfill('hideSaveIndicator');
25
30
  */
26
31
  export function initializeUi(app: UiConfig): void {
27
32
  ({
28
- showNotification,
29
- addIndicator,
30
- removeIndicator,
31
- on,
32
- showSaveIndicator,
33
- hideSaveIndicator,
33
+ showNotification = polyfill('showNotification'),
34
+ addIndicator = polyfill('addIndicator'),
35
+ removeIndicator = polyfill('removeIndicator'),
36
+ on = polyfill('on'),
37
+ setSaveIndicator = polyfill('setSaveIndicator'),
34
38
  } = app);
35
39
  }
36
40
 
@@ -39,15 +43,14 @@ export interface UiConfig {
39
43
  addIndicator: AddIndicator;
40
44
  removeIndicator: RemoveIndicator;
41
45
  on: CustomEventEmitter['on'];
42
- showSaveIndicator: () => void;
43
- hideSaveIndicator: () => void;
46
+ setSaveIndicator: (type: IndicatorType) => void;
44
47
  }
45
48
 
46
49
  function polyfill(methodName: string): () => void {
47
50
  return () => {
48
51
  // eslint-disable-next-line no-console
49
52
  console.warn(
50
- `Could not find ${methodName} method. Is the UI initialized in the pilet? To initialize UI library call 'initializeUi(app)' in your pilet.`,
53
+ `Could not find '${methodName}' method. Is the UI initialized in the pilet? To initialize UI library call 'initializeUi(app)' in your pilet.`,
51
54
  );
52
55
  };
53
56
  }
@@ -41,6 +41,7 @@ $accordion-item-background-color: white;
41
41
  $accordion-item-text-color: $dark-gray;
42
42
  $accordion-item-hover-color: rgba($blue, 0.15);
43
43
  $accordion-item-border: 1px solid $light-gray;
44
+ $accordion-item-arrow-color: $blue;
44
45
 
45
46
  /* Explorer vars */
46
47
  $explorer-background-color: #ffffff;
@@ -65,7 +66,7 @@ $filter-background-color: white;
65
66
  $filter-background-selected-color: rgba($blue, 0.15);
66
67
  $filter-light-font-color: $dark-gray;
67
68
  $filter-option-background-color: #d7e9f1;
68
- $filter-arrow-button-color: $blue;
69
+ $filter-context-button-color: $blue;
69
70
  $filter-title-color: $blue;
70
71
  $filter-font-size: 16px;
71
72
  $filter-width: 360px;
@@ -184,7 +185,7 @@ $tag-font-color: $dark-gray;
184
185
  $tag-background-color: $light-gray-2;
185
186
  $form-error-color: $red;
186
187
  $select-arrow-color: $blue;
187
- $select-disabled-arrow-color: $light-gray;
188
+ $select-disabled-arrow-color: $gray;
188
189
  $label-font-size: 16px;
189
190
  $file-upload-progress: $blue;
190
191
  $file-upload-progress-background: $light-gray-2;
@@ -198,6 +199,16 @@ $form-element-min-height: 50px;
198
199
  $read-only-text-background-color: $light-gray-2;
199
200
  $select-background-color: white;
200
201
  $form-indicator-color: $green;
202
+ $radio-hover-stroke-color: $blue;
203
+ $radio-checked-fill-color: $blue;
204
+
205
+ /* Date Time Picker*/
206
+ $calendar-tile-active: $blue;
207
+ $calendar-tile-active-hover: rgba($blue, 0.2);
208
+ $calendar-button-stroke-color: $blue;
209
+ $calendar-title-color: $dark-blue;
210
+ $calendar-container-border-color: $blue;
211
+ $calendar-container-bg-color: $blue;
201
212
 
202
213
  /* Dynamic Data List */
203
214
  $dynamic-list-row-bg-color: white;
@@ -271,3 +282,22 @@ $infotooltip-font-size: 16px;
271
282
  /* Video Player */
272
283
  $video-player-controls-background: $light-gray-2;
273
284
  $video-player-controls-text-color: $dark-gray;
285
+
286
+ /* Buttons */
287
+ $navigation-button-background-color: $light-blue;
288
+ $navigation-button-background-color-hover: rgba($light-blue, 0.9);
289
+ $navigation-button-stroke-color: white;
290
+ $navigation-button-background-active-color: white;
291
+ $navigation-button-stroke-active-color: $light-blue;
292
+ $navigation-button-background-disabled-color: $gray;
293
+ $active-button-background-color: $blue;
294
+ $active-button-hover-background-color: rgba($blue, 0.9);
295
+ $active-button-stroke-background-color: white;
296
+ $active-button-active-background-color: white;
297
+ $active-button-active-stroke-color: $blue;
298
+ $context-button-border-color: $blue;
299
+ $context-button-stroke-color: $blue;
300
+ $context-button-hover-border-color: $blue;
301
+ $context-button-active-color: $blue;
302
+ $icon-button-stroke-color: $blue;
303
+ $icon-button-hover-color: $blue;