@hortiview/shared-components 0.0.1
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 +34 -0
- package/dist/ListAreaService-D16C1IfO.js +67 -0
- package/dist/_commonjsHelpers-CT_km90n.js +30 -0
- package/dist/assets/BaseView.css +1 -0
- package/dist/assets/BasicHeading.css +1 -0
- package/dist/assets/BlockView.css +1 -0
- package/dist/assets/HashTabView.css +1 -0
- package/dist/assets/Iconify.css +1 -0
- package/dist/assets/ListAreaService.css +1 -0
- package/dist/assets/SearchBar.css +1 -0
- package/dist/assets/VerticalDivider.css +1 -0
- package/dist/components/BaseView/BaseView.d.ts +55 -0
- package/dist/components/BaseView/BaseView.js +63 -0
- package/dist/components/BaseView/BaseView.test.d.ts +1 -0
- package/dist/components/BaseView/BaseView.test.js +124 -0
- package/dist/components/BasicHeading/BasicHeading.d.ts +48 -0
- package/dist/components/BasicHeading/BasicHeading.js +80 -0
- package/dist/components/BasicHeading/BasicHeading.test.d.ts +1 -0
- package/dist/components/BasicHeading/BasicHeading.test.js +35 -0
- package/dist/components/BlockView/BlockView.d.ts +59 -0
- package/dist/components/BlockView/BlockView.js +73 -0
- package/dist/components/BlockView/BlockView.test.d.ts +1 -0
- package/dist/components/BlockView/BlockView.test.js +46 -0
- package/dist/components/EmptyView/EmptyView.d.ts +14 -0
- package/dist/components/EmptyView/EmptyView.js +10 -0
- package/dist/components/EmptyView/EmptyView.test.d.ts +1 -0
- package/dist/components/EmptyView/EmptyView.test.js +18 -0
- package/dist/components/HashTabView/HashTabView.d.ts +47 -0
- package/dist/components/HashTabView/HashTabView.js +81 -0
- package/dist/components/HashTabView/HashTabView.test.d.ts +1 -0
- package/dist/components/HashTabView/HashTabView.test.js +30 -0
- package/dist/components/Iconify/Iconify.d.ts +13 -0
- package/dist/components/Iconify/Iconify.js +38 -0
- package/dist/components/Iconify/Iconify.test.d.ts +1 -0
- package/dist/components/Iconify/Iconify.test.js +24 -0
- package/dist/components/ListArea/ListArea.d.ts +57 -0
- package/dist/components/ListArea/ListArea.js +892 -0
- package/dist/components/ListArea/ListArea.test.d.ts +1 -0
- package/dist/components/ListArea/ListArea.test.js +104 -0
- package/dist/components/ListArea/ListAreaService.d.ts +64 -0
- package/dist/components/ListArea/ListAreaService.js +10 -0
- package/dist/components/SearchBar/SearchBar.d.ts +24 -0
- package/dist/components/SearchBar/SearchBar.js +33 -0
- package/dist/components/SearchBar/SearchBar.test.d.ts +1 -0
- package/dist/components/SearchBar/SearchBar.test.js +21 -0
- package/dist/components/VerticalDivider/VerticalDivider.d.ts +13 -0
- package/dist/components/VerticalDivider/VerticalDivider.js +8 -0
- package/dist/components/VerticalDivider/VerticalDivider.test.d.ts +1 -0
- package/dist/components/VerticalDivider/VerticalDivider.test.js +14 -0
- package/dist/enums/AvailableCustomIcons.d.ts +15 -0
- package/dist/enums/AvailableCustomIcons.js +4 -0
- package/dist/hooks/useBreakpoint.d.ts +15 -0
- package/dist/hooks/useBreakpoint.js +6 -0
- package/dist/magic-string.es-irX7syie.js +732 -0
- package/dist/main.d.ts +13 -0
- package/dist/main.js +24 -0
- package/dist/services/BlockService.d.ts +8 -0
- package/dist/services/BlockService.js +4 -0
- package/dist/types/HashTab.d.ts +25 -0
- package/dist/types/HashTab.js +1 -0
- package/dist/types/ListElement.d.ts +94 -0
- package/dist/types/ListElement.js +1 -0
- package/dist/types/internal/Block.d.ts +9 -0
- package/dist/types/internal/Block.js +1 -0
- package/dist/types/internal/ReactRouterTypes.d.ts +28 -0
- package/dist/types/internal/ReactRouterTypes.js +1 -0
- package/dist/useBreakpoint-DyAmuka7.js +35 -0
- package/dist/vi.JYQecGiw-D8gb8QJV.js +22539 -0
- package/dist/vite-env.d.js +1 -0
- package/package.json +61 -0
package/dist/main.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { BaseView } from './components/BaseView/BaseView';
|
|
2
|
+
export { BasicHeading } from './components/BasicHeading/BasicHeading';
|
|
3
|
+
export { BlockView } from './components/BlockView/BlockView';
|
|
4
|
+
export { EmptyView } from './components/EmptyView/EmptyView';
|
|
5
|
+
export { HashTabView } from './components/HashTabView/HashTabView';
|
|
6
|
+
export { Iconify } from './components/Iconify/Iconify';
|
|
7
|
+
export { ListArea } from './components/ListArea/ListArea';
|
|
8
|
+
export { SearchBar } from './components/SearchBar/SearchBar';
|
|
9
|
+
export { VerticalDivider } from './components/VerticalDivider/VerticalDivider';
|
|
10
|
+
export { AvailableCustomIcons } from './enums/AvailableCustomIcons';
|
|
11
|
+
export { useBreakpoints } from './hooks/useBreakpoint';
|
|
12
|
+
export type { ListElement, BaseListElement } from './types/ListElement';
|
|
13
|
+
export type { HashTab } from './types/HashTab';
|
package/dist/main.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { BaseView as e } from "./components/BaseView/BaseView.js";
|
|
2
|
+
import { BasicHeading as a } from "./components/BasicHeading/BasicHeading.js";
|
|
3
|
+
import { BlockView as m } from "./components/BlockView/BlockView.js";
|
|
4
|
+
import { EmptyView as f } from "./components/EmptyView/EmptyView.js";
|
|
5
|
+
import { HashTabView as s } from "./components/HashTabView/HashTabView.js";
|
|
6
|
+
import { Iconify as B } from "./components/Iconify/Iconify.js";
|
|
7
|
+
import { ListArea as l } from "./components/ListArea/ListArea.js";
|
|
8
|
+
import { SearchBar as w } from "./components/SearchBar/SearchBar.js";
|
|
9
|
+
import { VerticalDivider as b } from "./components/VerticalDivider/VerticalDivider.js";
|
|
10
|
+
import { AvailableCustomIcons as h } from "./enums/AvailableCustomIcons.js";
|
|
11
|
+
import { u as v } from "./useBreakpoint-DyAmuka7.js";
|
|
12
|
+
export {
|
|
13
|
+
h as AvailableCustomIcons,
|
|
14
|
+
e as BaseView,
|
|
15
|
+
a as BasicHeading,
|
|
16
|
+
m as BlockView,
|
|
17
|
+
f as EmptyView,
|
|
18
|
+
s as HashTabView,
|
|
19
|
+
B as Iconify,
|
|
20
|
+
l as ListArea,
|
|
21
|
+
w as SearchBar,
|
|
22
|
+
b as VerticalDivider,
|
|
23
|
+
v as useBreakpoints
|
|
24
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Block } from '../types/internal/Block';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the block number by the given block and columns
|
|
4
|
+
* @param block
|
|
5
|
+
* @param columns
|
|
6
|
+
* @returns block number
|
|
7
|
+
*/
|
|
8
|
+
export declare const getBlockNumberByDto: (block: Block, columns: number) => number;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HashTab type
|
|
3
|
+
*/
|
|
4
|
+
export type HashTab = {
|
|
5
|
+
/**
|
|
6
|
+
* title of the tab
|
|
7
|
+
*/
|
|
8
|
+
title: string;
|
|
9
|
+
/**
|
|
10
|
+
* component to be rendered when the tab is active
|
|
11
|
+
*/
|
|
12
|
+
component: JSX.Element;
|
|
13
|
+
/**
|
|
14
|
+
* hash of the tab, used in url to navigate to the tab
|
|
15
|
+
*/
|
|
16
|
+
hash?: string;
|
|
17
|
+
/**
|
|
18
|
+
* leading icon of the tab, should be a string {@see https://fonts.google.com/icons?selected=Material+Icons+Outlined:search:&icon.platform=web&icon.set=Material+Icons }
|
|
19
|
+
*/
|
|
20
|
+
leadingIcon?: string;
|
|
21
|
+
/**
|
|
22
|
+
* trailing icon of the tab, a JSX.Element
|
|
23
|
+
*/
|
|
24
|
+
trailingIcon?: JSX.Element;
|
|
25
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The basic list element to use with BaseView and ListArea
|
|
3
|
+
*/
|
|
4
|
+
export type BaseListElement = {
|
|
5
|
+
/**
|
|
6
|
+
* the icon of the list element
|
|
7
|
+
*/
|
|
8
|
+
icon?: JSX.Element | string;
|
|
9
|
+
/**
|
|
10
|
+
* the type of the icon
|
|
11
|
+
*/
|
|
12
|
+
iconType?: 'avatar' | 'badge' | 'checkbox' | 'icon' | 'image' | 'lgImage' | 'meta' | 'radio' | 'switch' | 'thumbnail';
|
|
13
|
+
/**
|
|
14
|
+
* the base view normally show the icon in the detail view, if you want to hide it set this to true
|
|
15
|
+
*/
|
|
16
|
+
hideIconInDetail?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* the trailing icon of the list element
|
|
19
|
+
*/
|
|
20
|
+
trailingIcon?: JSX.Element | string;
|
|
21
|
+
/**
|
|
22
|
+
* the type of the trailing icon
|
|
23
|
+
*/
|
|
24
|
+
trailingIconType?: 'avatar' | 'badge' | 'checkbox' | 'icon' | 'image' | 'lgImage' | 'meta' | 'radio' | 'switch' | 'thumbnail';
|
|
25
|
+
/**
|
|
26
|
+
* the id of the list element
|
|
27
|
+
*/
|
|
28
|
+
id: string;
|
|
29
|
+
/**
|
|
30
|
+
* the title of the list element
|
|
31
|
+
*/
|
|
32
|
+
title: string;
|
|
33
|
+
/**
|
|
34
|
+
* the baseview normally show the title in the detail view, if you want to show a different title set this
|
|
35
|
+
*/
|
|
36
|
+
detailTitle?: string;
|
|
37
|
+
/**
|
|
38
|
+
* the subtitle of the list element
|
|
39
|
+
*/
|
|
40
|
+
subTitle?: string;
|
|
41
|
+
/**
|
|
42
|
+
* the route of the list element
|
|
43
|
+
*/
|
|
44
|
+
route?: string;
|
|
45
|
+
/**
|
|
46
|
+
* the component showing in the details, when the list element is selected
|
|
47
|
+
*/
|
|
48
|
+
component: JSX.Element;
|
|
49
|
+
/**
|
|
50
|
+
* the action button of the list element, it is used in the trailing block of the list element
|
|
51
|
+
*/
|
|
52
|
+
actionButton?: React.ReactNode;
|
|
53
|
+
/**
|
|
54
|
+
* the height of the list item
|
|
55
|
+
*/
|
|
56
|
+
listItemHeight?: string;
|
|
57
|
+
/**
|
|
58
|
+
* the list element acts as a navigation link, if noNavigation is set to true the list element has no link behaivour
|
|
59
|
+
*/
|
|
60
|
+
noNavigation?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* the onClick function of the list element
|
|
63
|
+
*/
|
|
64
|
+
onClick?: (value: string) => void;
|
|
65
|
+
/**
|
|
66
|
+
* the value of the list element
|
|
67
|
+
*/
|
|
68
|
+
value?: string;
|
|
69
|
+
/**
|
|
70
|
+
* the list element is disabled if this is true
|
|
71
|
+
*/
|
|
72
|
+
disabled?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* an additonal action element shown in the detail section of the base view behind the detail heading
|
|
75
|
+
*/
|
|
76
|
+
detailAction?: JSX.Element;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* The list element to use with BaseView and ListArea, it is an extension of the BaseListElement to handle grouped lists
|
|
80
|
+
*/
|
|
81
|
+
export type ListElement = Omit<BaseListElement, 'component'> & {
|
|
82
|
+
/**
|
|
83
|
+
* the group name of multiple list elements
|
|
84
|
+
*/
|
|
85
|
+
groupName?: string | JSX.Element;
|
|
86
|
+
/**
|
|
87
|
+
* the list elements of the group
|
|
88
|
+
*/
|
|
89
|
+
items?: ListElement[];
|
|
90
|
+
/**
|
|
91
|
+
* will be rendered instead of title and subtitle
|
|
92
|
+
*/
|
|
93
|
+
customTitle?: JSX.Element;
|
|
94
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* the types are copied from react-router-dom
|
|
3
|
+
*/
|
|
4
|
+
export type RelativeRoutingType = 'route' | 'path';
|
|
5
|
+
/**
|
|
6
|
+
* the types are copied from react-router-dom
|
|
7
|
+
*/
|
|
8
|
+
export interface Path {
|
|
9
|
+
pathname: string;
|
|
10
|
+
search: string;
|
|
11
|
+
hash: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* the types are copied from react-router-dom
|
|
15
|
+
*/
|
|
16
|
+
export interface LinkProps extends Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href'> {
|
|
17
|
+
reloadDocument?: boolean;
|
|
18
|
+
replace?: boolean;
|
|
19
|
+
state?: any;
|
|
20
|
+
preventScrollReset?: boolean;
|
|
21
|
+
relative?: RelativeRoutingType;
|
|
22
|
+
to: To;
|
|
23
|
+
unstable_viewTransition?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* the types are copied from react-router-dom
|
|
27
|
+
*/
|
|
28
|
+
export type To = string | Partial<Path>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { useState as r, useEffect as c } from "react";
|
|
2
|
+
function t(e) {
|
|
3
|
+
const [s, a] = r(!1);
|
|
4
|
+
return c(
|
|
5
|
+
() => {
|
|
6
|
+
const i = window.matchMedia(e);
|
|
7
|
+
a(i.matches);
|
|
8
|
+
const n = (o) => a(o.matches);
|
|
9
|
+
return i.addEventListener("change", n), () => i.removeEventListener("change", n);
|
|
10
|
+
},
|
|
11
|
+
[s]
|
|
12
|
+
// Empty array ensures effect is only run on mount and unmount
|
|
13
|
+
), s;
|
|
14
|
+
}
|
|
15
|
+
function d() {
|
|
16
|
+
const e = {
|
|
17
|
+
isXs: t("(max-width: 640px)"),
|
|
18
|
+
isSm: t("(min-width: 641px) and (max-width: 768px)"),
|
|
19
|
+
isMd: t("(min-width: 769px) and (max-width: 839px)"),
|
|
20
|
+
isLg: t("(min-width: 840px)"),
|
|
21
|
+
isXlg: t("(min-width: 1280px)"),
|
|
22
|
+
active: ""
|
|
23
|
+
};
|
|
24
|
+
return e.isXs && (e.active = "xs"), e.isSm && (e.active = "sm"), e.isMd && (e.active = "md"), e.isLg && (e.active = "lg"), e;
|
|
25
|
+
}
|
|
26
|
+
const u = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
27
|
+
__proto__: null,
|
|
28
|
+
useBreakpoints: d,
|
|
29
|
+
useMediaQuery: t
|
|
30
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
31
|
+
export {
|
|
32
|
+
u as a,
|
|
33
|
+
t as b,
|
|
34
|
+
d as u
|
|
35
|
+
};
|