@trackunit/react-components 0.0.206 → 0.0.208

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/index.css CHANGED
@@ -13,14 +13,13 @@
13
13
  outline-current
14
14
  transition-all
15
15
  ease-in-out
16
- rounded-lg
16
+ component-button-border
17
17
  cursor-pointer
18
18
  flex-none
19
19
  py-1.5
20
20
  px-2.5
21
- h-min
22
- w-min
23
- max-h-8
21
+ component-button-height
22
+ component-button-width
24
23
  focus:ring
25
24
  focus:ring-offset-1
26
25
  focus:outline-none
package/index.js CHANGED
@@ -901,7 +901,7 @@ const AddonBefore = tw.div`
901
901
  const AddonAfter = tw.div`
902
902
  tu-input__addon-after
903
903
  `;
904
- const InputContainer$1 = tw.div`
904
+ const InputContainer$1 = tw.label`
905
905
  tu-input
906
906
  ${({
907
907
  $invalid
@@ -3054,13 +3054,11 @@ const Pagination = ({
3054
3054
  canPreviousPage,
3055
3055
  canNextPage,
3056
3056
  loading,
3057
- eventName,
3058
- parentName,
3059
3057
  className,
3060
3058
  dataTestId,
3061
- logPageChange,
3062
3059
  getTranslatedCount,
3063
3060
  getTranslatedPage,
3061
+ onPageChange,
3064
3062
  cursorBase
3065
3063
  }) => {
3066
3064
  const [page, setPage] = React.useState(pageIndex);
@@ -3112,14 +3110,12 @@ const Pagination = ({
3112
3110
  setPage(to);
3113
3111
  setPageInputValue(String(to + 1));
3114
3112
  }
3115
- eventName && logPageChange && logPageChange(eventName, {
3116
- parentName,
3117
- type: "Pagination",
3118
- from: from !== undefined ? from : "",
3119
- to: to !== undefined ? to : "",
3120
- action: description
3113
+ onPageChange === null || onPageChange === void 0 ? void 0 : onPageChange({
3114
+ from,
3115
+ to,
3116
+ description
3121
3117
  });
3122
- }, [page, logPageChange, eventName, parentName, previousPage, nextPage, parsePageString, pageInputValue, gotoPage]);
3118
+ }, [page, onPageChange, previousPage, nextPage, parsePageString, pageInputValue, gotoPage]);
3123
3119
  const handleOnBlur = () => {
3124
3120
  handlePageChange("manual");
3125
3121
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-components",
3
- "version": "0.0.206",
3
+ "version": "0.0.208",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "dependencies": {
@@ -28,14 +28,6 @@ export interface IPaginationProps {
28
28
  * A flag to enable next page button
29
29
  */
30
30
  canNextPage?: boolean;
31
- /**
32
- * A parent name
33
- */
34
- parentName: string;
35
- /**
36
- * A event name used for logging
37
- */
38
- eventName?: string;
39
31
  /**
40
32
  * A flag indicating loading state
41
33
  */
@@ -48,10 +40,6 @@ export interface IPaginationProps {
48
40
  * A data test id
49
41
  */
50
42
  dataTestId?: string;
51
- /**
52
- * You can attach logging handler for page change
53
- */
54
- logPageChange?: (eventName: string, event: EventProperties) => void;
55
43
  /**
56
44
  * An helper to get translation for count.
57
45
  */
@@ -60,16 +48,23 @@ export interface IPaginationProps {
60
48
  * An helper to get translation for page.
61
49
  */
62
50
  getTranslatedPage: () => string;
51
+ /**
52
+ * Callback that fires on page change with details about the action
53
+ */
54
+ onPageChange?: (change: {
55
+ from?: number;
56
+ to?: number;
57
+ description?: string;
58
+ }) => void;
63
59
  /**
64
60
  * An flag to disable jumping to particular page by text input, could be used for cursor based pagination
65
61
  */
66
62
  cursorBase?: boolean;
67
63
  }
68
- export declare type EventProperties = Record<string, string | number | boolean | null | undefined | (string | number)[]>;
69
64
  /**
70
65
  * Pagination Description. It could be used when you need navigation for your paging feature.
71
66
  *
72
67
  * @param {IPaginationProps} props - The props for the Pagination component
73
68
  * @returns {JSX.Element} Pagination component
74
69
  */
75
- export declare const Pagination: ({ gotoPage, previousPage, nextPage, pageCount, pageIndex, canPreviousPage, canNextPage, loading, eventName, parentName, className, dataTestId, logPageChange, getTranslatedCount, getTranslatedPage, cursorBase, }: IPaginationProps) => JSX.Element;
70
+ export declare const Pagination: ({ gotoPage, previousPage, nextPage, pageCount, pageIndex, canPreviousPage, canNextPage, loading, className, dataTestId, getTranslatedCount, getTranslatedPage, onPageChange, cursorBase, }: IPaginationProps) => JSX.Element;