@hortiview/shared-components 0.0.1 → 0.0.4529
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 +200 -20
- package/dist/ListAreaService-BPp_O2BH.js +67 -0
- package/dist/assets/BaseView.css +1 -1
- package/dist/assets/BasicHeading.css +1 -1
- package/dist/assets/BlockView.css +1 -1
- package/dist/assets/HashTabView.css +1 -1
- package/dist/assets/Iconify.css +1 -1
- package/dist/assets/ListAreaService.css +1 -1
- package/dist/assets/SearchBar.css +1 -1
- package/dist/assets/VerticalDivider.css +1 -1
- package/dist/components/BaseView/BaseView.js +8 -8
- package/dist/components/BaseView/BaseView.test.js +1 -1
- package/dist/components/BasicHeading/BasicHeading.js +27 -27
- package/dist/components/BasicHeading/BasicHeading.test.js +1 -1
- package/dist/components/BlockView/BlockView.js +21 -21
- package/dist/components/BlockView/BlockView.test.js +1 -1
- package/dist/components/EmptyView/EmptyView.test.js +1 -1
- package/dist/components/HashTabView/HashTabView.js +31 -31
- package/dist/components/HashTabView/HashTabView.test.js +1 -1
- package/dist/components/Iconify/Iconify.js +1 -1
- package/dist/components/Iconify/Iconify.test.js +1 -1
- package/dist/components/ListArea/ListArea.js +1 -1
- package/dist/components/ListArea/ListArea.test.js +2 -2
- package/dist/components/ListArea/ListAreaService.js +1 -1
- package/dist/components/SearchBar/SearchBar.js +9 -9
- package/dist/components/SearchBar/SearchBar.test.js +1 -1
- package/dist/components/VerticalDivider/VerticalDivider.js +1 -1
- package/dist/components/VerticalDivider/VerticalDivider.test.js +1 -1
- package/dist/{vi.JYQecGiw-D8gb8QJV.js → vi.JYQecGiw-8gz0k16C.js} +2306 -2313
- package/package.json +61 -61
- package/dist/ListAreaService-D16C1IfO.js +0 -67
package/README.md
CHANGED
|
@@ -2,33 +2,213 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://dev.azure.com/sdundc/HV%20Platform/_build/latest?definitionId=88&branchName=main)
|
|
4
4
|
|
|
5
|
-
#
|
|
5
|
+
# HortiView Shared Components
|
|
6
6
|
|
|
7
|
-
This
|
|
7
|
+
This is a shared component library. It should used in the HortiView platform and its modules.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
## Install
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
|
|
11
|
+
`npm i @hortiview/shared-components`
|
|
13
12
|
|
|
14
|
-
|
|
13
|
+
`yarn add @hortiview/shared-components`
|
|
15
14
|
|
|
16
|
-
|
|
15
|
+
## Remarks
|
|
17
16
|
|
|
18
|
-
-
|
|
17
|
+
For the best experience use [react-router](https://reactrouter.com/en/main) in your solution, because some of the component rely on properties like pathname, hash or components like `Link` out of `react-router`.
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
19
|
+
## Available packages:
|
|
20
|
+
|
|
21
|
+
1. [BaseView](#baseview)
|
|
22
|
+
1. [BasicHeading](#basicheading)
|
|
23
|
+
1. [BlockView](#blockview)
|
|
24
|
+
1. [EmptyView](#emptyview)
|
|
25
|
+
1. [HashTabView](#hashtabview)
|
|
26
|
+
1. [Iconify](#iconify)
|
|
27
|
+
1. [ListArea](#listarea)
|
|
28
|
+
1. [SearchBar](#searchbar)
|
|
29
|
+
1. [VerticalDivider](#verticaldivider)
|
|
30
|
+
|
|
31
|
+
### BaseView
|
|
32
|
+
|
|
33
|
+
Can used to show a kind off main and detail view. On the left side you will have a list of elements and on the right a detail section of the element selected.
|
|
34
|
+
|
|
35
|
+
```typescript
|
|
36
|
+
import { BaseListElement, BaseView } from '@hortiview/shared-components';
|
|
37
|
+
import { Link, useLocation } from 'react-router-dom';
|
|
38
|
+
|
|
39
|
+
...
|
|
40
|
+
const { pathname } = useLocation();
|
|
41
|
+
|
|
42
|
+
const elements: BaseListElement[] = [{
|
|
43
|
+
id: '1',
|
|
44
|
+
title: 'First',
|
|
45
|
+
subTitle: 'First Subtilte',
|
|
46
|
+
type: 'Primary',
|
|
47
|
+
icon: 'grid_view',
|
|
48
|
+
route: '/first',
|
|
49
|
+
component: <MyComponentToShowOnClick />,
|
|
28
50
|
},
|
|
29
|
-
|
|
51
|
+
{
|
|
52
|
+
id: '2',
|
|
53
|
+
title: 'Second',
|
|
54
|
+
subTitle: 'Second Subtilte',
|
|
55
|
+
type: 'Primary',
|
|
56
|
+
icon: 'add',
|
|
57
|
+
route: '/second',
|
|
58
|
+
component: <MyComponentToShowOnClickSecond />,
|
|
59
|
+
}];
|
|
60
|
+
|
|
61
|
+
...
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<BaseView
|
|
65
|
+
routerLinkElement={Link}
|
|
66
|
+
pathname={pathname}
|
|
67
|
+
elements={elements}
|
|
68
|
+
heading='Header'
|
|
69
|
+
hasSearch
|
|
70
|
+
emptyText='Empty'
|
|
71
|
+
/>
|
|
72
|
+
);
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### BasicHeading
|
|
76
|
+
|
|
77
|
+
Provides a heading component with optional children which are rendered on the right side of the heading.
|
|
78
|
+
|
|
79
|
+
```typescript
|
|
80
|
+
import { BasicHeading } from '@hortiview/shared-components';
|
|
81
|
+
|
|
82
|
+
...
|
|
83
|
+
<BasicHeading heading={'Header'}>
|
|
84
|
+
<button>Test</button>
|
|
85
|
+
</BasicHeading>
|
|
86
|
+
...
|
|
87
|
+
|
|
30
88
|
```
|
|
31
89
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
90
|
+
### BlockView
|
|
91
|
+
|
|
92
|
+
This is a component showing blocks in a row/column view.
|
|
93
|
+
|
|
94
|
+
```typescript
|
|
95
|
+
import { BlockView, BlockDto } from '@hortiview/shared-components';
|
|
96
|
+
|
|
97
|
+
...
|
|
98
|
+
const blocks: BlockDto = [{
|
|
99
|
+
position: { row: 1, column:1 },
|
|
100
|
+
fieldId: '1',
|
|
101
|
+
}];
|
|
102
|
+
|
|
103
|
+
<BlockView
|
|
104
|
+
blocks={blocks}
|
|
105
|
+
columns={1}
|
|
106
|
+
rows={1}
|
|
107
|
+
/>
|
|
108
|
+
...
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### EmptyView
|
|
113
|
+
|
|
114
|
+
A basic view if no content is available.
|
|
115
|
+
|
|
116
|
+
```typescript
|
|
117
|
+
import { EmptyView } from '@hortiview/shared-components';
|
|
118
|
+
|
|
119
|
+
<EmptyView title='No Content' subtitle='nothing' icon='grass' />;
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### HashTabView
|
|
123
|
+
|
|
124
|
+
A tab view component, which can use the hash value in the url to render the tab regarding to the hash. For the best experience use `react-router`.
|
|
125
|
+
|
|
126
|
+
```typescript
|
|
127
|
+
import { HashTabView, HashTab } from '@hortiview/shared-components';
|
|
128
|
+
|
|
129
|
+
const tabs: HashTab[] = [
|
|
130
|
+
{
|
|
131
|
+
title: 'My Map',
|
|
132
|
+
hash: 'map',
|
|
133
|
+
leadingIcon: 'map',
|
|
134
|
+
component: <>My map Component to show in the tab</>,
|
|
135
|
+
},
|
|
136
|
+
];
|
|
137
|
+
|
|
138
|
+
<HashTabView tabs={tabs} elevation={1} />;
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Iconify
|
|
142
|
+
|
|
143
|
+
Provides some custom icons based on the elements Icon API. Currently supported:
|
|
144
|
+
|
|
145
|
+
- block
|
|
146
|
+
- block-delete
|
|
147
|
+
- cloud-rain
|
|
148
|
+
- cloud-sunny
|
|
149
|
+
- cloud
|
|
150
|
+
- farm-delete
|
|
151
|
+
- farm
|
|
152
|
+
- greenhouse-delete
|
|
153
|
+
- subscription
|
|
154
|
+
- wind
|
|
155
|
+
|
|
156
|
+
```typescript
|
|
157
|
+
import { Iconify } from '@hortiview/shared-components';
|
|
158
|
+
|
|
159
|
+
<Iconify icon='wind' iconSize='large' />;
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### ListArea
|
|
163
|
+
|
|
164
|
+
Shows some items in a list. The list can be used as a navigation list and provides search. For the best experience use `react-router`.
|
|
165
|
+
|
|
166
|
+
```typescript
|
|
167
|
+
import { BaseListElement, ListArea } from '@hortiview/shared-components';
|
|
168
|
+
import { Link, useLocation } from 'react-router-dom';
|
|
169
|
+
|
|
170
|
+
const { pathname } = useLocation();
|
|
171
|
+
|
|
172
|
+
const elements: BaseListElement[] = [{
|
|
173
|
+
route: `/my/route/${1}`,
|
|
174
|
+
id: 1,
|
|
175
|
+
title: 'name',
|
|
176
|
+
subTitle: 'sub-name',
|
|
177
|
+
icon: <Icon icon={'grass'} />,
|
|
178
|
+
}]
|
|
179
|
+
|
|
180
|
+
<ListArea
|
|
181
|
+
hasSearch
|
|
182
|
+
searchPlaceholder={'Search....'}
|
|
183
|
+
elements={elements}
|
|
184
|
+
isSorted={false}
|
|
185
|
+
pathname={pathname}
|
|
186
|
+
routerLinkElement={Link}
|
|
187
|
+
/>;
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### SearchBar
|
|
191
|
+
|
|
192
|
+
Provides a searchbar component.
|
|
193
|
+
|
|
194
|
+
```typescript
|
|
195
|
+
import { SearchBar } from '@hortiview/shared-components';
|
|
196
|
+
|
|
197
|
+
const [searchValue, setSearchValue] = useState('');
|
|
198
|
+
<SearchBar
|
|
199
|
+
searchTerm={searchValue}
|
|
200
|
+
setSearchTerm={setSearchValue}
|
|
201
|
+
dense
|
|
202
|
+
placeholder={'Search....'}
|
|
203
|
+
/>;
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### VerticalDivider
|
|
207
|
+
|
|
208
|
+
Provides a simple vertical divider.
|
|
209
|
+
|
|
210
|
+
```typescript
|
|
211
|
+
import { VerticalDivider } from '@hortiview/shared-components';
|
|
212
|
+
|
|
213
|
+
<VerticalDivider className={'custom'} height='3rem' />;
|
|
214
|
+
```
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import "./assets/ListAreaService.css";
|
|
2
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
3
|
+
import { TypoButton as b, TypoSubtitle as q, TypoBody as k, Icon as L } from "@element/react-components";
|
|
4
|
+
import { Iconify as C } from "./components/Iconify/Iconify.js";
|
|
5
|
+
import { AvailableCustomIcons as x } from "./enums/AvailableCustomIcons.js";
|
|
6
|
+
const E = "_fullWidth_1l0qh_1", N = "_mainElevation_1l0qh_5", W = "_searchbar_1l0qh_11", $ = "_roundedBottom_1l0qh_19", j = "_list_1l0qh_24", S = "_listItem_1l0qh_48", w = "_trailingIcon_1l0qh_52", A = "_groupedListItem_1l0qh_64", _ = {
|
|
7
|
+
fullWidth: E,
|
|
8
|
+
mainElevation: N,
|
|
9
|
+
searchbar: W,
|
|
10
|
+
roundedBottom: $,
|
|
11
|
+
list: j,
|
|
12
|
+
listItem: S,
|
|
13
|
+
trailingIcon: w,
|
|
14
|
+
groupedListItem: A
|
|
15
|
+
}, J = (o, i, n, r) => {
|
|
16
|
+
const l = o.reduce((e, a) => {
|
|
17
|
+
const { groupName: t, ...m } = a;
|
|
18
|
+
return !t || typeof t != "string" || (e[t] || (e[t] = {
|
|
19
|
+
groupName: /* @__PURE__ */ s(b, { children: t }),
|
|
20
|
+
id: t,
|
|
21
|
+
items: []
|
|
22
|
+
}), e[t].items = [
|
|
23
|
+
...e[t].items,
|
|
24
|
+
g(m, i, n, !0, r)
|
|
25
|
+
]), e;
|
|
26
|
+
}, {});
|
|
27
|
+
return Object.values(l);
|
|
28
|
+
}, K = (o, i, n, r) => o.map((l) => g(l, i, n, !1, r)), g = (o, i, n, r, l) => {
|
|
29
|
+
const {
|
|
30
|
+
title: e,
|
|
31
|
+
subTitle: a,
|
|
32
|
+
route: t,
|
|
33
|
+
value: m,
|
|
34
|
+
noNavigation: d,
|
|
35
|
+
disabled: I,
|
|
36
|
+
icon: h,
|
|
37
|
+
iconType: p,
|
|
38
|
+
trailingIcon: v,
|
|
39
|
+
trailingIconType: y,
|
|
40
|
+
actionButton: f,
|
|
41
|
+
onClick: T,
|
|
42
|
+
customTitle: u
|
|
43
|
+
} = o, c = i === t;
|
|
44
|
+
return {
|
|
45
|
+
select: c,
|
|
46
|
+
primaryText: u ?? /* @__PURE__ */ s(q, { level: 1, bold: c, themeColor: c ? "primary" : void 0, children: e }),
|
|
47
|
+
secondaryText: a && !u ? /* @__PURE__ */ s(k, { level: 2, themeColor: c ? "primary" : void 0, children: a }) : void 0,
|
|
48
|
+
trailingBlock: f ?? v ?? /* @__PURE__ */ s(L, { icon: "arrow_right" }),
|
|
49
|
+
leadingBlock: G(h),
|
|
50
|
+
nonInteractive: I,
|
|
51
|
+
value: m,
|
|
52
|
+
componentProps: {
|
|
53
|
+
leadingBlockType: p ?? "icon",
|
|
54
|
+
trailingBlockType: y ?? "icon",
|
|
55
|
+
className: `${p === "avatar" ? "" : _.listItem} ${n} ${r ? _.groupedListItem : ""}`,
|
|
56
|
+
onClick: (O, B) => T?.(B),
|
|
57
|
+
tag: d ? void 0 : l ?? "a",
|
|
58
|
+
to: d ? void 0 : t
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
}, G = (o) => typeof o == "string" && o in x ? /* @__PURE__ */ s(C, { icon: o }) : o;
|
|
62
|
+
export {
|
|
63
|
+
K as a,
|
|
64
|
+
J as g,
|
|
65
|
+
g as m,
|
|
66
|
+
_ as s
|
|
67
|
+
};
|
package/dist/assets/BaseView.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._divider_anyyu_1{margin:0 2rem}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._pageHeader_fwns1_1{display:flex;flex-wrap:nowrap;justify-content:space-between;align-items:center;width:100%;margin-bottom:1rem;align-self:end}._headlineContainer_fwns1_11,._actionButtonContainer_fwns1_16{display:flex;align-items:center}._actionButtonContainer_fwns1_16>button{max-height:48px}._content_fwns1_25{display:flex;justify-content:space-between;gap:1.5rem}._leadingIcon_fwns1_31{margin-right:.8rem}._headingWrapper_fwns1_38{display:flex;align-items:center}._headingContainer_fwns1_43{display:flex;flex-direction:column}._invisible_fwns1_48{visibility:hidden}._withAvatar_fwns1_52{margin-left:.25rem;padding-right:1rem;margin-top:0rem}._withAvatar_fwns1_52>._iconContainer_fwns1_57{scale:1.1}._iconContainer_fwns1_57{padding-right:.5rem}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._grid_g18cu_1{display:flex;padding-bottom:0;flex-direction:column;justify-content:center;align-items:center;gap:1rem;align-self:stretch}._black_g18cu_11{color:#000}._blockLayout_g18cu_15{padding:.5rem;gap:.5rem;display:flex;flex-direction:column;border-radius:.5rem;background:var(--secondary-color-ramp-200, #b9e5ff);width:15rem;height:15rem}._blockRow_g18cu_27{display:flex;flex-direction:row;gap:.5rem;height:100%;align-self:stretch}._block_g18cu_15{flex:auto;border-radius:.25rem;background:var(--secondary-color-ramp-600, #3599d1);align-items:center;display:flex;justify-content:center;position:relative}._block_g18cu_15._active_g18cu_46{border:2px solid var(--lmnt-theme-primary, #673ab7);background:var(--primary-color-ramp-100, #c7b7e4);margin:-2px}._block_g18cu_15._error_g18cu_52{border:2px solid var(--danger-danger, #cf2d22);background:var(--danger-color-ramp-050, #ffeaed);margin:-2px}._block_g18cu_15._empty_g18cu_58{margin:-2px;border:2px solid var(--lmnt-theme-on-surface-disabled);background:var(--lmnt-theme-surface-variant);color:var(--lmnt-theme-on-surface-disabled)}._blockText_g18cu_65{display:flex;justify-content:center;position:absolute;width:1vw;height:1vh;align-items:center}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._elevation_1rcw6_1{width:100%;border-radius:.5rem}._themeBackground_1rcw6_6{background:var(--lmnt-theme-background)}._tabBar_1rcw6_10{background:transparent;align-self:flex-end;border-radius:.5rem}._tabWrapper_1rcw6_16{border-bottom:1px solid var(--lmnt-theme-on-surface-stroke)}._tabButton_1rcw6_20{height:3.5rem!important}._childContainer_1rcw6_24{width:25rem}._childContainerLg_1rcw6_28{width:100%}
|
package/dist/assets/Iconify.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._image_178sv_1>svg{width:inherit;height:inherit;color:inherit}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._fullWidth_1l0qh_1{width:100%}._mainElevation_1l0qh_5{background:var(--lmnt-theme-background);border-radius:.5rem;width:100%}._searchbar_1l0qh_11 div{border:none}._searchbar_1l0qh_11 button{margin-right:.5rem}._roundedBottom_1l0qh_19{border-bottom-right-radius:.5rem;border-bottom-left-radius:.5rem}._list_1l0qh_24{padding-top:0;padding-bottom:0;overflow-y:auto}._list_1l0qh_24::-webkit-scrollbar-track{-webkit-box-shadow:inset 0 0 4px rgba(0,0,0,.2);border-radius:.5rem;margin-right:.25rem;background-color:var(--lmnt-theme-background)}._list_1l0qh_24::-webkit-scrollbar{width:.5rem;background-color:var(--lmnt-theme-background)}._list_1l0qh_24::-webkit-scrollbar-thumb{border-radius:.5rem;-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,.3);background-color:var(--lmnt-theme-primary-on-surface)}._listItem_1l0qh_48{border-bottom:.0775rem solid var(--lmnt-utility-gray-surface)}._listItem_1l0qh_48 i:not(._trailingIcon_1l0qh_52){color:var(--lmnt-theme-on-surface-inactive)}._listItem_1l0qh_48 i._trailingIcon_1l0qh_52{color:var(--lmnt-theme-on-surface-disabled)}._listItem_1l0qh_48 [class^=mdc-list-item__start]{margin:0 1rem!important;align-self:center!important}._groupedListItem_1l0qh_64{height:4.5rem!important}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._searchbar_gnvwc_1 button{color:var(--lmnt-theme-on-surface-inactive)!important}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._divider_opvom_1{border-left:1px solid var(--lmnt-theme-on-surface-stroke)}
|
|
@@ -3,12 +3,12 @@ import { jsx as t, Fragment as w, jsxs as e } from "react/jsx-runtime";
|
|
|
3
3
|
import { useMemo as n } from "react";
|
|
4
4
|
import { EmptyView as x } from "../EmptyView/EmptyView.js";
|
|
5
5
|
import { ListArea as k } from "../ListArea/ListArea.js";
|
|
6
|
-
import { VerticalDivider as
|
|
7
|
-
import { u as
|
|
8
|
-
import { Grid as
|
|
6
|
+
import { VerticalDivider as y } from "../VerticalDivider/VerticalDivider.js";
|
|
7
|
+
import { u as A } from "../../useBreakpoint-DyAmuka7.js";
|
|
8
|
+
import { Grid as H, GridRow as L, GridCol as u, Group as m } from "@element/react-components";
|
|
9
9
|
import { BasicHeading as a } from "../BasicHeading/BasicHeading.js";
|
|
10
|
-
const
|
|
11
|
-
divider:
|
|
10
|
+
const V = "_divider_anyyu_1", W = {
|
|
11
|
+
divider: V
|
|
12
12
|
}, q = ({
|
|
13
13
|
action: d,
|
|
14
14
|
heading: c,
|
|
@@ -22,8 +22,8 @@ const W = "_divider_1uelt_1", _ = {
|
|
|
22
22
|
pathname: l,
|
|
23
23
|
routerLinkElement: C
|
|
24
24
|
}) => {
|
|
25
|
-
const { isLg: r } =
|
|
26
|
-
return /* @__PURE__ */ t(
|
|
25
|
+
const { isLg: r } = A(), i = n(() => o.find((b) => b.route === l), [l, o]), B = n(() => i?.component ?? (r ? /* @__PURE__ */ t(x, { subtitle: s }) : /* @__PURE__ */ t(w, {})), [i, r, s]), G = n(() => r ? !0 : !i, [i, r]);
|
|
26
|
+
return /* @__PURE__ */ t(H, { className: f ?? "", fullHeight: !0, fullWidth: !0, columnGap: 0, children: /* @__PURE__ */ e(L, { children: [
|
|
27
27
|
G && /* @__PURE__ */ e(u, { desktopCol: 4, tabletCol: 12, phoneCol: 12, children: [
|
|
28
28
|
/* @__PURE__ */ e(m, { direction: "vertical", fullWidth: !0, children: [
|
|
29
29
|
c && /* @__PURE__ */ t(a, { heading: c, level: 4, marginBottom: 0, children: d }),
|
|
@@ -39,7 +39,7 @@ const W = "_divider_1uelt_1", _ = {
|
|
|
39
39
|
}
|
|
40
40
|
)
|
|
41
41
|
] }),
|
|
42
|
-
r && /* @__PURE__ */ t(
|
|
42
|
+
r && /* @__PURE__ */ t(y, { className: W.divider, height: "100%" })
|
|
43
43
|
] }),
|
|
44
44
|
/* @__PURE__ */ t(u, { desktopCol: 8, tabletCol: 12, phoneCol: 12, children: /* @__PURE__ */ e(m, { direction: "vertical", fullWidth: !0, children: [
|
|
45
45
|
/* @__PURE__ */ t(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as a, Fragment as s } from "react/jsx-runtime";
|
|
2
2
|
import { a as l } from "../../useBreakpoint-DyAmuka7.js";
|
|
3
3
|
import { BaseView as r } from "./BaseView.js";
|
|
4
|
-
import { d as p, b as u, t as i, r as n, g as t, s as e, v as c, f as d } from "../../vi.JYQecGiw-
|
|
4
|
+
import { d as p, b as u, t as i, r as n, g as t, s as e, v as c, f as d } from "../../vi.JYQecGiw-8gz0k16C.js";
|
|
5
5
|
p("BaseView Test", () => {
|
|
6
6
|
u(() => {
|
|
7
7
|
c.spyOn(l, "useBreakpoints").mockReturnValue({
|
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
import "../../assets/BasicHeading.css";
|
|
2
2
|
import { jsxs as a, jsx as i } from "react/jsx-runtime";
|
|
3
|
-
import { TypoDisplay as
|
|
4
|
-
import { u as
|
|
5
|
-
import { Iconify as
|
|
6
|
-
import { AvailableCustomIcons as
|
|
7
|
-
const
|
|
8
|
-
pageHeader:
|
|
9
|
-
headlineContainer:
|
|
10
|
-
actionButtonContainer:
|
|
11
|
-
content:
|
|
12
|
-
leadingIcon:
|
|
13
|
-
headingWrapper:
|
|
3
|
+
import { TypoDisplay as C, TypoBody as u, Icon as w } from "@element/react-components";
|
|
4
|
+
import { u as y } from "../../useBreakpoint-DyAmuka7.js";
|
|
5
|
+
import { Iconify as I } from "../Iconify/Iconify.js";
|
|
6
|
+
import { AvailableCustomIcons as B } from "../../enums/AvailableCustomIcons.js";
|
|
7
|
+
const N = "_pageHeader_fwns1_1", H = "_headlineContainer_fwns1_11", b = "_actionButtonContainer_fwns1_16", A = "_content_fwns1_25", W = "_leadingIcon_fwns1_31", $ = "_headingWrapper_fwns1_38", x = "_headingContainer_fwns1_43", T = "_invisible_fwns1_48", j = "_withAvatar_fwns1_52", z = "_iconContainer_fwns1_57", n = {
|
|
8
|
+
pageHeader: N,
|
|
9
|
+
headlineContainer: H,
|
|
10
|
+
actionButtonContainer: b,
|
|
11
|
+
content: A,
|
|
12
|
+
leadingIcon: W,
|
|
13
|
+
headingWrapper: $,
|
|
14
14
|
headingContainer: x,
|
|
15
15
|
invisible: T,
|
|
16
16
|
withAvatar: j,
|
|
17
17
|
iconContainer: z
|
|
18
|
-
}, L = ({ icon: e }) => e ? typeof e != "string" ? /* @__PURE__ */ i("div", { className: n.iconContainer, children: e }) : e in
|
|
19
|
-
|
|
18
|
+
}, L = ({ icon: e }) => e ? typeof e != "string" ? /* @__PURE__ */ i("div", { className: n.iconContainer, children: e }) : e in B ? /* @__PURE__ */ i(
|
|
19
|
+
I,
|
|
20
20
|
{
|
|
21
21
|
icon: e,
|
|
22
22
|
className: n.leadingIcon,
|
|
23
23
|
iconSize: "large",
|
|
24
24
|
iconType: "filled"
|
|
25
25
|
}
|
|
26
|
-
) : /* @__PURE__ */ i(
|
|
26
|
+
) : /* @__PURE__ */ i(w, { iconSize: "large", iconType: "filled", icon: e, className: n.leadingIcon }) : null, q = ({
|
|
27
27
|
children: e,
|
|
28
28
|
marginBottom: t,
|
|
29
29
|
heading: l,
|
|
30
30
|
icon: d,
|
|
31
|
-
className:
|
|
31
|
+
className: p,
|
|
32
32
|
subHeading: o,
|
|
33
|
-
subHeadingLevel:
|
|
34
|
-
invisibleButton:
|
|
33
|
+
subHeadingLevel: _ = 2,
|
|
34
|
+
invisibleButton: f = !1,
|
|
35
35
|
level: r = 4,
|
|
36
36
|
fontWeight: s = 400,
|
|
37
|
-
withAvatar:
|
|
37
|
+
withAvatar: g = !1
|
|
38
38
|
}) => {
|
|
39
|
-
const { isLg: c } =
|
|
39
|
+
const { isLg: c } = y(), h = c ? r : r + 1, m = s === "bold" ? 500 : s, v = () => {
|
|
40
40
|
if (t !== void 0)
|
|
41
41
|
return typeof t == "number" ? `${t}px` : "2rem";
|
|
42
42
|
};
|
|
@@ -44,29 +44,29 @@ const H = "_pageHeader_1hm8h_1", b = "_headlineContainer_1hm8h_21", A = "_action
|
|
|
44
44
|
"div",
|
|
45
45
|
{
|
|
46
46
|
className: n.pageHeader,
|
|
47
|
-
style: { marginBottom:
|
|
47
|
+
style: { marginBottom: v() },
|
|
48
48
|
"data-testid": "HeaderContainer",
|
|
49
49
|
children: [
|
|
50
|
-
/* @__PURE__ */ a("div", { className: `${
|
|
50
|
+
/* @__PURE__ */ a("div", { className: `${g && c ? n.withAvatar : ""} ${n.headingWrapper}`, children: [
|
|
51
51
|
/* @__PURE__ */ i(L, { icon: d }),
|
|
52
52
|
/* @__PURE__ */ a("div", { className: o ? n.headingContainer : "", children: [
|
|
53
53
|
/* @__PURE__ */ i(
|
|
54
|
-
|
|
54
|
+
C,
|
|
55
55
|
{
|
|
56
|
-
level:
|
|
56
|
+
level: h,
|
|
57
57
|
"data-testid": "Header",
|
|
58
|
-
className:
|
|
59
|
-
style: { fontWeight:
|
|
58
|
+
className: p ?? "",
|
|
59
|
+
style: { fontWeight: m },
|
|
60
60
|
children: l
|
|
61
61
|
}
|
|
62
62
|
),
|
|
63
|
-
/* @__PURE__ */ i(u, { level:
|
|
63
|
+
/* @__PURE__ */ i(u, { level: _, children: o })
|
|
64
64
|
] })
|
|
65
65
|
] }),
|
|
66
66
|
/* @__PURE__ */ i(
|
|
67
67
|
"div",
|
|
68
68
|
{
|
|
69
|
-
className: `${n.actionButtonContainer} ${
|
|
69
|
+
className: `${n.actionButtonContainer} ${f && n.invisible}`,
|
|
70
70
|
"data-testid": "RightPart",
|
|
71
71
|
children: e
|
|
72
72
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as o, Fragment as c } from "react/jsx-runtime";
|
|
2
2
|
import { Button as g } from "@element/react-components";
|
|
3
3
|
import { BasicHeading as a } from "./BasicHeading.js";
|
|
4
|
-
import { d as h, t as i, r as s, s as n, g as e } from "../../vi.JYQecGiw-
|
|
4
|
+
import { d as h, t as i, r as s, s as n, g as e } from "../../vi.JYQecGiw-8gz0k16C.js";
|
|
5
5
|
h("BasicHeading-Test", () => {
|
|
6
6
|
i("render small container without content", () => {
|
|
7
7
|
s(/* @__PURE__ */ o(a, { heading: "Test" }));
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "../../assets/BlockView.css";
|
|
2
|
-
import { jsxs as
|
|
2
|
+
import { jsxs as g, jsx as l } from "react/jsx-runtime";
|
|
3
3
|
import { TypoSubtitle as x, TypoDisplay as T } from "@element/react-components";
|
|
4
4
|
import { useState as L, useEffect as R, useMemo as B } from "react";
|
|
5
5
|
import { getBlockNumberByDto as C } from "../../services/BlockService.js";
|
|
6
|
-
const A = "
|
|
6
|
+
const A = "_grid_g18cu_1", D = "_black_g18cu_11", E = "_blockLayout_g18cu_15", S = "_blockRow_g18cu_27", V = "_block_g18cu_15", M = "_active_g18cu_46", j = "_error_g18cu_52", q = "_empty_g18cu_58", F = "_blockText_g18cu_65", o = {
|
|
7
7
|
grid: A,
|
|
8
8
|
black: D,
|
|
9
9
|
blockLayout: E,
|
|
@@ -16,44 +16,44 @@ const A = "_grid_8fci1_1", D = "_black_8fci1_21", E = "_blockLayout_8fci1_29", S
|
|
|
16
16
|
}, O = ({
|
|
17
17
|
rows: s,
|
|
18
18
|
columns: t,
|
|
19
|
-
hideText:
|
|
19
|
+
hideText: u = !1,
|
|
20
20
|
errorBlocks: p = [],
|
|
21
21
|
showNumbers: y = !0,
|
|
22
22
|
clickable: h = !0,
|
|
23
|
-
size:
|
|
24
|
-
onClick:
|
|
23
|
+
size: m = 15,
|
|
24
|
+
onClick: b = null,
|
|
25
25
|
currentBlock: i,
|
|
26
|
-
blocks:
|
|
26
|
+
blocks: _,
|
|
27
27
|
blockViewTitle: v,
|
|
28
|
-
blockLabel:
|
|
28
|
+
blockLabel: f
|
|
29
29
|
}) => {
|
|
30
|
-
const [
|
|
30
|
+
const [k, d] = L(0);
|
|
31
31
|
R(() => {
|
|
32
32
|
if (!i)
|
|
33
33
|
return;
|
|
34
34
|
const c = C(i, t);
|
|
35
|
-
|
|
35
|
+
d(c);
|
|
36
36
|
}, [i, t]);
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
}, w = ({ row: c, column: r }) =>
|
|
40
|
-
return /* @__PURE__ */
|
|
41
|
-
!
|
|
42
|
-
/* @__PURE__ */ l("div", { className: o.blockLayout, style: { width: `${
|
|
37
|
+
const N = B(() => s * t, [s, t]), $ = (c) => {
|
|
38
|
+
b && b(c, i ?? void 0);
|
|
39
|
+
}, w = ({ row: c, column: r }) => _.length === 0 ? !0 : _.some((n) => n.position?.row === c && n.position?.column === r);
|
|
40
|
+
return /* @__PURE__ */ g("div", { className: o.grid, children: [
|
|
41
|
+
!u && /* @__PURE__ */ l(x, { level: 1, bold: !0, className: o.black, children: v }),
|
|
42
|
+
/* @__PURE__ */ l("div", { className: o.blockLayout, style: { width: `${m}rem`, height: `${m}rem` }, children: Array.from({ length: s }).map((c, r) => /* @__PURE__ */ l("div", { className: o.blockRow, children: Array.from({ length: t }).map((n, a) => {
|
|
43
43
|
const e = t * r + a + 1;
|
|
44
44
|
return /* @__PURE__ */ l(
|
|
45
45
|
"div",
|
|
46
46
|
{
|
|
47
47
|
"data-testid": "blockViewBlock",
|
|
48
|
-
className: `${o.block} ${
|
|
48
|
+
className: `${o.block} ${k === e ? o.active : ""} ${w({ row: r + 1, column: a + 1 }) ? "" : o.empty} ${p.includes(e) ? o.error : ""}`,
|
|
49
49
|
id: `block${e}`,
|
|
50
50
|
onClick: h ? () => {
|
|
51
|
-
|
|
51
|
+
d(e), $({ row: r + 1, column: a + 1 });
|
|
52
52
|
} : void 0,
|
|
53
53
|
children: y && /* @__PURE__ */ l(
|
|
54
54
|
"div",
|
|
55
55
|
{
|
|
56
|
-
className: `${o.blockText} ${
|
|
56
|
+
className: `${o.blockText} ${k === e ? o.black : ""}`,
|
|
57
57
|
children: e
|
|
58
58
|
}
|
|
59
59
|
)
|
|
@@ -61,10 +61,10 @@ const A = "_grid_8fci1_1", D = "_black_8fci1_21", E = "_blockLayout_8fci1_29", S
|
|
|
61
61
|
e
|
|
62
62
|
);
|
|
63
63
|
}) }, r)) }),
|
|
64
|
-
!
|
|
65
|
-
|
|
64
|
+
!u && /* @__PURE__ */ g(T, { themeColor: "primary", level: 6, children: [
|
|
65
|
+
N,
|
|
66
66
|
" ",
|
|
67
|
-
|
|
67
|
+
f
|
|
68
68
|
] })
|
|
69
69
|
] });
|
|
70
70
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
-
import { d as n, v as B, t as s, r as i, g as o, s as t, f as a } from "../../vi.JYQecGiw-
|
|
2
|
+
import { d as n, v as B, t as s, r as i, g as o, s as t, f as a } from "../../vi.JYQecGiw-8gz0k16C.js";
|
|
3
3
|
import { BlockView as k } from "./BlockView.js";
|
|
4
4
|
n("BlockView Test", () => {
|
|
5
5
|
const c = B.fn(), e = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { d as r, t as s, r as d, g as e, s as n } from "../../vi.JYQecGiw-
|
|
2
|
+
import { d as r, t as s, r as d, g as e, s as n } from "../../vi.JYQecGiw-8gz0k16C.js";
|
|
3
3
|
import { EmptyView as i } from "./EmptyView.js";
|
|
4
4
|
r("EmptyView", () => {
|
|
5
5
|
s("should render", () => {
|