@luscii-healthtech/web-ui 0.10.0 → 0.10.3

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.
@@ -23,7 +23,7 @@ export interface PaginationMenuLargeProps {
23
23
  resultCount?: number;
24
24
  }
25
25
  export declare type OnPaginationChange = (pageNumber: number, pageSize?: PageSize) => void;
26
- export declare type PageSize = 50 | 100 | 150 | 200;
26
+ export declare type PageSize = 25 | 50 | 75 | 100;
27
27
  export interface Localization {
28
28
  display: string;
29
29
  page: string;
@@ -1,10 +1,14 @@
1
1
  /// <reference types="react" />
2
2
  import { TabItemDetails } from "./TabbarItem";
3
- interface TabbarProps {
3
+ export interface TabbarProps {
4
4
  tabs?: TabItemDetails[];
5
5
  selectedIndex?: number;
6
- onSelect?: (index: number) => void;
6
+ onSelect?: (params: {
7
+ index: number;
8
+ selectedTab: TabItemDetails;
9
+ }) => void;
7
10
  className?: string;
8
11
  }
12
+ export { TabItemDetails };
9
13
  export declare const Tabbar: ({ tabs, selectedIndex, onSelect, className, }: TabbarProps) => JSX.Element;
10
14
  export default Tabbar;
package/dist/index.d.ts CHANGED
@@ -40,7 +40,7 @@ export { SettingsMenuButton, SettingsMenuButtonProps, } from "./components/Setti
40
40
  export { Spinner } from "./components/Spinner/Spinner";
41
41
  export { Steps } from "./components/Steps/Steps";
42
42
  export { default as Switcher } from "./components/Switcher/Switcher";
43
- export { default as Tabbar } from "./components/Tabbar/Tabbar";
43
+ export { default as Tabbar, TabbarProps, TabItemDetails, } from "./components/Tabbar/Tabbar";
44
44
  export { default as TabLinks } from "./components/TabLinks/TabLinks";
45
45
  export { default as Tag } from "./components/Tag/Tag";
46
46
  export { default as TagGroup } from "./components/Tag/TagGroup";
@@ -2313,7 +2313,7 @@ var CustomSelect = /*#__PURE__*/React__default.forwardRef(function (props, _ref)
2313
2313
  }));
2314
2314
  });
2315
2315
 
2316
- var PAGE_SIZES = [50, 100, 150, 200];
2316
+ var PAGE_SIZES = [25, 50, 75, 100];
2317
2317
  var PAGE_SIZE_OPTIONS = /*#__PURE__*/PAGE_SIZES.map(function (pageSize) {
2318
2318
  return {
2319
2319
  label: pageSize.toString(),
@@ -2733,15 +2733,11 @@ var List = function List(_ref) {
2733
2733
  };
2734
2734
 
2735
2735
  var setupDragging = function setupDragging() {
2736
- if (onDragEnd) {
2737
- var dragulaInstance = dragula([listRef.current], {
2738
- revertOnSpill: true
2739
- });
2740
- dragulaInstance.on("dragend", handleDragEnd);
2741
- return dragulaInstance;
2742
- }
2743
-
2744
- return null;
2736
+ var dragulaInstance = dragula([listRef.current], {
2737
+ revertOnSpill: true
2738
+ });
2739
+ dragulaInstance.on("dragend", handleDragEnd);
2740
+ return dragulaInstance;
2745
2741
  };
2746
2742
 
2747
2743
  return /*#__PURE__*/React__default.createElement("div", {
@@ -4020,35 +4016,32 @@ var TabbarItem = function TabbarItem(_ref) {
4020
4016
  };
4021
4017
 
4022
4018
  var Tabbar = function Tabbar(_ref) {
4023
- var tabs = _ref.tabs,
4019
+ var _ref$tabs = _ref.tabs,
4020
+ tabs = _ref$tabs === void 0 ? [] : _ref$tabs,
4024
4021
  selectedIndex = _ref.selectedIndex,
4025
4022
  onSelect = _ref.onSelect,
4026
4023
  _ref$className = _ref.className,
4027
4024
  className = _ref$className === void 0 ? "" : _ref$className;
4028
4025
 
4029
- var _useState = React.useState(tabs),
4030
- innerTabs = _useState[0],
4031
- setInnerTabs = _useState[1];
4032
-
4033
- var _useState2 = React.useState(selectedIndex),
4034
- innerSelectedIndex = _useState2[0],
4035
- setInnerSelectedIndex = _useState2[1];
4026
+ var _useState = React.useState(selectedIndex),
4027
+ innerSelectedIndex = _useState[0],
4028
+ setInnerSelectedIndex = _useState[1];
4036
4029
 
4037
4030
  React.useEffect(function () {
4038
- setInnerTabs(tabs);
4039
- }, [tabs]);
4040
- React.useEffect(function () {
4041
- setInnerSelectedIndex(innerSelectedIndex);
4042
- }, [innerSelectedIndex]);
4031
+ setInnerSelectedIndex(selectedIndex);
4032
+ }, [selectedIndex]);
4043
4033
 
4044
4034
  function handleOnTabSelect(index) {
4045
4035
  setInnerSelectedIndex(index);
4046
- onSelect == null ? void 0 : onSelect(index);
4036
+ onSelect == null ? void 0 : onSelect({
4037
+ index: index,
4038
+ selectedTab: tabs[index]
4039
+ });
4047
4040
  }
4048
4041
 
4049
4042
  return /*#__PURE__*/React__default.createElement("div", {
4050
- className: "flex flex-row w-full bg-white rounded-xl " + className
4051
- }, innerTabs == null ? void 0 : innerTabs.map(function (tabItemProps, index) {
4043
+ className: "flex flex-row w-full bg-white rounded-xl p-2 " + className
4044
+ }, tabs == null ? void 0 : tabs.map(function (tabItemProps, index) {
4052
4045
  var _tabItemProps$dataTes;
4053
4046
 
4054
4047
  var itemProps = _extends({