pixelize-design-library 1.1.31 → 1.1.32
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/EmailCards/VerifyEmailOtp/VerifyEmailOtp.d.ts +1 -1
- package/dist/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.js +2 -2
- package/dist/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtpProps.d.ts +1 -1
- package/dist/Components/MultiSelect/MultiSelect.d.ts +1 -1
- package/dist/Components/MultiSelect/MultiSelect.js +34 -5
- package/dist/Components/MultiSelect/MultiSelectProps.d.ts +12 -0
- package/dist/Pages/selectSearch.js +3 -5
- package/dist/Pages/verifyEmail.js +1 -1
- package/dist/Theme/Default/fonts.d.ts +35 -0
- package/dist/Theme/Default/fonts.js +37 -0
- package/package.json +1 -1
- package/dist/Pages/katable.d.ts +0 -3
- package/dist/Pages/katable.js +0 -194
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { VerifyEmailOtpProps } from "./VerifyEmailOtpProps";
|
|
3
|
-
export default function VerifyEmailOtp({
|
|
3
|
+
export default function VerifyEmailOtp({ resendMail, onChange, onComplete, placeholder, pins, description, title, isDisabled, isInvalid, styles, }: VerifyEmailOtpProps): React.JSX.Element;
|
|
@@ -8,7 +8,7 @@ var react_2 = require("@chakra-ui/react");
|
|
|
8
8
|
var lu_1 = require("react-icons/lu");
|
|
9
9
|
var useCustomTheme_1 = require("../../../Theme/useCustomTheme");
|
|
10
10
|
function VerifyEmailOtp(_a) {
|
|
11
|
-
var
|
|
11
|
+
var resendMail = _a.resendMail, onChange = _a.onChange, onComplete = _a.onComplete, _b = _a.placeholder, placeholder = _b === void 0 ? "" : _b, _c = _a.pins, pins = _c === void 0 ? 5 : _c, description = _a.description, title = _a.title, _d = _a.isDisabled, isDisabled = _d === void 0 ? false : _d, _e = _a.isInvalid, isInvalid = _e === void 0 ? false : _e, styles = _a.styles;
|
|
12
12
|
var theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
13
13
|
return (react_1.default.createElement("div", { style: styles },
|
|
14
14
|
react_1.default.createElement("div", { style: {
|
|
@@ -31,7 +31,7 @@ function VerifyEmailOtp(_a) {
|
|
|
31
31
|
react_1.default.createElement("p", { style: { textAlign: "center", marginBottom: "2%" } },
|
|
32
32
|
"Didn't receive the code?",
|
|
33
33
|
" ",
|
|
34
|
-
react_1.default.createElement("button", { onClick: function () { return
|
|
34
|
+
react_1.default.createElement("button", { onClick: function () { return resendMail(); }, style: {
|
|
35
35
|
background: "none",
|
|
36
36
|
color: theme.colors.primary[700],
|
|
37
37
|
border: "none",
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { MultiSelectProps } from "./MultiSelectProps";
|
|
3
|
-
export default function MultiSelect({ value, onValueChange, }: MultiSelectProps): React.JSX.Element;
|
|
3
|
+
export default function MultiSelect({ value, onValueChange, width, label, isRequired, isInformation, informationMessage, name, id, placeholderText, isDisabled, isReadOnly, size, inputStyle, }: MultiSelectProps): React.JSX.Element;
|
|
@@ -1,4 +1,15 @@
|
|
|
1
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
|
+
};
|
|
2
13
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
14
|
if (k2 === undefined) k2 = k;
|
|
4
15
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -34,6 +45,8 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
34
45
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
46
|
var react_1 = __importStar(require("react"));
|
|
36
47
|
var react_2 = require("@chakra-ui/react");
|
|
48
|
+
var FormLabel_1 = require("../Common/FormLabel");
|
|
49
|
+
var useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
37
50
|
var generateUniqueId = (function () {
|
|
38
51
|
var counter = 0;
|
|
39
52
|
return function () {
|
|
@@ -42,18 +55,32 @@ var generateUniqueId = (function () {
|
|
|
42
55
|
};
|
|
43
56
|
})();
|
|
44
57
|
function MultiSelect(_a) {
|
|
45
|
-
var value = _a.value, onValueChange = _a.onValueChange;
|
|
46
|
-
var
|
|
47
|
-
var
|
|
58
|
+
var value = _a.value, onValueChange = _a.onValueChange, _b = _a.width, width = _b === void 0 ? "100%" : _b, _c = _a.label, label = _c === void 0 ? "label" : _c, _d = _a.isRequired, isRequired = _d === void 0 ? true : _d, _e = _a.isInformation, isInformation = _e === void 0 ? false : _e, _f = _a.informationMessage, informationMessage = _f === void 0 ? "" : _f, name = _a.name, id = _a.id, _g = _a.placeholderText, placeholderText = _g === void 0 ? "Type valid email and press enter" : _g, isDisabled = _a.isDisabled, isReadOnly = _a.isReadOnly, size = _a.size, inputStyle = _a.inputStyle;
|
|
59
|
+
var theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
60
|
+
var getPadding = function () {
|
|
61
|
+
return "0.5rem";
|
|
62
|
+
};
|
|
63
|
+
var _h = (0, react_1.useState)(value), options = _h[0], setOptions = _h[1];
|
|
64
|
+
var _j = (0, react_1.useState)(""), inputValue = _j[0], setInputValue = _j[1];
|
|
65
|
+
var _k = (0, react_1.useState)(""), error = _k[0], setError = _k[1];
|
|
48
66
|
var inputRef = (0, react_1.useRef)(null);
|
|
49
67
|
(0, react_1.useEffect)(function () {
|
|
50
68
|
setOptions(value);
|
|
51
69
|
}, [value]);
|
|
52
70
|
var handleInputChange = function (e) {
|
|
53
71
|
setInputValue(e.target.value);
|
|
72
|
+
setError("");
|
|
73
|
+
};
|
|
74
|
+
var validateEmail = function (email) {
|
|
75
|
+
var emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
76
|
+
return emailRegex.test(email);
|
|
54
77
|
};
|
|
55
78
|
var handleKeyDown = function (e) {
|
|
56
79
|
if (e.key === "Enter" && inputValue.trim() !== "") {
|
|
80
|
+
if (!validateEmail(inputValue)) {
|
|
81
|
+
setError("Invalid email address");
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
57
84
|
var existingOption = options.find(function (option) { return option.label === inputValue; });
|
|
58
85
|
if (!existingOption) {
|
|
59
86
|
var newOption = { id: generateUniqueId(), label: inputValue };
|
|
@@ -77,10 +104,12 @@ function MultiSelect(_a) {
|
|
|
77
104
|
setOptions(updatedOptions);
|
|
78
105
|
onValueChange(updatedOptions);
|
|
79
106
|
};
|
|
80
|
-
return (react_1.default.createElement(react_2.Box, { width:
|
|
107
|
+
return (react_1.default.createElement(react_2.Box, { width: width, borderRadius: "md", padding: "2", backgroundColor: "white" },
|
|
108
|
+
label && (react_1.default.createElement(FormLabel_1.TextLabel, { label: label, isRequired: isRequired, isInformation: isInformation, informationMessage: informationMessage })),
|
|
81
109
|
react_1.default.createElement(react_2.Flex, { wrap: "wrap", gap: 2 }, options.map(function (option) { return (react_1.default.createElement(react_2.Tag, { key: option.id, size: "md", variant: "solid", colorScheme: "gray" },
|
|
82
110
|
react_1.default.createElement(react_2.TagLabel, null, option.label),
|
|
83
111
|
react_1.default.createElement(react_2.TagCloseButton, { onClick: function () { return handleRemove(option); } }))); })),
|
|
84
|
-
react_1.default.createElement(react_2.Input, { ref: inputRef, type: "text", value: inputValue, onChange: handleInputChange, onKeyDown: handleKeyDown, placeholder:
|
|
112
|
+
react_1.default.createElement(react_2.Input, { ref: inputRef, type: "text", value: inputValue, isDisabled: isDisabled, isReadOnly: isReadOnly, id: id, name: name, size: size, style: __assign(__assign({}, inputStyle), { backgroundColor: theme.colors.backgroundColor.light, fontWeight: 600, color: theme.colors.gray[600], padding: getPadding(), fontSize: 15, letterSpacing: 0.7, borderRadius: "0.125rem" }), onChange: handleInputChange, onKeyDown: handleKeyDown, placeholder: placeholderText, marginTop: 2, marginLeft: 1 }),
|
|
113
|
+
error && (react_1.default.createElement(react_2.Text, { color: "red.500", marginTop: 2, marginLeft: 1 }, error))));
|
|
85
114
|
}
|
|
86
115
|
exports.default = MultiSelect;
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
export type MultiSelectProps = {
|
|
2
2
|
value: MultiSelctOPtions[];
|
|
3
3
|
onValueChange: (options: MultiSelctOPtions[]) => void;
|
|
4
|
+
width?: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
id?: string;
|
|
7
|
+
name?: string;
|
|
8
|
+
isRequired?: boolean;
|
|
9
|
+
isInformation?: boolean;
|
|
10
|
+
informationMessage?: string;
|
|
11
|
+
placeholderText?: string;
|
|
12
|
+
isDisabled?: boolean;
|
|
13
|
+
isReadOnly?: boolean;
|
|
14
|
+
size?: string;
|
|
15
|
+
inputStyle?: {};
|
|
4
16
|
};
|
|
5
17
|
export type MultiSelctOPtions = {
|
|
6
18
|
id: string;
|
|
@@ -30,7 +30,7 @@ var react_1 = __importStar(require("react"));
|
|
|
30
30
|
var SelectSearch_1 = __importDefault(require("../Components/SelectSearch/SelectSearch"));
|
|
31
31
|
var fi_1 = require("react-icons/fi");
|
|
32
32
|
var SelectSearchs = function () {
|
|
33
|
-
var _a = (0, react_1.useState)("
|
|
33
|
+
var _a = (0, react_1.useState)(""), selectSearchText = _a[0], setSelectSearchText = _a[1];
|
|
34
34
|
var _b = (0, react_1.useState)(), selectedOption = _b[0], setSelectedOption = _b[1];
|
|
35
35
|
return (react_1.default.createElement("div", null,
|
|
36
36
|
react_1.default.createElement(SelectSearch_1.default, { options: [
|
|
@@ -44,11 +44,9 @@ var SelectSearchs = function () {
|
|
|
44
44
|
setSelectSearchText(value.toString());
|
|
45
45
|
console.log(value);
|
|
46
46
|
}, initialSelectedOption: { id: "1", label: "Option 1" }, onOptionSelect: function (data) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}, name: "hai", label: "SelectSearch", searchQuery: selectSearchText, rightIcon: react_1.default.createElement(fi_1.FiUser, { color: "gray.300" }), isMultipleSelect: true, onOptionMultiSelect: function (data) {
|
|
47
|
+
setSelectSearchText(data.label);
|
|
48
|
+
}, name: "hai", label: "SelectSearch", searchQuery: selectSearchText, rightIcon: react_1.default.createElement(fi_1.FiUser, { color: "gray.300" }), isMultipleSelect: false, onOptionMultiSelect: function (data) {
|
|
50
49
|
setSelectedOption(data);
|
|
51
|
-
console.log("Selected option:", data);
|
|
52
50
|
} })));
|
|
53
51
|
};
|
|
54
52
|
exports.default = SelectSearchs;
|
|
@@ -7,7 +7,7 @@ var react_1 = __importDefault(require("react"));
|
|
|
7
7
|
var VerifyEmailOtp_1 = __importDefault(require("../Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp"));
|
|
8
8
|
var VerifyEmailPage = function () {
|
|
9
9
|
return (react_1.default.createElement("div", null,
|
|
10
|
-
react_1.default.createElement(VerifyEmailOtp_1.default, {
|
|
10
|
+
react_1.default.createElement(VerifyEmailOtp_1.default, { resendMail: function () {
|
|
11
11
|
console.log("hello");
|
|
12
12
|
}, onChange: function (val) {
|
|
13
13
|
console.log("onchange", val);
|
|
@@ -0,0 +1,35 @@
|
|
|
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;
|
|
@@ -0,0 +1,37 @@
|
|
|
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;
|
package/package.json
CHANGED
package/dist/Pages/katable.d.ts
DELETED
package/dist/Pages/katable.js
DELETED
|
@@ -1,194 +0,0 @@
|
|
|
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;
|