@hortiview/shared-components 0.0.4540 → 0.0.4721
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 +101 -29
- package/dist/{ListAreaService-CFOmATRF.js → ListAreaService-BQCdQv7a.js} +5 -5
- package/dist/assets/{main.css → DeleteModal.css} +2 -2
- package/dist/assets/Disclaimer.css +1 -0
- package/dist/assets/HeaderFilter.css +1 -0
- package/dist/assets/Scrollbar.css +1 -0
- package/dist/{component-D1YrRAXe.js → component-DCtofpGS.js} +61 -54
- package/dist/components/BaseView/BaseView.js +2 -2
- package/dist/components/BaseView/BaseView.test.js +15 -14
- package/dist/components/BasicHeading/BasicHeading.d.ts +2 -5
- package/dist/components/BasicHeading/BasicHeading.js +2 -2
- package/dist/components/BasicHeading/BasicHeading.test.js +33 -333
- package/dist/components/BlockView/BlockView.js +5 -5
- package/dist/components/BlockView/BlockView.test.js +15 -14
- package/dist/components/DeleteModal/DeleteModal.d.ts +65 -0
- package/dist/components/DeleteModal/DeleteModal.js +4721 -0
- package/dist/components/DeleteModal/DeleteModal.test.d.ts +1 -0
- package/dist/components/DeleteModal/DeleteModal.test.js +85 -0
- package/dist/components/Disclaimer/Disclaimer.d.ts +33 -0
- package/dist/components/Disclaimer/Disclaimer.js +24 -0
- package/dist/components/Disclaimer/Disclaimer.test.d.ts +1 -0
- package/dist/components/Disclaimer/Disclaimer.test.js +13 -0
- package/dist/components/EmptyView/EmptyView.js +4 -4
- package/dist/components/EmptyView/EmptyView.test.js +14 -13
- package/dist/components/HashTabView/HashTabView.js +5 -5
- package/dist/components/HashTabView/HashTabView.test.js +9 -8
- package/dist/components/HeaderFilter/HeaderFilter.d.ts +33 -0
- package/dist/components/HeaderFilter/HeaderFilter.js +7606 -0
- package/dist/components/HeaderFilter/HeaderFilter.test.d.ts +1 -0
- package/dist/components/HeaderFilter/HeaderFilter.test.js +46 -0
- package/dist/components/Iconify/Iconify.js +1 -1
- package/dist/components/Iconify/Iconify.test.js +8 -7
- package/dist/components/ListArea/ListArea.js +298 -5351
- package/dist/components/ListArea/ListArea.test.js +4 -3
- package/dist/components/ListArea/ListAreaService.js +3 -3
- package/dist/components/Scrollbar/Scrollbar.d.ts +2 -0
- package/dist/components/Scrollbar/Scrollbar.js +9 -0
- package/dist/components/Scrollbar/scrollbar.test.d.ts +1 -0
- package/dist/components/Scrollbar/scrollbar.test.js +15 -0
- package/dist/components/SearchBar/SearchBar.js +2052 -3
- package/dist/components/SearchBar/SearchBar.test.js +16 -15
- package/dist/components/VerticalDivider/VerticalDivider.test.js +8 -7
- package/dist/{index.es-Cv6meSAn.js → index.es-3I3oam0G.js} +1 -1
- package/dist/{index.es-WZ1mqvGz.js → index.es-BahjEG5L.js} +104 -97
- package/dist/index.es-BcHAMD5J.js +5068 -0
- package/dist/index.es-C3EKMb0J.js +305 -0
- package/dist/{index.es-CUWXKh7P.js → index.es-CcfZlo4c.js} +8 -8
- package/dist/index.es-DVNdCQvl.js +1192 -0
- package/dist/{index.es-mBp_Btvi.js → index.es-STyHqa-8.js} +2 -2
- package/dist/{index.es-DYsXox--.js → index.es-hAl7Wxm5.js} +1 -1
- package/dist/{index.es-BD4kFWFx.js → index.es-z8RCxF8n.js} +3 -3
- package/dist/main.d.ts +5 -1
- package/dist/main.js +33 -23
- package/dist/react.esm-BeDwcQWb.js +12741 -0
- package/dist/services/UtilService.d.ts +6 -0
- package/dist/services/UtilService.js +4 -0
- package/dist/services/services.test.d.ts +1 -0
- package/dist/services/services.test.js +22 -0
- package/dist/vi.JYQecGiw-BbUbJcT8.js +9795 -0
- package/package.json +1 -1
- package/dist/SearchBar-CY2zfu6B.js +0 -3232
- package/dist/vi.JYQecGiw-8gz0k16C.js +0 -22532
package/README.md
CHANGED
|
@@ -21,10 +21,14 @@ For the best experience use [react-router](https://reactrouter.com/en/main) in y
|
|
|
21
21
|
1. [BaseView](#baseview)
|
|
22
22
|
1. [BasicHeading](#basicheading)
|
|
23
23
|
1. [BlockView](#blockview)
|
|
24
|
+
1. [DeleteModal](#deletemodal)
|
|
25
|
+
1. [Disclaimer](#disclaimer)
|
|
24
26
|
1. [EmptyView](#emptyview)
|
|
25
27
|
1. [HashTabView](#hashtabview)
|
|
28
|
+
1. [HaederFilter](#headerfilter)
|
|
26
29
|
1. [Iconify](#iconify)
|
|
27
30
|
1. [ListArea](#listarea)
|
|
31
|
+
1. [ScrollBar](#scrollbar)
|
|
28
32
|
1. [SearchBar](#searchbar)
|
|
29
33
|
1. [VerticalDivider](#verticaldivider)
|
|
30
34
|
|
|
@@ -36,10 +40,10 @@ Can used to show a kind off main and detail view. On the left side you will have
|
|
|
36
40
|
import { BaseListElement, BaseView } from '@hortiview/shared-components';
|
|
37
41
|
import { Link, useLocation } from 'react-router-dom';
|
|
38
42
|
|
|
39
|
-
...
|
|
40
43
|
const { pathname } = useLocation();
|
|
41
44
|
|
|
42
|
-
const elements: BaseListElement[] = [
|
|
45
|
+
const elements: BaseListElement[] = [
|
|
46
|
+
{
|
|
43
47
|
id: '1',
|
|
44
48
|
title: 'First',
|
|
45
49
|
subTitle: 'First Subtilte',
|
|
@@ -56,20 +60,19 @@ const elements: BaseListElement[] = [{
|
|
|
56
60
|
icon: 'add',
|
|
57
61
|
route: '/second',
|
|
58
62
|
component: <MyComponentToShowOnClickSecond />,
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
...
|
|
63
|
+
},
|
|
64
|
+
];
|
|
62
65
|
|
|
63
66
|
return (
|
|
64
67
|
<BaseView
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
routerLinkElement={Link}
|
|
69
|
+
pathname={pathname}
|
|
70
|
+
elements={elements}
|
|
71
|
+
heading='Header'
|
|
72
|
+
hasSearch
|
|
73
|
+
emptyText='Empty'
|
|
74
|
+
/>
|
|
75
|
+
);
|
|
73
76
|
```
|
|
74
77
|
|
|
75
78
|
### BasicHeading
|
|
@@ -79,12 +82,9 @@ Provides a heading component with optional children which are rendered on the ri
|
|
|
79
82
|
```typescript
|
|
80
83
|
import { BasicHeading } from '@hortiview/shared-components';
|
|
81
84
|
|
|
82
|
-
|
|
83
|
-
<
|
|
84
|
-
|
|
85
|
-
</BasicHeading>
|
|
86
|
-
...
|
|
87
|
-
|
|
85
|
+
<BasicHeading heading={'Header'}>
|
|
86
|
+
<button>Test</button>
|
|
87
|
+
</BasicHeading>;
|
|
88
88
|
```
|
|
89
89
|
|
|
90
90
|
### BlockView
|
|
@@ -94,18 +94,52 @@ This is a component showing blocks in a row/column view.
|
|
|
94
94
|
```typescript
|
|
95
95
|
import { BlockView, BlockDto } from '@hortiview/shared-components';
|
|
96
96
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
position: { row: 1, column:1 },
|
|
97
|
+
const blocks: BlockDto = [
|
|
98
|
+
{
|
|
99
|
+
position: { row: 1, column: 1 },
|
|
100
100
|
fieldId: '1',
|
|
101
|
-
}
|
|
101
|
+
},
|
|
102
|
+
];
|
|
102
103
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
104
|
+
<BlockView blocks={blocks} columns={1} rows={1} />;
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### DeleteModal
|
|
108
|
+
|
|
109
|
+
A modal to confirm a deletion.
|
|
110
|
+
|
|
111
|
+
```typescript
|
|
112
|
+
import { DeleteModal } from '@hortiview/shared-components';
|
|
113
|
+
|
|
114
|
+
const [open, setOpen] = useState<string>();
|
|
115
|
+
const onDelete = () => {
|
|
116
|
+
console.log('deleted');
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
<DeleteModal
|
|
120
|
+
icon='block'
|
|
121
|
+
open={open}
|
|
122
|
+
setOpen={setOpen}
|
|
123
|
+
onDelete={onDelete}
|
|
124
|
+
title={'DELETE'}
|
|
125
|
+
confirmButtonLabel={'Remove'}
|
|
126
|
+
cancelButtonLabel={'Cancel'}
|
|
127
|
+
deleteHeader={'Delete my block'}
|
|
128
|
+
impossibleDeleteHeader={'block cant be deleted'}
|
|
129
|
+
deleteBody={['block 1', 'block 2', 'block 3']}
|
|
130
|
+
isDeletePossible
|
|
131
|
+
/>;
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Disclaimer
|
|
135
|
+
|
|
136
|
+
A red notice or hint with to show in the ui.
|
|
137
|
+
|
|
138
|
+
```typescript
|
|
139
|
+
|
|
140
|
+
import { Disclaimer } form '@hortiview/shared-components'
|
|
141
|
+
|
|
142
|
+
<Disclaimer text='Currently not available' subtext='Please try again later' icon='wifi_off' />
|
|
109
143
|
|
|
110
144
|
```
|
|
111
145
|
|
|
@@ -138,6 +172,26 @@ const tabs: HashTab[] = [
|
|
|
138
172
|
<HashTabView tabs={tabs} elevation={1} />;
|
|
139
173
|
```
|
|
140
174
|
|
|
175
|
+
### HeaderFilter
|
|
176
|
+
|
|
177
|
+
A filter dropdown component which can be used in headers like a tabview header. It supports a single filter value only.
|
|
178
|
+
|
|
179
|
+
```typescript
|
|
180
|
+
import { HeaderFilter } from '@hortiview/shared-components';
|
|
181
|
+
|
|
182
|
+
const [filterValue, setFilterValue] = useState<string>();
|
|
183
|
+
|
|
184
|
+
<HeaderFilter
|
|
185
|
+
heading={'Test'}
|
|
186
|
+
setFilter={setFilterValue}
|
|
187
|
+
filterValue={filterValue}
|
|
188
|
+
filterOptions={[
|
|
189
|
+
{ value: 'test', label: 'Test' },
|
|
190
|
+
{ value: 'different', label: 'Different' },
|
|
191
|
+
]}
|
|
192
|
+
/>;
|
|
193
|
+
```
|
|
194
|
+
|
|
141
195
|
### Iconify
|
|
142
196
|
|
|
143
197
|
Provides some custom icons based on the elements Icon API. Currently supported:
|
|
@@ -187,6 +241,24 @@ const elements: BaseListElement[] = [{
|
|
|
187
241
|
/>;
|
|
188
242
|
```
|
|
189
243
|
|
|
244
|
+
### ScrollBar
|
|
245
|
+
|
|
246
|
+
Provides a scrollbar in hortiview styling. Add it a classname on your component.
|
|
247
|
+
|
|
248
|
+
```typescript
|
|
249
|
+
|
|
250
|
+
import { ScrollbarY, ScrollbarX } from '@hortiview/shared-components';
|
|
251
|
+
|
|
252
|
+
<div className={`${ScrollbarY}`}>
|
|
253
|
+
Height content
|
|
254
|
+
<div>
|
|
255
|
+
|
|
256
|
+
<div className={`${ScrollbarX}`}>
|
|
257
|
+
Wide content
|
|
258
|
+
<div>
|
|
259
|
+
|
|
260
|
+
```
|
|
261
|
+
|
|
190
262
|
### SearchBar
|
|
191
263
|
|
|
192
264
|
Provides a searchbar component.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "./assets/ListAreaService.css";
|
|
2
2
|
import { jsx as l } from "react/jsx-runtime";
|
|
3
|
-
import { Iconify as
|
|
3
|
+
import { Iconify as B } from "./components/Iconify/Iconify.js";
|
|
4
4
|
import { AvailableCustomIcons as q } from "./enums/AvailableCustomIcons.js";
|
|
5
|
-
import { T as k, a as L,
|
|
6
|
-
import { I as x } from "./index.es-
|
|
5
|
+
import { T as k, a as L, b as C } from "./index.es-z8RCxF8n.js";
|
|
6
|
+
import { I as x } from "./index.es-3I3oam0G.js";
|
|
7
7
|
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", _ = {
|
|
8
8
|
fullWidth: E,
|
|
9
9
|
mainElevation: N,
|
|
@@ -54,12 +54,12 @@ const E = "_fullWidth_1l0qh_1", N = "_mainElevation_1l0qh_5", W = "_searchbar_1l
|
|
|
54
54
|
leadingBlockType: p ?? "icon",
|
|
55
55
|
trailingBlockType: y ?? "icon",
|
|
56
56
|
className: `${p === "avatar" ? "" : _.listItem} ${n} ${r ? _.groupedListItem : ""}`,
|
|
57
|
-
onClick: (O,
|
|
57
|
+
onClick: (O, b) => T?.(b),
|
|
58
58
|
tag: d ? void 0 : s ?? "a",
|
|
59
59
|
to: d ? void 0 : t
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
|
-
}, G = (o) => typeof o == "string" && o in q ? /* @__PURE__ */ l(
|
|
62
|
+
}, G = (o) => typeof o == "string" && o in q ? /* @__PURE__ */ l(B, { icon: o }) : o;
|
|
63
63
|
export {
|
|
64
64
|
M as a,
|
|
65
65
|
K as g,
|