@hortiview/shared-components 1.0.0 → 1.1.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/CHANGELOG.md +26 -0
- package/README.md +5 -1
- package/dist/assets/BlockView.css +1 -1
- package/dist/components/BlockView/BlockView.d.ts +5 -1
- package/dist/components/BlockView/BlockView.js +71 -62
- package/dist/components/FormComponents/FormDatePicker/FormDatePicker.d.ts +1 -1
- package/dist/components/FormComponents/FormDatePicker/FormDatePicker.js +5160 -5155
- package/dist/components/Modal/Modal.js +1 -1
- package/package.json +3 -2
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# [1.1.0](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/compare/v1.0.1...v1.1.0) (2025-03-26)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* helpertext does not display form error correctly ([2fb2bcd](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/2fb2bcda65e0172e4b278345a975ed077f8ce926))
|
|
7
|
+
* validation of date values ([380e4cf](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/380e4cffcc8c9547f2c7886f7752b32d5d4f11e8))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* add emptyView description to BlockViewComponent ([403fad8](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/403fad8ce3307e3f7f5a07fb54ac81d15fd608e2))
|
|
13
|
+
* add emtpy view to block view ([45a2045](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/45a204586211b42323be1a3cd5988ac5d57caf4c))
|
|
14
|
+
|
|
15
|
+
## [1.0.1](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/compare/v1.0.0...v1.0.1) (2025-03-25)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* change styles to fix window resize ([e399faf](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/e399faff0d8c59bf13aa951b948bcc1014ec0565))
|
|
21
|
+
|
|
22
|
+
# 1.0.0 (2025-03-16)
|
|
23
|
+
|
|
24
|
+
### Features
|
|
25
|
+
|
|
26
|
+
* Introduce HortiView Shared Components
|
package/README.md
CHANGED
|
@@ -68,6 +68,10 @@ Additionally the library provides form components using [react-hook-form](https:
|
|
|
68
68
|
|
|
69
69
|
1. [Languages and countries](#languages-and-countries)
|
|
70
70
|
|
|
71
|
+
## Changelog
|
|
72
|
+
|
|
73
|
+
[Changelog](./Changelog.md)
|
|
74
|
+
|
|
71
75
|
## Available Components:
|
|
72
76
|
|
|
73
77
|
### AlertBanner
|
|
@@ -1054,4 +1058,4 @@ The supported countries are:
|
|
|
1054
1058
|
const languageCode = 'en' as AVAILABLE_LANGUAGE_CODES;
|
|
1055
1059
|
const languageCountryCode = LANGUAGE_CODES_MAPPER[languageCode];
|
|
1056
1060
|
console.log(languageCountryCode); // 'en-US'
|
|
1057
|
-
```
|
|
1061
|
+
```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._grid_17o13_1{display:flex;padding-bottom:0;flex-direction:column;justify-content:center;align-items:center;gap:1rem;align-self:stretch}._black_17o13_11{color:#000}._blockLayout_17o13_15{padding:.5rem;gap:.5rem;display:flex;flex-direction:column;border-radius:.5rem;background:var(--lmnt-theme-secondary-200);width:15rem;height:15rem}._blockRow_17o13_26{display:flex;flex-direction:row;gap:.5rem;height:100%;align-self:stretch}._block_17o13_15{flex:auto;border-radius:.25rem;background:var(--lmnt-theme-secondary-600);align-items:center;display:flex;justify-content:center;position:relative}._block_17o13_15._active_17o13_45{border:2px solid var(--lmnt-theme-primary);background:var(--lmnt-theme-primary-100);margin:-2px}._block_17o13_15._error_17o13_51{border:2px solid var(--lmnt-theme-danger);background:var(--lmnt-theme-danger-50);margin:-2px}._block_17o13_15._empty_17o13_57{background:var(--lmnt-theme-secondary-200)}._blockText_17o13_61{display:flex;justify-content:center;position:absolute;width:1vw;height:1vh;align-items:center}._emptyLayout_17o13_70{display:flex;justify-content:center;align-items:center;background:var(--lmnt-theme-surface-variant);border-radius:.5rem}
|
|
@@ -52,9 +52,13 @@ type BlockViewProps<T extends Block> = {
|
|
|
52
52
|
* the label of the block, normally 'Block', shown when `hideText` is false
|
|
53
53
|
*/
|
|
54
54
|
blockLabel: string;
|
|
55
|
+
/**
|
|
56
|
+
* an empty view title to be shown when there are no blocks
|
|
57
|
+
*/
|
|
58
|
+
emptyViewTitle?: string;
|
|
55
59
|
};
|
|
56
60
|
/**
|
|
57
61
|
* A component that renders a grid of blocks
|
|
58
62
|
*/
|
|
59
|
-
export declare const BlockView: <T extends Block>({ rows, columns, hideText, errorBlocks, showNumbers, clickable, size, onClick, currentBlock, blocks, blockViewTitle, blockLabel, }: BlockViewProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
63
|
+
export declare const BlockView: <T extends Block>({ rows, columns, hideText, errorBlocks, showNumbers, clickable, size, onClick, currentBlock, blocks, blockViewTitle, blockLabel, emptyViewTitle, }: BlockViewProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
60
64
|
export {};
|
|
@@ -1,71 +1,80 @@
|
|
|
1
|
-
import { jsxs as h, jsx as
|
|
2
|
-
import { d as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { getBlockNumberByDto as
|
|
5
|
-
import '../../assets/BlockView.css';const
|
|
6
|
-
grid:
|
|
7
|
-
black:
|
|
8
|
-
blockLayout:
|
|
9
|
-
blockRow:
|
|
10
|
-
block:
|
|
11
|
-
active:
|
|
12
|
-
error:
|
|
13
|
-
empty:
|
|
14
|
-
blockText:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
import { jsxs as h, jsx as t, Fragment as v } from "react/jsx-runtime";
|
|
2
|
+
import { d as C, T as R, a as B } from "../../index.es-CF_xy2ns.js";
|
|
3
|
+
import { useState as A, useEffect as D, useMemo as S } from "react";
|
|
4
|
+
import { getBlockNumberByDto as F } from "../../services/BlockService.js";
|
|
5
|
+
import '../../assets/BlockView.css';const M = "_grid_17o13_1", V = "_black_17o13_11", j = "_blockLayout_17o13_15", q = "_blockRow_17o13_26", G = "_block_17o13_15", H = "_active_17o13_45", I = "_error_17o13_51", J = "_empty_17o13_57", K = "_blockText_17o13_61", O = "_emptyLayout_17o13_70", o = {
|
|
6
|
+
grid: M,
|
|
7
|
+
black: V,
|
|
8
|
+
blockLayout: j,
|
|
9
|
+
blockRow: q,
|
|
10
|
+
block: G,
|
|
11
|
+
active: H,
|
|
12
|
+
error: I,
|
|
13
|
+
empty: J,
|
|
14
|
+
blockText: K,
|
|
15
|
+
emptyLayout: O
|
|
16
|
+
}, Y = ({
|
|
17
|
+
rows: e,
|
|
18
|
+
columns: r,
|
|
19
|
+
hideText: m = !1,
|
|
20
|
+
errorBlocks: f = [],
|
|
21
|
+
showNumbers: g = !0,
|
|
22
|
+
clickable: N = !0,
|
|
23
|
+
size: b = 15,
|
|
24
|
+
onClick: _ = null,
|
|
25
|
+
currentBlock: a,
|
|
26
|
+
blocks: d,
|
|
27
|
+
blockViewTitle: $,
|
|
28
|
+
blockLabel: w,
|
|
29
|
+
emptyViewTitle: x
|
|
28
30
|
}) => {
|
|
29
|
-
const [
|
|
30
|
-
|
|
31
|
-
if (!
|
|
32
|
-
const l =
|
|
33
|
-
|
|
34
|
-
}, [
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
},
|
|
31
|
+
const [u, k] = A(0);
|
|
32
|
+
D(() => {
|
|
33
|
+
if (!a) return;
|
|
34
|
+
const l = F(a, r);
|
|
35
|
+
k(l);
|
|
36
|
+
}, [a, r]);
|
|
37
|
+
const L = S(() => e * r, [e, r]), T = (l) => {
|
|
38
|
+
_ && _(l, a ?? void 0);
|
|
39
|
+
}, E = ({ row: l, column: i }) => d.length === 0 ? !0 : d.some((n) => n.position?.row === l && n.position?.column === i), y = !e && !r;
|
|
38
40
|
return /* @__PURE__ */ h("div", { "data-testid": "block-view-container", className: o.grid, children: [
|
|
39
|
-
!
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
{
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
onClick: f ? () => {
|
|
49
|
-
p(t), $({ row: r + 1, column: n + 1 });
|
|
50
|
-
} : void 0,
|
|
51
|
-
children: v && u && /* @__PURE__ */ c(
|
|
41
|
+
!m && /* @__PURE__ */ t(C, { level: 1, bold: !0, className: o.black, children: $ }),
|
|
42
|
+
/* @__PURE__ */ t(
|
|
43
|
+
"div",
|
|
44
|
+
{
|
|
45
|
+
className: y ? o.emptyLayout : o.blockLayout,
|
|
46
|
+
style: { width: `${b}rem`, height: `${b}rem` },
|
|
47
|
+
children: y ? /* @__PURE__ */ t(P, { emptyViewTitle: x }) : /* @__PURE__ */ t(v, { children: Array.from({ length: e }).map((l, i) => /* @__PURE__ */ t("div", { className: o.blockRow, children: Array.from({ length: r }).map((n, s) => {
|
|
48
|
+
const c = r * i + s + 1, p = E({ row: i + 1, column: s + 1 });
|
|
49
|
+
return /* @__PURE__ */ t(
|
|
52
50
|
"div",
|
|
53
51
|
{
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
52
|
+
"data-testid": "block-view-block",
|
|
53
|
+
className: `${o.block} ${u === c ? o.active : ""} ${p ? "" : o.empty} ${f.includes(c) ? o.error : ""}`,
|
|
54
|
+
id: `block${c}`,
|
|
55
|
+
onClick: N ? () => {
|
|
56
|
+
k(c), T({ row: i + 1, column: s + 1 });
|
|
57
|
+
} : void 0,
|
|
58
|
+
children: g && p && /* @__PURE__ */ t(
|
|
59
|
+
"div",
|
|
60
|
+
{
|
|
61
|
+
className: `${o.blockText} ${u === c ? o.black : ""}`,
|
|
62
|
+
children: c
|
|
63
|
+
}
|
|
64
|
+
)
|
|
65
|
+
},
|
|
66
|
+
c
|
|
67
|
+
);
|
|
68
|
+
}) }, i)) })
|
|
69
|
+
}
|
|
70
|
+
),
|
|
71
|
+
!m && /* @__PURE__ */ h(R, { themeColor: "primary", level: 6, children: [
|
|
72
|
+
L,
|
|
64
73
|
" ",
|
|
65
|
-
|
|
74
|
+
w
|
|
66
75
|
] })
|
|
67
76
|
] });
|
|
68
|
-
};
|
|
77
|
+
}, P = ({ emptyViewTitle: e }) => e ? /* @__PURE__ */ t(B, { bold: !0, children: e }) : /* @__PURE__ */ t(v, {});
|
|
69
78
|
export {
|
|
70
|
-
|
|
79
|
+
Y as BlockView
|
|
71
80
|
};
|
|
@@ -43,5 +43,5 @@ type DatePickerProps<T extends FieldValues> = {
|
|
|
43
43
|
*
|
|
44
44
|
* @returns A JSX element that renders a date picker form input.
|
|
45
45
|
*/
|
|
46
|
-
export declare const FormDatePicker: <T extends FieldValues>({ propertyName, label, closeLabel, className, minRangeYear, maxRangeYear, locale, rules, ...props }: Omit<ElementDatePickerProps, "locale"> & DatePickerProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
46
|
+
export declare const FormDatePicker: <T extends FieldValues>({ propertyName, label, closeLabel, className, minRangeYear, maxRangeYear, locale, rules, helperText, ...props }: Omit<ElementDatePickerProps, "locale"> & DatePickerProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
47
47
|
export {};
|