@uxf/data-grid 4.0.0 → 5.0.0-beta.10
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/DataGrid.d.ts +1 -0
- package/DataGrid.js +52 -51
- package/{useCallbackRef.d.ts → hooks/useCallbackRef.d.ts} +2 -1
- package/{useCallbackRef.js → hooks/useCallbackRef.js} +1 -1
- package/{useColumns.d.ts → hooks/useColumns.d.ts} +1 -1
- package/hooks/useColumns.js +116 -0
- package/icons-config/index.js +62 -0
- package/index.d.ts +1 -1
- package/index.js +7 -3
- package/package.json +20 -17
- package/store/actions.d.ts +43 -41
- package/store/actions.js +46 -48
- package/store/reducer.d.ts +1 -1
- package/store/reducer.js +2 -2
- package/tailwindui/DataGrid.d.ts +2 -2
- package/tailwindui/DataGrid.js +8 -16
- package/tailwindui/body-cell/body-cell-boolean.d.ts +2 -0
- package/tailwindui/body-cell/body-cell-boolean.js +17 -0
- package/tailwindui/body-cell/body-cell-date.d.ts +2 -0
- package/tailwindui/body-cell/body-cell-date.js +16 -0
- package/tailwindui/body-cell/body-cell-datetime.d.ts +2 -0
- package/tailwindui/body-cell/body-cell-datetime.js +16 -0
- package/tailwindui/body-cell/body-cell-default.d.ts +2 -0
- package/tailwindui/body-cell/body-cell-default.js +18 -0
- package/tailwindui/body-cell/body-cell-email.d.ts +2 -0
- package/tailwindui/body-cell/body-cell-email.js +17 -0
- package/tailwindui/body-cell/body-cell-phone.d.ts +2 -0
- package/tailwindui/body-cell/body-cell-phone.js +17 -0
- package/tailwindui/body-cell/body-cell-to-many.d.ts +2 -0
- package/tailwindui/body-cell/body-cell-to-many.js +18 -0
- package/tailwindui/body-cell/body-cell-to-one.d.ts +2 -0
- package/tailwindui/body-cell/body-cell-to-one.js +15 -0
- package/tailwindui/body-cell/body-cell-url.d.ts +2 -0
- package/tailwindui/body-cell/body-cell-url.js +17 -0
- package/tailwindui/body-cell/index.d.ts +2 -0
- package/tailwindui/body-cell/index.js +24 -0
- package/tailwindui/components/action-cell-base.d.ts +2 -2
- package/tailwindui/components/action-cell-base.js +20 -22
- package/tailwindui/components/container.js +4 -10
- package/tailwindui/components/drawer.js +11 -11
- package/tailwindui/components/filter-list.d.ts +2 -0
- package/tailwindui/components/filter-list.js +32 -0
- package/tailwindui/components/footer.d.ts +2 -0
- package/tailwindui/components/footer.js +13 -0
- package/tailwindui/components/linear-progress.js +4 -2
- package/tailwindui/components/no-rows-fallback.js +6 -3
- package/tailwindui/components/pagination-counts.d.ts +2 -0
- package/tailwindui/components/pagination-counts.js +19 -0
- package/tailwindui/components/pagination-rows-per-page-select.d.ts +2 -0
- package/tailwindui/components/pagination-rows-per-page-select.js +21 -0
- package/tailwindui/components/select-row-checkbox.js +7 -3
- package/tailwindui/components/selected-rows-toolbar.js +9 -11
- package/tailwindui/components/toolbar-control.d.ts +2 -0
- package/tailwindui/components/toolbar-control.js +82 -0
- package/tailwindui/components/toolbar-customs.d.ts +2 -0
- package/tailwindui/components/toolbar-customs.js +14 -0
- package/tailwindui/components/toolbar-tabs.d.ts +2 -0
- package/tailwindui/components/toolbar-tabs.js +20 -0
- package/tailwindui/components/toolbar.d.ts +2 -0
- package/tailwindui/components/toolbar.js +14 -0
- package/tailwindui/filter-handler/boolean-filter.d.ts +3 -0
- package/tailwindui/filter-handler/boolean-filter.js +32 -0
- package/tailwindui/filter-handler/index.d.ts +2 -0
- package/tailwindui/filter-handler/index.js +18 -0
- package/tailwindui/filter-handler/interval-filter.d.ts +3 -0
- package/tailwindui/filter-handler/interval-filter.js +50 -0
- package/tailwindui/filter-handler/select-filter.d.ts +3 -0
- package/tailwindui/filter-handler/select-filter.js +33 -0
- package/tailwindui/filter-handler/text-filter.d.ts +3 -0
- package/tailwindui/filter-handler/text-filter.js +36 -0
- package/tailwindui/index.d.ts +0 -4
- package/tailwindui/index.js +6 -6
- package/tailwindui/show.d.ts +7 -0
- package/tailwindui/show.js +35 -0
- package/tailwindui/styles.css +215 -32
- package/tailwindui/ui.js +23 -16
- package/types/api.d.ts +22 -0
- package/{types.js → types/api.js} +1 -1
- package/types/components.d.ts +184 -0
- package/types/components.js +3 -0
- package/types/core.d.ts +75 -0
- package/types/core.js +3 -0
- package/types/index.d.ts +5 -0
- package/types/index.js +22 -0
- package/types/schema.d.ts +48 -0
- package/types/schema.js +3 -0
- package/types/state.d.ts +21 -0
- package/types/state.js +3 -0
- package/utils.d.ts +3 -0
- package/utils.js +57 -2
- package/tailwindui/components/badge.d.ts +0 -5
- package/tailwindui/components/badge.js +0 -18
- package/tailwindui/components/body-cell-base.d.ts +0 -2
- package/tailwindui/components/body-cell-base.js +0 -23
- package/tailwindui/components/body-cell-wrapper.d.ts +0 -8
- package/tailwindui/components/body-cell-wrapper.js +0 -14
- package/tailwindui/components/circle-button.d.ts +0 -10
- package/tailwindui/components/circle-button.js +0 -15
- package/tailwindui/components/filter-input-base.d.ts +0 -2
- package/tailwindui/components/filter-input-base.js +0 -30
- package/tailwindui/components/filter-list-item-base.d.ts +0 -2
- package/tailwindui/components/filter-list-item-base.js +0 -34
- package/tailwindui/components/filters-list.d.ts +0 -2
- package/tailwindui/components/filters-list.js +0 -23
- package/tailwindui/components/icons/chevron-double-left.d.ts +0 -2
- package/tailwindui/components/icons/chevron-double-left.js +0 -13
- package/tailwindui/components/icons/chevron-double-right.d.ts +0 -2
- package/tailwindui/components/icons/chevron-double-right.js +0 -13
- package/tailwindui/components/icons/chevron-left.d.ts +0 -2
- package/tailwindui/components/icons/chevron-left.js +0 -13
- package/tailwindui/components/icons/chevron-right.d.ts +0 -2
- package/tailwindui/components/icons/chevron-right.js +0 -13
- package/tailwindui/components/icons/cloud-download.d.ts +0 -2
- package/tailwindui/components/icons/cloud-download.js +0 -13
- package/tailwindui/components/icons/edit.d.ts +0 -2
- package/tailwindui/components/icons/edit.js +0 -13
- package/tailwindui/components/icons/filter.d.ts +0 -2
- package/tailwindui/components/icons/filter.js +0 -13
- package/tailwindui/components/icons/open.d.ts +0 -2
- package/tailwindui/components/icons/open.js +0 -13
- package/tailwindui/components/icons/table.d.ts +0 -2
- package/tailwindui/components/icons/table.js +0 -13
- package/tailwindui/components/icons/trash.d.ts +0 -2
- package/tailwindui/components/icons/trash.js +0 -13
- package/tailwindui/components/inputs/checkbox.d.ts +0 -10
- package/tailwindui/components/inputs/checkbox.js +0 -23
- package/tailwindui/components/inputs/select.d.ts +0 -14
- package/tailwindui/components/inputs/select.js +0 -21
- package/tailwindui/components/inputs/switch.d.ts +0 -7
- package/tailwindui/components/inputs/switch.js +0 -21
- package/tailwindui/components/inputs/text-input.d.ts +0 -7
- package/tailwindui/components/inputs/text-input.js +0 -18
- package/tailwindui/components/pagination.d.ts +0 -2
- package/tailwindui/components/pagination.js +0 -56
- package/tailwindui/components/tab.d.ts +0 -6
- package/tailwindui/components/tab.js +0 -16
- package/tailwindui/components/toolbar-container.d.ts +0 -2
- package/tailwindui/components/toolbar-container.js +0 -13
- package/tailwindui/toolbar-plugins/csv-export-plugin.d.ts +0 -2
- package/tailwindui/toolbar-plugins/csv-export-plugin.js +0 -20
- package/tailwindui/toolbar-plugins/filters-plugin.d.ts +0 -2
- package/tailwindui/toolbar-plugins/filters-plugin.js +0 -60
- package/tailwindui/toolbar-plugins/fulltext-plugin.d.ts +0 -2
- package/tailwindui/toolbar-plugins/fulltext-plugin.js +0 -72
- package/tailwindui/toolbar-plugins/hidden-columns-plugin.d.ts +0 -2
- package/tailwindui/toolbar-plugins/hidden-columns-plugin.js +0 -76
- package/tailwindui/toolbar-plugins/tabs-plugin.d.ts +0 -2
- package/tailwindui/toolbar-plugins/tabs-plugin.js +0 -21
- package/tailwindui/toolbar-plugins/title-plugin.d.ts +0 -2
- package/tailwindui/toolbar-plugins/title-plugin.js +0 -16
- package/types.d.ts +0 -270
- package/useColumns.js +0 -102
package/tailwindui/index.d.ts
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
1
|
export * from "./DataGrid";
|
|
2
2
|
export * from "./components/action-cell-base";
|
|
3
|
-
export * from "./components/body-cell-base";
|
|
4
|
-
export * from "./components/body-cell-wrapper";
|
|
5
|
-
export * from "./components/filter-input-base";
|
|
6
|
-
export * from "./components/filter-list-item-base";
|
|
7
3
|
export * from "./ui";
|
package/tailwindui/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -12,9 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
12
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
17
|
__exportStar(require("./DataGrid"), exports);
|
|
14
18
|
__exportStar(require("./components/action-cell-base"), exports);
|
|
15
|
-
__exportStar(require("./components/body-cell-base"), exports);
|
|
16
|
-
__exportStar(require("./components/body-cell-wrapper"), exports);
|
|
17
|
-
__exportStar(require("./components/filter-input-base"), exports);
|
|
18
|
-
__exportStar(require("./components/filter-list-item-base"), exports);
|
|
19
19
|
__exportStar(require("./ui"), exports);
|
|
20
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
20
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdGFpbHdpbmR1aS9pbmRleC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLDZDQUEyQjtBQUMzQixnRUFBOEM7QUFDOUMsdUNBQXFCIn0=
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.Show = void 0;
|
|
27
|
+
var react_1 = __importStar(require("react"));
|
|
28
|
+
var Show = function (props) {
|
|
29
|
+
if (!props.when) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
return react_1.default.createElement(react_1.Fragment, null, props.children);
|
|
33
|
+
};
|
|
34
|
+
exports.Show = Show;
|
|
35
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2hvdy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90YWlsd2luZHVpL3Nob3cudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsNkNBQW1EO0FBTzVDLElBQU0sSUFBSSxHQUF3QixVQUFBLEtBQUs7SUFDMUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxJQUFJLEVBQUU7UUFBQyxPQUFPLElBQUksQ0FBQztLQUFDO0lBRS9CLE9BQU8sOEJBQUMsZ0JBQVEsUUFBRSxLQUFLLENBQUMsUUFBUSxDQUFZLENBQUM7QUFDakQsQ0FBQyxDQUFDO0FBSlcsUUFBQSxJQUFJLFFBSWYifQ==
|
package/tailwindui/styles.css
CHANGED
|
@@ -1,3 +1,211 @@
|
|
|
1
|
+
.uxf-data-grid {
|
|
2
|
+
@apply border border-gray-300 rounded;
|
|
3
|
+
|
|
4
|
+
&.no-border {
|
|
5
|
+
@apply border-0;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.uxf-icon {
|
|
9
|
+
@apply text-gray-400;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
&__action-cell {
|
|
13
|
+
@apply bg-white sticky right-0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&__action-cell-wrapper {
|
|
17
|
+
@apply flex items-center justify-center text-center w-full h-full space-x-2;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&__body-cell {
|
|
21
|
+
&--boolean {
|
|
22
|
+
@apply w-full h-full flex items-center;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&__cell {
|
|
27
|
+
@apply bg-transparent;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&__drawer {
|
|
31
|
+
@apply fixed overflow-hidden z-10 bg-gray-900 bg-opacity-25 inset-0 transform ease-in-out;
|
|
32
|
+
|
|
33
|
+
&--open {
|
|
34
|
+
@apply transition-opacity opacity-100 duration-500 translate-x-0;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&--closed {
|
|
38
|
+
@apply transition-all delay-500 opacity-0 translate-x-full;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&-body-wrapper {
|
|
42
|
+
@apply w-11/12 max-w-sm right-0 absolute bg-white h-full shadow-xl duration-500 ease-in-out transition-all transform translate-x-full;
|
|
43
|
+
|
|
44
|
+
&--open {
|
|
45
|
+
@apply translate-x-0;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&-body {
|
|
50
|
+
@apply relative w-full max-w-sm pb-10 flex flex-col overflow-y-scroll h-full;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&-close-button {
|
|
54
|
+
@apply ml-auto !mt-4 mr-4;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&-header {
|
|
58
|
+
@apply p-4 pt-8 font-bold text-lg;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&-content {
|
|
62
|
+
@apply p-4;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&-backdrop {
|
|
66
|
+
@apply w-screen h-full cursor-pointer;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&__fallback {
|
|
71
|
+
grid-column: 1/-1;
|
|
72
|
+
|
|
73
|
+
@apply flex items-center justify-center text-center text-gray-600;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&__filter {
|
|
77
|
+
&--interval {
|
|
78
|
+
@apply gap-4 grid grid-cols-[1fr_min-content_1fr];
|
|
79
|
+
|
|
80
|
+
.uxf-data-grid__filter-gap {
|
|
81
|
+
@apply flex items-center pt-5;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&__filters {
|
|
87
|
+
@apply space-y-4;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&__filter-list {
|
|
91
|
+
@apply p-2;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&__footer {
|
|
95
|
+
@apply flex flex-wrap items-center justify-end p-2 gap-4;
|
|
96
|
+
|
|
97
|
+
&.no-border {
|
|
98
|
+
@apply px-0;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&__linear-progress {
|
|
103
|
+
position: absolute;
|
|
104
|
+
z-index: 1;
|
|
105
|
+
left: 0;
|
|
106
|
+
right: 0;
|
|
107
|
+
overflow: hidden;
|
|
108
|
+
height: 3px;
|
|
109
|
+
-webkit-border-radius: 20px;
|
|
110
|
+
-moz-border-radius: 20px;
|
|
111
|
+
border-radius: 20px;
|
|
112
|
+
|
|
113
|
+
&.is-loading:before {
|
|
114
|
+
content: "";
|
|
115
|
+
position: absolute;
|
|
116
|
+
left: -50%;
|
|
117
|
+
height: 3px;
|
|
118
|
+
width: 40%;
|
|
119
|
+
background-color: #FF4F06;
|
|
120
|
+
-webkit-animation: datagridLineAnim 1s linear infinite;
|
|
121
|
+
-moz-animation: datagridLineAnim 1s linear infinite;
|
|
122
|
+
animation: datagridLineAnim 1s linear infinite;
|
|
123
|
+
-webkit-border-radius: 20px;
|
|
124
|
+
-moz-border-radius: 20px;
|
|
125
|
+
border-radius: 20px;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
&__linear-progress-wrapper {
|
|
130
|
+
@apply relative;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
&__pagination-counts {
|
|
134
|
+
@apply text-sm text-neutral-700 text-lightLow;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
&__plugin-fulltext {
|
|
138
|
+
@apply text-gray-400;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
&__plugin-filter {
|
|
142
|
+
@apply shrink-0;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
&__rows-per-page {
|
|
146
|
+
@apply flex flex-wrap gap-2 text-sm text-gray-700 items-center text-lightLow;
|
|
147
|
+
|
|
148
|
+
.uxf-select {
|
|
149
|
+
@apply w-28;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
&__select-row-checkbox {
|
|
154
|
+
@apply form-checkbox focus:ring-0 checked:bg-dataGridSecondary focus:checked:bg-dataGridSecondary active:bg-dataGridSecondary h-4 w-4 border-gray-300 rounded;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
&__selected-rows-toolbar-wrapper {
|
|
158
|
+
@apply fixed bottom-8 left-0 right-0 flex flex-row justify-center items-center;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
&__selected-rows-toolbar {
|
|
162
|
+
@apply text-white text-sm bg-dataGridPrimary rounded-full px-6 py-2 flex items-center justify-center drop-shadow-xl border border-gray-100;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
&__selected-rows-toolbar-actions {
|
|
166
|
+
@apply pl-4 space-x-2;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
&__table {
|
|
170
|
+
@apply bg-transparent rounded-none;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
&__toolbar {
|
|
174
|
+
@apply flex items-center justify-end space-x-2 border-b border-b-gray-300 px-2;
|
|
175
|
+
|
|
176
|
+
.uxf-button {
|
|
177
|
+
@apply my-2;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
&__toolbar-tab {
|
|
182
|
+
@apply inline-flex items-center hover:text-gray-700 whitespace-nowrap py-1 px-1 border-b-2 font-medium text-sm border-transparent text-gray-500 hover:text-gray-700;
|
|
183
|
+
|
|
184
|
+
&.is-active {
|
|
185
|
+
@apply border-dataGridPrimary text-dataGridPrimary;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
&__toolbar-tabs {
|
|
190
|
+
@apply flex flex-1 self-stretch;
|
|
191
|
+
|
|
192
|
+
&-nav {
|
|
193
|
+
@apply -mb-px flex space-x-4;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
&__toolbar-control {
|
|
198
|
+
@apply flex flex-row items-center gap-2;
|
|
199
|
+
|
|
200
|
+
&--custom {
|
|
201
|
+
@apply overflow-auto;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
|
|
1
209
|
.rdg-cell.action {
|
|
2
210
|
text-align: right;
|
|
3
211
|
border-right: 0;
|
|
@@ -9,12 +217,11 @@
|
|
|
9
217
|
right: 0;
|
|
10
218
|
}
|
|
11
219
|
.rdg-header-row {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
.rdg-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
color: #252525;
|
|
220
|
+
@apply bg-gray-200 text-gray-400 font-medium;
|
|
221
|
+
|
|
222
|
+
.rdg-cell {
|
|
223
|
+
@apply rounded-none bg-gray-50;
|
|
224
|
+
}
|
|
18
225
|
}
|
|
19
226
|
.rdg-header-sort-name + span {
|
|
20
227
|
display: flex;
|
|
@@ -22,9 +229,10 @@
|
|
|
22
229
|
}
|
|
23
230
|
.rdg-cell.rdg-cell-frozen {
|
|
24
231
|
box-shadow: none;
|
|
232
|
+
background: transparent;
|
|
25
233
|
}
|
|
26
234
|
.rdg-cell[aria-selected=true] {
|
|
27
|
-
outline-color: #
|
|
235
|
+
outline-color: #060C0C;
|
|
28
236
|
}
|
|
29
237
|
.rdg-row[aria-selected=true] {
|
|
30
238
|
background-color: rgba(255,79,6,0.05);
|
|
@@ -32,31 +240,6 @@
|
|
|
32
240
|
.rdg-row[aria-selected=true]:hover {
|
|
33
241
|
background-color: rgba(255,79,6,0.1);
|
|
34
242
|
}
|
|
35
|
-
.datagrid-linear-progress {
|
|
36
|
-
width: 100%;
|
|
37
|
-
height: 3px;
|
|
38
|
-
position: relative;
|
|
39
|
-
overflow: hidden;
|
|
40
|
-
background-color: white;
|
|
41
|
-
-webkit-border-radius: 20px;
|
|
42
|
-
-moz-border-radius: 20px;
|
|
43
|
-
border-radius: 20px;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.datagrid-linear-progress.loading:before {
|
|
47
|
-
content: "";
|
|
48
|
-
position: absolute;
|
|
49
|
-
left: -50%;
|
|
50
|
-
height: 3px;
|
|
51
|
-
width: 40%;
|
|
52
|
-
background-color: #FF4F06;
|
|
53
|
-
-webkit-animation: datagridLineAnim 1s linear infinite;
|
|
54
|
-
-moz-animation: datagridLineAnim 1s linear infinite;
|
|
55
|
-
animation: datagridLineAnim 1s linear infinite;
|
|
56
|
-
-webkit-border-radius: 20px;
|
|
57
|
-
-moz-border-radius: 20px;
|
|
58
|
-
border-radius: 20px;
|
|
59
|
-
}
|
|
60
243
|
|
|
61
244
|
@keyframes datagridLineAnim {
|
|
62
245
|
0% {
|
package/tailwindui/ui.js
CHANGED
|
@@ -2,31 +2,38 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UI = void 0;
|
|
4
4
|
var action_cell_base_1 = require("./components/action-cell-base");
|
|
5
|
-
var body_cell_base_1 = require("./components/body-cell-base");
|
|
6
5
|
var no_rows_fallback_1 = require("./components/no-rows-fallback");
|
|
7
6
|
var linear_progress_1 = require("./components/linear-progress");
|
|
8
|
-
var
|
|
7
|
+
var toolbar_1 = require("./components/toolbar");
|
|
9
8
|
var container_1 = require("./components/container");
|
|
10
|
-
var
|
|
11
|
-
var filter_list_item_base_1 = require("./components/filter-list-item-base");
|
|
12
|
-
var filters_list_1 = require("./components/filters-list");
|
|
13
|
-
var pagination_1 = require("./components/pagination");
|
|
9
|
+
var filter_list_1 = require("./components/filter-list");
|
|
14
10
|
var select_row_checkbox_1 = require("./components/select-row-checkbox");
|
|
15
11
|
var selected_rows_toolbar_1 = require("./components/selected-rows-toolbar");
|
|
12
|
+
var pagination_counts_1 = require("./components/pagination-counts");
|
|
13
|
+
var pagination_rows_per_page_select_1 = require("./components/pagination-rows-per-page-select");
|
|
14
|
+
var pagination_1 = require("@uxf/ui/pagination/pagination");
|
|
15
|
+
var filter_handler_1 = require("./filter-handler");
|
|
16
|
+
var toolbar_tabs_1 = require("./components/toolbar-tabs");
|
|
17
|
+
var toolbar_control_1 = require("./components/toolbar-control");
|
|
18
|
+
var toolbar_customs_1 = require("./components/toolbar-customs");
|
|
19
|
+
var body_cell_1 = require("./body-cell");
|
|
16
20
|
exports.UI = {
|
|
17
21
|
ActionCell: action_cell_base_1.ActionCellBase,
|
|
18
|
-
actionCellWidth:
|
|
19
|
-
|
|
20
|
-
BodyCell: body_cell_base_1.BodyCellBase,
|
|
21
|
-
NoRowsFallback: no_rows_fallback_1.NoRowsFallback,
|
|
22
|
-
LinearProgress: linear_progress_1.LinearProgress,
|
|
23
|
-
ToolbarContainer: toolbar_container_1.ToolbarContainer,
|
|
22
|
+
actionCellWidth: 128,
|
|
23
|
+
BodyCells: body_cell_1.BodyCells,
|
|
24
24
|
Container: container_1.Container,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
FilterHandlers: filter_handler_1.defaultFilterHandlers,
|
|
26
|
+
FilterList: filter_list_1.FilterList,
|
|
27
|
+
LinearProgress: linear_progress_1.LinearProgress,
|
|
28
|
+
NoRowsFallback: no_rows_fallback_1.NoRowsFallback,
|
|
28
29
|
Pagination: pagination_1.Pagination,
|
|
30
|
+
PaginationCounts: pagination_counts_1.PaginationCounts,
|
|
31
|
+
PaginationRowsPerPageSelect: pagination_rows_per_page_select_1.PaginationRowsPerPageSelect,
|
|
29
32
|
SelectRowCheckbox: select_row_checkbox_1.SelectRowCheckbox,
|
|
30
33
|
SelectedRowsToolbar: selected_rows_toolbar_1.SelectedRowsToolbar,
|
|
34
|
+
Toolbar: toolbar_1.Toolbar,
|
|
35
|
+
ToolbarControl: toolbar_control_1.ToolbarControl,
|
|
36
|
+
ToolbarCustoms: toolbar_customs_1.ToolbarCustoms,
|
|
37
|
+
ToolbarTabs: toolbar_tabs_1.ToolbarTabs,
|
|
31
38
|
};
|
|
32
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
39
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidWkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdGFpbHdpbmR1aS91aS50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQ0Esa0VBQStEO0FBQy9ELGtFQUErRDtBQUMvRCxnRUFBOEQ7QUFDOUQsZ0RBQStDO0FBQy9DLG9EQUFtRDtBQUNuRCx3REFBc0Q7QUFDdEQsd0VBQXFFO0FBQ3JFLDRFQUF5RTtBQUN6RSxvRUFBa0U7QUFDbEUsZ0dBQTJGO0FBQzNGLDREQUEyRDtBQUMzRCxtREFBeUQ7QUFDekQsMERBQXdEO0FBQ3hELGdFQUE4RDtBQUM5RCxnRUFBOEQ7QUFDOUQseUNBQXdDO0FBRTNCLFFBQUEsRUFBRSxHQUEyQjtJQUN0QyxVQUFVLEVBQUUsaUNBQWM7SUFDMUIsZUFBZSxFQUFFLEdBQUc7SUFDcEIsU0FBUyxFQUFFLHFCQUFTO0lBQ3BCLFNBQVMsRUFBRSxxQkFBUztJQUNwQixjQUFjLEVBQUUsc0NBQXFCO0lBQ3JDLFVBQVUsRUFBRSx3QkFBVTtJQUN0QixjQUFjLEVBQUUsZ0NBQWM7SUFDOUIsY0FBYyxFQUFFLGlDQUFjO0lBQzlCLFVBQVUsRUFBRSx1QkFBVTtJQUN0QixnQkFBZ0IsRUFBRSxvQ0FBZ0I7SUFDbEMsMkJBQTJCLEVBQUUsNkRBQTJCO0lBQ3hELGlCQUFpQixFQUFFLHVDQUFpQjtJQUNwQyxtQkFBbUIsRUFBRSwyQ0FBbUI7SUFDeEMsT0FBTyxFQUFFLGlCQUFPO0lBQ2hCLGNBQWMsRUFBRSxnQ0FBYztJQUM5QixjQUFjLEVBQUUsZ0NBQWM7SUFDOUIsV0FBVyxFQUFFLDBCQUFXO0NBQzNCLENBQUMifQ==
|
package/types/api.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SortDirection } from "./schema";
|
|
2
|
+
export declare type ResultItem = any;
|
|
3
|
+
export interface RequestFilter<T = any> {
|
|
4
|
+
name: string;
|
|
5
|
+
value: T;
|
|
6
|
+
label?: string;
|
|
7
|
+
op?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface Request {
|
|
10
|
+
f?: RequestFilter[];
|
|
11
|
+
sort?: string;
|
|
12
|
+
dir?: SortDirection;
|
|
13
|
+
page?: number;
|
|
14
|
+
perPage?: number;
|
|
15
|
+
search?: string;
|
|
16
|
+
tab?: string | null;
|
|
17
|
+
}
|
|
18
|
+
export interface Response {
|
|
19
|
+
totalCount: number;
|
|
20
|
+
count: number;
|
|
21
|
+
result: ResultItem[];
|
|
22
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXBpLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3R5cGVzL2FwaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIn0=
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import React, { ComponentType, FC, ReactElement, ReactNode } from "react";
|
|
2
|
+
import { BaseGridType, Columns, Filter, Filters, Schema } from "./schema";
|
|
3
|
+
import { RequestFilter, Response } from "./api";
|
|
4
|
+
import { PaginationProps } from "@uxf/ui/pagination/pagination";
|
|
5
|
+
import { CheckboxFormatterProps } from "react-data-grid";
|
|
6
|
+
import { ChangeHiddenColumnsHandler } from "./core";
|
|
7
|
+
/**
|
|
8
|
+
* Action cell
|
|
9
|
+
*/
|
|
10
|
+
export interface ActionCellProps<R> {
|
|
11
|
+
row: R;
|
|
12
|
+
onOpen?: (row: R) => void;
|
|
13
|
+
getOpenUrl?: (row: R) => string | null | undefined;
|
|
14
|
+
onEdit?: (row: R) => void;
|
|
15
|
+
getEditUrl?: (row: R) => string | null | undefined;
|
|
16
|
+
onRemove?: (row: R) => void;
|
|
17
|
+
reload: () => Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
export declare type ActionCellComponent<R> = FC<ActionCellProps<R>>;
|
|
20
|
+
/**
|
|
21
|
+
* Body cell
|
|
22
|
+
*/
|
|
23
|
+
export interface BodyCellProps<C, R> {
|
|
24
|
+
value: any;
|
|
25
|
+
column: C;
|
|
26
|
+
row: R;
|
|
27
|
+
reload: () => Promise<void>;
|
|
28
|
+
}
|
|
29
|
+
export declare type BodyCellComponent<C extends BaseGridType["columns"], R> = ComponentType<BodyCellProps<Columns<C>, R>>;
|
|
30
|
+
export declare type BodyCellComponents<C, R> = {
|
|
31
|
+
[key: string]: BodyCellComponent<C, R>;
|
|
32
|
+
default: BodyCellComponent<C, R>;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Container
|
|
36
|
+
*/
|
|
37
|
+
export interface ContainerProps {
|
|
38
|
+
noBorder?: boolean;
|
|
39
|
+
children: ReactNode;
|
|
40
|
+
className?: string;
|
|
41
|
+
}
|
|
42
|
+
export declare type ContainerComponent = FC<ContainerProps>;
|
|
43
|
+
/**
|
|
44
|
+
* Filter list
|
|
45
|
+
*/
|
|
46
|
+
export interface FilterListProps<F extends Filter<any, any>, T> {
|
|
47
|
+
gridName?: string;
|
|
48
|
+
filters: F[];
|
|
49
|
+
filtersData: RequestFilter<T>[];
|
|
50
|
+
onFilter: (value: RequestFilter<T>) => void;
|
|
51
|
+
filterHandlers: FilterHandlers;
|
|
52
|
+
noBorder: boolean | null | undefined;
|
|
53
|
+
}
|
|
54
|
+
export declare type FilterListComponent<F extends BaseGridType["filters"], T = any> = ComponentType<FilterListProps<Filters<F>, T>>;
|
|
55
|
+
/**
|
|
56
|
+
* Filters
|
|
57
|
+
*/
|
|
58
|
+
export interface FilterProps<F extends Filter<any, any>, T> {
|
|
59
|
+
gridName?: string;
|
|
60
|
+
filter: F;
|
|
61
|
+
value: RequestFilter<T>;
|
|
62
|
+
onFilter: (value: RequestFilter<T>) => void;
|
|
63
|
+
onClear: () => void;
|
|
64
|
+
}
|
|
65
|
+
export declare type FilterComponent<F extends BaseGridType["filters"], T = any> = ComponentType<FilterProps<Filters<F>, T>>;
|
|
66
|
+
export interface FilterHandler {
|
|
67
|
+
input: FilterComponent<any>;
|
|
68
|
+
listItem: FilterComponent<any>;
|
|
69
|
+
}
|
|
70
|
+
export interface FilterHandlers {
|
|
71
|
+
[kex: string]: FilterHandler;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Footer
|
|
75
|
+
*/
|
|
76
|
+
export interface FooterProps {
|
|
77
|
+
children: ReactNode;
|
|
78
|
+
noBorder?: boolean;
|
|
79
|
+
}
|
|
80
|
+
export declare type FooterComponent = FC<FooterProps>;
|
|
81
|
+
/**
|
|
82
|
+
* Linear progress
|
|
83
|
+
*/
|
|
84
|
+
export interface LinearProgressProps {
|
|
85
|
+
loading: boolean;
|
|
86
|
+
}
|
|
87
|
+
export declare type LinearProgressComponent = FC<LinearProgressProps>;
|
|
88
|
+
/**
|
|
89
|
+
* No rows fallback
|
|
90
|
+
*/
|
|
91
|
+
export interface NoRowsFallbackProps {
|
|
92
|
+
error?: any;
|
|
93
|
+
loading: boolean;
|
|
94
|
+
}
|
|
95
|
+
export declare type NoRowsFallbackComponent = React.FC<NoRowsFallbackProps>;
|
|
96
|
+
/**
|
|
97
|
+
* Pagination
|
|
98
|
+
*/
|
|
99
|
+
export declare type PaginationComponent = React.FC<PaginationProps>;
|
|
100
|
+
/**
|
|
101
|
+
* Pagination rows per page select
|
|
102
|
+
*/
|
|
103
|
+
export interface PaginationRowsPerPageSelectProps {
|
|
104
|
+
value: number;
|
|
105
|
+
onChange: (value: number) => void;
|
|
106
|
+
}
|
|
107
|
+
export declare type PaginationRowsPerPageSelectComponent = FC<PaginationRowsPerPageSelectProps>;
|
|
108
|
+
/**
|
|
109
|
+
* Pagination counts
|
|
110
|
+
*/
|
|
111
|
+
export interface PaginationCountsProps {
|
|
112
|
+
page: number;
|
|
113
|
+
perPage: number;
|
|
114
|
+
response?: Response;
|
|
115
|
+
}
|
|
116
|
+
export declare type PaginationCountsComponent = FC<PaginationCountsProps>;
|
|
117
|
+
/**
|
|
118
|
+
* Selected rows toolbar
|
|
119
|
+
*/
|
|
120
|
+
export interface SelectedRowsToolbarProps {
|
|
121
|
+
selectedRows?: Set<number>;
|
|
122
|
+
onChangeSelectedRows?: (rows: Set<number>) => void;
|
|
123
|
+
Actions?: SelectedRowsToolbarActionsComponent;
|
|
124
|
+
reload: () => Promise<void>;
|
|
125
|
+
}
|
|
126
|
+
export declare type SelectedRowsToolbarComponent = FC<SelectedRowsToolbarProps>;
|
|
127
|
+
/**
|
|
128
|
+
* Select row checkbox
|
|
129
|
+
*/
|
|
130
|
+
export declare type SelectRowCheckboxComponent = React.FC<CheckboxFormatterProps>;
|
|
131
|
+
/**
|
|
132
|
+
* Selected rows toolbar actions
|
|
133
|
+
*/
|
|
134
|
+
export interface SelectedRowsToolbarActionsProps {
|
|
135
|
+
selectedRows: Set<number>;
|
|
136
|
+
onChangeSelectedRows: (rows: Set<number>) => void;
|
|
137
|
+
reload: () => Promise<void>;
|
|
138
|
+
}
|
|
139
|
+
export declare type SelectedRowsToolbarActionsComponent = FC<SelectedRowsToolbarActionsProps>;
|
|
140
|
+
/**
|
|
141
|
+
* Toolbar
|
|
142
|
+
*/
|
|
143
|
+
export interface ToolbarProps {
|
|
144
|
+
children: ReactNode;
|
|
145
|
+
noBorder?: boolean;
|
|
146
|
+
}
|
|
147
|
+
export declare type ToolbarComponent = FC<ToolbarProps>;
|
|
148
|
+
/**
|
|
149
|
+
* Toolbar control
|
|
150
|
+
*/
|
|
151
|
+
export interface ToolbarControlProps {
|
|
152
|
+
gridName: string | undefined;
|
|
153
|
+
schema: Schema<any>;
|
|
154
|
+
dispatch: (action: any) => void;
|
|
155
|
+
filtersData: RequestFilter[];
|
|
156
|
+
filterHandlers: FilterHandlers;
|
|
157
|
+
fulltextValue: string;
|
|
158
|
+
onFulltextChange: (value: string) => void;
|
|
159
|
+
noBorder: boolean | null | undefined;
|
|
160
|
+
onChangeHiddenColumns?: ChangeHiddenColumnsHandler;
|
|
161
|
+
hiddenColumns?: string[];
|
|
162
|
+
}
|
|
163
|
+
export declare type ToolbarControlComponent = React.FC<ToolbarControlProps>;
|
|
164
|
+
/**
|
|
165
|
+
* Toolbar customs
|
|
166
|
+
*/
|
|
167
|
+
export interface ToolbarCustomsProps {
|
|
168
|
+
buttons?: {
|
|
169
|
+
label: string | ReactElement;
|
|
170
|
+
onClick?: () => void;
|
|
171
|
+
href?: string;
|
|
172
|
+
variant?: "default" | "outlined" | "text";
|
|
173
|
+
}[];
|
|
174
|
+
}
|
|
175
|
+
export declare type ToolbarCustomsComponent = React.FC<ToolbarCustomsProps>;
|
|
176
|
+
/**
|
|
177
|
+
* Toolbar tabs
|
|
178
|
+
*/
|
|
179
|
+
export interface ToolbarTabsProps {
|
|
180
|
+
activeTab: string | null;
|
|
181
|
+
onChange: (tabName: string) => void;
|
|
182
|
+
schema: Schema<any>;
|
|
183
|
+
}
|
|
184
|
+
export declare type ToolbarTabsComponent = React.FC<ToolbarTabsProps>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcG9uZW50cy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90eXBlcy9jb21wb25lbnRzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIifQ==
|