@axinom/mosaic-ui 0.62.0-rc.3 → 0.62.0-rc.5
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/FormElements/DateTimeField/DateTimeText.d.ts.map +1 -1
- package/dist/components/LandingPageTiles/LandingPageTiles.d.ts.map +1 -1
- package/dist/components/List/ListRow/Renderers/DateRenderer/DateRenderer.d.ts +1 -1
- package/dist/components/List/ListRow/Renderers/DateRenderer/DateRenderer.d.ts.map +1 -1
- package/dist/components/List/ListRow/Renderers/TimestampRenderer/TimestampRenderer.d.ts.map +1 -1
- package/dist/helpers/utils.d.ts.map +1 -1
- package/dist/index.es.js +1 -1
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/FormElements/DateTimeField/DateTimeText.tsx +8 -1
- package/src/components/LandingPageTiles/LandingPageTiles.tsx +3 -2
- package/src/components/List/ListRow/Renderers/DateRenderer/DateRenderer.tsx +4 -2
- package/src/components/List/ListRow/Renderers/TimestampRenderer/TimestampRenderer.tsx +0 -1
- package/src/helpers/utils.ts +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axinom/mosaic-ui",
|
|
3
|
-
"version": "0.62.0-rc.
|
|
3
|
+
"version": "0.62.0-rc.5",
|
|
4
4
|
"description": "UI components for building Axinom Mosaic applications",
|
|
5
5
|
"author": "Axinom",
|
|
6
6
|
"license": "PROPRIETARY",
|
|
@@ -112,5 +112,5 @@
|
|
|
112
112
|
"publishConfig": {
|
|
113
113
|
"access": "public"
|
|
114
114
|
},
|
|
115
|
-
"gitHead": "
|
|
115
|
+
"gitHead": "6956b5e2c231c114d12b2d0a4dde25adb4e9bc8b"
|
|
116
116
|
}
|
|
@@ -60,6 +60,13 @@ export const DateTimeText: React.FC<DateTimeTextProps> = ({
|
|
|
60
60
|
|
|
61
61
|
const onBlurHandler = useCallback(
|
|
62
62
|
(e: React.FocusEvent<HTMLInputElement>) => {
|
|
63
|
+
// `display` represents the formatted version of the `value` prop and is updated whenever `value` changes.
|
|
64
|
+
// Comparing `e.target.value` with `display` ensures that onChange is only triggered when the input value has changed.
|
|
65
|
+
if (e.target.value === display) {
|
|
66
|
+
// If the value hasn't changed, do not trigger onChange
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
|
|
63
70
|
const textValue = e.target.value;
|
|
64
71
|
const parsedValue = modifyTime
|
|
65
72
|
? DateTime.fromFormat(textValue, 'f')
|
|
@@ -80,7 +87,7 @@ export const DateTimeText: React.FC<DateTimeTextProps> = ({
|
|
|
80
87
|
}
|
|
81
88
|
}
|
|
82
89
|
},
|
|
83
|
-
[modifyTime, onChange],
|
|
90
|
+
[display, modifyTime, onChange],
|
|
84
91
|
);
|
|
85
92
|
|
|
86
93
|
return (
|
|
@@ -35,8 +35,9 @@ export interface LandingPageTilesProps {
|
|
|
35
35
|
// TODO: Determine if we really need to keep have two seperate tile components(large/small)
|
|
36
36
|
// or can they be combined into the same component since they share a lot of the same props/logic
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
function
|
|
38
|
+
function assertUnreachable(_i: never): void {
|
|
39
|
+
// This function is used to ensure that all cases in a switch statement are handled.
|
|
40
|
+
}
|
|
40
41
|
|
|
41
42
|
const useTiles = (
|
|
42
43
|
items: LandingPageItem[],
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
1
|
import { Data } from '../../../../../types/data';
|
|
3
2
|
import { formatDateTime } from '../../../../Utils/Transformers/DateTime';
|
|
4
3
|
|
|
@@ -7,7 +6,10 @@ import { formatDateTime } from '../../../../Utils/Transformers/DateTime';
|
|
|
7
6
|
* @param val date
|
|
8
7
|
* @param data row data
|
|
9
8
|
*/
|
|
10
|
-
export const DateRenderer = <T extends Data>(
|
|
9
|
+
export const DateRenderer = <T extends Data>(
|
|
10
|
+
val: unknown,
|
|
11
|
+
_data: T,
|
|
12
|
+
): string => {
|
|
11
13
|
if (val) {
|
|
12
14
|
return String(formatDateTime(val as string));
|
|
13
15
|
}
|
package/src/helpers/utils.ts
CHANGED
|
@@ -9,7 +9,6 @@ export function noop(): void {}
|
|
|
9
9
|
/**
|
|
10
10
|
* Function that can be used for exhaustiveness checks on switch statements.
|
|
11
11
|
*/
|
|
12
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
13
12
|
export const assertNever = (_type: never): void => {
|
|
14
13
|
// eslint-disable-next-line no-console
|
|
15
14
|
console.error(`Switch was not exhaustive`);
|