@alfalab/core-components-table 2.3.11 → 2.4.0

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 (113) hide show
  1. package/Component-72308007.d.ts +1 -1
  2. package/Component-72dda473.d.ts +53 -0
  3. package/component-72308007.d.ts +1 -1
  4. package/components/pagination/Component.d.ts +4 -0
  5. package/components/pagination/Component.js +4 -4
  6. package/components/pagination/index.css +10 -8
  7. package/components/pagination/select-field/index.css +4 -4
  8. package/components/pagination/select-field/index.js +1 -1
  9. package/components/table/Component.js +1 -1
  10. package/components/table/index.css +7 -7
  11. package/components/tbody/Component.js +1 -1
  12. package/components/tbody/index.css +2 -2
  13. package/components/tcell/Component.js +1 -1
  14. package/components/tcell/index.css +6 -6
  15. package/components/texpandable-row/Component.js +1 -1
  16. package/components/texpandable-row/index.css +5 -5
  17. package/components/thead/Component.js +1 -1
  18. package/components/thead/index.css +6 -6
  19. package/components/thead-cell/Component.js +1 -1
  20. package/components/thead-cell/index.css +9 -9
  21. package/components/trow/Component.js +1 -1
  22. package/components/trow/index.css +8 -8
  23. package/components/tsortable-head-cell/Component.js +1 -1
  24. package/components/tsortable-head-cell/index.css +8 -8
  25. package/cssm/Component-72308007.d.ts +1 -1
  26. package/cssm/Component-72dda473.d.ts +53 -0
  27. package/cssm/component-72308007.d.ts +1 -1
  28. package/cssm/components/pagination/Component.d.ts +4 -0
  29. package/cssm/components/pagination/Component.js +3 -3
  30. package/cssm/components/pagination/index.module.css +3 -1
  31. package/cssm/index-72308007.d.ts +2 -2
  32. package/cssm/index-c44170fe.d.ts +2 -20
  33. package/cssm/index-c76d6398.d.ts +1 -1
  34. package/cssm/index-ebda875c.d.ts +2 -2
  35. package/cssm/index-f12ee135.d.ts +1 -1
  36. package/{esm/types-83e2bd9e.d.ts → cssm/types-1c79e231.d.ts} +1 -1
  37. package/{esm/types-e40becc7.d.ts → cssm/types-67a2d8af.d.ts} +1 -1
  38. package/esm/Component-72308007.d.ts +1 -1
  39. package/esm/Component-72dda473.d.ts +53 -0
  40. package/esm/component-72308007.d.ts +1 -1
  41. package/esm/components/pagination/Component.d.ts +4 -0
  42. package/esm/components/pagination/Component.js +4 -4
  43. package/esm/components/pagination/index.css +10 -8
  44. package/esm/components/pagination/select-field/index.css +4 -4
  45. package/esm/components/pagination/select-field/index.js +1 -1
  46. package/esm/components/table/Component.js +1 -1
  47. package/esm/components/table/index.css +7 -7
  48. package/esm/components/tbody/Component.js +1 -1
  49. package/esm/components/tbody/index.css +2 -2
  50. package/esm/components/tcell/Component.js +1 -1
  51. package/esm/components/tcell/index.css +6 -6
  52. package/esm/components/texpandable-row/Component.js +1 -1
  53. package/esm/components/texpandable-row/index.css +5 -5
  54. package/esm/components/thead/Component.js +1 -1
  55. package/esm/components/thead/index.css +6 -6
  56. package/esm/components/thead-cell/Component.js +1 -1
  57. package/esm/components/thead-cell/index.css +9 -9
  58. package/esm/components/trow/Component.js +1 -1
  59. package/esm/components/trow/index.css +8 -8
  60. package/esm/components/tsortable-head-cell/Component.js +1 -1
  61. package/esm/components/tsortable-head-cell/index.css +8 -8
  62. package/esm/index-72308007.d.ts +2 -2
  63. package/esm/index-c44170fe.d.ts +2 -20
  64. package/esm/index-c76d6398.d.ts +1 -1
  65. package/esm/index-ebda875c.d.ts +2 -2
  66. package/esm/index-f12ee135.d.ts +1 -1
  67. package/{cssm/types-83e2bd9e.d.ts → esm/types-1c79e231.d.ts} +1 -1
  68. package/{modern/types-e40becc7.d.ts → esm/types-67a2d8af.d.ts} +1 -1
  69. package/index-72308007.d.ts +2 -2
  70. package/index-c44170fe.d.ts +2 -20
  71. package/index-c76d6398.d.ts +1 -1
  72. package/index-ebda875c.d.ts +2 -2
  73. package/index-f12ee135.d.ts +1 -1
  74. package/modern/Component-72308007.d.ts +1 -1
  75. package/modern/Component-72dda473.d.ts +53 -0
  76. package/modern/component-72308007.d.ts +1 -1
  77. package/modern/components/pagination/Component.d.ts +4 -0
  78. package/modern/components/pagination/Component.js +4 -4
  79. package/modern/components/pagination/index.css +10 -8
  80. package/modern/components/pagination/select-field/index.css +4 -4
  81. package/modern/components/pagination/select-field/index.js +1 -1
  82. package/modern/components/table/Component.js +1 -1
  83. package/modern/components/table/index.css +7 -7
  84. package/modern/components/tbody/Component.js +1 -1
  85. package/modern/components/tbody/index.css +2 -2
  86. package/modern/components/tcell/Component.js +1 -1
  87. package/modern/components/tcell/index.css +6 -6
  88. package/modern/components/texpandable-row/Component.js +1 -1
  89. package/modern/components/texpandable-row/index.css +5 -5
  90. package/modern/components/thead/Component.js +1 -1
  91. package/modern/components/thead/index.css +6 -6
  92. package/modern/components/thead-cell/Component.js +1 -1
  93. package/modern/components/thead-cell/index.css +9 -9
  94. package/modern/components/trow/Component.js +1 -1
  95. package/modern/components/trow/index.css +8 -8
  96. package/modern/components/tsortable-head-cell/Component.js +1 -1
  97. package/modern/components/tsortable-head-cell/index.css +8 -8
  98. package/modern/index-72308007.d.ts +2 -2
  99. package/modern/index-c44170fe.d.ts +2 -20
  100. package/modern/index-c76d6398.d.ts +1 -1
  101. package/modern/index-ebda875c.d.ts +2 -2
  102. package/modern/index-f12ee135.d.ts +1 -1
  103. package/modern/{types-83e2bd9e.d.ts → types-1c79e231.d.ts} +1 -1
  104. package/{cssm/types-e40becc7.d.ts → modern/types-67a2d8af.d.ts} +1 -1
  105. package/package.json +2 -2
  106. package/src/components/pagination/Component.tsx +21 -11
  107. package/src/components/pagination/index.module.css +4 -0
  108. package/{types-83e2bd9e.d.ts → types-1c79e231.d.ts} +1 -1
  109. package/{types-e40becc7.d.ts → types-67a2d8af.d.ts} +1 -1
  110. /package/cssm/{mobile-96988a65.d.ts → mobile-d7e9f69d.d.ts} +0 -0
  111. /package/esm/{mobile-96988a65.d.ts → mobile-d7e9f69d.d.ts} +0 -0
  112. /package/{mobile-96988a65.d.ts → mobile-d7e9f69d.d.ts} +0 -0
  113. /package/modern/{mobile-96988a65.d.ts → mobile-d7e9f69d.d.ts} +0 -0
