@hortiview/default-components 0.0.11924 → 0.0.11935
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/README.md +92 -1
- package/dist/{HealthCheckFailed-D-HxxKaW.js → HealthCheckFailed-j1XFU5px.js} +3 -3
- package/dist/{InternationalizationWrapper-f8wtvSQv.js → InternationalizationWrapper-BtWuzVFG.js} +1 -1
- package/dist/{LoadingSpinner-cKWdZk2k.js → LoadingSpinner-BxqY1o89.js} +2 -2
- package/dist/{component-DsB0poTj-DaqoXt8b.js → component-DsB0poTj-B4NF-JCy.js} +1 -1
- package/dist/components/DefaultFormNumber/DefaultFormNumber.js +157 -160
- package/dist/components/DefaultLoadingSpinner/DefaultLoadingSpinner.d.ts +1 -2
- package/dist/components/DefaultLoadingSpinner/DefaultLoadingSpinner.js +9 -8
- package/dist/components/HealthChecks/DataBaseHealthCheck.d.ts +1 -2
- package/dist/components/HealthChecks/DataBaseHealthCheck.js +9 -8
- package/dist/components/HealthChecks/DefaultHealthCheck.d.ts +1 -2
- package/dist/components/HealthChecks/DefaultHealthCheck.js +9 -8
- package/dist/components/HealthChecks/IotServiceHealthCheck.d.ts +1 -2
- package/dist/components/HealthChecks/IotServiceHealthCheck.js +9 -8
- package/dist/components/HealthChecks/PlatformHealthCheck.d.ts +1 -2
- package/dist/components/HealthChecks/PlatformHealthCheck.js +9 -8
- package/dist/components/ImpatienceLoadingSpinner/ImpatienceLoadingSpinner.d.ts +1 -2
- package/dist/components/ImpatienceLoadingSpinner/ImpatienceLoadingSpinner.js +8 -7
- package/dist/components/InternationalizationWrapper/InternationalizationWrapper.js +2 -2
- package/dist/{i18n-BfBMXJfT.js → i18n-DIprVS_u.js} +70 -60
- package/dist/i18n.js +1 -1
- package/dist/{index.es-D-CKRzIB-DytY6U2C.js → index.es-D-CKRzIB-Cv9zF1oG.js} +1 -1
- package/dist/locales/es-MX.js +3 -2
- package/dist/locales/es-MX.json.d.ts +2 -0
- package/dist/locales/tr-TR.js +2 -1
- package/dist/locales/tr-TR.json.d.ts +2 -0
- package/dist/main.js +1 -1
- package/dist/{useTranslation-DCJK5-ax.js → useTranslation-Bh0VR1ML.js} +3 -3
- package/package.json +9 -2
- /package/dist/assets/{useTranslation.css → i18n.css} +0 -0
package/README.md
CHANGED
|
@@ -31,10 +31,46 @@ This library provides form components using [react-hook-form](https://react-hook
|
|
|
31
31
|
|
|
32
32
|
Number input field that formats the users input depending on the input language. The component automatically sets the language specific thousand separators and only allows the language specific decimal separator.
|
|
33
33
|
|
|
34
|
+
```tsx
|
|
35
|
+
import { DefaultFormNumber } from '@hortiview/default-components';
|
|
36
|
+
import { FormProvider, SubmitHandler, useForm } from 'react-hook-form';
|
|
37
|
+
|
|
38
|
+
const formMethods = useForm<{ birthday: string }>({
|
|
39
|
+
mode: 'onSubmit',
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const { handleSubmit } = formMethods;
|
|
43
|
+
|
|
44
|
+
<FormProvider {...formMethods}>
|
|
45
|
+
<form onSubmit={handleSubmit(onSubmit)}>
|
|
46
|
+
<DefaultFormNumber<{ price: number }>
|
|
47
|
+
propertyName='price'
|
|
48
|
+
label='module.price'
|
|
49
|
+
decimalScale={5}
|
|
50
|
+
fixedDecimalScale={true}
|
|
51
|
+
allowNegative={false}
|
|
52
|
+
allowLeadingZeros={false}
|
|
53
|
+
prefix=' €'
|
|
54
|
+
/>
|
|
55
|
+
</form>
|
|
56
|
+
</FormProvider>;
|
|
57
|
+
```
|
|
58
|
+
|
|
34
59
|
### DefaultLoadingSpinner
|
|
35
60
|
|
|
36
61
|
Renders a loading spinner. The loading spinner can be customized in size and color. It can also be centered.
|
|
37
62
|
|
|
63
|
+
```TSX
|
|
64
|
+
import { DefaultLoadingSpinner } from '@hortiview/default-components';
|
|
65
|
+
|
|
66
|
+
const [isLoading, setIsLoading] = useState(false)
|
|
67
|
+
|
|
68
|
+
/** add logic that changes state of isLoading */
|
|
69
|
+
|
|
70
|
+
if (isLoading) return <DefaultLoadingSpinner />
|
|
71
|
+
return <DefaultComponent />
|
|
72
|
+
```
|
|
73
|
+
|
|
38
74
|
### HealthCheckComponents
|
|
39
75
|
|
|
40
76
|
A screen that shows a health check failed message. It can be used if the check for database health, iot health or HV platform health fails. Please use the default components provided here to ensure a consistent user experience for the HV platform.
|
|
@@ -43,13 +79,68 @@ If a custom text and type should be displayed please use the shared component `<
|
|
|
43
79
|
|
|
44
80
|
#### DataBaseHealthCheck
|
|
45
81
|
|
|
46
|
-
|
|
82
|
+
```TSX
|
|
83
|
+
import { DataBaseHealthCheck } from '@hortiview/default-components';
|
|
84
|
+
|
|
85
|
+
const [isHealthy, setIsHealthy] = useState(false)
|
|
86
|
+
|
|
87
|
+
/** add logic that changes state of isHealthy */
|
|
88
|
+
|
|
89
|
+
if (!isHealthy) return <DataBaseHealthCheck />
|
|
90
|
+
return <DefaultComponent />
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
#### DataBaseHealthCheck
|
|
94
|
+
|
|
95
|
+
```TSX
|
|
96
|
+
import { DataBaseHealthCheck } from '@hortiview/default-components';
|
|
97
|
+
|
|
98
|
+
const [isHealthy, setIsHealthy] = useState(false)
|
|
99
|
+
|
|
100
|
+
/** add logic that changes state of isHealthy */
|
|
101
|
+
|
|
102
|
+
if (!isHealthy) return <DataBaseHealthCheck />
|
|
103
|
+
return <DefaultComponent />
|
|
104
|
+
```
|
|
47
105
|
|
|
48
106
|
#### IotServiceHealthCheck
|
|
49
107
|
|
|
108
|
+
```TSX
|
|
109
|
+
import { IotServiceHealthCheck } from '@hortiview/default-components';
|
|
110
|
+
|
|
111
|
+
const [isHealthy, setIsHealthy] = useState(false)
|
|
112
|
+
|
|
113
|
+
/** add logic that changes state of isHealthy */
|
|
114
|
+
|
|
115
|
+
if (!isHealthy) return <IotServiceHealthCheck />
|
|
116
|
+
return <DefaultComponent />
|
|
117
|
+
```
|
|
118
|
+
|
|
50
119
|
#### PlatformHealthCheck
|
|
51
120
|
|
|
121
|
+
```TSX
|
|
122
|
+
import { PlatformHealthCheck } from '@hortiview/default-components';
|
|
123
|
+
|
|
124
|
+
const [isHealthy, setIsHealthy] = useState(false)
|
|
125
|
+
|
|
126
|
+
/** add logic that changes state of isHealthy */
|
|
127
|
+
|
|
128
|
+
if (!isHealthy) return <PlatformHealthCheck />
|
|
129
|
+
return <DefaultComponent />
|
|
130
|
+
```
|
|
131
|
+
|
|
52
132
|
### ImpatienceLoadingSpinner
|
|
53
133
|
|
|
54
134
|
This Loading spinner will automatically change to a specific text, after a certain waiting time, the time is adjustable.
|
|
55
135
|
The default waiting time are 10 seconds.
|
|
136
|
+
|
|
137
|
+
```TSX
|
|
138
|
+
import { ImpatienceLoadingSpinner } from '@hortiview/default-components';
|
|
139
|
+
|
|
140
|
+
const [isLoading, setIsLoading] = useState(false)
|
|
141
|
+
|
|
142
|
+
/** add logic that changes state of isLoading */
|
|
143
|
+
|
|
144
|
+
if (isLoading) return <ImpatienceLoadingSpinner />
|
|
145
|
+
return <DefaultComponent />
|
|
146
|
+
```
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as W, jsxs as We } from "react/jsx-runtime";
|
|
2
|
-
import { _ as y, N, R as e, b as A, L as Z, r as me, h as Ie, f as je, p as Ae, a as Fe, q as ee, d as Be, I as xe } from "./useTranslation-
|
|
2
|
+
import { _ as y, N, R as e, b as A, L as Z, r as me, h as Ie, f as je, p as Ae, a as Fe, q as ee, d as Be, I as xe } from "./useTranslation-Bh0VR1ML.js";
|
|
3
3
|
import i, { forwardRef as k, useRef as D, useImperativeHandle as j, useEffect as G, useCallback as Le, useState as ue, useMemo as ne, createContext as Me, useLayoutEffect as qe } from "react";
|
|
4
|
-
import { U as ye } from "./component-DsB0poTj-
|
|
5
|
-
import { a as Pe, n as He, f as we, l as Ve } from "./index.es-D-CKRzIB-
|
|
4
|
+
import { U as ye } from "./component-DsB0poTj-B4NF-JCy.js";
|
|
5
|
+
import { a as Pe, n as He, f as we, l as Ve } from "./index.es-D-CKRzIB-Cv9zF1oG.js";
|
|
6
6
|
import './assets/HealthCheckFailed.css';const Ge = {
|
|
7
7
|
/**
|
|
8
8
|
* The css class name to be passed through to the component markup.
|
package/dist/{InternationalizationWrapper-f8wtvSQv.js → InternationalizationWrapper-BtWuzVFG.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { createContext as n, useMemo as c, createElement as m, useEffect as i } from "react";
|
|
3
|
-
import { i as t } from "./i18n-
|
|
3
|
+
import { i as t } from "./i18n-DIprVS_u.js";
|
|
4
4
|
const p = n();
|
|
5
5
|
class N {
|
|
6
6
|
constructor() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as c, jsxs as R } from "react/jsx-runtime";
|
|
2
|
-
import { U as M, N as j, _ as W, h as P, p as I, a as U, f as F, R as l, b as H } from "./useTranslation-
|
|
2
|
+
import { U as M, N as j, _ as W, h as P, p as I, a as U, f as F, R as l, b as H } from "./useTranslation-Bh0VR1ML.js";
|
|
3
3
|
import t, { useState as V, useEffect as k, useMemo as K, forwardRef as q, useRef as O, useImperativeHandle as Y, useCallback as Z } from "react";
|
|
4
|
-
import { l as G, f as B, n as J, a as Q } from "./index.es-D-CKRzIB-
|
|
4
|
+
import { l as G, f as B, n as J, a as Q } from "./index.es-D-CKRzIB-Cv9zF1oG.js";
|
|
5
5
|
import './assets/LoadingSpinner.css';const X = "_loadingBigOverlay_7dxo1_1", ee = "_bigLoadSpinnerCard_7dxo1_12", re = "_bigLoadSpinnerCardText_7dxo1_27", te = "_logo_7dxo1_33", x = {
|
|
6
6
|
loadingBigOverlay: X,
|
|
7
7
|
bigLoadSpinnerCard: ee,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h as T, f as b, p as v, a as E } from "./useTranslation-
|
|
1
|
+
import { h as T, f as b, p as v, a as E } from "./useTranslation-Bh0VR1ML.js";
|
|
2
2
|
function I(r, i) {
|
|
3
3
|
var t = r.matches || r.webkitMatchesSelector || r.msMatchesSelector;
|
|
4
4
|
return t.call(r, i);
|