@hortiview/shared-components 0.0.7315 → 0.0.7369
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 +83 -1
- package/dist/assets/contextMenu.css +1 -1
- package/dist/assets/genericCard.css +1 -0
- package/dist/assets/genericTable.css +1 -1
- package/dist/components/AlertBanner/AlertBanner.d.ts +2 -1
- package/dist/components/AlertBanner/AlertBanner.js +17 -11
- package/dist/components/AlertBanner/AlertBanner.test.js +2 -2
- package/dist/components/BaseView/BaseView.js +1 -1
- package/dist/components/BaseView/BaseView.test.js +2 -2
- package/dist/components/BasicHeading/BasicHeading.js +1 -1
- package/dist/components/BasicHeading/BasicHeading.test.js +1 -1
- package/dist/components/BlockView/BlockView.test.js +1 -1
- package/dist/components/ContextMenu/ContextMenu.js +16 -15
- package/dist/components/ContextMenu/ContextMenu.test.js +1 -1
- package/dist/components/DeleteModal/DeleteModal.test.js +1 -1
- package/dist/components/Disclaimer/Disclaimer.test.js +1 -1
- package/dist/components/EmptyView/EmptyView.test.js +1 -1
- package/dist/components/Filter/Filter.js +39 -42
- package/dist/components/Filter/Filter.test.js +22 -19
- package/dist/components/FormComponents/FormCheckBox/FormCheckBox.test.js +1 -1
- package/dist/components/FormComponents/FormDatePicker/FormDatePicker.test.js +1 -1
- package/dist/components/FormComponents/FormRadio/FormRadio.test.js +1 -1
- package/dist/components/FormComponents/FormSelect/FormSelect.test.js +2 -2
- package/dist/components/FormComponents/FormSlider/FormSlider.test.js +1 -1
- package/dist/components/FormComponents/FormText/FormText.test.js +1 -1
- package/dist/components/GenericTable/GenericTable.d.ts +7 -2
- package/dist/components/GenericTable/GenericTable.js +91 -66
- package/dist/components/GenericTable/GenericTable.test.js +59 -45
- package/dist/components/GenericTable/GenericTableService.d.ts +19 -0
- package/dist/components/GenericTable/GenericTableService.js +59 -0
- package/dist/components/GenericTable/Mobile/GenericCard.d.ts +19 -0
- package/dist/components/GenericTable/Mobile/GenericCard.js +68 -0
- package/dist/components/GenericTable/Mobile/GenericCard.test.d.ts +1 -0
- package/dist/components/GenericTable/Mobile/GenericCard.test.js +76 -0
- package/dist/components/GenericTable/Mobile/GenericCardList.d.ts +22 -0
- package/dist/components/GenericTable/Mobile/GenericCardList.js +20 -0
- package/dist/components/GenericTable/Mobile/GenericCardList.test.d.ts +1 -0
- package/dist/components/GenericTable/Mobile/GenericCardList.test.js +78 -0
- package/dist/components/HashTabView/HashTabView.js +1 -1
- package/dist/components/HashTabView/HashTabView.test.js +1 -1
- package/dist/components/HeaderFilter/HeaderFilter.test.js +1 -1
- package/dist/components/Iconify/Iconify.test.js +1 -1
- package/dist/components/InfoGroup/InfoGroup.js +1 -1
- package/dist/components/InfoGroup/InfoGroup.test.js +1 -1
- package/dist/components/ListArea/ListArea.test.js +1 -1
- package/dist/components/LoadingSpinner/Big/BigLoadingSpinner.test.js +1 -1
- package/dist/components/LoadingSpinner/Default/LoadingSpinner.test.js +1 -1
- package/dist/components/OverflowTooltip/OverflowTooltip.js +29 -13
- package/dist/components/OverflowTooltip/OverflowTooltip.test.js +2 -2
- package/dist/components/Scrollbar/scrollbar.test.js +1 -1
- package/dist/components/SearchBar/SearchBar.test.js +1 -1
- package/dist/components/VerticalDivider/VerticalDivider.test.js +1 -1
- package/dist/contextMenu.module-DNQ8d9Aj.js +8 -0
- package/dist/genericCard.module-DzqcufuN.js +12 -0
- package/dist/genericTable.module-CXfRg0e4.js +15 -0
- package/dist/hooks/useBreakpoints.js +5 -0
- package/dist/hooks/useBreakpoints.test.js +2 -2
- package/dist/index-DW4oU_OU.js +11708 -0
- package/dist/main.d.ts +1 -1
- package/dist/main.js +60 -59
- package/dist/{react.esm-C3jDj5Fe.js → react.esm-Dy4VzU4L.js} +4 -1
- package/dist/types/GenericTable.d.ts +36 -0
- package/package.json +10 -10
- package/dist/assets/Filter.css +0 -22
- package/dist/contextMenu.module-B7aUMFPe.js +0 -7
- package/dist/genericTable.module-BkU2VDKR.js +0 -11
- package/dist/hooks/useBreakpoint.js +0 -5
- package/dist/index-BQnj-5Zt.js +0 -2963
- /package/dist/hooks/{useBreakpoint.d.ts → useBreakpoints.d.ts} +0 -0
- /package/dist/{useBreakpoint-BNeVhjjZ.js → useBreakpoints-BNeVhjjZ.js} +0 -0
package/README.md
CHANGED
|
@@ -31,6 +31,7 @@ Additionally the library provides form components using [react-hook-form](https:
|
|
|
31
31
|
1. [DeleteModal](#deletemodal)
|
|
32
32
|
1. [Disclaimer](#disclaimer)
|
|
33
33
|
1. [EmptyView](#emptyview)
|
|
34
|
+
1. [Filter](#filter)
|
|
34
35
|
1. [FormComponents](#formcomponents)
|
|
35
36
|
1. [FormCheckBox](#formcheckbox)
|
|
36
37
|
1. [FormDatePicker](#formdatepicker)
|
|
@@ -45,6 +46,7 @@ Additionally the library provides form components using [react-hook-form](https:
|
|
|
45
46
|
1. [Iconify](#iconify)
|
|
46
47
|
1. [ListArea](#listarea)
|
|
47
48
|
1. [LoadingSpinner](#loadingspinner)
|
|
49
|
+
1. [OverflowTooltip](#overflowtooltip)
|
|
48
50
|
1. [ScrollBar](#scrollbar)
|
|
49
51
|
1. [SearchBar](#searchbar)
|
|
50
52
|
1. [VerticalDivider](#verticaldivider)
|
|
@@ -209,6 +211,70 @@ import { EmptyView } from '@hortiview/shared-components';
|
|
|
209
211
|
<EmptyView title='No Content' subtitle='nothing' icon='grass' />;
|
|
210
212
|
```
|
|
211
213
|
|
|
214
|
+
### Filter
|
|
215
|
+
|
|
216
|
+
A filter component, which provides a well designed filter experience. It contains a filter button and a modal for different select inputs.
|
|
217
|
+
You need to provide some filter options in a `FilterData` array and handle the current filter selections.
|
|
218
|
+
|
|
219
|
+
```jsx
|
|
220
|
+
import { Filter } from '@hortiview/shared-components';
|
|
221
|
+
import { useState } from 'react';
|
|
222
|
+
|
|
223
|
+
const MyComponent = () => {
|
|
224
|
+
const [selectedFilters, setSelectedFilters] = useState([]);
|
|
225
|
+
|
|
226
|
+
const options = [
|
|
227
|
+
{
|
|
228
|
+
id: 'cars',
|
|
229
|
+
title: 'Cars',
|
|
230
|
+
availableOptions: [
|
|
231
|
+
{
|
|
232
|
+
id: 'bmw';
|
|
233
|
+
text: 'BMW';
|
|
234
|
+
icon: 'car';
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
id: 'vw';
|
|
238
|
+
text: 'Volkswagen';
|
|
239
|
+
icon: 'car';
|
|
240
|
+
}
|
|
241
|
+
],
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
id: 'food',
|
|
245
|
+
title: 'Food',
|
|
246
|
+
availableOptions: [
|
|
247
|
+
{
|
|
248
|
+
id: 'icecream';
|
|
249
|
+
text: 'Icecream';
|
|
250
|
+
icon: 'food';
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
id: 'burger';
|
|
254
|
+
text: 'Burger';
|
|
255
|
+
icon: 'food';
|
|
256
|
+
}
|
|
257
|
+
],
|
|
258
|
+
},
|
|
259
|
+
];
|
|
260
|
+
|
|
261
|
+
return (
|
|
262
|
+
<Filter
|
|
263
|
+
modalCancelButtonText={'cancel'}
|
|
264
|
+
modalConfirmButtonText={'useFilter'}
|
|
265
|
+
clearFilterText={'clearFilter'}
|
|
266
|
+
closeCallback={filter => setSelectedFilters(filter)}
|
|
267
|
+
currentFilter={selectedFilters}
|
|
268
|
+
filterButtonText={'filterButton'}
|
|
269
|
+
filterModalTitle={'filterResults'}
|
|
270
|
+
filters={options}
|
|
271
|
+
/>
|
|
272
|
+
);
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
export default MyComponent;
|
|
276
|
+
```
|
|
277
|
+
|
|
212
278
|
### FormComponents
|
|
213
279
|
|
|
214
280
|
The library provides some form components based on [react-hook-form](https://react-hook-form.com/). The components can only be use within a form provided by react-hook-form.
|
|
@@ -393,7 +459,7 @@ const { handleSubmit } = formMethods;
|
|
|
393
459
|
|
|
394
460
|
### GenericTable
|
|
395
461
|
|
|
396
|
-
A dynamic table, that renders a table based on a type and an array of data (of the specified type)
|
|
462
|
+
A dynamic table, that renders a table based on a type and an array of data (of the specified type). It renders a card list if your are in mobile or tablet mode.
|
|
397
463
|
|
|
398
464
|
```jsx
|
|
399
465
|
import { GenericTable, CellTemplateProps, CellTemplate } from '@hortiview/shared-components';
|
|
@@ -621,6 +687,22 @@ return <>
|
|
|
621
687
|
</>
|
|
622
688
|
```
|
|
623
689
|
|
|
690
|
+
### OverflowTooltip
|
|
691
|
+
|
|
692
|
+
Provides a tooltip and overflow behavior of a given text value.
|
|
693
|
+
|
|
694
|
+
```jsx
|
|
695
|
+
import { OverflowTooltip } from '@hortiview/shared-components';
|
|
696
|
+
import { TypoBody } from '@element/react-components';
|
|
697
|
+
|
|
698
|
+
const longText =
|
|
699
|
+
'This is a very long text that needs to be truncated and shown with a tooltip when it overflows.';
|
|
700
|
+
|
|
701
|
+
<OverflowTooltip text={longText}>
|
|
702
|
+
<TypoBody>{longText}</TypoBody>
|
|
703
|
+
</OverflowTooltip>;
|
|
704
|
+
```
|
|
705
|
+
|
|
624
706
|
### ScrollBar
|
|
625
707
|
|
|
626
708
|
Provides a scrollbar in hortiview styling. Add it a classname on your component.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._menu_1jlla_1{width:15.875rem}._icon_1jlla_5{color:var(--lmnt-theme-on-secondary-inactive)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._cardTitle_1738q_1{padding:.5rem!important}._cardBody_1738q_5{padding:.25rem .5rem!important;overflow:hidden!important}._cardContent_1738q_10{border-radius:.5rem}._row_1738q_14{padding:.25rem 0}._font_1738q_18{max-width:125px;font-weight:400;overflow:hidden;text-overflow:ellipsis;text-wrap:nowrap}._title_1738q_26{display:inline-block;width:65vw;overflow:hidden;text-overflow:ellipsis;text-wrap:nowrap}
|