@@ -1,4 +1,4 @@
1
- /* hash: 3hpvl */
1
+ /* hash: i9hkc */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-bg-primary: #fff;
@@ -21,7 +21,7 @@
21
21
  --gap-2xl: 32px;
22
22
  } :root {
23
23
  } :root {
24
- } .table__component_m3ymr {
24
+ } .table__component_10gr5 {
25
25
  font-size: 12px;
26
26
  line-height: 16px;
27
27
  font-weight: 500;
@@ -36,23 +36,23 @@
36
36
  background: var(--color-light-bg-primary);
37
37
  vertical-align: top;
38
38
  box-sizing: border-box
39
- } .table__component_m3ymr:first-child {
39
+ } .table__component_10gr5:first-child {
40
40
  padding-left: var(--gap-m);
41
- } .table__component_m3ymr:last-child {
41
+ } .table__component_10gr5:last-child {
42
42
  padding-right: var(--gap-m);
43
- } .table__component_m3ymr:not(.table__stickyHeader_m3ymr) {
43
+ } .table__component_10gr5:not(.table__stickyHeader_10gr5) {
44
44
  position: relative;
45
- } .table__sortable_m3ymr {
45
+ } .table__sortable_10gr5 {
46
46
  cursor: pointer;
47
- } .table__sorted_m3ymr {
47
+ } .table__sorted_10gr5 {
48
48
  color: var(--color-light-text-primary);
49
- } .table__stickyHeader_m3ymr {
49
+ } .table__stickyHeader_10gr5 {
50
50
  top: 0;
51
51
  position: sticky;
52
52
  box-shadow: inset 0 -1px 0 0 rgba(11, 31, 53, 0.16);
53
53
  border: none;
54
54
  z-index: 1;
55
- } .table__compactHorizontal_m3ymr {
55
+ } .table__compactHorizontal_10gr5 {
56
56
  padding-left: 6px;
57
57
  padding-right: 6px;
58
58
  }
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import cn from 'classnames';
3
3
 
