hi-tm 0.0.1 → 0.0.2

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.
Files changed (36) hide show
  1. package/README.md +61 -0
  2. package/dist/components/Cards/AutoComplete&DropDown/ItemCard.js +2 -2
  3. package/dist/components/DropDowns/CreatableDropDown.d.ts +3 -0
  4. package/dist/components/DropDowns/CreatableDropDown.js +255 -0
  5. package/dist/components/Inputs/InputMultiselect.js +17 -7
  6. package/dist/components/Layout/Headers/HeaderLayout.js +9 -3
  7. package/dist/components/Layout/Sidebar.js +1 -1
  8. package/dist/components/Table/ModernTable/ModernTable.d.ts +4 -0
  9. package/dist/components/Table/ModernTable/ModernTable.js +421 -0
  10. package/dist/components/Table/ModernTable/ModernTableHeader.d.ts +102 -0
  11. package/dist/components/Table/ModernTable/ModernTableHeader.js +322 -0
  12. package/dist/components/Table/RtlTable/RtlTable.d.ts +5 -0
  13. package/dist/components/Table/RtlTable/RtlTable.js +126 -0
  14. package/dist/components/Table/TableHeaderDiv.js +1 -1
  15. package/dist/components/Table/TableRowDiv.d.ts +1 -0
  16. package/dist/components/Table/TableRowDiv.js +0 -1
  17. package/dist/components/Wrapper/Bounded.d.ts +5 -3
  18. package/dist/components/Wrapper/Bounded.js +6 -6
  19. package/dist/components/Wrapper/ModernTable/ModernTableBounded.d.ts +26 -0
  20. package/dist/components/Wrapper/ModernTable/ModernTableBounded.js +23 -0
  21. package/dist/components/Wrapper/TableBodyBoundedDiv.js +1 -1
  22. package/dist/components/Wrapper/TableBoundedDiv.d.ts +2 -2
  23. package/dist/components/Wrapper/TableBoundedDiv.js +2 -2
  24. package/dist/components/sections/components/Tabs/TabsComponent.js +6 -1
  25. package/dist/elements/Loader.d.ts +3 -0
  26. package/dist/elements/Loader.js +21 -0
  27. package/dist/index.d.ts +5 -0
  28. package/dist/index.js +14 -1
  29. package/dist/styles/globals.css +100 -96
  30. package/dist/types/DropDown/CreatableDropDown.d.ts +57 -0
  31. package/dist/types/DropDown/CreatableDropDown.js +2 -0
  32. package/dist/types/ModernTable/index.d.ts +87 -0
  33. package/dist/types/ModernTable/index.js +2 -0
  34. package/dist/types/RtlTable/index.d.ts +73 -0
  35. package/dist/types/RtlTable/index.js +2 -0
  36. package/package.json +3 -1
@@ -62,7 +62,12 @@ const TabsComponent = ({ isOpenSidebar, tabsData, activeTabId, setActiveTabId, d
62
62
  document.removeEventListener('mousedown', handleClickOutside);
63
63
  };
64
64
  }, []);
