pixelize-design-library 1.1.27 → 1.1.29
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/dist/Components/ButtonGroupIcon/ButtonGoupIconProps.d.ts +1 -0
- package/dist/Components/ButtonGroupIcon/ButtonGroupIcon.js +3 -1
- package/dist/Components/KaTable/CustomHeader.js +3 -414
- package/dist/Components/KaTable/KaTable.js +6 -2
- package/dist/Components/KaTable/useMergedChildComponents.js +7 -3
- package/dist/Components/SelectSearch/SelectSearch.js +284 -448
- package/dist/Components/SelectSearch/SelectSearchProps.d.ts +1 -1
- package/dist/Pages/KaTableExample.js +1 -2
- package/dist/Pages/button.js +1 -1
- package/dist/Pages/katable.d.ts +3 -0
- package/dist/Pages/katable.js +194 -0
- package/dist/Pages/selectSearch.js +1 -1
- package/package.json +1 -1
- package/dist/Theme/Default/fonts.d.ts +0 -35
- package/dist/Theme/Default/fonts.js +0 -37
|
@@ -43,8 +43,7 @@ var KaTable_2 = require("../Components/KaTable/KaTable");
|
|
|
43
43
|
var icons_1 = require("@chakra-ui/icons");
|
|
44
44
|
var react_2 = require("@chakra-ui/react");
|
|
45
45
|
var menuItems = [
|
|
46
|
-
{ label: "
|
|
47
|
-
{ label: "Hide column", action: "Hide column" },
|
|
46
|
+
{ label: "Hide column", action: "hidecolumn" },
|
|
48
47
|
{
|
|
49
48
|
label: "Filter",
|
|
50
49
|
submenu: [
|
package/dist/Pages/button.js
CHANGED
|
@@ -12,7 +12,7 @@ var ButtonPage = function () {
|
|
|
12
12
|
react_1.default.createElement(ButtonGroupIcon_1.default, { buttonText: "hello", rightIcon: react_1.default.createElement(fi_1.FiHome, null), leftIcon: react_1.default.createElement(fi_1.FiHome, null), size: "md", variant: "solid",
|
|
13
13
|
// color="red"
|
|
14
14
|
rightIconDropdown: true, dropdownOptions: [
|
|
15
|
-
{ label: "123", id: "1" },
|
|
15
|
+
{ label: "123", id: "1", image: react_1.default.createElement(fi_1.FiHome, { style: { marginRight: "20px" } }) },
|
|
16
16
|
{ label: "456", id: "2" }
|
|
17
17
|
], onDropdownOptionClick: function (e, option) {
|
|
18
18
|
console.log(e, option);
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
var react_1 = __importDefault(require("react"));
|
|
18
|
+
var KaTable_1 = __importDefault(require("../Components/KaTable/KaTable"));
|
|
19
|
+
var KaTable_2 = require("../Components/KaTable/KaTable");
|
|
20
|
+
var icons_1 = require("@chakra-ui/icons");
|
|
21
|
+
var katable = function () {
|
|
22
|
+
var DataType = KaTable_2.TableEnums.DataType;
|
|
23
|
+
var dataArray = Array(50)
|
|
24
|
+
.fill(undefined)
|
|
25
|
+
.map(function (_, index) { return ({
|
|
26
|
+
column1: index % 2 === 0,
|
|
27
|
+
column2: "column:2 row:".concat(index + 1),
|
|
28
|
+
column3: index + 5,
|
|
29
|
+
column4: index + 10,
|
|
30
|
+
column5: index + 15,
|
|
31
|
+
column6: index + 20,
|
|
32
|
+
column7: index + 25,
|
|
33
|
+
column8: index + 30,
|
|
34
|
+
column9: index + 35,
|
|
35
|
+
column10: index + 40,
|
|
36
|
+
column11: index + 45,
|
|
37
|
+
column12: index + 50,
|
|
38
|
+
column13: index + 55,
|
|
39
|
+
column14: index + 60,
|
|
40
|
+
column15: new Date(2022, 11, index),
|
|
41
|
+
id: index + 1,
|
|
42
|
+
}); });
|
|
43
|
+
var columns = [
|
|
44
|
+
{
|
|
45
|
+
key: "column1",
|
|
46
|
+
title: "Column 1",
|
|
47
|
+
dataType: DataType.Boolean,
|
|
48
|
+
width: 150,
|
|
49
|
+
columnFreeze: true,
|
|
50
|
+
customHeader: false,
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
key: "column2",
|
|
54
|
+
title: "Column 2",
|
|
55
|
+
dataType: DataType.String,
|
|
56
|
+
width: 150,
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
key: "column3",
|
|
60
|
+
title: "Column 3",
|
|
61
|
+
dataType: DataType.Number,
|
|
62
|
+
width: 150,
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
key: "column4",
|
|
66
|
+
title: "Column 4",
|
|
67
|
+
dataType: DataType.Number,
|
|
68
|
+
width: 150,
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
key: "column5",
|
|
72
|
+
title: "Column 5",
|
|
73
|
+
dataType: DataType.Number,
|
|
74
|
+
width: 150,
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
key: "column6",
|
|
78
|
+
title: "Column 6",
|
|
79
|
+
dataType: DataType.Number,
|
|
80
|
+
width: 150,
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
key: "column7",
|
|
84
|
+
title: "Column 7",
|
|
85
|
+
dataType: DataType.Number,
|
|
86
|
+
width: 150,
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
key: "column8",
|
|
90
|
+
title: "Column 8",
|
|
91
|
+
dataType: DataType.Number,
|
|
92
|
+
width: 150,
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
key: "column9",
|
|
96
|
+
title: "Column 9",
|
|
97
|
+
dataType: DataType.Number,
|
|
98
|
+
width: 150,
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
key: "column10",
|
|
102
|
+
title: "Column 10",
|
|
103
|
+
dataType: DataType.Number,
|
|
104
|
+
width: 150,
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
key: "column11",
|
|
108
|
+
title: "Column 11",
|
|
109
|
+
dataType: DataType.Number,
|
|
110
|
+
width: 150,
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
key: "column12",
|
|
114
|
+
title: "Column 12",
|
|
115
|
+
dataType: DataType.Number,
|
|
116
|
+
width: 150,
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
key: "column13",
|
|
120
|
+
title: "Column 13",
|
|
121
|
+
dataType: DataType.Number,
|
|
122
|
+
width: 150,
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
key: "column14",
|
|
126
|
+
title: "Column 14",
|
|
127
|
+
dataType: DataType.Number,
|
|
128
|
+
width: 150,
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
key: "column15",
|
|
132
|
+
title: "Column 15",
|
|
133
|
+
dataType: DataType.Date,
|
|
134
|
+
width: 150,
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
key: "editColumn",
|
|
138
|
+
width: 80,
|
|
139
|
+
customHeader: false,
|
|
140
|
+
},
|
|
141
|
+
];
|
|
142
|
+
var kaTableFormat = function (props) {
|
|
143
|
+
if (props.column.dataType === DataType.Date) {
|
|
144
|
+
return (props.value &&
|
|
145
|
+
props.value.toLocaleDateString("en", {
|
|
146
|
+
month: "2-digit",
|
|
147
|
+
day: "2-digit",
|
|
148
|
+
year: "numeric",
|
|
149
|
+
}));
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
var EditButton = function (_a) {
|
|
153
|
+
var dispatch = _a.dispatch, rowKeyValue = _a.rowKeyValue;
|
|
154
|
+
return (react_1.default.createElement("div", { className: "edit-cell-button" },
|
|
155
|
+
react_1.default.createElement(icons_1.EditIcon, null),
|
|
156
|
+
react_1.default.createElement(icons_1.DeleteIcon, null)));
|
|
157
|
+
};
|
|
158
|
+
var handleSortChange = function (newSortState, columnName) {
|
|
159
|
+
console.log("Sort state for ".concat(columnName, " changed to:"), newSortState);
|
|
160
|
+
};
|
|
161
|
+
var handleMenuItemClick = function (action, columnName) {
|
|
162
|
+
console.log("Menu item clicked for ".concat(columnName, ":"), action);
|
|
163
|
+
};
|
|
164
|
+
var menuItems = [
|
|
165
|
+
{ label: "Sort", action: "Sort" },
|
|
166
|
+
{ label: "Hide column", action: "Hide column" },
|
|
167
|
+
{
|
|
168
|
+
label: "Filter",
|
|
169
|
+
submenu: [
|
|
170
|
+
{ label: "Filter by Date", action: "Filter by Date" },
|
|
171
|
+
{ label: "Filter by Name", action: "Filter by Name" },
|
|
172
|
+
{ label: "Filter by Status", action: "Filter by Status" },
|
|
173
|
+
],
|
|
174
|
+
},
|
|
175
|
+
];
|
|
176
|
+
return (react_1.default.createElement("div", null,
|
|
177
|
+
react_1.default.createElement(KaTable_1.default, { data: dataArray, columns: columns, checkSelect: true, onRowClick: function (rowKeyValue) {
|
|
178
|
+
console.log("Row clicked", rowKeyValue);
|
|
179
|
+
}, onSelectionChange: function (selectedRows) {
|
|
180
|
+
console.log("Selected rows:", selectedRows);
|
|
181
|
+
}, menuItems: menuItems, onSortChange: handleSortChange, onMenuItemClick: handleMenuItemClick, format: kaTableFormat, childComponents: {
|
|
182
|
+
cellText: {
|
|
183
|
+
content: function (props) {
|
|
184
|
+
if (props.column.key === "editColumn") {
|
|
185
|
+
return react_1.default.createElement(EditButton, __assign({}, props));
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
}, loading: {
|
|
190
|
+
enabled: false,
|
|
191
|
+
text: "Loading data",
|
|
192
|
+
} })));
|
|
193
|
+
};
|
|
194
|
+
exports.default = katable;
|
|
@@ -32,7 +32,6 @@ var fi_1 = require("react-icons/fi");
|
|
|
32
32
|
var SelectSearchs = function () {
|
|
33
33
|
var _a = (0, react_1.useState)("Option 1"), selectSearchText = _a[0], setSelectSearchText = _a[1];
|
|
34
34
|
var _b = (0, react_1.useState)(), selectedOption = _b[0], setSelectedOption = _b[1];
|
|
35
|
-
console.log("selectedOption", selectedOption);
|
|
36
35
|
return (react_1.default.createElement("div", null,
|
|
37
36
|
react_1.default.createElement(SelectSearch_1.default, { options: [
|
|
38
37
|
{ id: "1", label: "Option 1" },
|
|
@@ -49,6 +48,7 @@ var SelectSearchs = function () {
|
|
|
49
48
|
console.log("Selected option:", data);
|
|
50
49
|
}, name: "hai", label: "SelectSearch", searchQuery: selectSearchText, rightIcon: react_1.default.createElement(fi_1.FiUser, { color: "gray.300" }), isMultipleSelect: true, onOptionMultiSelect: function (data) {
|
|
51
50
|
setSelectedOption(data);
|
|
51
|
+
console.log("Selected option:", data);
|
|
52
52
|
} })));
|
|
53
53
|
};
|
|
54
54
|
exports.default = SelectSearchs;
|
package/package.json
CHANGED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import "@fontsource/ubuntu-sans";
|
|
2
|
-
declare const fontOptions: {
|
|
3
|
-
fonts: {
|
|
4
|
-
body: string;
|
|
5
|
-
heading: string;
|
|
6
|
-
mono: string;
|
|
7
|
-
};
|
|
8
|
-
fontSizes: {
|
|
9
|
-
xs: string;
|
|
10
|
-
sm: string;
|
|
11
|
-
md: string;
|
|
12
|
-
lg: string;
|
|
13
|
-
xl: string;
|
|
14
|
-
"2xl": string;
|
|
15
|
-
"3xl": string;
|
|
16
|
-
"4xl": string;
|
|
17
|
-
"5xl": string;
|
|
18
|
-
"6xl": string;
|
|
19
|
-
"7xl": string;
|
|
20
|
-
"8xl": string;
|
|
21
|
-
"9xl": string;
|
|
22
|
-
};
|
|
23
|
-
fontWeights: {
|
|
24
|
-
hairline: number;
|
|
25
|
-
thin: number;
|
|
26
|
-
light: number;
|
|
27
|
-
normal: number;
|
|
28
|
-
medium: number;
|
|
29
|
-
semibold: number;
|
|
30
|
-
bold: number;
|
|
31
|
-
extrabold: number;
|
|
32
|
-
black: number;
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
export default fontOptions;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
require("@fontsource/ubuntu-sans");
|
|
4
|
-
var fontOptions = {
|
|
5
|
-
fonts: {
|
|
6
|
-
body: "Ubuntu Sans, serif",
|
|
7
|
-
heading: "Ubuntu Sans, serif",
|
|
8
|
-
mono: "Ubuntu Sans, monospace",
|
|
9
|
-
},
|
|
10
|
-
fontSizes: {
|
|
11
|
-
xs: "0.75rem",
|
|
12
|
-
sm: "0.875rem",
|
|
13
|
-
md: "1rem",
|
|
14
|
-
lg: "1.125rem",
|
|
15
|
-
xl: "1.25rem",
|
|
16
|
-
"2xl": "1.5rem",
|
|
17
|
-
"3xl": "1.875rem",
|
|
18
|
-
"4xl": "2.25rem",
|
|
19
|
-
"5xl": "3rem",
|
|
20
|
-
"6xl": "3.75rem",
|
|
21
|
-
"7xl": "4.5rem",
|
|
22
|
-
"8xl": "6rem",
|
|
23
|
-
"9xl": "8rem",
|
|
24
|
-
},
|
|
25
|
-
fontWeights: {
|
|
26
|
-
hairline: 100,
|
|
27
|
-
thin: 200,
|
|
28
|
-
light: 300,
|
|
29
|
-
normal: 400,
|
|
30
|
-
medium: 500,
|
|
31
|
-
semibold: 600,
|
|
32
|
-
bold: 700,
|
|
33
|
-
extrabold: 800,
|
|
34
|
-
black: 900,
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
exports.default = fontOptions;
|