jb-grid 0.4.0 → 0.5.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 +138 -11
- package/package.json +5 -8
- package/react/README.md +207 -202
- package/react/dist/Components/module-declaration.d.ts +1 -1
- package/react/dist/Content.d.ts +1 -2
- package/react/dist/Footer.d.ts +1 -2
- package/react/dist/Header.d.ts +3 -16
- package/react/dist/JBGrid.cjs.js +3631 -1
- package/react/dist/JBGrid.cjs.js.map +1 -1
- package/react/dist/JBGrid.d.ts +288 -26
- package/react/dist/JBGrid.js +3624 -1
- package/react/dist/JBGrid.js.map +1 -1
- package/react/dist/JBGrid.umd.js +3641 -1
- package/react/dist/JBGrid.umd.js.map +1 -1
- package/react/dist/JBGridData.d.ts +1 -5
- package/react/dist/JBGridViewModel.d.ts +28 -25
- package/react/dist/types.d.ts +17 -49
- package/react/lib/Components/Cell.tsx +17 -15
- package/react/lib/Components/ColumnHeader.tsx +44 -0
- package/react/lib/Components/ExpandToggle.tsx +14 -10
- package/react/lib/Components/FullscreenIcon.tsx +28 -0
- package/react/lib/Components/JBLoading.tsx +5 -4
- package/react/lib/Components/Pagination.tsx +1 -1
- package/react/lib/Components/PaginationInfo.tsx +71 -0
- package/react/lib/Components/RefreshIcon.tsx +11 -0
- package/react/lib/Components/Row.tsx +17 -15
- package/react/lib/Components/TableHeader.tsx +21 -0
- package/react/lib/Components/blob-loading.css +27 -23
- package/react/lib/Components/cell.css +7 -7
- package/react/lib/Components/content-error/ContentError.tsx +19 -16
- package/react/lib/Components/content-error/content-error.css +5 -11
- package/react/lib/Components/module-declaration.ts +61 -13
- package/react/lib/Content.tsx +23 -47
- package/react/lib/Footer.tsx +52 -79
- package/react/lib/Header.tsx +11 -24
- package/react/lib/JBGrid.tsx +129 -70
- package/react/lib/JBGridViewModel.ts +189 -452
- package/react/lib/footer.css +25 -55
- package/react/lib/header.css +20 -20
- package/react/lib/jb-grid.css +69 -55
- package/react/lib/types.ts +32 -129
- package/react/lib/variables.css +6 -0
- package/react/package.json +14 -10
- package/react/tsconfig.json +5 -4
- package/web-component/dist/index.cjs.js +559 -1
- package/web-component/dist/index.cjs.js.br +0 -0
- package/web-component/dist/index.cjs.js.gz +0 -0
- package/web-component/dist/index.cjs.js.map +1 -1
- package/web-component/dist/index.d.ts +161 -4
- package/web-component/dist/index.d.ts.map +1 -1
- package/web-component/dist/index.js +561 -1
- package/web-component/dist/index.js.br +0 -0
- package/web-component/dist/index.js.gz +0 -0
- package/web-component/dist/index.js.map +1 -1
- package/web-component/dist/index.umd.js +567 -1
- package/web-component/dist/index.umd.js.br +0 -0
- package/web-component/dist/index.umd.js.gz +0 -0
- package/web-component/dist/index.umd.js.map +1 -1
- package/web-component/dist/row/row.d.ts.map +1 -1
- package/web-component/dist/row/types.d.ts +3 -5
- package/web-component/dist/row/types.d.ts.map +1 -1
- package/web-component/dist/row/utils.d.ts +1 -2
- package/web-component/dist/row/utils.d.ts.map +1 -1
- package/web-component/dist/table-header/render.d.ts +2 -0
- package/web-component/dist/table-header/render.d.ts.map +1 -0
- package/web-component/dist/table-header/table-header.d.ts +9 -0
- package/web-component/dist/table-header/table-header.d.ts.map +1 -0
- package/web-component/dist/table-header/types.d.ts +4 -0
- package/web-component/dist/table-header/types.d.ts.map +1 -0
- package/web-component/dist/types.d.ts +6 -0
- package/web-component/dist/types.d.ts.map +1 -0
- package/web-component/dist/utils.d.ts +8 -0
- package/web-component/dist/utils.d.ts.map +1 -0
- package/web-component/lib/cell/cell.ts +10 -5
- package/web-component/lib/cell/style.css +2 -1
- package/web-component/lib/column-header/column-header.ts +117 -0
- package/web-component/lib/column-header/render.ts +14 -0
- package/web-component/lib/column-header/style.css +60 -0
- package/web-component/lib/column-header/types.ts +10 -0
- package/web-component/lib/fullscreen-icon/fullscreen-icon.ts +72 -0
- package/web-component/lib/fullscreen-icon/render.ts +23 -0
- package/web-component/lib/fullscreen-icon/style.css +44 -0
- package/web-component/lib/fullscreen-icon/types.ts +1 -0
- package/web-component/lib/i18n.ts +38 -0
- package/web-component/lib/index.ts +9 -4
- package/web-component/lib/pagination/README.md +4 -0
- package/web-component/lib/pagination/pagination.ts +25 -15
- package/web-component/lib/pagination/render.ts +13 -10
- package/web-component/lib/pagination/style.css +43 -31
- package/web-component/lib/pagination/types.ts +1 -1
- package/web-component/lib/pagination/variables.css +10 -0
- package/web-component/lib/pagination-info/pagination-info.ts +191 -0
- package/web-component/lib/pagination-info/render.ts +16 -0
- package/web-component/lib/pagination-info/style.css +47 -0
- package/web-component/lib/pagination-info/types.ts +12 -0
- package/web-component/lib/refresh-icon/refresh-icon.ts +79 -0
- package/web-component/lib/refresh-icon/render.ts +10 -0
- package/web-component/lib/refresh-icon/style.css +21 -0
- package/web-component/lib/row/render.ts +3 -3
- package/web-component/lib/row/row.ts +29 -15
- package/web-component/lib/row/style.css +30 -30
- package/web-component/lib/row/types.ts +7 -8
- package/web-component/lib/row/utils.ts +1 -40
- package/web-component/lib/row/variables.css +13 -0
- package/web-component/lib/table-header/render.ts +9 -0
- package/web-component/lib/table-header/style.css +29 -0
- package/web-component/lib/table-header/table-header.ts +50 -0
- package/web-component/lib/table-header/types.ts +4 -0
- package/web-component/lib/toggle/expand-toggle.ts +17 -13
- package/web-component/lib/toggle/render.ts +18 -13
- package/web-component/lib/toggle/style.css +18 -5
- package/web-component/lib/types.ts +6 -0
- package/web-component/lib/utils.ts +46 -0
- package/react/lib/JBGridBridgeExample.js +0 -90
- package/react/lib/JBGridData.ts +0 -51
- package/react/lib/global.d.ts +0 -15
- package/web-component/lib/global.d.ts +0 -15
- package/web-component/tsconfig.json +0 -17
package/react/lib/footer.css
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
.jb-grid-footer {
|
|
2
2
|
grid-area: footer;
|
|
3
3
|
background-color: transparent;
|
|
4
|
-
height:
|
|
4
|
+
height: 3.5rem;
|
|
5
5
|
width: 100%;
|
|
6
6
|
display: flex;
|
|
7
7
|
align-items: center;
|
|
8
|
-
border-bottom-left-radius:
|
|
9
|
-
border-bottom-right-radius:
|
|
8
|
+
border-bottom-left-radius: 1rem;
|
|
9
|
+
border-bottom-right-radius: 1rem;
|
|
10
10
|
justify-content: space-between;
|
|
11
11
|
container-type: size;
|
|
12
12
|
overflow: hidden;
|
|
@@ -15,37 +15,7 @@
|
|
|
15
15
|
align-items: center;
|
|
16
16
|
justify-content: flex-start;
|
|
17
17
|
|
|
18
|
-
.
|
|
19
|
-
padding: 0 16px;
|
|
20
|
-
float: left;
|
|
21
|
-
align-items: center;
|
|
22
|
-
height: 100%;
|
|
23
|
-
color: #7b7b7b;
|
|
24
|
-
font-size: 16px;
|
|
25
|
-
display: flex;
|
|
26
|
-
@container (max-width: 580px) {
|
|
27
|
-
display:none;
|
|
28
|
-
}
|
|
29
|
-
.page-size-select {
|
|
30
|
-
background-color: transparent;
|
|
31
|
-
font-family: inherit;
|
|
32
|
-
color: #7b7b7b;
|
|
33
|
-
font-size: 16px;
|
|
34
|
-
border: none;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
.items-information-section {
|
|
38
|
-
float: left;
|
|
39
|
-
display: flex;
|
|
40
|
-
align-items: center;
|
|
41
|
-
height: 100%;
|
|
42
|
-
color: #7b7b7b;
|
|
43
|
-
font-size: 16px;
|
|
44
|
-
@container (max-width: 500px) {
|
|
45
|
-
display:none;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
.navigation-section {
|
|
18
|
+
.navigation-section {
|
|
49
19
|
float: left;
|
|
50
20
|
display: flex;
|
|
51
21
|
align-items: center;
|
|
@@ -53,21 +23,21 @@
|
|
|
53
23
|
nav {
|
|
54
24
|
display: flex;
|
|
55
25
|
align-items: center;
|
|
56
|
-
height:
|
|
26
|
+
height: 3rem;
|
|
57
27
|
.nav-btn {
|
|
58
|
-
height:
|
|
59
|
-
width:
|
|
28
|
+
height: 3rem;
|
|
29
|
+
width: 3rem;
|
|
60
30
|
display: flex;
|
|
61
31
|
justify-content: center;
|
|
62
32
|
align-items: center;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
fill: var(--
|
|
67
|
-
}
|
|
68
|
-
}
|
|
33
|
+
&:hover {
|
|
34
|
+
cursor: pointer;
|
|
35
|
+
svg {
|
|
36
|
+
fill: var(--footer-icon-fill-color-hover);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
69
39
|
svg {
|
|
70
|
-
height:
|
|
40
|
+
height: 2.5rem;
|
|
71
41
|
display: block;
|
|
72
42
|
margin: 0px 4px;
|
|
73
43
|
html[dir="ltr"] & {
|
|
@@ -76,8 +46,8 @@
|
|
|
76
46
|
}
|
|
77
47
|
}
|
|
78
48
|
.number-container {
|
|
79
|
-
font-size:
|
|
80
|
-
max-width:
|
|
49
|
+
font-size: 1rem;
|
|
50
|
+
max-width: 10rem;
|
|
81
51
|
overflow: hidden;
|
|
82
52
|
text-align: center;
|
|
83
53
|
padding: 0;
|
|
@@ -91,17 +61,17 @@
|
|
|
91
61
|
}
|
|
92
62
|
.number-btn {
|
|
93
63
|
color: rgb(180, 180, 180);
|
|
94
|
-
padding: 0
|
|
64
|
+
padding: 0 0.5rem;
|
|
95
65
|
font-size: 0.8em;
|
|
96
66
|
cursor: pointer;
|
|
97
|
-
width:
|
|
67
|
+
width: 3rem;
|
|
98
68
|
display: inline-block;
|
|
99
|
-
&.current-page {
|
|
100
|
-
color: var(--
|
|
101
|
-
font-size: 1em;
|
|
102
|
-
}
|
|
103
|
-
/* If the jb-grid-footer is smaller than
|
|
104
|
-
@container (max-width:
|
|
69
|
+
&.current-page {
|
|
70
|
+
color: var(--page-color-active);
|
|
71
|
+
font-size: 1em;
|
|
72
|
+
}
|
|
73
|
+
/* If the jb-grid-footer is smaller than 35rem */
|
|
74
|
+
@container (max-width: 38.75rem) {
|
|
105
75
|
&:not(.current-page){
|
|
106
76
|
display:none;
|
|
107
77
|
}
|
|
@@ -111,4 +81,4 @@
|
|
|
111
81
|
}
|
|
112
82
|
}
|
|
113
83
|
}
|
|
114
|
-
}
|
|
84
|
+
}
|
package/react/lib/header.css
CHANGED
|
@@ -7,29 +7,29 @@
|
|
|
7
7
|
display: block;
|
|
8
8
|
height: auto;
|
|
9
9
|
width: 100%;
|
|
10
|
-
border-top-left-radius:
|
|
11
|
-
border-top-right-radius:
|
|
10
|
+
border-top-left-radius: 1.5rem;
|
|
11
|
+
border-top-right-radius: 1.5rem;
|
|
12
12
|
grid-area: header;
|
|
13
13
|
|
|
14
14
|
.main-section {
|
|
15
|
-
height:
|
|
15
|
+
height: 3.5rem;
|
|
16
16
|
width: 100%;
|
|
17
|
-
padding-top:
|
|
17
|
+
padding-top: 0.5rem;
|
|
18
18
|
box-sizing: border-box;
|
|
19
19
|
display: flex;
|
|
20
20
|
align-items: center;
|
|
21
21
|
justify-content: space-between;
|
|
22
22
|
.jb-grid-title {
|
|
23
23
|
display: block;
|
|
24
|
-
padding: 0
|
|
25
|
-
font-size:
|
|
26
|
-
line-height:
|
|
24
|
+
padding: 0 0.5rem;
|
|
25
|
+
font-size: 1.125rem;
|
|
26
|
+
line-height: 3rem;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
.button-container {
|
|
30
30
|
display: flex;
|
|
31
31
|
height: 100%;
|
|
32
|
-
padding: 0
|
|
32
|
+
padding: 0 0.5rem;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
&.hidden {
|
|
@@ -49,37 +49,37 @@
|
|
|
49
49
|
|
|
50
50
|
.close-btn {
|
|
51
51
|
float: right;
|
|
52
|
-
width:
|
|
53
|
-
height:
|
|
52
|
+
width: 2.8125rem;
|
|
53
|
+
height: 2.8125rem;
|
|
54
54
|
|
|
55
55
|
svg {
|
|
56
|
-
width:
|
|
57
|
-
margin:
|
|
56
|
+
width: 1.5rem;
|
|
57
|
+
margin: 0.6875rem;
|
|
58
58
|
cursor: pointer;
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
.search-bar-wrapper {
|
|
63
63
|
float: right;
|
|
64
|
-
width: calc(100% -
|
|
64
|
+
width: calc(100% - 3rem);
|
|
65
65
|
height: 100%;
|
|
66
66
|
display: flex;
|
|
67
67
|
align-items: center;
|
|
68
68
|
align-content: stretch;
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
width: 100%;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
70
|
+
> * {
|
|
71
|
+
width: 100%;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
.button-container .btn {
|
|
77
77
|
height: 100%;
|
|
78
|
-
width:
|
|
78
|
+
width: 3rem;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
.button-container .btn svg {
|
|
82
82
|
display: block;
|
|
83
|
-
margin:
|
|
83
|
+
margin: 0.5rem 0.5rem;
|
|
84
84
|
}
|
|
85
|
-
}
|
|
85
|
+
}
|
package/react/lib/jb-grid.css
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* responsive definition */
|
|
2
|
-
@custom-media --tablet-until (max-width:
|
|
2
|
+
@custom-media --tablet-until (max-width: 48rem);
|
|
3
3
|
|
|
4
4
|
:host{
|
|
5
5
|
--base-grid-row-color:#f9f9f9
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
height: 100%;
|
|
10
10
|
display: grid;
|
|
11
11
|
grid-template-columns: 1fr;
|
|
12
|
-
grid-template-rows: minmax(
|
|
12
|
+
grid-template-rows: minmax(3.5rem , auto) 1fr 3.5rem;
|
|
13
13
|
grid-template-areas: "header" "content" "footer";
|
|
14
|
-
box-shadow: 0px 0px
|
|
15
|
-
border-radius:
|
|
14
|
+
box-shadow: 0px 0px 0.875rem 2px #f0f4f7;
|
|
15
|
+
border-radius: 1.5rem;
|
|
16
16
|
background-color: #edf2f9;
|
|
17
17
|
svg {
|
|
18
18
|
fill: #7b7b7b;
|
|
@@ -25,43 +25,47 @@
|
|
|
25
25
|
/* 56*2=112 */
|
|
26
26
|
height: 100%;
|
|
27
27
|
position: relative;
|
|
28
|
-
border-radius: 0 0
|
|
28
|
+
border-radius: 0 0 1.5rem 1.5rem;
|
|
29
29
|
overflow: hidden;
|
|
30
|
-
box-shadow: #00000014 0px
|
|
30
|
+
box-shadow: #00000014 0px 0.9375rem 0.875rem -5px;
|
|
31
31
|
grid-area: content;
|
|
32
|
-
.loading {
|
|
33
|
-
position: absolute;
|
|
34
|
-
width: 100%;
|
|
35
|
-
height: 100%;
|
|
36
|
-
background-color: #fffffff2;
|
|
37
|
-
top: 0;
|
|
38
|
-
right: 0;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
32
|
+
.loading {
|
|
33
|
+
position: absolute;
|
|
34
|
+
width: 100%;
|
|
35
|
+
height: 100%;
|
|
36
|
+
background-color: #fffffff2;
|
|
37
|
+
top: 0;
|
|
38
|
+
right: 0;
|
|
39
|
+
z-index: 1;
|
|
40
|
+
display: flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
justify-content: center;
|
|
43
|
+
.loading-content {
|
|
44
|
+
width: min(18.75rem, 80%);
|
|
45
|
+
aspect-ratio: 1;
|
|
46
|
+
display: flex;
|
|
47
|
+
align-items: center;
|
|
48
|
+
justify-content: center;
|
|
49
|
+
font-size: 1.4375rem;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
49
52
|
.table-header {
|
|
50
53
|
width: 100%;
|
|
51
|
-
height:
|
|
54
|
+
height: 2rem;
|
|
52
55
|
background-color: #f0f4f7;
|
|
53
56
|
overflow: hidden;
|
|
54
57
|
@media(--tablet-until) {
|
|
55
58
|
display: none;
|
|
56
59
|
}
|
|
57
|
-
.table-header-wrapper
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
grid-
|
|
61
|
-
|
|
60
|
+
.table-header-wrapper,
|
|
61
|
+
jb-table-header {
|
|
62
|
+
display: grid;
|
|
63
|
+
grid-template-columns: auto;
|
|
64
|
+
grid-auto-columns: 1fr;
|
|
65
|
+
line-height: 2rem;
|
|
62
66
|
|
|
63
67
|
.header-item {
|
|
64
|
-
padding: 0
|
|
68
|
+
padding: 0 1rem;
|
|
65
69
|
align-self: right;
|
|
66
70
|
overflow: hidden;
|
|
67
71
|
display: flex;
|
|
@@ -71,8 +75,8 @@
|
|
|
71
75
|
.sort-icon-wrapper {
|
|
72
76
|
svg {
|
|
73
77
|
fill: #1e201d;
|
|
74
|
-
height:
|
|
75
|
-
margin-top:
|
|
78
|
+
height: 1rem;
|
|
79
|
+
margin-top: 0.5rem;
|
|
76
80
|
&.--asc {
|
|
77
81
|
transition: all 0.2s ease-out;
|
|
78
82
|
transform: rotate(0deg);
|
|
@@ -89,17 +93,17 @@
|
|
|
89
93
|
}
|
|
90
94
|
}
|
|
91
95
|
}
|
|
92
|
-
.table-content {
|
|
93
|
-
width: 100%;
|
|
94
|
-
background-color: #fff;
|
|
95
|
-
overflow-y: scroll;
|
|
96
|
-
height: calc(100% -
|
|
96
|
+
.table-content {
|
|
97
|
+
width: 100%;
|
|
98
|
+
background-color: #fff;
|
|
99
|
+
overflow-y: scroll;
|
|
100
|
+
height: calc(100% - 2rem);
|
|
97
101
|
@media(--tablet-until) {
|
|
98
102
|
height: 100%;
|
|
99
103
|
background: var(--base-grid-row-color);
|
|
100
104
|
}
|
|
101
105
|
&::-webkit-scrollbar {
|
|
102
|
-
width:
|
|
106
|
+
width: 0.5625rem;
|
|
103
107
|
background-color: transparent;
|
|
104
108
|
@media(--tablet-until) {
|
|
105
109
|
width: 0px;
|
|
@@ -121,11 +125,16 @@
|
|
|
121
125
|
grid-auto-flow: row;
|
|
122
126
|
grid-auto-rows: max-content;
|
|
123
127
|
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
&.without-table-header {
|
|
131
|
+
.table-content {
|
|
132
|
+
height: 100%;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
}
|
|
129
138
|
|
|
130
139
|
.btn-wrapper-section {
|
|
131
140
|
float: right;
|
|
@@ -134,8 +143,8 @@
|
|
|
134
143
|
align-items: center;
|
|
135
144
|
justify-content: center;
|
|
136
145
|
.btn {
|
|
137
|
-
width:
|
|
138
|
-
height:
|
|
146
|
+
width: 3rem;
|
|
147
|
+
height: 3rem;
|
|
139
148
|
cursor: pointer;
|
|
140
149
|
display: flex;
|
|
141
150
|
align-items: center;
|
|
@@ -144,19 +153,24 @@
|
|
|
144
153
|
transform: rotate(-146deg);
|
|
145
154
|
}
|
|
146
155
|
&.full-screen-button{
|
|
147
|
-
@container (max-width:
|
|
156
|
+
@container (max-width: 22.5rem) {
|
|
148
157
|
display: none;
|
|
149
158
|
}
|
|
150
159
|
}
|
|
151
|
-
svg {
|
|
152
|
-
height:
|
|
153
|
-
display: flex;
|
|
154
|
-
align-items: center;
|
|
155
|
-
justify-content: center;
|
|
156
|
-
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
+
svg {
|
|
161
|
+
height: 1.5rem;
|
|
162
|
+
display: flex;
|
|
163
|
+
align-items: center;
|
|
164
|
+
justify-content: center;
|
|
165
|
+
|
|
166
|
+
}
|
|
167
|
+
jb-refresh-icon,
|
|
168
|
+
jb-fullscreen-icon {
|
|
169
|
+
width: 1.5rem;
|
|
170
|
+
height: 1.5rem;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
160
174
|
.jb-grid-full-screen-container {
|
|
161
175
|
width: 100%;
|
|
162
176
|
height: 100%;
|
package/react/lib/types.ts
CHANGED
|
@@ -1,140 +1,43 @@
|
|
|
1
|
-
|
|
1
|
+
export type AnyObject = Record<string,any>
|
|
2
|
+
export type JBGridRowData<T extends AnyObject> = T;
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
// [key: keyof T]: any,
|
|
6
|
-
// jbGridDetail: {
|
|
7
|
-
// isDeleting: boolean,
|
|
8
|
-
// isDeleted: boolean,
|
|
9
|
-
// isRecovering: boolean,
|
|
10
|
-
// isExpanded: boolean
|
|
11
|
-
// }
|
|
12
|
-
// }
|
|
13
|
-
export type JBGridRowDataDetail = {
|
|
14
|
-
isDeleting: boolean,
|
|
15
|
-
isDeleted: boolean,
|
|
16
|
-
isRecovering: boolean,
|
|
17
|
-
isExpanded: boolean
|
|
18
|
-
}
|
|
19
|
-
export type JBGridRowDetail = { jbGridDetail: JBGridRowDataDetail };
|
|
20
|
-
export type AnyObject = Record<string,any>
|
|
21
|
-
export type JBGridStyles = {
|
|
22
|
-
table: {
|
|
23
|
-
generalCols: {
|
|
24
|
-
gridTemplateColumns: string,
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
fullWidthCol: {
|
|
28
|
-
gridColumn: string
|
|
29
|
-
},
|
|
30
|
-
scrollIndent: {
|
|
31
|
-
width: string
|
|
32
|
-
},
|
|
33
|
-
mainRowStyle: {
|
|
34
|
-
gridTemplateColumns: string,
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
searchBar: any,
|
|
38
|
-
contentWrapper: any
|
|
39
|
-
}
|
|
40
|
-
export type JBGridRowData<T extends AnyObject> = T & JBGridRowDetail;
|
|
41
|
-
|
|
42
|
-
export type JBGridResponseData<T extends AnyObject> = {
|
|
43
|
-
pageIndex: number,
|
|
4
|
+
export type JBGridResponseData<T extends AnyObject> = {
|
|
5
|
+
pageIndex: number,
|
|
44
6
|
startItemIndex: number,
|
|
45
7
|
endItemIndex: number,
|
|
46
8
|
totalItemsCount: number,
|
|
47
9
|
totalPages: number,
|
|
48
|
-
content: JBGridRowData<T>[],
|
|
49
|
-
}
|
|
50
|
-
export type
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
export interface JBGridBridgeInterface {
|
|
59
|
-
mapServerResponseDataToGridData: (data: any) => JBGridResponseData<any>,
|
|
60
|
-
getData: (data: JBGridConfigRequestParams, requestBody: any) => Promise<any>,
|
|
61
|
-
createRequestBody: (page: JBGridDataPage, filter?: JBSearchbarValue, sortColumn?: JBGridColumnDef | null, requestConfig?: JBGridConfigRequestParams) => any
|
|
62
|
-
}
|
|
63
|
-
// export interface JBGridBridgeClassInterface {
|
|
64
|
-
// new(): JBGridBridgeInterface
|
|
65
|
-
// }
|
|
66
|
-
type ClassBuilder<I, Args extends any[] = any[]> = new (...args: Args) => I;
|
|
67
|
-
|
|
68
|
-
export type JBGridBridgeClassInterface = ClassBuilder<JBGridBridgeInterface, []>;
|
|
69
|
-
//
|
|
70
|
-
export type JBGridDataPage = {
|
|
71
|
-
index: number,
|
|
72
|
-
size: number,
|
|
73
|
-
totalPages: number,
|
|
74
|
-
}
|
|
75
|
-
export type JBGridColumnDef = {
|
|
76
|
-
width?: string | number,
|
|
77
|
-
sort?: "ASC" | "DESC" | undefined,
|
|
78
|
-
sortable?: boolean,
|
|
79
|
-
id: number,
|
|
80
|
-
title: string,
|
|
81
|
-
name: string
|
|
82
|
-
}
|
|
83
|
-
export type JBGridConfigRequestParams = {
|
|
84
|
-
method?: "POST" | "GET",
|
|
85
|
-
url?: string,
|
|
86
|
-
//user can add any parameter needed to create request in his app
|
|
87
|
-
[key: string]: any
|
|
88
|
-
}
|
|
89
|
-
export type JBGridDataConfig<T extends AnyObject> = {
|
|
90
|
-
data: JBGridRowData<T>[],
|
|
91
|
-
//TODO: make it as a Generic type so user can standard it in whole app
|
|
92
|
-
requestParams: JBGridConfigRequestParams,
|
|
93
|
-
metaData: {
|
|
94
|
-
startItemIndex: number,
|
|
95
|
-
endItemIndex: number,
|
|
96
|
-
totalItemsCount: number
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
export type JBGridTableConfig = {
|
|
100
|
-
columns: JBGridColumnDef[]
|
|
101
|
-
}
|
|
102
|
-
export type JBGridConfigStates = {
|
|
103
|
-
headerSection: 'MAIN' | "SEARCH",
|
|
104
|
-
isFullScreen: boolean
|
|
105
|
-
}
|
|
106
|
-
export type JBGridCallbackConfig<T extends AnyObject> = {
|
|
107
|
-
onDataStandardizing: ((data: JBGridRowData<AnyObject>[]) => JBGridRowData<T>[]) | (<T extends AnyObject>(data: JBGridRowData<AnyObject>[]) => Promise<JBGridRowData<T>[]>) | null | undefined,
|
|
108
|
-
onPageIndexChange: ((newPageIndex: number) => unknown) | null | undefined
|
|
109
|
-
}
|
|
110
|
-
export type JBGridI18nMessage = {
|
|
111
|
-
serverErrorText?: string,
|
|
112
|
-
serverErrorTitle?: string,
|
|
10
|
+
content: JBGridRowData<T>[],
|
|
11
|
+
}
|
|
12
|
+
export type JBGridPaginationMeta = {
|
|
13
|
+
startItemIndex: number,
|
|
14
|
+
endItemIndex: number,
|
|
15
|
+
totalItemsCount: number
|
|
16
|
+
}
|
|
17
|
+
export type JBGridI18nMessage = {
|
|
18
|
+
serverErrorText?: string,
|
|
19
|
+
serverErrorTitle?: string,
|
|
113
20
|
serverErrorRefreshButtonTitle?: string,
|
|
114
21
|
EnterPageNumberMessage?: string,
|
|
115
22
|
currentAvailableItem?: string,
|
|
116
23
|
pageItemCount?:string,
|
|
117
24
|
from?:string
|
|
118
25
|
}
|
|
119
|
-
export type JBGridI18nConfig = {
|
|
120
|
-
messages?: JBGridI18nMessage,
|
|
121
|
-
showPersianNumber?: boolean
|
|
122
|
-
}
|
|
123
|
-
export type
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}
|
|
137
|
-
export type JBGridConfig<T extends AnyObject> = JBGridConfigInterface<T>;
|
|
138
|
-
export type JBGridCallbacks = {
|
|
139
|
-
onFullscreenChange: (isFullscreen: boolean) => void
|
|
140
|
-
}
|
|
26
|
+
export type JBGridI18nConfig = {
|
|
27
|
+
messages?: JBGridI18nMessage,
|
|
28
|
+
showPersianNumber?: boolean
|
|
29
|
+
}
|
|
30
|
+
export type JBGridRenderContext = Readonly<{
|
|
31
|
+
refreshView: () => void
|
|
32
|
+
}>
|
|
33
|
+
export type JBGridCallbacks = {
|
|
34
|
+
/**
|
|
35
|
+
* @deprecated use onFullscreen and onExitFullscreen instead
|
|
36
|
+
*/
|
|
37
|
+
onFullscreenChange?: (isFullscreen: boolean) => unknown,
|
|
38
|
+
onFullscreen?: () => unknown,
|
|
39
|
+
onPageIndexChange?: (newPageIndex: number) => unknown,
|
|
40
|
+
onPageSizeChange?: (newPageSize: number) => unknown,
|
|
41
|
+
onRefresh?: () => unknown | Promise<unknown>,
|
|
42
|
+
onExitFullscreen?: () => unknown
|
|
43
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
.jb-grid-wrapper {
|
|
2
|
+
/* Theme/Color */
|
|
3
|
+
--loading-color: var(--jb-grid-loading-color, var(--jb-primary));
|
|
4
|
+
--footer-icon-fill-color-hover: var(--jb-grid-footer-icon-fill-color-hover, var(--jb-neutral-2));
|
|
5
|
+
--page-color-active: var(--jb-grid-page-color-active, var(--jb-primary));
|
|
6
|
+
}
|
package/react/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jb-grid-react",
|
|
3
|
-
"description": "react
|
|
3
|
+
"description": "react jb grid table",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "mohammad javad bathaei",
|
|
@@ -12,9 +12,8 @@
|
|
|
12
12
|
"jb-grid react",
|
|
13
13
|
"grid",
|
|
14
14
|
"table",
|
|
15
|
-
"react table",
|
|
16
|
-
"react"
|
|
17
|
-
"mobx"
|
|
15
|
+
"react table",
|
|
16
|
+
"react"
|
|
18
17
|
],
|
|
19
18
|
"version": "0.25.0",
|
|
20
19
|
"bugs": "https://github.com/javadbat/jb-grid/issues",
|
|
@@ -29,9 +28,14 @@
|
|
|
29
28
|
"main": "index.js",
|
|
30
29
|
"types": "./dist/JBGrid.d.ts",
|
|
31
30
|
"jsnext:main":"index.js",
|
|
32
|
-
"module": "index.js",
|
|
33
|
-
"repository": {
|
|
34
|
-
"type": "git",
|
|
35
|
-
"url": "git@github.com:javadbat/jb-grid.git"
|
|
36
|
-
}
|
|
37
|
-
|
|
31
|
+
"module": "index.js",
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "git@github.com:javadbat/jb-grid.git"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"jb-button": ">=3.8.0",
|
|
38
|
+
"jb-core": ">=0.28.0",
|
|
39
|
+
"jb-grid": ">=0.4.1"
|
|
40
|
+
}
|
|
41
|
+
}
|
package/react/tsconfig.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
3
|
|
|
4
|
-
"rootDir": "./lib",
|
|
5
|
-
"declaration": true,
|
|
6
|
-
"declarationDir": "./dist"
|
|
4
|
+
"rootDir": "./lib",
|
|
5
|
+
"declaration": true,
|
|
6
|
+
"declarationDir": "./dist",
|
|
7
|
+
"skipLibCheck": true
|
|
7
8
|
},
|
|
8
9
|
"include": [
|
|
9
10
|
"lib/**/*.ts",
|
|
@@ -15,4 +16,4 @@
|
|
|
15
16
|
"dist",
|
|
16
17
|
],
|
|
17
18
|
"extends":"jb-core/configs/tsconfig-react.json"
|
|
18
|
-
}
|
|
19
|
+
}
|