hi-tm 0.13.0 → 0.13.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.
@@ -100,6 +100,7 @@ interface ModernTableHeaderProps {
100
100
  containerClassName?: string;
101
101
  isMobileView?: boolean;
102
102
  mobileViewGridClassName?: string;
103
+ defaultChecked?: boolean;
103
104
  }
104
- declare const ModernTableHeader: ({ columns, sortIcon, hasSelect, hasCheckbox, onCheckboxClick, onClickHandlerColumn, filterHandler, onSelectAllClick, FilterIcon, onFilterClick, onSortingClick, onPinClick, onFilterButtonClick, gridClassName, containerClassName, isMobileView, mobileViewGridClassName, }: ModernTableHeaderProps) => React.JSX.Element;
105
+ declare const ModernTableHeader: ({ columns, sortIcon, hasSelect, hasCheckbox, defaultChecked, onCheckboxClick, onClickHandlerColumn, filterHandler, onSelectAllClick, FilterIcon, onFilterClick, onSortingClick, onPinClick, onFilterButtonClick, gridClassName, containerClassName, isMobileView, mobileViewGridClassName, }: ModernTableHeaderProps) => React.JSX.Element;
105
106
  export default ModernTableHeader;
@@ -39,17 +39,24 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
39
39
  Object.defineProperty(exports, "__esModule", { value: true });
40
40
  const react_1 = __importStar(require("react"));
41
41
  const image_1 = __importDefault(require("next/image"));
