@vitrosoftware/common-ui-ts 1.0.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/README.md +30 -0
- package/dist/EventConstants.d.ts +4 -0
- package/dist/control/Breadcrumbs/Breadcrumbs.d.ts +23 -0
- package/dist/control/TopLevelMenu/TopLevelMenu.d.ts +15 -0
- package/dist/control/TreeView/TreeView.d.ts +34 -0
- package/dist/control/TreeView/TreeViewConfig.d.ts +28 -0
- package/dist/control/TreeView/constants.d.ts +16 -0
- package/dist/index.css +178 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +19985 -0
- package/dist/index.js.map +1 -0
- package/dist/index.modern.js +19980 -0
- package/dist/index.modern.js.map +1 -0
- package/dist/index.test.d.ts +1 -0
- package/package.json +71 -0
package/README.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# common-ui-ts
|
|
2
|
+
|
|
3
|
+
> Made with create-react-library
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/common-ui-ts) [](https://standardjs.com)
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install --save common-ui-ts
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import React, { Component } from 'react'
|
|
17
|
+
|
|
18
|
+
import MyComponent from 'common-ui-ts'
|
|
19
|
+
import 'common-ui-ts/dist/index.css'
|
|
20
|
+
|
|
21
|
+
class Example extends Component {
|
|
22
|
+
render() {
|
|
23
|
+
return <MyComponent />
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## License
|
|
29
|
+
|
|
30
|
+
MIT © [](https://github.com/)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface BreadcrumbsItem {
|
|
3
|
+
id: string;
|
|
4
|
+
text: string;
|
|
5
|
+
}
|
|
6
|
+
export interface BreadcrumbsProps {
|
|
7
|
+
text: string;
|
|
8
|
+
itemList: BreadcrumbsItem[];
|
|
9
|
+
onClick: (item: BreadcrumbsItem) => void;
|
|
10
|
+
displayItemCount: number;
|
|
11
|
+
}
|
|
12
|
+
export declare const Breadcrumbs: (props: BreadcrumbsProps) => JSX.Element;
|
|
13
|
+
interface BreadcrumbsItem {
|
|
14
|
+
name: string;
|
|
15
|
+
id: string;
|
|
16
|
+
}
|
|
17
|
+
interface BreadcrumbsItemProps {
|
|
18
|
+
onClick?: () => void;
|
|
19
|
+
text: string;
|
|
20
|
+
id: string;
|
|
21
|
+
}
|
|
22
|
+
declare const BreadcrumbsItem: (props: BreadcrumbsItemProps) => JSX.Element;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface TopLevelMenuItem {
|
|
3
|
+
id: string;
|
|
4
|
+
text: string;
|
|
5
|
+
link: string;
|
|
6
|
+
isActive: boolean;
|
|
7
|
+
itemList: TopLevelMenuItem[];
|
|
8
|
+
}
|
|
9
|
+
interface TopLevelMenuProps {
|
|
10
|
+
itemList: TopLevelMenuItem[];
|
|
11
|
+
onClick: (item: TopLevelMenuItem) => void;
|
|
12
|
+
text: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const TopLevelMenu: (props: TopLevelMenuProps) => JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import 'jstree';
|
|
3
|
+
export interface TreeViewEventHandler {
|
|
4
|
+
id: string;
|
|
5
|
+
process: (...params: any[]) => any;
|
|
6
|
+
}
|
|
7
|
+
export interface ITreeView {
|
|
8
|
+
setEventHandler(eventHandler: TreeViewEventHandler): void;
|
|
9
|
+
setContextMenu(func: any): void;
|
|
10
|
+
getFullPath(node: any): {
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
}[];
|
|
14
|
+
dispose(): void;
|
|
15
|
+
openAll(): void;
|
|
16
|
+
closeAll(node: any): void;
|
|
17
|
+
deselectAll(): void;
|
|
18
|
+
getSelected(): any;
|
|
19
|
+
getNode(nodeId: string): any;
|
|
20
|
+
deleteNode(node: any): void;
|
|
21
|
+
selectNode(node: any): void;
|
|
22
|
+
openNode(node: any): void;
|
|
23
|
+
editNode(): void;
|
|
24
|
+
createNewNode(parent: any, node: any): void;
|
|
25
|
+
redrawNode(node: any, deep?: boolean): void;
|
|
26
|
+
renameNode(node: any, newName: string): void;
|
|
27
|
+
}
|
|
28
|
+
interface TreeViewProps {
|
|
29
|
+
id: string;
|
|
30
|
+
getData: (obj: any, cb: any) => any;
|
|
31
|
+
onInit: (jsTreeView: ITreeView) => any;
|
|
32
|
+
}
|
|
33
|
+
export declare const TreeView: (props: TreeViewProps) => JSX.Element;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare class TreeViewConfig {
|
|
2
|
+
static getConfig(): {
|
|
3
|
+
core: {
|
|
4
|
+
check_callback: boolean;
|
|
5
|
+
themes: {
|
|
6
|
+
dots: boolean;
|
|
7
|
+
};
|
|
8
|
+
multiple: boolean;
|
|
9
|
+
data: (obj: any, cb: any) => any;
|
|
10
|
+
};
|
|
11
|
+
plugins: string[];
|
|
12
|
+
types: {
|
|
13
|
+
folder: {
|
|
14
|
+
icon: string;
|
|
15
|
+
new_node: string;
|
|
16
|
+
};
|
|
17
|
+
file: {
|
|
18
|
+
icon: string;
|
|
19
|
+
valid_children: string[];
|
|
20
|
+
new_node: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
checkbox: {
|
|
24
|
+
three_state: boolean;
|
|
25
|
+
};
|
|
26
|
+
contextmenu: () => never[];
|
|
27
|
+
};
|
|
28
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare enum TREE_VIEW {
|
|
2
|
+
GET_PATH = "get_path",
|
|
3
|
+
DESTROY = "destroy",
|
|
4
|
+
OPEN_ALL = "open_all",
|
|
5
|
+
CLOSE_ALL = "close_all",
|
|
6
|
+
DESELECT_ALL = "deselect_all",
|
|
7
|
+
GET_SELECTED = "get_selected",
|
|
8
|
+
GET_NODE = "get_node",
|
|
9
|
+
CREATE_NODE = "create_node",
|
|
10
|
+
RENAME_NODE = "rename_node",
|
|
11
|
+
REDRAW_NODE = "redraw_node",
|
|
12
|
+
DELETE_NODE = "delete_node",
|
|
13
|
+
SELECT_NODE = "select_node",
|
|
14
|
+
OPEN_NODE = "open_node",
|
|
15
|
+
EDIT = "edit"
|
|
16
|
+
}
|
package/dist/index.css
ADDED
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
._1H9Sa ::-webkit-scrollbar {
|
|
2
|
+
width: 4px;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
._1H9Sa ::-webkit-scrollbar-track {
|
|
6
|
+
background: #fff;
|
|
7
|
+
border-radius: 8px;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
._1H9Sa ::-webkit-scrollbar-thumb {
|
|
11
|
+
background: #e0e0e0;
|
|
12
|
+
border-radius: 2px;
|
|
13
|
+
height: 20px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
._1H9Sa ::-webkit-scrollbar-thumb:hover {
|
|
17
|
+
background: #828282;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
._1H9Sa {
|
|
21
|
+
height: 28px;
|
|
22
|
+
display: flex;
|
|
23
|
+
flex-direction: column;
|
|
24
|
+
border-left: 1px solid #BDBDBD;
|
|
25
|
+
padding: 0 0 0 12px;
|
|
26
|
+
position: relative;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
._1H9Sa ._2ToVu {
|
|
30
|
+
display: flex;
|
|
31
|
+
position: relative;
|
|
32
|
+
justify-content: space-between;
|
|
33
|
+
flex-direction: row-reverse;
|
|
34
|
+
justify-content: flex-end;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
._1H9Sa ._1rbdA {
|
|
38
|
+
height: 12px;
|
|
39
|
+
width: 12px;
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
margin-right: 8px;
|
|
42
|
+
position: relative;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
._1H9Sa ._1rbdA::after {
|
|
46
|
+
content: '<<';
|
|
47
|
+
color: #828282;
|
|
48
|
+
display: inline-block;
|
|
49
|
+
font-size: 13px;
|
|
50
|
+
line-height: 10px;
|
|
51
|
+
height: 10px;
|
|
52
|
+
position: absolute;
|
|
53
|
+
right: 0;
|
|
54
|
+
top: 0;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
._1H9Sa ._2EcJL {
|
|
58
|
+
list-style-type: none;
|
|
59
|
+
margin: 0;
|
|
60
|
+
padding: 0;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
._1H9Sa ._2EcJL > li {
|
|
64
|
+
margin-right: 6px;
|
|
65
|
+
color: #828282;
|
|
66
|
+
font-size: 10px;
|
|
67
|
+
line-height: 10px;
|
|
68
|
+
cursor: pointer;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
._1H9Sa ._3Tszw {
|
|
72
|
+
font-size: 13px;
|
|
73
|
+
line-height: 13px;
|
|
74
|
+
color: #4F4F4F;
|
|
75
|
+
margin-bottom: 4px;
|
|
76
|
+
align-self: flex-start;
|
|
77
|
+
cursor: pointer;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
._1H9Sa ._3Tszw::after {
|
|
81
|
+
content: '>';
|
|
82
|
+
display: inline-block;
|
|
83
|
+
margin-left: 8px;
|
|
84
|
+
font-size: 16px;
|
|
85
|
+
transform: rotate(90deg);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
._1H9Sa ._3Tszw._20GYX::after {
|
|
89
|
+
display: inline-block;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
._1H9Sa ._3Tszw._2nuvq::after {
|
|
93
|
+
display: none;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
._1H9Sa ._2zSbI {
|
|
97
|
+
background: white;
|
|
98
|
+
position: absolute;
|
|
99
|
+
top: 100%;
|
|
100
|
+
left: 0;
|
|
101
|
+
margin-top: 8px;
|
|
102
|
+
border-radius: 8px;
|
|
103
|
+
box-shadow: rgb(0 0 0 / 13%) 0px 3.2px 7.2px 0px, rgb(0 0 0 / 11%) 0px 0.6px 1.8px 0px;
|
|
104
|
+
padding: 0;
|
|
105
|
+
overflow: hidden;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
._1H9Sa ._2zSbI ul {
|
|
109
|
+
max-height: 172px;
|
|
110
|
+
padding: 0;
|
|
111
|
+
display: flex;
|
|
112
|
+
flex-direction: column-reverse;
|
|
113
|
+
list-style-type: none;
|
|
114
|
+
font-size: 10px;
|
|
115
|
+
color: #828282;
|
|
116
|
+
margin-bottom: 0px;
|
|
117
|
+
overflow-y: auto;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
._1H9Sa ._2zSbI ul > li {
|
|
121
|
+
line-height: 24px;
|
|
122
|
+
cursor: pointer;
|
|
123
|
+
padding: 0 12px;
|
|
124
|
+
white-space: nowrap;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
._1H9Sa ._2zSbI ul > li:hover {
|
|
128
|
+
background: #F5F6FA;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
._1H9Sa ._2EcJL {
|
|
132
|
+
display: flex;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
._1H9Sa ._2EcJL > li:not(:last-child)::after {
|
|
136
|
+
content: '>';
|
|
137
|
+
display: inline-block;
|
|
138
|
+
margin-left: 8px;
|
|
139
|
+
font-size: 13px;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
._1H9Sa ._2zSbI ul > li::after {
|
|
143
|
+
content: '>';
|
|
144
|
+
display: inline-block;
|
|
145
|
+
transform: rotate(-90deg);
|
|
146
|
+
margin-left: 8px;
|
|
147
|
+
font-size: 13px;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
@media (max-width: 800px) {
|
|
151
|
+
._1H9Sa ._2ToVu {
|
|
152
|
+
flex-direction: row;
|
|
153
|
+
justify-content: space-between;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
._1H9Sa ._1rbdA {
|
|
157
|
+
margin-right: 0;
|
|
158
|
+
/* archive.svg URL-encoder for SVG */
|
|
159
|
+
background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' standalone='no'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 20010904//EN' 'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd'%3E%3Csvg version='1.0' xmlns='http://www.w3.org/2000/svg' width='12.000000pt' height='12.000000pt' viewBox='0 0 512.000000 512.000000' preserveAspectRatio='xMidYMid meet'%3E%3Cg transform='translate(0.000000,512.000000) scale(0.100000,-0.100000)'%0Afill='%23000000' stroke='none'%3E%3Cpath d='M1485 4445 c-478 -117 -886 -222 -905 -232 -19 -10 -45 -36 -57 -58%0Al-23 -40 0 -1548 c0 -1298 2 -1553 14 -1581 22 -53 62 -83 135 -100 172 -41%0A2089 -426 2121 -426 42 0 92 30 124 73 19 26 21 45 24 187 l3 159 229 3 c251%0A3 254 4 304 72 21 27 21 36 24 911 l2 883 53 12 c78 17 177 28 320 36 l127 7%0A0 -94 c0 -76 4 -100 19 -123 42 -63 114 -74 177 -27 82 61 560 489 581 521 28%0A40 29 75 5 115 -25 40 -584 497 -627 512 -83 29 -155 -35 -155 -137 l0 -57%0A-67 -12 c-95 -17 -256 -72 -352 -120 l-80 -41 -3 399 c-3 386 -4 401 -24 427%0A-11 15 -33 37 -48 48 -27 20 -41 21 -446 24 l-419 3 -3 157 c-3 147 -5 159%0A-27 191 -26 36 -91 71 -131 70 -14 0 -416 -97 -895 -214z m923 -2192 c13 -18%0A90 -74 187 -135 l165 -103 0 -697 c0 -384 -2 -698 -4 -698 -2 0 -356 72 -787%0A159 -431 88 -902 184 -1046 213 l-263 53 0 1516 0 1516 333 81 c182 45 568%0A140 857 210 l525 128 5 -1105 5 -1106 23 -32z m912 1399 l0 -428 -46 -44%0Ac-105 -101 -205 -263 -252 -405 -25 -75 -52 -203 -52 -247 0 -49 32 -95 75%0A-107 69 -19 107 6 162 106 26 45 61 97 80 115 l33 32 0 -817 0 -817 -200 0%0A-199 0 -3 518 -3 517 -23 32 c-13 18 -90 74 -187 135 l-165 103 0 868 0 867%0A390 0 390 0 0 -428z m1050 -331 c118 -97 214 -181 213 -185 0 -5 -99 -95 -220%0A-201 l-218 -192 -5 71 c-9 126 -36 146 -197 146 -307 0 -554 -49 -691 -136%0Al-52 -34 26 53 c130 258 406 445 744 503 52 9 103 20 113 26 26 13 57 68 57%0A101 0 15 3 27 8 26 4 0 104 -80 222 -178z'/%3E%3C/g%3E%3C/svg%3E");
|
|
160
|
+
background-size: cover;
|
|
161
|
+
background-repeat: no-repeat;
|
|
162
|
+
background-position: center center;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
._1H9Sa ._1rbdA::after {
|
|
166
|
+
display: none;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
._1H9Sa ._2zSbI {
|
|
170
|
+
right: 0;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
@media (max-width: 414px) {
|
|
175
|
+
._1H9Sa {
|
|
176
|
+
margin-left: 20px;
|
|
177
|
+
}
|
|
178
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Breadcrumbs } from "./control/Breadcrumbs/Breadcrumbs";
|
|
2
|
+
import { TopLevelMenu } from "./control/TopLevelMenu/TopLevelMenu";
|
|
3
|
+
import { TreeView, ITreeView } from "./control/TreeView/TreeView";
|
|
4
|
+
export { Breadcrumbs, TopLevelMenu, TreeView };
|
|
5
|
+
export { ITreeView };
|