pixelize-design-library 1.1.66 → 1.1.70
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/App.js +5 -6
- package/dist/Components/Apexcharts/ApexPieChart/ApexPieChartProps.d.ts +25 -1
- package/dist/Components/ButtonGroupIcon/ButtonGroupIcon.stories.js +0 -1
- package/dist/Components/Common/FormLabel.js +1 -5
- package/dist/Components/Dropdown/DropDown.js +3 -3
- package/dist/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.js +2 -2
- package/dist/Components/NavigationBar/NavigationBar.js +2 -2
- package/dist/Components/NoteTextArea/NoteTextArea.js +3 -3
- package/dist/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +5 -7
- package/dist/Components/Search/Search.js +3 -4
- package/dist/Components/SideBar/SideBar.js +2 -2
- package/dist/Components/SideBar/SideBarProps.d.ts +1 -2
- package/dist/Components/SideBar/Sidebar.stories.js +0 -1
- package/dist/Components/Table/Components/Pagination.js +5 -5
- package/dist/Components/Table/Components/TableActions.js +5 -7
- package/dist/Components/Table/Components/TableBody.js +2 -2
- package/dist/Components/Table/Components/TableFilters.js +3 -4
- package/dist/Components/Table/Components/TableHeader.js +6 -8
- package/dist/Components/Table/TableSettings/ManageColumns.js +2 -2
- package/dist/Components/Table/TableSettings/TableSettings.js +2 -2
- package/dist/Components/Timeline/Timeline.js +5 -5
- package/dist/Components/Trail/EditableCell.js +2 -2
- package/dist/Pages/accordion.js +3 -3
- package/dist/Pages/button.js +3 -3
- package/dist/Pages/dropdown.js +6 -6
- package/dist/Pages/input.js +3 -3
- package/dist/Pages/selectSearch.js +3 -3
- package/dist/Theme/Default/fonts.d.ts +35 -0
- package/dist/Theme/Default/fonts.js +37 -0
- package/package.json +4 -6
- package/.github/workflows/build.yml +0 -31
- package/dist/Components/Table/Utils/functions.d.ts +0 -3
- package/dist/Components/Table/Utils/functions.js +0 -46
- package/dist/Pages/katable.d.ts +0 -3
- package/dist/Pages/katable.js +0 -194
- package/dist/Utils/common.d.ts +0 -7
- package/dist/Utils/common.js +0 -64
- package/webpack.config.js +0 -48
package/dist/Pages/accordion.js
CHANGED
|
@@ -6,14 +6,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
var react_1 = __importDefault(require("react"));
|
|
7
7
|
var Accordion_1 = __importDefault(require("../Components/Accordion/Accordion"));
|
|
8
8
|
var react_2 = require("@chakra-ui/react");
|
|
9
|
-
var
|
|
9
|
+
var lucide_react_1 = require("lucide-react");
|
|
10
10
|
var Accordions = function () {
|
|
11
11
|
return (react_1.default.createElement("div", null,
|
|
12
12
|
react_1.default.createElement(Accordion_1.default, { allowToggle: true, items: [
|
|
13
13
|
{
|
|
14
14
|
header: (react_1.default.createElement(react_1.default.Fragment, null,
|
|
15
15
|
react_1.default.createElement(react_2.Box, { as: "span", flex: "1", textAlign: "left" }, "Section 1 title"),
|
|
16
|
-
react_1.default.createElement(
|
|
16
|
+
react_1.default.createElement(lucide_react_1.ChevronDown, { style: { marginRight: "8px" } }))),
|
|
17
17
|
content: (react_1.default.createElement("div", null,
|
|
18
18
|
react_1.default.createElement(react_2.Text, null, "This is text inside Section 1."),
|
|
19
19
|
react_1.default.createElement(react_2.Box, { bg: "gray.200", p: 4, mt: 2 }, "This is a box with more content inside Section 1."),
|
|
@@ -29,7 +29,7 @@ var Accordions = function () {
|
|
|
29
29
|
{
|
|
30
30
|
header: (react_1.default.createElement(react_1.default.Fragment, null,
|
|
31
31
|
react_1.default.createElement(react_2.Box, { as: "span", flex: "1", textAlign: "left" }, "Section 1 title"),
|
|
32
|
-
react_1.default.createElement(
|
|
32
|
+
react_1.default.createElement(lucide_react_1.ChevronDown, { style: { marginRight: "8px" } }))),
|
|
33
33
|
content: (react_1.default.createElement("div", null,
|
|
34
34
|
react_1.default.createElement(react_2.Text, null, "This is text inside Section 1."),
|
|
35
35
|
react_1.default.createElement(react_2.Box, { bg: "gray.200", p: 4, mt: 2 }, "This is a box with more content inside Section 1."),
|
package/dist/Pages/button.js
CHANGED
|
@@ -5,14 +5,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
var react_1 = __importDefault(require("react"));
|
|
7
7
|
var ButtonGroupIcon_1 = __importDefault(require("../Components/ButtonGroupIcon/ButtonGroupIcon"));
|
|
8
|
-
var fi_1 = require("react-icons/fi");
|
|
9
8
|
var Button_1 = __importDefault(require("../Components/Button/Button"));
|
|
9
|
+
var lucide_react_1 = require("lucide-react");
|
|
10
10
|
var ButtonPage = function () {
|
|
11
11
|
return (react_1.default.createElement("div", null,
|
|
12
|
-
react_1.default.createElement(ButtonGroupIcon_1.default, { buttonText: "hello", rightIcon: react_1.default.createElement(
|
|
12
|
+
react_1.default.createElement(ButtonGroupIcon_1.default, { buttonText: "hello", rightIcon: react_1.default.createElement(lucide_react_1.House, null), leftIcon: react_1.default.createElement(lucide_react_1.House, null), size: "md", variant: "solid",
|
|
13
13
|
// color="red"
|
|
14
14
|
rightIconDropdown: true, dropdownOptions: [
|
|
15
|
-
{ label: "123", id: "1", image: react_1.default.createElement(
|
|
15
|
+
{ label: "123", id: "1", image: react_1.default.createElement(lucide_react_1.House, { style: { marginRight: "20px" } }) },
|
|
16
16
|
{ label: "456", id: "2" }
|
|
17
17
|
], onDropdownOptionClick: function (e, option) {
|
|
18
18
|
console.log(e, option);
|
package/dist/Pages/dropdown.js
CHANGED
|
@@ -5,19 +5,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
var react_1 = __importDefault(require("react"));
|
|
7
7
|
var DropDown_1 = __importDefault(require("../Components/Dropdown/DropDown"));
|
|
8
|
-
var
|
|
8
|
+
var lucide_react_1 = require("lucide-react");
|
|
9
9
|
var DropdownPage = function () {
|
|
10
10
|
var exportOptionss = [
|
|
11
11
|
{ id: 1, label: "Upload file" },
|
|
12
|
-
{ id: 2, label: "Documents", image:
|
|
13
|
-
{ id: 3, label: "CRM workDrive", image:
|
|
14
|
-
{ id: 4, label: "Other Cloud Drives", image:
|
|
15
|
-
{ id: 5, label: "Link(URL)", image:
|
|
12
|
+
{ id: 2, label: "Documents", image: lucide_react_1.ChevronUp },
|
|
13
|
+
{ id: 3, label: "CRM workDrive", image: lucide_react_1.ChevronUp },
|
|
14
|
+
{ id: 4, label: "Other Cloud Drives", image: lucide_react_1.ChevronUp },
|
|
15
|
+
{ id: 5, label: "Link(URL)", image: lucide_react_1.ChevronUp },
|
|
16
16
|
];
|
|
17
17
|
return (react_1.default.createElement("div", null,
|
|
18
18
|
react_1.default.createElement(DropDown_1.default, { ButtonText: "hello", optionsSize: "sm", options: exportOptionss,
|
|
19
19
|
// dropDownButtonStyle={{ color: "red" }}
|
|
20
|
-
DropdownIcon: react_1.default.createElement(
|
|
20
|
+
DropdownIcon: react_1.default.createElement(lucide_react_1.Ellipsis, { color: "gray.500" }), dropdownType: "button", handleOptionSelect: function (id, label) {
|
|
21
21
|
console.log("optionid", id, label);
|
|
22
22
|
}, buttonProps: { variant: "solid", colorScheme: "red" }, isVisibleIconShow: true, divider: true })));
|
|
23
23
|
};
|
package/dist/Pages/input.js
CHANGED
|
@@ -5,16 +5,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
var react_1 = __importDefault(require("react"));
|
|
7
7
|
var TextInput_1 = __importDefault(require("../Components/Input/TextInput"));
|
|
8
|
-
var
|
|
8
|
+
var lucide_react_1 = require("lucide-react");
|
|
9
9
|
var InputPage = function () {
|
|
10
10
|
return (react_1.default.createElement("div", null,
|
|
11
11
|
react_1.default.createElement(TextInput_1.default, { label: "My Label", id: "hello", name: "hello",
|
|
12
12
|
//helperText="Hello"
|
|
13
13
|
//errorMessage="Required"
|
|
14
14
|
//error={true}
|
|
15
|
-
type: "text", inputRightIcon: react_1.default.createElement(
|
|
15
|
+
type: "text", inputRightIcon: react_1.default.createElement(lucide_react_1.User, { color: "gray.300" }), onRightIconclick: function () {
|
|
16
16
|
console.log("icon click");
|
|
17
|
-
}, inputLeftIcon: react_1.default.createElement(
|
|
17
|
+
}, inputLeftIcon: react_1.default.createElement(lucide_react_1.User, { color: "gray.300" }), onLeftIconClick: function () {
|
|
18
18
|
console.log("icon click");
|
|
19
19
|
}, key: "input",
|
|
20
20
|
// border={"0px solid"}
|
|
@@ -28,7 +28,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
var react_1 = __importStar(require("react"));
|
|
30
30
|
var SelectSearch_1 = __importDefault(require("../Components/SelectSearch/SelectSearch"));
|
|
31
|
-
var
|
|
31
|
+
var lucide_react_1 = require("lucide-react");
|
|
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)({ id: "1", label: "Option 1" }), selectedOption = _b[0], setSelectedOption = _b[1];
|
|
@@ -45,7 +45,7 @@ var SelectSearchs = function () {
|
|
|
45
45
|
console.log(value);
|
|
46
46
|
}, initialSelectedOption: selectedOption, onOptionSelect: function (data) {
|
|
47
47
|
setSelectSearchText(data.label);
|
|
48
|
-
}, name: "hai", label: "SelectSearch", searchQuery: selectSearchText, rightIcon: react_1.default.createElement(
|
|
48
|
+
}, name: "hai", label: "SelectSearch", searchQuery: selectSearchText, rightIcon: react_1.default.createElement(lucide_react_1.User, { color: "gray.300" }), isMultipleSelect: false, onOptionMultiSelect: function (data) {
|
|
49
49
|
setSelectedOption(data);
|
|
50
50
|
} })),
|
|
51
51
|
react_1.default.createElement("br", null),
|
|
@@ -65,7 +65,7 @@ var SelectSearchs = function () {
|
|
|
65
65
|
// onOptionSelect={(data) => {
|
|
66
66
|
// setMultiSelectSearchText(data.label);
|
|
67
67
|
// }}
|
|
68
|
-
name: "hai", label: "MultiSelectSearch", searchQuery: multiSelectSearchText, rightIcon: react_1.default.createElement(
|
|
68
|
+
name: "hai", label: "MultiSelectSearch", searchQuery: multiSelectSearchText, rightIcon: react_1.default.createElement(lucide_react_1.User, { color: "gray.300" }), isMultipleSelect: true, onOptionMultiSelect: function (data) {
|
|
69
69
|
setMultiSelectedOption(data);
|
|
70
70
|
} }))));
|
|
71
71
|
};
|
|
@@ -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
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pixelize-design-library",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.70",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@chakra-ui/icons": "^2.1.1",
|
|
10
9
|
"@chakra-ui/react": "^2.8.2",
|
|
11
10
|
"@fontsource-variable/inter": "^5.1.0",
|
|
12
|
-
"apexcharts": "^3.49.1",
|
|
13
11
|
"framer-motion": "^11.2.2",
|
|
14
12
|
"jodit-react": "^4.1.2",
|
|
13
|
+
"lucide-react": "^0.487.0",
|
|
15
14
|
"react": "^18.3.1",
|
|
16
15
|
"react-apexcharts": "^1.4.1",
|
|
17
16
|
"react-datepicker": "^7.3.0",
|
|
18
17
|
"react-dom": "^18.3.1",
|
|
19
|
-
"react-icons": "^5.2.1",
|
|
20
18
|
"react-scripts": "^5.0.1"
|
|
21
19
|
},
|
|
22
20
|
"scripts": {
|
|
@@ -63,8 +61,8 @@
|
|
|
63
61
|
"path": "^0.12.7",
|
|
64
62
|
"prettier": "^3.3.2",
|
|
65
63
|
"prop-types": "^15.8.1",
|
|
66
|
-
"
|
|
67
|
-
"
|
|
64
|
+
"typescript": "^4.9.5",
|
|
65
|
+
"webpack": "^5.91.0"
|
|
68
66
|
},
|
|
69
67
|
"husky": {
|
|
70
68
|
"hooks": {
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
name: Check Build on PR
|
|
2
|
-
|
|
3
|
-
# Trigger the workflow when a pull request is raised against the develop branch
|
|
4
|
-
on:
|
|
5
|
-
pull_request:
|
|
6
|
-
branches:
|
|
7
|
-
- develop
|
|
8
|
-
|
|
9
|
-
# Define the job to run the build
|
|
10
|
-
jobs:
|
|
11
|
-
check-build:
|
|
12
|
-
runs-on: ubuntu-latest
|
|
13
|
-
|
|
14
|
-
steps:
|
|
15
|
-
# Check out the code from the repository
|
|
16
|
-
- name: Checkout code
|
|
17
|
-
uses: actions/checkout@v3
|
|
18
|
-
|
|
19
|
-
# Set up Node.js environment
|
|
20
|
-
- name: Set up Node.js
|
|
21
|
-
uses: actions/setup-node@v3
|
|
22
|
-
with:
|
|
23
|
-
node-version: '18' # Specify your required Node.js version
|
|
24
|
-
|
|
25
|
-
# Install npm dependencies
|
|
26
|
-
- name: Install dependencies
|
|
27
|
-
run: npm install
|
|
28
|
-
|
|
29
|
-
# Run the build script
|
|
30
|
-
- name: Run build
|
|
31
|
-
run: npm run build
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { DataObject } from "../TableProps";
|
|
2
|
-
export declare const searchAndSortData: (data: DataObject[], searchValues: Record<string, string>) => DataObject[];
|
|
3
|
-
export declare function debounce<T extends (...args: any[]) => void>(func: T, delay: number): (...args: Parameters<T>) => void;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.debounce = exports.searchAndSortData = void 0;
|
|
4
|
-
var searchAndSortData = function (data, searchValues) {
|
|
5
|
-
var filteredData = data.filter(function (item) {
|
|
6
|
-
return Object.keys(searchValues).every(function (key) {
|
|
7
|
-
var searchValue = searchValues[key].toLowerCase();
|
|
8
|
-
return item[key].toString().toLowerCase().includes(searchValue);
|
|
9
|
-
});
|
|
10
|
-
});
|
|
11
|
-
return filteredData.sort(function (a, b) {
|
|
12
|
-
var aMatchCount = 0;
|
|
13
|
-
var bMatchCount = 0;
|
|
14
|
-
Object.keys(searchValues).forEach(function (key) {
|
|
15
|
-
var searchValue = searchValues[key].toLowerCase();
|
|
16
|
-
if (a[key] && a[key].toString().toLowerCase() === searchValue) {
|
|
17
|
-
aMatchCount++;
|
|
18
|
-
}
|
|
19
|
-
if (b[key] && b[key].toString().toLowerCase() === searchValue) {
|
|
20
|
-
bMatchCount++;
|
|
21
|
-
}
|
|
22
|
-
if (a[key] && a[key].toString().toLowerCase().includes(searchValue)) {
|
|
23
|
-
aMatchCount += 0.5;
|
|
24
|
-
}
|
|
25
|
-
if (b[key] && b[key].toString().toLowerCase().includes(searchValue)) {
|
|
26
|
-
bMatchCount += 0.5;
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
return bMatchCount - aMatchCount;
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
|
-
exports.searchAndSortData = searchAndSortData;
|
|
33
|
-
function debounce(func, delay) {
|
|
34
|
-
var timer;
|
|
35
|
-
return function () {
|
|
36
|
-
var args = [];
|
|
37
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
38
|
-
args[_i] = arguments[_i];
|
|
39
|
-
}
|
|
40
|
-
clearTimeout(timer);
|
|
41
|
-
timer = setTimeout(function () {
|
|
42
|
-
func.apply(void 0, args);
|
|
43
|
-
}, delay);
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
exports.debounce = debounce;
|
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;
|
package/dist/Utils/common.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export declare function SortMultiColumnData(data: Record<string, any>[], sortConfig: {
|
|
2
|
-
column: string;
|
|
3
|
-
direction: string;
|
|
4
|
-
}[]): Record<string, any>[];
|
|
5
|
-
export declare const getPreviousColumnWidth: (columns: any, key: any) => any;
|
|
6
|
-
export declare const getFieldType: (header: string, data: any) => "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function";
|
|
7
|
-
export declare const calculateLeftOffset: (columns: number[], index: number) => number;
|
package/dist/Utils/common.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
-
if (ar || !(i in from)) {
|
|
5
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
-
ar[i] = from[i];
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.calculateLeftOffset = exports.getFieldType = exports.getPreviousColumnWidth = exports.SortMultiColumnData = void 0;
|
|
13
|
-
function SortMultiColumnData(data, sortConfig) {
|
|
14
|
-
if (!sortConfig.length)
|
|
15
|
-
return data;
|
|
16
|
-
return __spreadArray([], data, true).sort(function (a, b) {
|
|
17
|
-
for (var _i = 0, sortConfig_1 = sortConfig; _i < sortConfig_1.length; _i++) {
|
|
18
|
-
var _a = sortConfig_1[_i], column = _a.column, direction = _a.direction;
|
|
19
|
-
if (direction === "none") {
|
|
20
|
-
continue;
|
|
21
|
-
}
|
|
22
|
-
var dirMultiplier = direction === "asc" ? 1 : -1;
|
|
23
|
-
// Compare values for the current column
|
|
24
|
-
if (a[column] < b[column])
|
|
25
|
-
return -1 * dirMultiplier;
|
|
26
|
-
if (a[column] > b[column])
|
|
27
|
-
return 1 * dirMultiplier;
|
|
28
|
-
// If values are equal, continue to the next sorting rule
|
|
29
|
-
}
|
|
30
|
-
return 0; // Return 0 if all sort conditions are equal
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
exports.SortMultiColumnData = SortMultiColumnData;
|
|
34
|
-
var getPreviousColumnWidth = function (columns, key) {
|
|
35
|
-
var index = columns === null || columns === void 0 ? void 0 : columns.findIndex(function (column) { return column.key === key; });
|
|
36
|
-
if (index > 0) {
|
|
37
|
-
return columns[index - 1].width;
|
|
38
|
-
}
|
|
39
|
-
return 0;
|
|
40
|
-
};
|
|
41
|
-
exports.getPreviousColumnWidth = getPreviousColumnWidth;
|
|
42
|
-
// export function calculateLeftOffset(columns: any, currentIndex: number) {
|
|
43
|
-
// let offset = 0;
|
|
44
|
-
// for (let i = 0; i < currentIndex; i++) {
|
|
45
|
-
// if (columns[i].isFreeze) {
|
|
46
|
-
// offset += columns[i].width || 100;
|
|
47
|
-
// }
|
|
48
|
-
// }
|
|
49
|
-
// return offset;
|
|
50
|
-
// }
|
|
51
|
-
var getFieldType = function (header, data) {
|
|
52
|
-
for (var _i = 0, data_1 = data; _i < data_1.length; _i++) {
|
|
53
|
-
var row = data_1[_i];
|
|
54
|
-
if (row[header] !== null) {
|
|
55
|
-
return typeof row[header];
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
return "string";
|
|
59
|
-
};
|
|
60
|
-
exports.getFieldType = getFieldType;
|
|
61
|
-
var calculateLeftOffset = function (columns, index) {
|
|
62
|
-
return columns.slice(0, index).reduce(function (sum, width) { return sum + width; }, 0);
|
|
63
|
-
};
|
|
64
|
-
exports.calculateLeftOffset = calculateLeftOffset;
|
package/webpack.config.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
const path = require("path");
|
|
3
|
-
module.exports = {
|
|
4
|
-
// Entry point of your application
|
|
5
|
-
entry: "./src/index.ts",
|
|
6
|
-
// Development mode for better debugging
|
|
7
|
-
mode: "development",
|
|
8
|
-
module: {
|
|
9
|
-
rules: [
|
|
10
|
-
// TypeScript loader
|
|
11
|
-
{
|
|
12
|
-
test: /\.tsx?$/,
|
|
13
|
-
use: "ts-loader",
|
|
14
|
-
exclude: /node_modules/,
|
|
15
|
-
},
|
|
16
|
-
// CSS loader
|
|
17
|
-
{
|
|
18
|
-
test: /\.css$/,
|
|
19
|
-
use: ["style-loader", "css-loader"],
|
|
20
|
-
},
|
|
21
|
-
// File loader for image assets
|
|
22
|
-
{
|
|
23
|
-
test: /\.(png|svg|jpg|jpeg|gif)$/i,
|
|
24
|
-
type: "asset/resource",
|
|
25
|
-
},
|
|
26
|
-
],
|
|
27
|
-
},
|
|
28
|
-
resolve: {
|
|
29
|
-
// Add `.ts` and `.tsx` as resolvable extensions.
|
|
30
|
-
extensions: [".tsx", ".ts", ".js"],
|
|
31
|
-
},
|
|
32
|
-
output: {
|
|
33
|
-
// Output directory
|
|
34
|
-
path: path.resolve(__dirname, "dist"),
|
|
35
|
-
// Output file name
|
|
36
|
-
filename: "bundle.js",
|
|
37
|
-
},
|
|
38
|
-
// Source maps for debugging
|
|
39
|
-
devtool: "inline-source-map",
|
|
40
|
-
// Dev server configuration
|
|
41
|
-
devServer: {
|
|
42
|
-
static: {
|
|
43
|
-
directory: path.join(__dirname, "public"),
|
|
44
|
-
},
|
|
45
|
-
compress: true,
|
|
46
|
-
port: 9000,
|
|
47
|
-
},
|
|
48
|
-
};
|