65
- return (react_1.default.createElement("div", { className: `w-full h-full flex flex-row items-center justify-start bg-white-color ${!isOpenSidebar ? 'border border-border-color-primary border-solid ' : ''}`, style: { borderTopRightRadius: isOpenSidebar ? '12px' : '0px' } },
65
+ return (react_1.default.createElement("div", { className: `w-full h-full flex flex-row items-center justify-start bg-white-color ${!isOpenSidebar ? 'border border-border-color-primary border-solid border-t-none ' : ''}`, style: {
66
+ // borderTopRightRadius: isOpenSidebar ? '12px' : '0px',
67
+ // borderBottom: !isOpenSidebar
68
+ // ? 'border border-border-color-primary border-solid border-t-none'
69
+ // : '',
70
+ } },
66
71
  react_1.default.createElement("button", { ref: buttonRef, className: `bg-back-ground-color-primary w-8 h-8 rounded-xl ${tabsData && tabsData.length > 0 ? 'flex' : 'hidden'} flex-row items-center justify-center relative outline-none ml-2 mr-1 `, onClick: () => {
67
72
  setIsShowAllTab(!isShowAllTab);
68
73
  } },
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const Loader: () => React.JSX.Element;
3
+ export default Loader;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const react_1 = __importDefault(require("react"));
7
+ const Loader = () => {
8
+ return (react_1.default.createElement(react_1.default.Fragment, null,
9
+ react_1.default.createElement("div", { "aria-label": "Loading...", role: "status", className: "flex h-full w-full cursor-default items-center justify-center gap-2 space-x-2 text-3xl" },
10
+ react_1.default.createElement("svg", { className: "h-12 w-12 animate-spin stroke-gray-500", viewBox: "0 0 256 256" },
11
+ react_1.default.createElement("line", { x1: "128", y1: "32", x2: "128", y2: "64" }),
12
+ react_1.default.createElement("line", { x1: "195.9", y1: "60.1", x2: "173.3", y2: "82.7", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "24" }),
13
+ react_1.default.createElement("line", { x1: "224", y1: "128", x2: "192", y2: "128", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "24" }),
14
+ react_1.default.createElement("line", { x1: "195.9", y1: "195.9", x2: "173.3", y2: "173.3", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "24" }),
15
+ react_1.default.createElement("line", { x1: "128", y1: "224", x2: "128", y2: "192", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "24" }),
16
+ react_1.default.createElement("line", { x1: "60.1", y1: "195.9", x2: "82.7", y2: "173.3", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "24" }),
17
+ react_1.default.createElement("line", { x1: "32", y1: "128", x2: "64", y2: "128", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "24" }),
18
+ react_1.default.createElement("line", { x1: "60.1", y1: "60.1", x2: "82.7", y2: "82.7", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "24" })),
19
+ react_1.default.createElement("span", { className: "text-2xl font-medium text-gray-500" }, 'loader'))));
20
+ };
21
+ exports.default = Loader;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import './styles/globals.css';
2
2
  export { default as GlobalWrapper } from './components/Wrapper/GlobalWrapper';
3
3
  export { default as Bounded } from './components/Wrapper/Bounded';
4
+ export { default as ModernTableBounded } from './components/Wrapper/ModernTable/ModernTableBounded';
4
5
  export { default as HeaderLayout } from './components/Layout/Headers/HeaderLayout';
5
6
  export { default as SidebarLayout } from './components/Layout/Sidebar';
6
7
  export { default as SelectBranchHeader } from './components/Layout/Headers/HeaderSelectBranch';
@@ -23,6 +24,10 @@ export { default as TableBounded } from './components/Wrapper/TableBounded';
23
24
  export { default as TableBodyBounded } from './components/Wrapper/TableBodyBounded';
24
25
  export { default as TableHeader } from './components/Table/TableHeader';
25
26
  export { default as TableRow } from './components/Table/TableRow';
27
+ export { default as ModernTable } from './components/Table/ModernTable/ModernTable';
28
+ export { default as ModernTableHeader } from './components/Table/ModernTable/ModernTableHeader';
29
+ export { default as RtlTable } from './components/Table/RtlTable/RtlTable';
30
+ export { default as CreatableDropDown } from './components/DropDowns/CreatableDropDown';
26
31
  export { default as TableHeaderDiv } from './components/Table/TableHeaderDiv';
27
32
  export { default as TableRowDiv } from './components/Table/TableRowDiv';
28
33
  export { default as TableBoundedDiv } from './components/Wrapper/TableBoundedDiv';
package/dist/index.js CHANGED
@@ -3,13 +3,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.Tabs = exports.DropDownMultiSelect = exports.DropDown = exports.DropDownItemsPerPage = exports.PaginationPrimary = exports.TableBodyBoundedDiv = exports.TableBoundedDiv = exports.TableRowDiv = exports.TableHeaderDiv = exports.TableRow = exports.TableHeader = exports.TableBodyBounded = exports.TableBounded = exports.TreeAutoComplete = exports.AutoCompleteMultiSelect = exports.AutoComplete = exports.Modal = exports.Button = exports.DaysCheckBox = exports.InputBarcode = exports.InputMultiselect = exports.InputCurrency = exports.InputSearch = exports.TextInput = exports.InputPercent = exports.Toggle = exports.TextArea = exports.RangePicker = exports.SelectBranchHeader = exports.SidebarLayout = exports.HeaderLayout = exports.Bounded = exports.GlobalWrapper = void 0;
6
+ exports.Tabs = exports.DropDownMultiSelect = exports.DropDown = exports.DropDownItemsPerPage = exports.PaginationPrimary = exports.TableBodyBoundedDiv = exports.TableBoundedDiv = exports.TableRowDiv = exports.TableHeaderDiv = exports.CreatableDropDown = exports.RtlTable = exports.ModernTableHeader = exports.ModernTable = exports.TableRow = exports.TableHeader = exports.TableBodyBounded = exports.TableBounded = exports.TreeAutoComplete = exports.AutoCompleteMultiSelect = exports.AutoComplete = exports.Modal = exports.Button = exports.DaysCheckBox = exports.InputBarcode = exports.InputMultiselect = exports.InputCurrency = exports.InputSearch = exports.TextInput = exports.InputPercent = exports.Toggle = exports.TextArea = exports.RangePicker = exports.SelectBranchHeader = exports.SidebarLayout = exports.HeaderLayout = exports.ModernTableBounded = exports.Bounded = exports.GlobalWrapper = void 0;
7
7
  require("./styles/globals.css");
8
8
  // Wrapper ..............................................................................................................................................................................................
9
9
  var GlobalWrapper_1 = require("./components/Wrapper/GlobalWrapper");
10
10
  Object.defineProperty(exports, "GlobalWrapper", { enumerable: true, get: function () { return __importDefault(GlobalWrapper_1).default; } });
11
11
  var Bounded_1 = require("./components/Wrapper/Bounded");
12
12
  Object.defineProperty(exports, "Bounded", { enumerable: true, get: function () { return __importDefault(Bounded_1).default; } });
13
+ var ModernTableBounded_1 = require("./components/Wrapper/ModernTable/ModernTableBounded");
14
+ Object.defineProperty(exports, "ModernTableBounded", { enumerable: true, get: function () { return __importDefault(ModernTableBounded_1).default; } });
13
15
  // Layout ..............................................................................................................................................................................................
14
16
  var HeaderLayout_1 = require("./components/Layout/Headers/HeaderLayout");
15
17
  Object.defineProperty(exports, "HeaderLayout", { enumerable: true, get: function () { return __importDefault(HeaderLayout_1).default; } });
@@ -61,6 +63,17 @@ var TableHeader_1 = require("./components/Table/TableHeader");
61
63
  Object.defineProperty(exports, "TableHeader", { enumerable: true, get: function () { return __importDefault(TableHeader_1).default; } });
62
64
  var TableRow_1 = require("./components/Table/TableRow");
63
65
  Object.defineProperty(exports, "TableRow", { enumerable: true, get: function () { return __importDefault(TableRow_1).default; } });
66
+ // ModernTable..............................................................................................................................................................................................
67
+ var ModernTable_1 = require("./components/Table/ModernTable/ModernTable");
68
+ Object.defineProperty(exports, "ModernTable", { enumerable: true, get: function () { return __importDefault(ModernTable_1).default; } });
69
+ var ModernTableHeader_1 = require("./components/Table/ModernTable/ModernTableHeader");
70
+ Object.defineProperty(exports, "ModernTableHeader", { enumerable: true, get: function () { return __importDefault(ModernTableHeader_1).default; } });
71
+ // RTlTable..............................................................................................................................................................................................
72
+ var RtlTable_1 = require("./components/Table/RtlTable/RtlTable");
73
+ Object.defineProperty(exports, "RtlTable", { enumerable: true, get: function () { return __importDefault(RtlTable_1).default; } });
74
+ // CreatableDropDown..............................................................................................................................................................................................
75
+ var CreatableDropDown_1 = require("./components/DropDowns/CreatableDropDown");
76
+ Object.defineProperty(exports, "CreatableDropDown", { enumerable: true, get: function () { return __importDefault(CreatableDropDown_1).default; } });
64
77
  // Table Div ..............................................................................................................................................................................................
65
78
  var TableHeaderDiv_1 = require("./components/Table/TableHeaderDiv");
66
79
  Object.defineProperty(exports, "TableHeaderDiv", { enumerable: true, get: function () { return __importDefault(TableHeaderDiv_1).default; } });
@@ -3,174 +3,178 @@
3
3
  @tailwind utilities;
4
4
 
5
5
  * {
6
- margin: 0px;
7
- padding: 0;
8
- box-sizing: border-box;
6
+ margin: 0px;
7
+ padding: 0;
8
+ box-sizing: border-box;
9
9
  }
10
10
 
11
11
  body {
12
- font-family: var(--DanaFa);
13
- font-style: normal;
14
- font-weight: 400;
15
- font-size: 16px;
12
+ font-family: var(--DanaFa);
13
+ font-style: normal;
14
+ font-weight: 400;
15
+ font-size: 16px;
16
16
  }
17
17
 
18
18
  @layer components {
19
- .customTransition {
20
- transition: all ease 250ms;
21
- }
22
- .select-none-custom {
23
- -webkit-touch-callout: none;
24
- -webkit-user-select: none;
25
- -moz-user-select: none;
26
- -ms-user-select: none;
27
- user-select: none;
28
- }
29
- .customShadowBox {
30
- box-shadow: 0px 0px 10px 5px rgba(0, 0, 0, 0.08);
31
- }
32
- .BoundedShadow {
33
- box-shadow: 0px 0px 0px 1px #e9e9f0;
34
- }
35
- .trShadow {
36
- box-shadow: 0px 0px 0px 1px #ececee;
37
- }
38
- .input-style {
39
- width: 100%;
40
- height: 40px;
41
- border: 2px solid #e5e7eb;
42
- border-radius: 8px;
43
- padding: 0 12px 0px 12px;
44
- outline: none;
45
- }
19
+ .customTransition {
20
+ transition: all ease 250ms;
21
+ }
22
+ .select-none-custom {
23
+ -webkit-touch-callout: none;
24
+ -webkit-user-select: none;
25
+ -moz-user-select: none;
26
+ -ms-user-select: none;
27
+ user-select: none;
28
+ }
29
+ .customShadowBox {
30
+ box-shadow: 0px 0px 10px 5px rgba(0, 0, 0, 0.08);
31
+ }
32
+ .BoundedShadow {
33
+ box-shadow: 0px 0px 0px 1px #e9e9f0;
34
+ }
35
+ .trShadow {
36
+ box-shadow: 0px 0px 0px 1px #ececee;
37
+ }
38
+ .input-style {
39
+ width: 100%;
40
+ height: 40px;
41
+ border: 2px solid #e5e7eb;
42
+ border-radius: 8px;
43
+ padding: 0 12px 0px 12px;
44
+ outline: none;
45
+ }
46
46
  }
47
47
 
48
48
  li.activeSidebar {
49
- background-color: #1e88e554;
50
- font-weight: 500;
49
+ background-color: #1e88e554;
50
+ font-weight: 500;
51
51
  }
52
52
 
53
53
  li.activeSidebar::after {
54
- content: '';
55
- position: absolute;
56
- top: 50%;
57
- left: 100%;
58
- transform: translateY(-50%);
59
- height: 70%;
60
- width: 4px;
61
- background-color: #006fee;
62
- border-radius: 4px;
54
+ content: '';
55
+ position: absolute;
56
+ top: 50%;
57
+ left: 100%;
58
+ transform: translateY(-50%);
59
+ height: 70%;
60
+ width: 4px;
61
+ background-color: #006fee;
62
+ border-radius: 4px;
63
63
  }
64
64
  li.activeSidebar-subset {
65
- position: relative;
66
- background-color: #1e88e554;
67
- font-weight: 500;
65
+ position: relative;
66
+ background-color: #1e88e554;
67
+ font-weight: 500;
68
68
  }
69
69
 
70
70
  li.activeSidebar-subset::after {
71
- content: '';
72
- position: absolute;
73
- top: 50%;
74
- left: 102%;
75
- transform: translateY(-50%);
76
- height: 70%;
77
- width: 4px;
78
- background-color: #006fee;
79
- border-radius: 4px;
71
+ content: '';
72
+ position: absolute;
73
+ top: 50%;
74
+ left: 102%;
75
+ transform: translateY(-50%);
76
+ height: 70%;
77
+ width: 4px;
78
+ background-color: #006fee;
79
+ border-radius: 4px;
80
80
  }
81
81
 
82
82
  .noDisplay-scrollbar {
83
- scrollbar-width: none; /* For Firefox */
84
- -ms-overflow-style: none; /* For Internet Explorer and Edge */
83
+ scrollbar-width: none; /* For Firefox */
84
+ -ms-overflow-style: none; /* For Internet Explorer and Edge */
85
85
  }
86
86
 
87
87
  .noDisplay-scrollbar::-webkit-scrollbar {
88
- display: none; /* For Chrome, Safari, and Opera */
88
+ display: none; /* For Chrome, Safari, and Opera */
89
89
  }
90
90
  .danger {
91
- background-color: #ffffff;
92
- color: #f54180;
91
+ background-color: #ffffff;
92
+ color: #f54180;
93
93
  }
94
94
 
95
95
  .success {
96
- background-color: #ffffff;
97
- color: #45d483;
96
+ background-color: #ffffff;
97
+ color: #45d483;
98
98
  }
99
99
  .warning {
100
- background-color: #f7b750;
101
- color: #3b3834;
100
+ background-color: #f7b750;
101
+ color: #3b3834;
102
102
  }
103
103
 
104
104
  .info {
105
- background-color: #d1ecf1;
106
- color: #0c5460;
105
+ background-color: #d1ecf1;
106
+ color: #0c5460;
107
107
  }
108
108
 
109
109
  .primary {
110
- background-color: #338cf1;
111
- color: #fff;
110
+ background-color: #338cf1;
111
+ color: #fff;
112
112
  }
113
113
 
114
114
  .secondary {
115
- background-color: #dddde0;
116
- color: #000000;
115
+ background-color: #dddde0;
116
+ color: #000000;
117
117
  }
118
118
 
119
119
  /* ============================================================================================================================== */
120
120
  .dangerBtn {
121
- background-color: #ff0000ab;
122
- color: #ffffff;
121
+ background-color: #ff0000ab;
122
+ color: #ffffff;
123
123
  }
124
124
 
125
125
  .successBtn {
126
- background-color: #ffffff;
127
- color: #45d483;
126
+ background-color: #ffffff;
127
+ color: #45d483;
128
128
  }
129
129
  .warningBtn {
130
- background-color: #f7b750;
131
- color: #3b3834;
130
+ background-color: #f7b750;
131
+ color: #3b3834;
132
132
  }
133
133
 
134
134
  .infoBtn {
135
- background-color: #d1ecf1;
136
- color: #0c5460;
135
+ background-color: #d1ecf1;
136
+ color: #0c5460;
137
137
  }
138
138
 
139
139
  .primaryBtn {
140
- background-color: #338cf1;
141
- color: #fff;
140
+ background-color: #338cf1;
141
+ color: #fff;
142
142
  }
143
143
 
144
144
  .secondaryBtn {
145
- background-color: #dddde0;
146
- color: #000000;
145
+ background-color: #dddde0;
146
+ color: #000000;
147
147
  }
148
148
  /* ============================================================================================================================== */
149
149
  .dangerPrice {
150
- background-color: #ffffff;
151
- color: #f54180;
150
+ background-color: #ffffff;
151
+ color: #f54180;
152
152
  }
153
153
 
154
154
  .successPrice {
155
- background-color: #ffffff;
156
- color: #45d483;
155
+ background-color: #ffffff;
156
+ color: #45d483;
157
157
  }
158
158
  .warningPrice {
159
- background-color: #f7b750;
160
- color: #3b3834;
159
+ background-color: #f7b750;
160
+ color: #3b3834;
161
161
  }
162
162
 
163
163
  .infoPrice {
164
- background-color: #d1ecf1;
165
- color: #0c5460;
164
+ background-color: #d1ecf1;
165
+ color: #0c5460;
166
166
  }
167
167
 
168
168
  .primaryPrice {
169
- background-color: #338cf1;
170
- color: #fff;
169
+ background-color: #338cf1;
170
+ color: #fff;
171
171
  }
172
172
 
173
173
  .secondaryPrice {
174
- background-color: #dddde0;
175
- color: #000000;
174
+ background-color: #dddde0;
175
+ color: #000000;
176
+ }
177
+ .modal-content {
178
+ isolation: isolate;
179
+ contain: content;
176
180
  }
@@ -0,0 +1,57 @@
1
+ import { ReactNode } from 'react';
2
+ export type IconType = ReactNode | string | {
3
+ src: string;
4
+ alt?: string;
5
+ };
6
+ export type IconSourceProps = {
7
+ dropdownOpen?: IconType;
8
+ dropdownClosed?: IconType;
9
+ checkmark?: IconType;
10
+ loading?: IconType;
11
+ clear?: IconType;
12
+ create?: IconType;
13
+ xmark?: IconType;
14
+ };
15
+ export interface TailwindStyleProps extends React.CSSProperties {
16
+ container?: string;
17
+ trigger?: string;
18
+ input?: string;
19
+ dropdown?: string;
20
+ option?: string;
21
+ selectedOption?: string;
22
+ highlightedOption?: string;
23
+ createOption?: string;
24
+ loadingState?: string;
25
+ noOptions?: string;
26
+ noResults?: string;
27
+ clearButton?: string;
28
+ icon?: string;
29
+ separator?: string;
30
+ }
31
+ export type SelectOption = {
32
+ label: string;
33
+ value: string;
34
+ };
35
+ export type NoResultsType = ReactNode | string | {
36
+ icon?: IconType;
37
+ text: string;
38
+ };
39
+ export type CreatableSelectProps = {
40
+ options: SelectOption[] | [] | null;
41
+ value: SelectOption | null;
42
+ onChange: (value: SelectOption | null) => void;
43
+ onCreateOption?: (inputValue: string) => Promise<void> | void;
44
+ placeholder?: string;
45
+ isLoading?: boolean;
46
+ isDisabled?: boolean;
47
+ isClearable?: boolean;
48
+ isCreatable?: boolean;
49
+ noOptionsMessage?: string;
50
+ noResultsFound?: NoResultsType;
51
+ loadingMessage?: string;
52
+ createOptionMessage?: string;
53
+ className?: string;
54
+ tailwindStyle?: TailwindStyleProps;
55
+ iconSrc: IconSourceProps;
56
+ fetchOptions?: (inputValue: string) => Promise<SelectOption[]>;
57
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,87 @@
1
+ import { CSSProperties } from 'react';
2
+ export interface DataItem {
3
+ id: number;
4
+ type: 'text' | 'avatar' | 'status' | 'operation' | 'icon' | 'date' | 'price';
5
+ value: string | number | boolean | null;
6
+ statusClass?: string;
7
+ textAlign?: 'left' | 'center' | 'right';
8
+ inlineCSS?: CSSProperties;
9
+ contentClass?: string;
10
+ isTitle?: boolean;
11
+ isSubtitle?: boolean;
12
+ isFavorite?: boolean;
13
+ isUserAvatar?: boolean;
14
+ hasImage?: boolean;
15
+ imageUrl?: string;
16
+ imageWidth?: number;
17
+ imageHeight?: number;
18
+ imageClass?: string;
19
+ }
20
+ export interface TableRowData {
21
+ id: number;
22
+ data: DataItem[] | null;
23
+ hasChildren?: boolean;
24
+ childRows?: TableRowData[];
25
+ isChild?: boolean;
26
+ }
27
+ export interface ModalAction {
28
+ id: number;
29
+ text: string;
30
+ class?: string;
31
+ }
32
+ export interface MobileCardConfig {
33
+ enabled?: boolean;
34
+ showFolderIcon?: boolean;
35
+ folderIconPath?: string;
36
+ showFavoriteIcon?: boolean;
37
+ favoriteFilledIconPath?: string;
38
+ favoriteOutlineIconPath?: string;
39
+ showMoreOptions?: boolean;
40
+ moreOptionsIconPath?: string;
41
+ showAvatars?: boolean;
42
+ maxVisibleAvatars?: number;
43
+ cardStyle?: {
44
+ backgroundColor?: string;
45
+ borderRadius?: string;
46
+ shadow?: string;
47
+ border?: string;
48
+ padding?: string;
49
+ marginBottom?: string;
50
+ };
51
+ gridLayoutClassName?: string | undefined;
52
+ }
53
+ export interface NoItemFoundProps {
54
+ imagePath: string | React.ReactNode | undefined;
55
+ title: string | undefined;
56
+ }
57
+ export interface ModernTableProps {
58
+ rows: TableRowData[] | null;
59
+ loadingProps: {
60
+ isLoading: boolean;
61
+ loadingText?: string;
62
+ loadingIcon?: string | React.ReactNode;
63
+ };
64
+ onEdit: (id: number) => void;
65
+ onDelete?: (id: number) => void;
66
+ onView?: (id: number) => void;
67
+ onAction?: (actionId: number, rowId: number) => void;
68
+ selectable: boolean;
69
+ onSelectionChange?: (id: number | number[]) => void;
70
+ actions?: boolean;
71
+ modalActions: ModalAction[];
72
+ noItemFoundProps?: NoItemFoundProps;
73
+ selectedItems?: number[];
74
+ mobileCardConfig?: MobileCardConfig;
75
+ isModalTop?: boolean;
76
+ childRowConfig?: {
77
+ expandByDefault?: boolean;
78
+ indentSize?: string;
79
+ childRowClass?: string;
80
+ };
81
+ iconsSRC: {
82
+ editIcon: string | React.ReactNode;
83
+ moreIcon: string | React.ReactNode;
84
+ };
85
+ actionButtonsStyle?: string;
86
+ gridClassName: string;
87
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,73 @@
1
+ import { ReactNode } from 'react';
2
+ export type RtlTableHeader = {
3
+ id: string;
4
+ label: string;
5
+ width?: string;
6
+ };
7
+ export type RtlTableCell = {
8
+ [key: string]: string | number | ReactNode;
9
+ };
10
+ export type RtlSubItem = {
11
+ id: string;
12
+ cells: RtlTableCell;
13
+ };
14
+ export type RtlTableRow = {
15
+ id: string;
16
+ cells: RtlTableCell;
17
+ subItem?: RtlSubItem;
18
+ };
19
+ /**
20
+ * Icons that can be customized in the table
21
+ */
22
+ export type RtlTableIcons = {
23
+ /**
24
+ * Icon for deleting a row or sub-item
25
+ */
26
+ deleteIcon?: ReactNode | SVGAElement | string;
27
+ /**
28
+ * Icon for dropdown indicators
29
+ */
30
+ dropdownIcon?: ReactNode | SVGAElement | string;
31
+ /**
32
+ * Icon for Child(SubItem) indicators
33
+ */
34
+ childIcon?: ReactNode | SVGAElement | string;
35
+ };
36
+ export type RtlTableProps = {
37
+ /**
38
+ * Array of header objects that define the table columns
39
+ */
40
+ headers: RtlTableHeader[];
41
+ /**
42
+ * Array of row objects that contain the table data
43
+ */
44
+ data: RtlTableRow[];
45
+ /**
46
+ * Callback function when the delete button is clicked for a row
47
+ * @param rowId - The ID of the row to delete
48
+ */
49
+ onDeleteRow?: (rowId: string) => void;
50
+ /**
51
+ * Callback function when the delete button is clicked for a sub-item
52
+ * @param rowId - The ID of the parent row
53
+ * @param subItemId - The ID of the sub-item to delete
54
+ */
55
+ onDeleteSubItem?: (rowId: string, subItemId: string) => void;
56
+ /**
57
+ * Whether to show the delete button for rows and sub-items
58
+ * @default true
59
+ */
60
+ showDeleteButton?: boolean;
61
+ /**
62
+ * Custom icons to use in the table
63
+ */
64
+ iconSrc?: RtlTableIcons;
65
+ /**
66
+ * Additional CSS class names to apply to the table container
67
+ */
68
+ className?: string;
69
+ /**
70
+ * ID of the initially selected row (defaults to first row with a subitem)
71
+ */
72
+ initialSelectedRowId?: string;
73
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hi-tm",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "styles": "dist/styles/globals.css",
5
5
  "main": "dist/index.js",
6
6
  "exports": {
@@ -11,6 +11,8 @@
11
11
  "prepare": "npm run build"
12
12
  },
13
13
  "dependencies": {
14
+ "@hello-pangea/dnd": "^18.0.1",
15
+ "hi-tm": "^0.0.1-beta-0.0.303",
14
16
  "next": ">=13.0.0",
15
17
  "react": ">=18.0.0",
16
18
  "react-dom": ">=18.0.0"