@axinom/mosaic-ui 0.34.0-rc.20 → 0.34.0-rc.22
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/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 +3 -3
- package/dist/initialize.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/components/FormElements/CustomTags/CustomTags.scss +15 -4
- package/src/components/FormElements/Tags/Tags.scss +1 -1
- package/src/components/FormElements/ToggleButton/ToggleButton.scss +18 -7
- package/src/components/FormStation/FormStation.spec.tsx +12 -6
- package/src/components/FormStation/FormStation.tsx +6 -6
- package/src/components/InlineMenu/InlineMenu.scss +20 -5
- package/src/initialize.ts +4 -4
- package/src/styles/variables.scss +11 -0
package/dist/initialize.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AddIndicator, CustomEventEmitter, RemoveIndicator, ShowNotification } from './types/ui-config';
|
|
2
|
-
export declare enum
|
|
2
|
+
export declare enum SaveIndicatorType {
|
|
3
3
|
Saving = "saving",
|
|
4
4
|
Inactive = "inactive",
|
|
5
5
|
Dirty = "dirty"
|
|
@@ -8,7 +8,7 @@ export declare let showNotification: ShowNotification | (() => void);
|
|
|
8
8
|
export declare let addIndicator: AddIndicator | (() => void);
|
|
9
9
|
export declare let removeIndicator: RemoveIndicator | (() => void);
|
|
10
10
|
export declare let on: CustomEventEmitter['on'] | (() => void);
|
|
11
|
-
export declare let setSaveIndicator: (type:
|
|
11
|
+
export declare let setSaveIndicator: (type: SaveIndicatorType) => void;
|
|
12
12
|
/**
|
|
13
13
|
* Passes the PiralApi methods to the UI library.
|
|
14
14
|
* @param app {UiConfig} object containing PiralApi methods for use in UI library.
|
|
@@ -19,6 +19,6 @@ export interface UiConfig {
|
|
|
19
19
|
addIndicator: AddIndicator;
|
|
20
20
|
removeIndicator: RemoveIndicator;
|
|
21
21
|
on: CustomEventEmitter['on'];
|
|
22
|
-
setSaveIndicator: (type:
|
|
22
|
+
setSaveIndicator: (type: SaveIndicatorType) => void;
|
|
23
23
|
}
|
|
24
24
|
//# sourceMappingURL=initialize.d.ts.map
|
package/dist/initialize.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.d.ts","sourceRoot":"","sources":["../src/initialize.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EACjB,MAAM,mBAAmB,CAAC;AAE3B,oBAAY,
|
|
1
|
+
{"version":3,"file":"initialize.d.ts","sourceRoot":"","sources":["../src/initialize.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EACjB,MAAM,mBAAmB,CAAC;AAE3B,oBAAY,iBAAiB;IAC3B,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,KAAK,UAAU;CAChB;AAED,eAAO,IAAI,gBAAgB,EAAE,gBAAgB,GAAG,CAAC,MAAM,IAAI,CAC7B,CAAC;AAE/B,eAAO,IAAI,YAAY,EAAE,YAAY,GAAG,CAAC,MAAM,IAAI,CAA4B,CAAC;AAEhF,eAAO,IAAI,eAAe,EAAE,eAAe,GAAG,CAAC,MAAM,IAAI,CAC5B,CAAC;AAE9B,eAAO,IAAI,EAAE,EAAE,kBAAkB,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,IAAI,CAAkB,CAAC;AAExE,eAAO,IAAI,gBAAgB,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,IAC5B,CAAC;AAE/B;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,QAAQ,GAAG,IAAI,CAQhD;AAED,MAAM,WAAW,QAAQ;IACvB,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,YAAY,EAAE,YAAY,CAAC;IAC3B,eAAe,EAAE,eAAe,CAAC;IACjC,EAAE,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAC7B,gBAAgB,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,IAAI,CAAC;CACrD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axinom/mosaic-ui",
|
|
3
|
-
"version": "0.34.0-rc.
|
|
3
|
+
"version": "0.34.0-rc.22",
|
|
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.7-rc.
|
|
35
|
+
"@axinom/mosaic-core": "^0.4.7-rc.22",
|
|
36
36
|
"@faker-js/faker": "^7.4.0",
|
|
37
37
|
"@popperjs/core": "^2.9.2",
|
|
38
38
|
"clsx": "^1.1.0",
|
|
@@ -102,5 +102,5 @@
|
|
|
102
102
|
"publishConfig": {
|
|
103
103
|
"access": "public"
|
|
104
104
|
},
|
|
105
|
-
"gitHead": "
|
|
105
|
+
"gitHead": "7528c5c18d3ae99249a3eca2edf18b0143c5ef0f"
|
|
106
106
|
}
|
|
@@ -127,7 +127,10 @@
|
|
|
127
127
|
stroke: white;
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
-
background-color:
|
|
130
|
+
background-color: var(
|
|
131
|
+
--tag-plus-button-bg-color,
|
|
132
|
+
$tag-plus-button-bg-color
|
|
133
|
+
);
|
|
131
134
|
position: absolute;
|
|
132
135
|
right: 1px;
|
|
133
136
|
top: 1px;
|
|
@@ -146,8 +149,16 @@
|
|
|
146
149
|
|
|
147
150
|
&:enabled {
|
|
148
151
|
&:hover {
|
|
149
|
-
border: 1px solid
|
|
150
|
-
|
|
152
|
+
border: 1px solid
|
|
153
|
+
var(
|
|
154
|
+
--tag-plus-button-hover-stroke-color,
|
|
155
|
+
$tag-plus-button-hover-stroke-color
|
|
156
|
+
);
|
|
157
|
+
box-shadow: 0 0 0 2px
|
|
158
|
+
var(
|
|
159
|
+
--tag-plus-button-hover-stroke-color,
|
|
160
|
+
$tag-plus-button-hover-stroke-color
|
|
161
|
+
);
|
|
151
162
|
|
|
152
163
|
&.hasError {
|
|
153
164
|
border: 1px solid
|
|
@@ -164,7 +175,7 @@
|
|
|
164
175
|
|
|
165
176
|
.customTagEnter {
|
|
166
177
|
opacity: 0;
|
|
167
|
-
background-color:
|
|
178
|
+
background-color: var(--tag-enter-color, $tag-enter-color) !important;
|
|
168
179
|
}
|
|
169
180
|
|
|
170
181
|
.customTagEnterActive {
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
|
|
19
19
|
&:hover:enabled {
|
|
20
20
|
transition: box-shadow 0.15s ease-in-out 0s;
|
|
21
|
-
box-shadow: 0 0 0 2px
|
|
21
|
+
box-shadow: 0 0 0 2px
|
|
22
|
+
var(--toggle-button-stroke-color, $toggle-button-stroke-color);
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
div {
|
|
@@ -44,25 +45,35 @@
|
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
&.off {
|
|
47
|
-
border-top: 1px solid
|
|
48
|
-
|
|
49
|
-
border-
|
|
48
|
+
border-top: 1px solid
|
|
49
|
+
var(--toggle-button-stroke-color, $toggle-button-stroke-color);
|
|
50
|
+
border-bottom: 1px solid
|
|
51
|
+
var(--toggle-button-stroke-color, $toggle-button-stroke-color);
|
|
52
|
+
border-left: 1px solid
|
|
53
|
+
var(--toggle-button-stroke-color, $toggle-button-stroke-color);
|
|
50
54
|
}
|
|
51
55
|
&.on {
|
|
52
|
-
border: 1px solid
|
|
56
|
+
border: 1px solid
|
|
57
|
+
var(--toggle-button-stroke-color, $toggle-button-stroke-color);
|
|
53
58
|
}
|
|
54
59
|
}
|
|
55
60
|
|
|
56
61
|
div.active.off {
|
|
57
62
|
svg {
|
|
58
63
|
.svgText {
|
|
59
|
-
fill:
|
|
64
|
+
fill: var(
|
|
65
|
+
--toggle-button-off-text-color,
|
|
66
|
+
$toggle-button-off-text-color
|
|
67
|
+
);
|
|
60
68
|
}
|
|
61
69
|
}
|
|
62
70
|
}
|
|
63
71
|
|
|
64
72
|
div.active.on {
|
|
65
|
-
background-color:
|
|
73
|
+
background-color: var(
|
|
74
|
+
--toggle-button-on-bg-color,
|
|
75
|
+
$toggle-button-on-bg-color
|
|
76
|
+
) !important;
|
|
66
77
|
}
|
|
67
78
|
|
|
68
79
|
&:disabled {
|
|
@@ -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 {
|
|
8
|
+
import { SaveIndicatorType, setSaveIndicator } from '../../initialize';
|
|
9
9
|
import { ActionData, Actions } from '../Actions';
|
|
10
10
|
import { Action } from '../Actions/Action';
|
|
11
11
|
import { MessageBar } from '../MessageBar/MessageBar';
|
|
@@ -677,9 +677,12 @@ describe('Details', () => {
|
|
|
677
677
|
);
|
|
678
678
|
expect(setSaveIndicator).toHaveBeenNthCalledWith(
|
|
679
679
|
1,
|
|
680
|
-
|
|
681
|
-
); // 1. inactive
|
|
682
|
-
expect(setSaveIndicator).toHaveBeenNthCalledWith(
|
|
680
|
+
SaveIndicatorType.Inactive,
|
|
681
|
+
); // 1. inactive
|
|
682
|
+
expect(setSaveIndicator).toHaveBeenNthCalledWith(
|
|
683
|
+
3,
|
|
684
|
+
SaveIndicatorType.Dirty,
|
|
685
|
+
); // 3. dirty
|
|
683
686
|
|
|
684
687
|
// submit form
|
|
685
688
|
const actionSelected = wrapper
|
|
@@ -697,7 +700,10 @@ describe('Details', () => {
|
|
|
697
700
|
|
|
698
701
|
wrapper.update();
|
|
699
702
|
|
|
700
|
-
expect(setSaveIndicator).toHaveBeenNthCalledWith(
|
|
703
|
+
expect(setSaveIndicator).toHaveBeenNthCalledWith(
|
|
704
|
+
4,
|
|
705
|
+
SaveIndicatorType.Saving,
|
|
706
|
+
);
|
|
701
707
|
|
|
702
708
|
// complete form submission
|
|
703
709
|
await act(async () => {
|
|
@@ -707,7 +713,7 @@ describe('Details', () => {
|
|
|
707
713
|
|
|
708
714
|
expect(setSaveIndicator).toHaveBeenNthCalledWith(
|
|
709
715
|
5,
|
|
710
|
-
|
|
716
|
+
SaveIndicatorType.Inactive,
|
|
711
717
|
);
|
|
712
718
|
|
|
713
719
|
console.warn((setSaveIndicator as jest.Mock).mock.calls);
|
|
@@ -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 {
|
|
19
|
+
import { SaveIndicatorType, 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
|
-
setSaveIndicator(
|
|
158
|
+
setSaveIndicator(SaveIndicatorType.Saving);
|
|
159
159
|
setStationError(undefined);
|
|
160
160
|
if (!initialData.loading && saveData) {
|
|
161
161
|
const response = await saveData(values, initialData, formikHelpers);
|
|
@@ -171,7 +171,7 @@ export const FormStation = <TValues extends Data, TSubmitResponse = unknown>({
|
|
|
171
171
|
),
|
|
172
172
|
);
|
|
173
173
|
|
|
174
|
-
setSaveIndicator(
|
|
174
|
+
setSaveIndicator(SaveIndicatorType.Dirty);
|
|
175
175
|
|
|
176
176
|
// We still throw the error, to make sure that navigation or action execution
|
|
177
177
|
// will not continue after a failed save.
|
|
@@ -449,15 +449,15 @@ const FormStationHeader: React.FC<
|
|
|
449
449
|
useEffect(() => {
|
|
450
450
|
// Set the save indicator to dirty depending on the form state
|
|
451
451
|
if (dirty) {
|
|
452
|
-
setSaveIndicator(
|
|
452
|
+
setSaveIndicator(SaveIndicatorType.Dirty);
|
|
453
453
|
} else {
|
|
454
|
-
setSaveIndicator(
|
|
454
|
+
setSaveIndicator(SaveIndicatorType.Inactive);
|
|
455
455
|
}
|
|
456
456
|
return () => {
|
|
457
457
|
// The form is not always considered "not dirty" after the save
|
|
458
458
|
// so this code will make sure that the indicator is set to inactive
|
|
459
459
|
// when the station is left.
|
|
460
|
-
setSaveIndicator(
|
|
460
|
+
setSaveIndicator(SaveIndicatorType.Inactive);
|
|
461
461
|
};
|
|
462
462
|
}, [dirty]);
|
|
463
463
|
|
|
@@ -85,10 +85,16 @@ $pop-up-arrow-extrusion: -7px;
|
|
|
85
85
|
.buttonDefault {
|
|
86
86
|
background-color: transparent !important;
|
|
87
87
|
svg * {
|
|
88
|
-
stroke:
|
|
88
|
+
stroke: var(
|
|
89
|
+
--inline-menu-button-stroke-color,
|
|
90
|
+
$inline-menu-button-stroke-color
|
|
91
|
+
) !important;
|
|
89
92
|
}
|
|
90
93
|
&:hover {
|
|
91
|
-
background-color:
|
|
94
|
+
background-color: var(
|
|
95
|
+
--inline-menu-button-hover-bg-color,
|
|
96
|
+
$inline-menu-button-hover-bg-color
|
|
97
|
+
) !important;
|
|
92
98
|
svg * {
|
|
93
99
|
stroke: white !important;
|
|
94
100
|
}
|
|
@@ -98,10 +104,16 @@ $pop-up-arrow-extrusion: -7px;
|
|
|
98
104
|
.buttonDefaultOpacity {
|
|
99
105
|
background-color: rgba(white, 0.7) !important;
|
|
100
106
|
svg * {
|
|
101
|
-
stroke:
|
|
107
|
+
stroke: var(
|
|
108
|
+
--inline-menu-button-stroke-color,
|
|
109
|
+
$inline-menu-button-stroke-color
|
|
110
|
+
) !important;
|
|
102
111
|
}
|
|
103
112
|
&:hover {
|
|
104
|
-
background-color:
|
|
113
|
+
background-color: var(
|
|
114
|
+
--inline-menu-button-hover-bg-color,
|
|
115
|
+
$inline-menu-button-hover-bg-color
|
|
116
|
+
) !important;
|
|
105
117
|
svg * {
|
|
106
118
|
stroke: white !important;
|
|
107
119
|
}
|
|
@@ -109,7 +121,10 @@ $pop-up-arrow-extrusion: -7px;
|
|
|
109
121
|
}
|
|
110
122
|
|
|
111
123
|
.buttonSelected {
|
|
112
|
-
background-color:
|
|
124
|
+
background-color: var(
|
|
125
|
+
--inline-menu-button-selected-bg-color,
|
|
126
|
+
$inline-menu-button-selected-bg-color
|
|
127
|
+
) !important;
|
|
113
128
|
svg * {
|
|
114
129
|
stroke: white !important;
|
|
115
130
|
}
|
package/src/initialize.ts
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
ShowNotification,
|
|
6
6
|
} from './types/ui-config';
|
|
7
7
|
|
|
8
|
-
export enum
|
|
8
|
+
export enum SaveIndicatorType {
|
|
9
9
|
Saving = 'saving',
|
|
10
10
|
Inactive = 'inactive',
|
|
11
11
|
Dirty = 'dirty',
|
|
@@ -21,8 +21,8 @@ export let removeIndicator: RemoveIndicator | (() => void) =
|
|
|
21
21
|
|
|
22
22
|
export let on: CustomEventEmitter['on'] | (() => void) = polyfill('on');
|
|
23
23
|
|
|
24
|
-
export let setSaveIndicator: (type:
|
|
25
|
-
polyfill('
|
|
24
|
+
export let setSaveIndicator: (type: SaveIndicatorType) => void =
|
|
25
|
+
polyfill('setSaveIndicator');
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* Passes the PiralApi methods to the UI library.
|
|
@@ -43,7 +43,7 @@ export interface UiConfig {
|
|
|
43
43
|
addIndicator: AddIndicator;
|
|
44
44
|
removeIndicator: RemoveIndicator;
|
|
45
45
|
on: CustomEventEmitter['on'];
|
|
46
|
-
setSaveIndicator: (type:
|
|
46
|
+
setSaveIndicator: (type: SaveIndicatorType) => void;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
function polyfill(methodName: string): () => void {
|
|
@@ -183,6 +183,9 @@ $tag-border-color-2: $blue;
|
|
|
183
183
|
$tag-icon-color: $blue;
|
|
184
184
|
$tag-font-color: $dark-gray;
|
|
185
185
|
$tag-background-color: $light-gray-2;
|
|
186
|
+
$tag-enter-color: rgba($blue, 0.25);
|
|
187
|
+
$tag-plus-button-bg-color: $blue;
|
|
188
|
+
$tag-plus-button-hover-stroke-color: $blue;
|
|
186
189
|
$form-error-color: $red;
|
|
187
190
|
$select-arrow-color: $blue;
|
|
188
191
|
$select-disabled-arrow-color: $gray;
|
|
@@ -201,6 +204,14 @@ $select-background-color: white;
|
|
|
201
204
|
$form-indicator-color: $green;
|
|
202
205
|
$radio-hover-stroke-color: $blue;
|
|
203
206
|
$radio-checked-fill-color: $blue;
|
|
207
|
+
$toggle-button-stroke-color: $blue;
|
|
208
|
+
$toggle-button-off-text-color: $blue;
|
|
209
|
+
$toggle-button-on-bg-color: $blue;
|
|
210
|
+
|
|
211
|
+
/* Inline Menu */
|
|
212
|
+
$inline-menu-button-stroke-color: $blue;
|
|
213
|
+
$inline-menu-button-hover-bg-color: $blue;
|
|
214
|
+
$inline-menu-button-selected-bg-color: $blue;
|
|
204
215
|
|
|
205
216
|
/* Date Time Picker*/
|
|
206
217
|
$calendar-tile-active: $blue;
|