4
- const styles = {"component":"table__component_jx5vy","withoutBorder":"table__withoutBorder_jx5vy","clickable":"table__clickable_jx5vy","selected":"table__selected_jx5vy"};
4
+ const styles = {"component":"table__component_1qx6c","withoutBorder":"table__withoutBorder_1qx6c","clickable":"table__clickable_1qx6c","selected":"table__selected_1qx6c"};
5
5
  require('./index.css')
6
6
 
7
7
  const TRow = ({ children, className, selected, withoutBorder, dataTestId, ...restProps }) => (React.createElement("tr", { className: cn(styles.component, className, {
@@ -1,4 +1,4 @@
1
- /* hash: 9gimf */
1
+ /* hash: hkj3t */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-bg-primary: #fff;
@@ -17,22 +17,22 @@
17
17
  } :root {
18
18
  } :root {
19
19
  } :root {
20
- } .table__component_jx5vy {
20
+ } .table__component_1qx6c {
21
21
  padding-top: 1px;
22
22
  width: 100%;
23
23
  transition: background-color 0.2s;
24
24
  box-sizing: border-box;
25
25
  background: var(--color-light-bg-primary)
26
- } .table__component_jx5vy:first-child td {
26
+ } .table__component_1qx6c:first-child td {
27
27
  border-top: 0;
28
- } .table__withoutBorder_jx5vy td {
28
+ } .table__withoutBorder_1qx6c td {
29
29
  border: none;
30
- } .table__clickable_jx5vy {
30
+ } .table__clickable_1qx6c {
31
31
  cursor: pointer
32
- } .table__clickable_jx5vy:hover {
32
+ } .table__clickable_1qx6c:hover {
33
33
  background-color: var(--color-light-bg-secondary);
34
- } .table__selected_jx5vy {
34
+ } .table__selected_1qx6c {
35
35
  background-color: #f2f8ff /* нет цвета в палитре */
36
- } .table__selected_jx5vy:hover {
36
+ } .table__selected_1qx6c:hover {
37
37
  background-color: var(--color-static-graphic-solitude);
38
38
  }
@@ -6,7 +6,7 @@ import { SortIconDesc } from './sort-icon-desc.js';
6
6
  import { SortIconUnset } from './sort-icon-unset.js';
7
7
  import '../table-context/index.js';
8
8
 
9
- const styles = {"content":"table__content_gzson","icon":"table__icon_gzson","reverse":"table__reverse_gzson","sorted":"table__sorted_gzson"};
9
+ const styles = {"content":"table__content_1v4bn","icon":"table__icon_1v4bn","reverse":"table__reverse_1v4bn","sorted":"table__sorted_1v4bn"};
10
10
  require('./index.css')
11
11
 
12
12
  const TSortableHeadCell = ({ children, className, defaultIsSortedDesc, isSortedDesc, textAlign, onSort, ...restProps }) => {
@@ -1,4 +1,4 @@
1
- /* hash: 4pjoi */
1
+ /* hash: ez9ux */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-graphic-link: #0072ef;
@@ -18,10 +18,10 @@
18
18
  --gap-xs: 8px;
19
19
  } :root {
20
20
  } :root {
21
- } .table__content_gzson {
21
+ } .table__content_1v4bn {
22
22
  display: flex;
23
23
  align-items: flex-start;
24
- } .table__icon_gzson {
24
+ } .table__icon_1v4bn {
25
25
  cursor: pointer;
26
26
  margin-left: var(--gap-xs);
27
27
 
@@ -33,15 +33,15 @@
33
33
  color: var(--color-light-graphic-secondary);
34
34
  transition: color 0.2s ease;
35
35
  flex-shrink: 0
36
- } .table__icon_gzson:hover {
36
+ } .table__icon_1v4bn:hover {
37
37
  color: var(--color-light-graphic-primary);
38
- } .table__reverse_gzson {
38
+ } .table__reverse_1v4bn {
39
39
  flex-direction: row-reverse
40
- } .table__reverse_gzson .table__icon_gzson {
40
+ } .table__reverse_1v4bn .table__icon_1v4bn {
41
41
  margin-left: 0;
42
42
  margin-right: var(--gap-xs);
43
- } .table__sorted_gzson {
43
+ } .table__sorted_1v4bn {
44
44
  color: var(--color-light-graphic-link)
45
- } .table__sorted_gzson:hover {
45
+ } .table__sorted_1v4bn:hover {
46
46
  color: var(--color-light-graphic-link);
47
47
  }
@@ -3,9 +3,9 @@ import React from "react";
3
3
  import { PaddingType } from "./index-72dda473";
4
4
  /* eslint-disable no-plusplus, no-param-reassign */
5
5
  import { MaskitoPlugin, MaskitoPostprocessor, MaskitoPreprocessor } from "@maskito/core";
6
- declare function createPaddingStyle(padding?: PaddingType): undefined | React.CSSProperties;
7
6
  declare const isClient: () => boolean;
8
7
  declare const getDataTestId: (dataTestId?: string, element?: string) => string | undefined;
8
+ declare function createPaddingStyle(padding?: PaddingType): undefined | React.CSSProperties;
9
9
  declare function easeInOutQuad(x: number): number;
10
10
  declare const easingFns: {
11
11
  easeInOutQuad: typeof easeInOutQuad;
@@ -51,4 +51,4 @@ declare const maskUtils: {
51
51
  prefixPostprocessor: typeof prefixPostprocessor;
52
52
  caretGuard: typeof caretGuard;
53
53
  };
54
- export { createPaddingStyle, isClient, getDataTestId, easingFns, inputUtils, fnUtils, maskUtils };
54
+ export { isClient, getDataTestId, createPaddingStyle, easingFns, inputUtils, fnUtils, maskUtils };
@@ -1,21 +1,3 @@
1
1
  /// <reference types="react" />
2
- import React from "react";
3
- import { BaseInputProps } from "./index-ebda875c";
4
- type InputProps = Omit<BaseInputProps, "FormControlComponent" | "colorStyles"> & {
5
- /**
6
- * Контрольная точка, с нее начинается desktop версия
7
- * @default 1024
8
- */
9
- breakpoint?: number;
10
- /**
11
- * Значение по-умолчанию для хука useMatchMedia
12
- */
13
- defaultMatchMediaValue?: boolean | (() => boolean);
14
- };
15
- declare const Input: React.ForwardRefExoticComponent<Omit<BaseInputProps, "colorStyles" | "FormControlComponent"> & {
16
- breakpoint?: number | undefined;
17
- defaultMatchMediaValue?: boolean | (() => boolean) | undefined;
18
- } & React.RefAttributes<HTMLInputElement>>;
19
- type InputMobileProps = Omit<BaseInputProps, "FormControlComponent" | "colorStyles">;
20
- declare const InputMobile: React.ForwardRefExoticComponent<InputMobileProps & React.RefAttributes<HTMLInputElement>>;
21
- export { InputProps, Input, InputMobileProps, InputMobile };
2
+ export * from "./Component.responsive-785df74d";
3
+ export {};
@@ -1,2 +1,2 @@
1
1
  export * from "./Component-72308007";
2
- export type { NavigationBarProps } from "./types-83e2bd9e";
2
+ export type { NavigationBarProps } from "./types-1c79e231";
@@ -66,7 +66,7 @@ type IconButtonProps = {
66
66
  * Набор цветов для компонента
67
67
  */
68
68
  colors?: "default" | "inverted";
69
- } & Omit<ButtonHTMLAttributes<HTMLButtonElement>, "size"> & Pick<ButtonProps, "href" | "loading" | "breakpoint"> & Pick<AnchorHTMLAttributes<HTMLAnchorElement>, "target" | "download">;
69
+ } & Omit<ButtonHTMLAttributes<HTMLButtonElement>, "size"> & Pick<ButtonProps, "Component" | "href" | "loading" | "breakpoint"> & Pick<AnchorHTMLAttributes<HTMLAnchorElement>, "target" | "download">;
70
70
  declare const IconButton: React.ForwardRefExoticComponent<{
71
71
  icon: ElementType<{
72
72
  className?: string;
@@ -77,5 +77,5 @@ declare const IconButton: React.ForwardRefExoticComponent<{
77
77
  alignIcon?: "center" | "left" | "right" | undefined;
78
78
  dataTestId?: string | undefined;
79
79
  colors?: "default" | "inverted" | undefined;
80
- } & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "size"> & Pick<ButtonProps, "href" | "loading" | "breakpoint"> & Pick<React.AnchorHTMLAttributes<HTMLAnchorElement>, "download" | "target"> & React.RefAttributes<HTMLButtonElement>>;
80
+ } & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "size"> & Pick<ButtonProps, "href" | "Component" | "loading" | "breakpoint"> & Pick<React.AnchorHTMLAttributes<HTMLAnchorElement>, "download" | "target"> & React.RefAttributes<HTMLButtonElement>>;
81
81
  export { CloserProps, Closer, IconButtonProps, IconButton };
@@ -1,3 +1,3 @@
1
1
  export * from "./component-72308007";
2
- export type { BottomSheetProps, BottomSheetTitleAlign } from "./types-e40becc7";
2
+ export type { BottomSheetProps, BottomSheetTitleAlign } from "./types-67a2d8af";
3
3
  export { CLOSE_OFFSET, HEADER_OFFSET } from "./utils-49cc3c24";
@@ -14,7 +14,7 @@ type NavigationBarProps = {
14
14
  /**
15
15
  * Подзаголовок (доступен только в мобильной версии)
16
16
  */
17
- subtitle?: string;
17
+ subtitle?: ReactNode;
18
18
  /**
19
19
  * Размер заголовка (compact доступен только в мобильной версии)
20
20
  */
@@ -259,7 +259,7 @@ type BottomSheetProps = {
259
259
  /**
260
260
  * Вызывается после окончания анимации притягивания
261
261
  */
262
- onMagnetizeEnd?: () => void;
262
+ onMagnetizeEnd?: (index: number) => void;
263
263
  /**
264
264
  * Вызывается при изменении положения шторки
265
265
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfalab/core-components-table",
3
- "version": "2.3.11",
3
+ "version": "2.4.0",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -17,7 +17,7 @@
17
17
  "dependencies": {
18
18
  "@alfalab/core-components-button": "^9.0.5",
19
19
  "@alfalab/core-components-pagination": "^2.1.2",
20
- "@alfalab/core-components-select": "^15.1.6",
20
+ "@alfalab/core-components-select": "^15.2.0",
21
21
  "classnames": "^2.3.1",
22
22
  "tslib": "^2.4.0"
23
23
  }
@@ -30,6 +30,11 @@ export type PaginationProps = CorePaginationProps & {
30
30
  */
31
31
  onPerPageChange?: (perPage: number) => void;
32
32
 
33
+ /**
34
+ * Скрывает переключатель количества строк на страницу
35
+ */
36
+ hidePerPageSelect?: boolean;
37
+
33
38
  /**
34
39
  * Идентификатор для систем автоматизированного тестирования
35
40
  */
@@ -40,6 +45,7 @@ export const Pagination: FC<PaginationProps> = ({
40
45
  perPage = 25,
41
46
  possiblePerPage = [25, 50, 100],
42
47
  onPerPageChange = () => null,
48
+ hidePerPageSelect = false,
43
49
  pagesCount,
44
50
  onPageChange = () => null,
45
51
  className,
@@ -81,21 +87,25 @@ export const Pagination: FC<PaginationProps> = ({
81
87
 
82
88
  return (
83
89
  <div className={cn(styles.component, className)} data-test-id={dataTestId}>
84
- <SelectDesktop
85
- options={options}
86
- selected={perPage.toString()}
87
- onChange={handlePerPageChange}
88
- preventFlip={false}
89
- size='s'
90
- className={styles.select}
91
- optionsListClassName={styles.menu}
92
- optionClassName={styles.option}
93
- Field={CustomSelectField}
94
- />
90
+ {hidePerPageSelect === false && (
91
+ <SelectDesktop
92
+ options={options}
93
+ selected={perPage.toString()}
94
+ onChange={handlePerPageChange}
95
+ preventFlip={false}
96
+ size='s'
97
+ className={styles.select}
98
+ optionsListClassName={styles.menu}
99
+ optionClassName={styles.option}
100
+ Field={CustomSelectField}
101
+ />
102
+ )}
103
+
95
104
  {pagesCount > 1 && (
96
105
  <CorePagination
97
106
  pagesCount={pagesCount}
98
107
  onPageChange={handlePageChange}
108
+ className={styles.pagination}
99
109
  {...restPaginationProps}
100
110
  />
101
111
  )}
@@ -29,6 +29,10 @@
29
29
  }
30
30
  }
31
31
 
32
+ .pagination {
33
+ margin-left: auto;
34
+ }
35
+
32
36
  .menu {
33
37
  margin: var(--gap-2xs) 0;
34
38
  }
@@ -14,7 +14,7 @@ type NavigationBarProps = {
14
14
  /**
15
15
  * Подзаголовок (доступен только в мобильной версии)
16
16
  */
17
- subtitle?: string;
17
+ subtitle?: ReactNode;
18
18
  /**
19
19
  * Размер заголовка (compact доступен только в мобильной версии)
20
20
  */
@@ -259,7 +259,7 @@ type BottomSheetProps = {
259
259
  /**
260
260
  * Вызывается после окончания анимации притягивания
261
261
  */
262
- onMagnetizeEnd?: () => void;
262
+ onMagnetizeEnd?: (index: number) => void;
263
263
  /**
264
264
  * Вызывается при изменении положения шторки
265
265
  */
File without changes