42
- const ModernTableHeader = ({ columns = [], sortIcon, hasSelect = false, hasCheckbox = false, onCheckboxClick, onClickHandlerColumn, filterHandler, onSelectAllClick, FilterIcon, onFilterClick, onSortingClick, onPinClick, onFilterButtonClick, gridClassName, containerClassName, isMobileView, mobileViewGridClassName, }) => {
42
+ const ModernTableHeader = ({ columns = [], sortIcon, hasSelect = false, hasCheckbox = false, defaultChecked = false, onCheckboxClick, onClickHandlerColumn, filterHandler, onSelectAllClick, FilterIcon, onFilterClick, onSortingClick, onPinClick, onFilterButtonClick, gridClassName, containerClassName, isMobileView, mobileViewGridClassName, }) => {
43
43
  const [activeFilterColumn, setActiveFilterColumn] = (0, react_1.useState)(null);
44
44
  const [clickedColumn, setClickedColumn] = (0, react_1.useState)(null);
45
45
  const [arrowDir, setArrowDir] = (0, react_1.useState)(false);
46
46
  const [isFilterClicked, setIsFilterClicked] = (0, react_1.useState)(false);
47
- const [isChecked, setIsChecked] = (0, react_1.useState)(false);
47
+ const [isChecked, setIsChecked] = (0, react_1.useState)(defaultChecked);
48
48
  const [checkedFilters, setCheckedFilters] = (0, react_1.useState)({});
49
49
  const [checkedSorting, setCheckedSorting] = (0, react_1.useState)({});
50
50
  const [checkedPins, setCheckedPins] = (0, react_1.useState)({});
51
51
  const modalFilterRef = (0, react_1.useRef)(null);
52
52
  const filterIconRef = (0, react_1.useRef)(null);
53
+ (0, react_1.useEffect)(() => {
54
+ setIsChecked(defaultChecked);
55
+ if (defaultChecked) {
56
+ onCheckboxClick?.(true);
57
+ onSelectAllClick?.(true);
58
+ }
59
+ }, [defaultChecked]);
53
60
  const handleCheckboxChange = () => {
54
61
  const newCheckedState = !isChecked;
55
62
  setIsChecked(newCheckedState);
@@ -63,33 +63,27 @@ const TabsComponent = ({ isOpenSidebar, tabsData, activeTabId, setActiveTabId, d
63
63
  document.removeEventListener('mousedown', handleClickOutside);
64
64
  };
65
65
  }, []);
66
- // Add this new useEffect to update dropdown position
67
66
  (0, react_1.useEffect)(() => {
68
67
  if (isShowAllTab && buttonRef.current && modalRef.current) {
69
68
  const buttonRect = buttonRef.current.getBoundingClientRect();
70
69
  setDropdownPosition({
71
70
  top: buttonRect.bottom,
72
- right: buttonRect.right - 170, // Adjust based on dropdown width
71
+ right: buttonRect.right - 170,
73
72
  });
74
73
  }
75
74
  }, [isShowAllTab]);
76
- return (react_1.default.createElement("div", { className: `w-full h-full flex flex-row items-center justify-start bg-white-color overflow-x-scroll ${!isOpenSidebar ? 'border border-border-color-primary border-solid border-t-none ' : ''}`, style: {
77
- // borderTopRightRadius: isOpenSidebar ? '12px' : '0px',
78
- // borderBottom: !isOpenSidebar
79
- // ? 'border border-border-color-primary border-solid border-t-none'
80
- // : '',
81
- } },
75
+ return (react_1.default.createElement("div", { className: `w-full h-full flex flex-row items-center justify-start bg-white-color overflow-x-scroll ${!isOpenSidebar ? 'border border-border-color-primary border-solid border-t-none ' : ''}` },
82
76
  react_1.default.createElement("button", { ref: buttonRef, className: `bg-back-ground-color-primary min-w-[36px] min-h-[36px] rounded-xl ${tabsData && tabsData.length > 0 ? 'flex' : 'hidden'} flex-row items-center justify-center relative outline-none ml-2 mr-1 `, onClick: () => {
83
77
  setIsShowAllTab(!isShowAllTab);
84
78
  } },
85
79
  react_1.default.createElement(image_1.default, { src: iconsSRC.arrowIconSRC, alt: "arrow.svg", width: 16, height: 16, className: `cursor-pointer customTransition ${isShowAllTab ? 'rotate-180' : 'rotate-0'}` }),
86
- react_1.default.createElement("ul", { ref: modalRef, className: `${isShowAllTab ? 'flex' : 'hidden'} flex-col items-start justify-start py-2 px-2 w-[170px] max-h-60 h-auto overflow-y-auto bg-white-color customShadowBox rounded-xl`, style: {
80
+ react_1.default.createElement("ul", { ref: modalRef, className: `${isShowAllTab ? 'flex' : 'hidden'} flex-col items-start justify-start py-2 px-2 w-[170px] max-h-60 h-auto bg-white-color customShadowBox rounded-xl`, style: {
87
81
  zIndex: 999999,
88
82
  position: 'fixed',
89
83
  top: `${dropdownPosition.top}px`,
90
84
  left: `${dropdownPosition.right}px`,
91
85
  } },
92
- tabsData &&
86
+ react_1.default.createElement("div", { className: "overflow-y-auto max-h-[calc(100%-56px)]" }, tabsData &&
93
87
  tabsData.length > 0 &&
94
88
  tabsData.map((tab) => {
95
89
  return (react_1.default.createElement("li", { key: tab.id, onClick: (e) => {
@@ -100,8 +94,8 @@ const TabsComponent = ({ isOpenSidebar, tabsData, activeTabId, setActiveTabId, d
100
94
  }, className: "flex flex-row-reverse items-center justify-between w-full h-auto rounded-lg px-2 py-1 opacity-80 customTransition hover:bg-back-ground-color-primary" },
101
95
  react_1.default.createElement("p", { onClick: () => tabRouteHandler(tab.routeURL), className: "text-text-color-primary text-sm w-32 truncate overflow-hidden whitespace-nowrap bg-inherit text-start" }, tab.name),
102
96
  react_1.default.createElement(image_1.default, { src: iconsSRC.closeIconSRC, alt: "close.svg", width: 20, height: 20, className: "cursor-pointer customTransition hover:scale-[1.01]", onClick: () => deleteTabHandler(tab.id) })));
103
- }),
104
- react_1.default.createElement("li", { className: "flex flex-row items-center justify-between w-full h-auto py-1 opacity-90 border-t border-border-color-primary border-solid mt-3 pt-3 customTransition hover:opacity-70" },
97
+ })),
98
+ react_1.default.createElement("li", { className: "flex flex-row items-center justify-between w-full h-auto py-1 opacity-90 border-t border-border-color-primary border-solid mt-3 pt-3 customTransition hover:opacity-70 sticky bottom-0 bg-white" },
105
99
  react_1.default.createElement("p", { onClick: () => {
106
100
  deleteTabHandler(0);
107
101
  setIsShowAllTab(false);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hi-tm",
3
- "version": "0.13.0",
3
+ "version": "0.13.2",
4
4
  "styles": "dist/styles/globals.css",
5
5
  "main": "dist/index.js",
6
6
  "exports": {