@alfalab/core-components-table 4.0.7 → 4.0.8
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/component.d.ts +21 -22
- package/components/pagination/Component.d.ts +1 -1
- package/components/pagination/Component.js.map +1 -1
- package/components/pagination/index.css +8 -8
- package/components/pagination/index.module.css.js +1 -1
- package/components/pagination/index.module.css.js.map +1 -1
- package/components/pagination/select-field/index.css +3 -3
- package/components/pagination/select-field/index.module.css.js +1 -1
- package/components/pagination/select-field/index.module.css.js.map +1 -1
- package/components/table/Component.d.ts +7 -7
- package/components/table/index.css +6 -6
- package/components/table/index.module.css.js +1 -1
- package/components/table/index.module.css.js.map +1 -1
- package/components/table/utils.js.map +1 -1
- package/components/table-context/index.d.ts +2 -2
- package/components/tbody/Component.d.ts +3 -3
- package/components/tbody/index.css +1 -1
- package/components/tbody/index.module.css.js +1 -1
- package/components/tbody/index.module.css.js.map +1 -1
- package/components/tcell/Component.d.ts +1 -1
- package/components/tcell/index.css +5 -5
- package/components/tcell/index.module.css.js +1 -1
- package/components/tcell/index.module.css.js.map +1 -1
- package/components/texpandable-row/Component.d.ts +9 -9
- package/components/texpandable-row/Component.js.map +1 -1
- package/components/texpandable-row/index.css +4 -4
- package/components/texpandable-row/index.module.css.js +1 -1
- package/components/texpandable-row/index.module.css.js.map +1 -1
- package/components/thead/Component.d.ts +1 -1
- package/components/thead/index.css +5 -5
- package/components/thead/index.module.css.js +1 -1
- package/components/thead/index.module.css.js.map +1 -1
- package/components/thead-cell/Component.d.ts +1 -1
- package/components/thead-cell/index.css +8 -8
- package/components/thead-cell/index.module.css.js +1 -1
- package/components/thead-cell/index.module.css.js.map +1 -1
- package/components/trow/Component.d.ts +6 -6
- package/components/trow/index.css +7 -7
- package/components/trow/index.module.css.js +1 -1
- package/components/trow/index.module.css.js.map +1 -1
- package/components/tsortable-head-cell/Component.d.ts +1 -1
- package/components/tsortable-head-cell/index.css +7 -7
- package/components/tsortable-head-cell/index.module.css.js +1 -1
- package/components/tsortable-head-cell/index.module.css.js.map +1 -1
- package/cssm/component.d.ts +21 -22
- package/cssm/components/pagination/Component.d.ts +1 -1
- package/cssm/components/pagination/Component.js.map +1 -1
- package/cssm/components/table/Component.d.ts +7 -7
- package/cssm/components/table/utils.js.map +1 -1
- package/cssm/components/table-context/index.d.ts +2 -2
- package/cssm/components/tbody/Component.d.ts +3 -3
- package/cssm/components/tcell/Component.d.ts +1 -1
- package/cssm/components/texpandable-row/Component.d.ts +9 -9
- package/cssm/components/texpandable-row/Component.js.map +1 -1
- package/cssm/components/thead/Component.d.ts +1 -1
- package/cssm/components/thead-cell/Component.d.ts +1 -1
- package/cssm/components/trow/Component.d.ts +6 -6
- package/cssm/components/tsortable-head-cell/Component.d.ts +1 -1
- package/cssm/typings.d.ts +1 -1
- package/cssm/utils.d.ts +4 -1
- package/cssm/utils.js +1 -1
- package/cssm/utils.js.map +1 -1
- package/esm/component.d.ts +21 -22
- package/esm/components/pagination/Component.d.ts +1 -1
- package/esm/components/pagination/Component.js.map +1 -1
- package/esm/components/pagination/index.css +8 -8
- package/esm/components/pagination/index.module.css.js +1 -1
- package/esm/components/pagination/index.module.css.js.map +1 -1
- package/esm/components/pagination/select-field/index.css +3 -3
- package/esm/components/pagination/select-field/index.module.css.js +1 -1
- package/esm/components/pagination/select-field/index.module.css.js.map +1 -1
- package/esm/components/table/Component.d.ts +7 -7
- package/esm/components/table/index.css +6 -6
- package/esm/components/table/index.module.css.js +1 -1
- package/esm/components/table/index.module.css.js.map +1 -1
- package/esm/components/table/utils.js.map +1 -1
- package/esm/components/table-context/index.d.ts +2 -2
- package/esm/components/tbody/Component.d.ts +3 -3
- package/esm/components/tbody/index.css +1 -1
- package/esm/components/tbody/index.module.css.js +1 -1
- package/esm/components/tbody/index.module.css.js.map +1 -1
- package/esm/components/tcell/Component.d.ts +1 -1
- package/esm/components/tcell/index.css +5 -5
- package/esm/components/tcell/index.module.css.js +1 -1
- package/esm/components/tcell/index.module.css.js.map +1 -1
- package/esm/components/texpandable-row/Component.d.ts +9 -9
- package/esm/components/texpandable-row/Component.js.map +1 -1
- package/esm/components/texpandable-row/index.css +4 -4
- package/esm/components/texpandable-row/index.module.css.js +1 -1
- package/esm/components/texpandable-row/index.module.css.js.map +1 -1
- package/esm/components/thead/Component.d.ts +1 -1
- package/esm/components/thead/index.css +5 -5
- package/esm/components/thead/index.module.css.js +1 -1
- package/esm/components/thead/index.module.css.js.map +1 -1
- package/esm/components/thead-cell/Component.d.ts +1 -1
- package/esm/components/thead-cell/index.css +8 -8
- package/esm/components/thead-cell/index.module.css.js +1 -1
- package/esm/components/thead-cell/index.module.css.js.map +1 -1
- package/esm/components/trow/Component.d.ts +6 -6
- package/esm/components/trow/index.css +7 -7
- package/esm/components/trow/index.module.css.js +1 -1
- package/esm/components/trow/index.module.css.js.map +1 -1
- package/esm/components/tsortable-head-cell/Component.d.ts +1 -1
- package/esm/components/tsortable-head-cell/index.css +7 -7
- package/esm/components/tsortable-head-cell/index.module.css.js +1 -1
- package/esm/components/tsortable-head-cell/index.module.css.js.map +1 -1
- package/esm/typings.d.ts +1 -1
- package/esm/utils.d.ts +4 -1
- package/esm/utils.js +1 -1
- package/esm/utils.js.map +1 -1
- package/modern/component.d.ts +21 -22
- package/modern/components/pagination/Component.d.ts +1 -1
- package/modern/components/pagination/Component.js.map +1 -1
- package/modern/components/pagination/index.css +8 -8
- package/modern/components/pagination/index.module.css.js +1 -1
- package/modern/components/pagination/index.module.css.js.map +1 -1
- package/modern/components/pagination/select-field/index.css +3 -3
- package/modern/components/pagination/select-field/index.module.css.js +1 -1
- package/modern/components/pagination/select-field/index.module.css.js.map +1 -1
- package/modern/components/table/Component.d.ts +7 -7
- package/modern/components/table/index.css +6 -6
- package/modern/components/table/index.module.css.js +1 -1
- package/modern/components/table/index.module.css.js.map +1 -1
- package/modern/components/table/utils.js.map +1 -1
- package/modern/components/table-context/index.d.ts +2 -2
- package/modern/components/tbody/Component.d.ts +3 -3
- package/modern/components/tbody/index.css +1 -1
- package/modern/components/tbody/index.module.css.js +1 -1
- package/modern/components/tbody/index.module.css.js.map +1 -1
- package/modern/components/tcell/Component.d.ts +1 -1
- package/modern/components/tcell/index.css +5 -5
- package/modern/components/tcell/index.module.css.js +1 -1
- package/modern/components/tcell/index.module.css.js.map +1 -1
- package/modern/components/texpandable-row/Component.d.ts +9 -9
- package/modern/components/texpandable-row/Component.js.map +1 -1
- package/modern/components/texpandable-row/index.css +4 -4
- package/modern/components/texpandable-row/index.module.css.js +1 -1
- package/modern/components/texpandable-row/index.module.css.js.map +1 -1
- package/modern/components/thead/Component.d.ts +1 -1
- package/modern/components/thead/index.css +5 -5
- package/modern/components/thead/index.module.css.js +1 -1
- package/modern/components/thead/index.module.css.js.map +1 -1
- package/modern/components/thead-cell/Component.d.ts +1 -1
- package/modern/components/thead-cell/index.css +8 -8
- package/modern/components/thead-cell/index.module.css.js +1 -1
- package/modern/components/thead-cell/index.module.css.js.map +1 -1
- package/modern/components/trow/Component.d.ts +6 -6
- package/modern/components/trow/index.css +7 -7
- package/modern/components/trow/index.module.css.js +1 -1
- package/modern/components/trow/index.module.css.js.map +1 -1
- package/modern/components/tsortable-head-cell/Component.d.ts +1 -1
- package/modern/components/tsortable-head-cell/index.css +7 -7
- package/modern/components/tsortable-head-cell/index.module.css.js +1 -1
- package/modern/components/tsortable-head-cell/index.module.css.js.map +1 -1
- package/modern/typings.d.ts +1 -1
- package/modern/utils.d.ts +4 -1
- package/modern/utils.js +1 -1
- package/modern/utils.js.map +1 -1
- package/moderncssm/component.d.ts +21 -22
- package/moderncssm/components/pagination/Component.d.ts +1 -1
- package/moderncssm/components/pagination/Component.js.map +1 -1
- package/moderncssm/components/table/Component.d.ts +7 -7
- package/moderncssm/components/table/utils.js.map +1 -1
- package/moderncssm/components/table-context/index.d.ts +2 -2
- package/moderncssm/components/tbody/Component.d.ts +3 -3
- package/moderncssm/components/tcell/Component.d.ts +1 -1
- package/moderncssm/components/texpandable-row/Component.d.ts +9 -9
- package/moderncssm/components/texpandable-row/Component.js.map +1 -1
- package/moderncssm/components/thead/Component.d.ts +1 -1
- package/moderncssm/components/thead-cell/Component.d.ts +1 -1
- package/moderncssm/components/trow/Component.d.ts +6 -6
- package/moderncssm/components/tsortable-head-cell/Component.d.ts +1 -1
- package/moderncssm/typings.d.ts +1 -1
- package/moderncssm/utils.d.ts +4 -1
- package/moderncssm/utils.js +1 -1
- package/moderncssm/utils.js.map +1 -1
- package/package.json +5 -5
- package/src/components/pagination/index.module.css +1 -1
- package/src/components/pagination/select-field/index.module.css +1 -1
- package/src/components/table/index.module.css +1 -1
- package/src/components/tbody/index.module.css +1 -1
- package/src/components/tcell/index.module.css +1 -1
- package/src/components/texpandable-row/index.module.css +1 -1
- package/src/components/thead/index.module.css +1 -1
- package/src/components/thead-cell/index.module.css +1 -1
- package/src/components/trow/index.module.css +1 -1
- package/src/components/tsortable-head-cell/index.module.css +1 -1
- package/src/utils.ts +8 -2
- package/typings.d.ts +1 -1
- package/utils.d.ts +4 -1
- package/utils.js +1 -1
- package/utils.js.map +1 -1
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
--font-family-system:
|
|
18
18
|
system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Helvetica, sans-serif;
|
|
19
19
|
}
|
|
20
|
-
.
|
|
20
|
+
.table__component_b71i8 {
|
|
21
21
|
font-size: 14px;
|
|
22
22
|
line-height: 20px;
|
|
23
23
|
font-weight: 400;
|
|
@@ -30,17 +30,17 @@
|
|
|
30
30
|
vertical-align: top;
|
|
31
31
|
box-sizing: border-box;
|
|
32
32
|
}
|
|
33
|
-
.
|
|
33
|
+
.table__component_b71i8:first-child {
|
|
34
34
|
padding-left: var(--gap-16);
|
|
35
35
|
}
|
|
36
|
-
.
|
|
36
|
+
.table__component_b71i8:last-child {
|
|
37
37
|
padding-right: var(--gap-16);
|
|
38
38
|
}
|
|
39
|
-
.
|
|
39
|
+
.table__compactHorizontal_b71i8 {
|
|
40
40
|
padding-left: var(--gap-6);
|
|
41
41
|
padding-right: var(--gap-6);
|
|
42
42
|
}
|
|
43
|
-
.
|
|
43
|
+
.table__compact_b71i8 {
|
|
44
44
|
padding-top: var(--gap-8);
|
|
45
45
|
padding-bottom: var(--gap-8);
|
|
46
46
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
|
|
3
|
-
const styles = {"component":"
|
|
3
|
+
const styles = {"component":"table__component_b71i8","compactHorizontal":"table__compactHorizontal_b71i8","compact":"table__compact_b71i8"};
|
|
4
4
|
|
|
5
5
|
export { styles as default };
|
|
6
6
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":["../../src/components/tcell/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["../../src/components/tcell/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n.component {\n @mixin paragraph_primary_small;\n\n color: var(--color-light-text-primary);\n padding: var(--gap-24) var(--gap-12);\n height: 72px;\n border-top: 1px solid var(--color-light-neutral-400);\n vertical-align: top;\n box-sizing: border-box;\n\n &:first-child {\n padding-left: var(--gap-16);\n }\n\n &:last-child {\n padding-right: var(--gap-16);\n }\n}\n\n.compactHorizontal {\n padding-left: var(--gap-6);\n padding-right: var(--gap-6);\n}\n\n.compact {\n padding-top: var(--gap-8);\n padding-bottom: var(--gap-8);\n\n max-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n"],"names":[],"mappings":";;AAEgB,eAAe,CAAC,WAAW,CAAC,wBAAwB,CAAC,mBAAmB,CAAC,gCAAgC,CAAC,SAAS,CAAC,sBAAsB,CAAC;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { type ReactNode, type Ref } from 'react';
|
|
2
2
|
import { type TRowProps } from '../trow';
|
|
3
|
-
export
|
|
3
|
+
export type TExpandableRowProps = TRowProps & {
|
|
4
4
|
defaultExpanded?: boolean;
|
|
5
5
|
expanded?: boolean;
|
|
6
6
|
onToggle?: (expanded: boolean) => void;
|
|
@@ -9,14 +9,14 @@ export declare type TExpandableRowProps = TRowProps & {
|
|
|
9
9
|
};
|
|
10
10
|
export declare const TExpandableRow: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableRowElement> & {
|
|
11
11
|
children: React.ReactElement<import("..").TCellProps, ({ className, style, dataTestId, children, index, ...restProps }: import("..").TCellProps) => React.JSX.Element | null> | React.ReactElement<import("..").TCellProps, ({ className, style, dataTestId, children, index, ...restProps }: import("..").TCellProps) => React.JSX.Element | null>[];
|
|
12
|
-
className?: string
|
|
13
|
-
selected?: boolean
|
|
14
|
-
withoutBorder?: boolean
|
|
15
|
-
dataTestId?: string
|
|
12
|
+
className?: string;
|
|
13
|
+
selected?: boolean;
|
|
14
|
+
withoutBorder?: boolean;
|
|
15
|
+
dataTestId?: string;
|
|
16
16
|
} & {
|
|
17
|
-
defaultExpanded?: boolean
|
|
18
|
-
expanded?: boolean
|
|
19
|
-
onToggle?: (
|
|
17
|
+
defaultExpanded?: boolean;
|
|
18
|
+
expanded?: boolean;
|
|
19
|
+
onToggle?: (expanded: boolean) => void;
|
|
20
20
|
renderContent: (expanded: boolean) => ReactNode;
|
|
21
|
-
rowRef?:
|
|
21
|
+
rowRef?: Ref<HTMLTableRowElement>;
|
|
22
22
|
} & React.RefAttributes<HTMLTableRowElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component.js","sources":["../../../src/components/texpandable-row/Component.tsx"],"sourcesContent":["import React, { forwardRef, type ReactNode, type Ref, useState } from 'react';\nimport cn from 'classnames';\n\nimport { TRow, type TRowProps } from '../trow';\n\nimport styles from './index.module.css';\n\nexport type TExpandableRowProps = TRowProps & {\n defaultExpanded?: boolean;\n\n expanded?: boolean;\n\n onToggle?: (expanded: boolean) => void;\n\n renderContent: (expanded: boolean) => ReactNode;\n\n rowRef?: Ref<HTMLTableRowElement>;\n};\n\nexport const TExpandableRow = forwardRef<HTMLTableRowElement, TExpandableRowProps>(\n (\n {\n className,\n selected,\n expanded,\n defaultExpanded = false,\n onToggle = () => null,\n renderContent = () => null,\n rowRef,\n ...restProps\n }: TExpandableRowProps,\n ref,\n ) => {\n const [expandedState, setExpandedState] = useState<boolean>(defaultExpanded);\n\n const uncontrolled = expanded === undefined;\n\n const isExpanded = uncontrolled ? expandedState : expanded;\n\n const handleToggle = () => {\n if (uncontrolled) {\n setExpandedState(!isExpanded);\n }\n\n onToggle(isExpanded);\n };\n\n return (\n <React.Fragment>\n <TRow\n className={cn(styles.row, className, {\n [styles.selected]: selected,\n [styles.expanded]: isExpanded,\n })}\n selected={selected}\n onClick={handleToggle}\n ref={rowRef}\n {...restProps}\n />\n\n <tr ref={ref} className={cn(styles.expandable, { [styles.expanded]: isExpanded })}>\n {renderContent(isExpanded)}\n </tr>\n </React.Fragment>\n );\n },\n);\n\nTExpandableRow.displayName = 'TExpandableRow';\n"],"names":[],"mappings":";;;;;AAmBa,MAAA,cAAc,GAAG,UAAU,CACpC,CACI,EACI,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,eAAe,GAAG,KAAK,EACvB,QAAQ,GAAG,MAAM,IAAI,EACrB,aAAa,GAAG,MAAM,IAAI,EAC1B,MAAM,EACN,GAAG,SAAS,EACM,EACtB,GAAG,KACH;IACA,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAU,eAAe,CAAC;AAE5E,IAAA,MAAM,YAAY,GAAG,QAAQ,KAAK,SAAS;IAE3C,MAAM,UAAU,GAAG,YAAY,GAAG,aAAa,GAAG,QAAQ;IAE1D,MAAM,YAAY,GAAG,MAAK;
|
|
1
|
+
{"version":3,"file":"Component.js","sources":["../../../src/components/texpandable-row/Component.tsx"],"sourcesContent":["import React, { forwardRef, type ReactNode, type Ref, useState } from 'react';\nimport cn from 'classnames';\n\nimport { TRow, type TRowProps } from '../trow';\n\nimport styles from './index.module.css';\n\nexport type TExpandableRowProps = TRowProps & {\n defaultExpanded?: boolean;\n\n expanded?: boolean;\n\n onToggle?: (expanded: boolean) => void;\n\n renderContent: (expanded: boolean) => ReactNode;\n\n rowRef?: Ref<HTMLTableRowElement>;\n};\n\nexport const TExpandableRow = forwardRef<HTMLTableRowElement, TExpandableRowProps>(\n (\n {\n className,\n selected,\n expanded,\n defaultExpanded = false,\n onToggle = () => null,\n renderContent = () => null,\n rowRef,\n ...restProps\n }: TExpandableRowProps,\n ref,\n ) => {\n const [expandedState, setExpandedState] = useState<boolean>(defaultExpanded);\n\n const uncontrolled = expanded === undefined;\n\n const isExpanded = uncontrolled ? expandedState : expanded;\n\n const handleToggle = () => {\n if (uncontrolled) {\n setExpandedState(!isExpanded);\n }\n\n onToggle(isExpanded);\n };\n\n return (\n <React.Fragment>\n <TRow\n className={cn(styles.row, className, {\n [styles.selected]: selected,\n [styles.expanded]: isExpanded,\n })}\n selected={selected}\n onClick={handleToggle}\n ref={rowRef}\n {...restProps}\n />\n\n <tr ref={ref} className={cn(styles.expandable, { [styles.expanded]: isExpanded })}>\n {renderContent(isExpanded)}\n </tr>\n </React.Fragment>\n );\n },\n);\n\nTExpandableRow.displayName = 'TExpandableRow';\n"],"names":[],"mappings":";;;;;AAmBa,MAAA,cAAc,GAAG,UAAU,CACpC,CACI,EACI,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,eAAe,GAAG,KAAK,EACvB,QAAQ,GAAG,MAAM,IAAI,EACrB,aAAa,GAAG,MAAM,IAAI,EAC1B,MAAM,EACN,GAAG,SAAS,EACM,EACtB,GAAG,KACH;IACA,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAU,eAAe,CAAC;AAE5E,IAAA,MAAM,YAAY,GAAG,QAAQ,KAAK,SAAS;IAE3C,MAAM,UAAU,GAAG,YAAY,GAAG,aAAa,GAAG,QAAQ;IAE1D,MAAM,YAAY,GAAG,MAAK;QACtB,IAAI,YAAY,EAAE;AACd,YAAA,gBAAgB,CAAC,CAAC,UAAU,CAAC;;QAGjC,QAAQ,CAAC,UAAU,CAAC;AACxB,KAAC;AAED,IAAA,QACI,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,QAAQ,EAAA,IAAA;QACX,KAAC,CAAA,aAAA,CAAA,IAAI,EACD,EAAA,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,SAAS,EAAE;AACjC,gBAAA,CAAC,MAAM,CAAC,QAAQ,GAAG,QAAQ;AAC3B,gBAAA,CAAC,MAAM,CAAC,QAAQ,GAAG,UAAU;AAChC,aAAA,CAAC,EACF,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,YAAY,EACrB,GAAG,EAAE,MAAM,EAAA,GACP,SAAS,EACf,CAAA;AAEF,QAAA,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAI,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,GAAG,UAAU,EAAE,CAAC,EAAA,EAC5E,aAAa,CAAC,UAAU,CAAC,CACzB,CACQ;AAEzB,CAAC;AAGL,cAAc,CAAC,WAAW,GAAG,gBAAgB;;;;"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
:root {
|
|
2
2
|
--gap-0: 0px;
|
|
3
3
|
}
|
|
4
|
-
.
|
|
4
|
+
.table__row_1g6vt {
|
|
5
5
|
cursor: pointer;
|
|
6
6
|
}
|
|
7
|
-
.
|
|
7
|
+
.table__selected_1g6vt.table__expanded_1g6vt {
|
|
8
8
|
background-color: inherit;
|
|
9
9
|
}
|
|
10
|
-
.
|
|
10
|
+
.table__expanded_1g6vt:hover {
|
|
11
11
|
background-color: inherit;
|
|
12
12
|
}
|
|
13
|
-
.
|
|
13
|
+
.table__expandable_1g6vt td {
|
|
14
14
|
margin: var(--gap-0);
|
|
15
15
|
padding-top: var(--gap-0);
|
|
16
16
|
padding-bottom: var(--gap-0);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
|
|
3
|
-
const styles = {"row":"
|
|
3
|
+
const styles = {"row":"table__row_1g6vt","selected":"table__selected_1g6vt","expanded":"table__expanded_1g6vt","expandable":"table__expandable_1g6vt"};
|
|
4
4
|
|
|
5
5
|
export { styles as default };
|
|
6
6
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":["../../src/components/texpandable-row/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["../../src/components/texpandable-row/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n.row {\n cursor: pointer;\n}\n\n.selected.expanded {\n background-color: inherit;\n}\n\n.expanded {\n &:hover {\n background-color: inherit;\n }\n}\n\n.expandable {\n & td {\n margin: var(--gap-0);\n padding-top: var(--gap-0);\n padding-bottom: var(--gap-0);\n border: none;\n height: auto;\n }\n}\n"],"names":[],"mappings":";;AAEgB,eAAe,CAAC,KAAK,CAAC,kBAAkB,CAAC,UAAU,CAAC,uBAAuB,CAAC,UAAU,CAAC,uBAAuB,CAAC,YAAY,CAAC,yBAAyB,CAAC;;;;"}
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
--gap-0: 0px;
|
|
7
7
|
--gap-8: var(--gap-xs);
|
|
8
8
|
}
|
|
9
|
-
.
|
|
9
|
+
.table__component_1yumx {
|
|
10
10
|
position: relative;
|
|
11
11
|
width: 100%;
|
|
12
12
|
box-sizing: border-box;
|
|
13
13
|
}
|
|
14
|
-
.
|
|
14
|
+
.table__component_1yumx th:not(:last-child):not(:empty):after {
|
|
15
15
|
transition: opacity 0.2s;
|
|
16
16
|
position: absolute;
|
|
17
17
|
content: '';
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
bottom: var(--gap-8);
|
|
24
24
|
background-color: var(--color-light-neutral-400);
|
|
25
25
|
}
|
|
26
|
-
.
|
|
26
|
+
.table__component_1yumx th:after {
|
|
27
27
|
opacity: 0;
|
|
28
28
|
}
|
|
29
|
-
.
|
|
29
|
+
.table__component_1yumx:hover th:after {
|
|
30
30
|
opacity: 1;
|
|
31
31
|
}
|
|
32
|
-
.
|
|
32
|
+
.table__row_1yumx {
|
|
33
33
|
height: 72px;
|
|
34
34
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
|
|
3
|
-
const styles = {"component":"
|
|
3
|
+
const styles = {"component":"table__component_1yumx","row":"table__row_1yumx"};
|
|
4
4
|
|
|
5
5
|
export { styles as default };
|
|
6
6
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":["../../src/components/thead/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["../../src/components/thead/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n.component {\n position: relative;\n width: 100%;\n box-sizing: border-box;\n\n & th:not(:last-child):not(:empty):after {\n transition: opacity 0.2s;\n position: absolute;\n content: '';\n display: block;\n\n width: 1px;\n right: var(--gap-0);\n top: var(--gap-8);\n bottom: var(--gap-8);\n background-color: var(--color-light-neutral-400);\n }\n\n & th:after {\n opacity: 0;\n }\n\n &:hover th:after {\n opacity: 1;\n }\n}\n\n.row {\n height: 72px;\n}\n"],"names":[],"mappings":";;AAEgB,eAAe,CAAC,WAAW,CAAC,wBAAwB,CAAC,KAAK,CAAC,kBAAkB,CAAC;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { type ThHTMLAttributes } from 'react';
|
|
2
2
|
import { type TextAlignProperty } from '../../typings';
|
|
3
|
-
export
|
|
3
|
+
export type THeadCellProps = ThHTMLAttributes<HTMLHeadingElement> & {
|
|
4
4
|
/**
|
|
5
5
|
* Дополнительный класс
|
|
6
6
|
*/
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
--font-family-system:
|
|
20
20
|
system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Helvetica, sans-serif;
|
|
21
21
|
}
|
|
22
|
-
.
|
|
22
|
+
.table__component_8b0qo {
|
|
23
23
|
font-size: 12px;
|
|
24
24
|
line-height: 16px;
|
|
25
25
|
font-weight: 400;
|
|
@@ -36,29 +36,29 @@
|
|
|
36
36
|
vertical-align: top;
|
|
37
37
|
box-sizing: border-box;
|
|
38
38
|
}
|
|
39
|
-
.
|
|
39
|
+
.table__component_8b0qo:first-child {
|
|
40
40
|
padding-left: var(--gap-16);
|
|
41
41
|
}
|
|
42
|
-
.
|
|
42
|
+
.table__component_8b0qo:last-child {
|
|
43
43
|
padding-right: var(--gap-16);
|
|
44
44
|
}
|
|
45
|
-
.
|
|
45
|
+
.table__component_8b0qo:not(.table__stickyHeader_8b0qo) {
|
|
46
46
|
position: relative;
|
|
47
47
|
}
|
|
48
|
-
.
|
|
48
|
+
.table__sortable_8b0qo {
|
|
49
49
|
cursor: pointer;
|
|
50
50
|
}
|
|
51
|
-
.
|
|
51
|
+
.table__sorted_8b0qo {
|
|
52
52
|
color: var(--color-light-text-primary);
|
|
53
53
|
}
|
|
54
|
-
.
|
|
54
|
+
.table__stickyHeader_8b0qo {
|
|
55
55
|
top: var(--gap-0);
|
|
56
56
|
position: sticky;
|
|
57
57
|
box-shadow: inset 0 -1px 0 0 rgba(11, 31, 53, 0.16);
|
|
58
58
|
border: none;
|
|
59
59
|
z-index: 1;
|
|
60
60
|
}
|
|
61
|
-
.
|
|
61
|
+
.table__compactHorizontal_8b0qo {
|
|
62
62
|
padding-left: var(--gap-6);
|
|
63
63
|
padding-right: var(--gap-6);
|
|
64
64
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
|
|
3
|
-
const styles = {"component":"
|
|
3
|
+
const styles = {"component":"table__component_8b0qo","stickyHeader":"table__stickyHeader_8b0qo","compactHorizontal":"table__compactHorizontal_8b0qo"};
|
|
4
4
|
|
|
5
5
|
export { styles as default };
|
|
6
6
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":["../../src/components/thead-cell/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["../../src/components/thead-cell/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n.component {\n @mixin paragraph_caps;\n\n line-height: 20px;\n text-align: left;\n color: var(--color-light-text-primary);\n padding: var(--gap-32) var(--gap-12) var(--gap-4);\n border-bottom: 1px solid var(--color-light-neutral-400);\n background: var(--color-light-base-bg-primary);\n vertical-align: top;\n box-sizing: border-box;\n\n &:first-child {\n padding-left: var(--gap-16);\n }\n\n &:last-child {\n padding-right: var(--gap-16);\n }\n\n &:not(.stickyHeader) {\n position: relative;\n }\n}\n\n.sortable {\n cursor: pointer;\n}\n\n.sorted {\n color: var(--color-light-text-primary);\n}\n\n.stickyHeader {\n top: var(--gap-0);\n position: sticky;\n box-shadow: inset 0 -1px 0 0 rgba(11, 31, 53, 0.16);\n border: none;\n z-index: 1;\n}\n\n.compactHorizontal {\n padding-left: var(--gap-6);\n padding-right: var(--gap-6);\n}\n"],"names":[],"mappings":";;AAEgB,eAAe,CAAC,WAAW,CAAC,wBAAwB,CAAC,cAAc,CAAC,2BAA2B,CAAmE,mBAAmB,CAAC,gCAAgC,CAAC;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { type HTMLAttributes } from 'react';
|
|
2
2
|
import { type TCell, type TCellProps } from '../tcell';
|
|
3
|
-
|
|
4
|
-
export
|
|
3
|
+
type TCellElement = React.ReactElement<TCellProps, typeof TCell>;
|
|
4
|
+
export type TRowProps = HTMLAttributes<HTMLTableRowElement> & {
|
|
5
5
|
/**
|
|
6
6
|
* Компоненты ячеек
|
|
7
7
|
*/
|
|
@@ -31,18 +31,18 @@ export declare const TRow: React.ForwardRefExoticComponent<React.HTMLAttributes<
|
|
|
31
31
|
/**
|
|
32
32
|
* Дополнительный класс
|
|
33
33
|
*/
|
|
34
|
-
className?: string
|
|
34
|
+
className?: string;
|
|
35
35
|
/**
|
|
36
36
|
* Стиль выбранной строки
|
|
37
37
|
*/
|
|
38
|
-
selected?: boolean
|
|
38
|
+
selected?: boolean;
|
|
39
39
|
/**
|
|
40
40
|
* Убирает нижнюю границу
|
|
41
41
|
*/
|
|
42
|
-
withoutBorder?: boolean
|
|
42
|
+
withoutBorder?: boolean;
|
|
43
43
|
/**
|
|
44
44
|
* Идентификатор для систем автоматизированного тестирования
|
|
45
45
|
*/
|
|
46
|
-
dataTestId?: string
|
|
46
|
+
dataTestId?: string;
|
|
47
47
|
} & React.RefAttributes<HTMLTableRowElement>>;
|
|
48
48
|
export {};
|
|
@@ -5,28 +5,28 @@
|
|
|
5
5
|
:root {
|
|
6
6
|
--color-static-graphic-solitude: #e8f2fe;
|
|
7
7
|
}
|
|
8
|
-
.
|
|
8
|
+
.table__component_17227 {
|
|
9
9
|
padding-top: 1px;
|
|
10
10
|
width: 100%;
|
|
11
11
|
transition: background-color 0.2s;
|
|
12
12
|
box-sizing: border-box;
|
|
13
13
|
background: var(--color-light-base-bg-primary);
|
|
14
14
|
}
|
|
15
|
-
.
|
|
15
|
+
.table__component_17227:first-child td {
|
|
16
16
|
border-top: 0;
|
|
17
17
|
}
|
|
18
|
-
.
|
|
18
|
+
.table__withoutBorder_17227 td {
|
|
19
19
|
border: none;
|
|
20
20
|
}
|
|
21
|
-
.
|
|
21
|
+
.table__clickable_17227 {
|
|
22
22
|
cursor: pointer;
|
|
23
23
|
}
|
|
24
|
-
.
|
|
24
|
+
.table__clickable_17227:hover {
|
|
25
25
|
background-color: var(--color-light-base-bg-secondary);
|
|
26
26
|
}
|
|
27
|
-
.
|
|
27
|
+
.table__selected_17227 {
|
|
28
28
|
background-color: #f2f8ff;
|
|
29
29
|
}
|
|
30
|
-
.
|
|
30
|
+
.table__selected_17227:hover {
|
|
31
31
|
background-color: var(--color-static-graphic-solitude);
|
|
32
32
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
|
|
3
|
-
const styles = {"component":"
|
|
3
|
+
const styles = {"component":"table__component_17227","withoutBorder":"table__withoutBorder_17227","clickable":"table__clickable_17227","selected":"table__selected_17227"};
|
|
4
4
|
|
|
5
5
|
export { styles as default };
|
|
6
6
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":["../../src/components/trow/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["../../src/components/trow/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n.component {\n padding-top: 1px;\n width: 100%;\n transition: background-color 0.2s;\n box-sizing: border-box;\n background: var(--color-light-base-bg-primary);\n\n &:first-child td {\n border-top: 0;\n }\n}\n\n.withoutBorder {\n & td {\n border: none;\n }\n}\n\n.clickable {\n cursor: pointer;\n\n &:hover {\n background-color: var(--color-light-base-bg-secondary);\n }\n}\n\n.selected {\n background-color: #f2f8ff; /* нет цвета в палитре */\n\n &:hover {\n background-color: var(--color-static-graphic-solitude);\n }\n}\n"],"names":[],"mappings":";;AAEgB,eAAe,CAAC,WAAW,CAAC,wBAAwB,CAAC,eAAe,CAAC,4BAA4B,CAAC,WAAW,CAAC,wBAAwB,CAAC,UAAU,CAAC,uBAAuB,CAAC;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type THeadCellProps } from '../thead-cell';
|
|
3
|
-
export
|
|
3
|
+
export type TSortableHeadCellProps = THeadCellProps & {
|
|
4
4
|
isSortedDesc?: boolean;
|
|
5
5
|
defaultIsSortedDesc?: boolean;
|
|
6
6
|
onSort?: () => void;
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
--gap-0: 0px;
|
|
9
9
|
--gap-8: var(--gap-xs);
|
|
10
10
|
}
|
|
11
|
-
.
|
|
11
|
+
.table__content_yomp9 {
|
|
12
12
|
display: flex;
|
|
13
13
|
align-items: flex-start;
|
|
14
14
|
}
|
|
15
|
-
.
|
|
15
|
+
.table__icon_yomp9 {
|
|
16
16
|
cursor: pointer;
|
|
17
17
|
margin-left: var(--gap-8);
|
|
18
18
|
margin-top: 1px;
|
|
@@ -20,19 +20,19 @@
|
|
|
20
20
|
transition: color 0.2s ease;
|
|
21
21
|
flex-shrink: 0;
|
|
22
22
|
}
|
|
23
|
-
.
|
|
23
|
+
.table__icon_yomp9:hover {
|
|
24
24
|
color: var(--color-light-neutral-translucent-1300);
|
|
25
25
|
}
|
|
26
|
-
.
|
|
26
|
+
.table__reverse_yomp9 {
|
|
27
27
|
flex-direction: row-reverse;
|
|
28
28
|
}
|
|
29
|
-
.
|
|
29
|
+
.table__reverse_yomp9 .table__icon_yomp9 {
|
|
30
30
|
margin-left: var(--gap-0);
|
|
31
31
|
margin-right: var(--gap-8);
|
|
32
32
|
}
|
|
33
|
-
.
|
|
33
|
+
.table__sorted_yomp9 {
|
|
34
34
|
color: var(--color-light-status-info);
|
|
35
35
|
}
|
|
36
|
-
.
|
|
36
|
+
.table__sorted_yomp9:hover {
|
|
37
37
|
color: var(--color-light-status-info);
|
|
38
38
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
|
|
3
|
-
const styles = {"content":"
|
|
3
|
+
const styles = {"content":"table__content_yomp9","icon":"table__icon_yomp9","reverse":"table__reverse_yomp9","sorted":"table__sorted_yomp9"};
|
|
4
4
|
|
|
5
5
|
export { styles as default };
|
|
6
6
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":["../../src/components/tsortable-head-cell/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["../../src/components/tsortable-head-cell/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n.content {\n display: flex;\n align-items: flex-start;\n}\n\n.icon {\n cursor: pointer;\n margin-left: var(--gap-8);\n\n /**\n * иконка сортировки должна быть выровнена по верхнему краю,\n * т.к. текст может быть в две строки\n */\n margin-top: 1px;\n color: var(--color-light-neutral-700);\n transition: color 0.2s ease;\n flex-shrink: 0;\n\n &:hover {\n color: var(--color-light-neutral-translucent-1300);\n }\n}\n\n.reverse {\n flex-direction: row-reverse;\n\n & .icon {\n margin-left: var(--gap-0);\n margin-right: var(--gap-8);\n }\n}\n\n.sorted {\n color: var(--color-light-status-info);\n\n &:hover {\n color: var(--color-light-status-info);\n }\n}\n"],"names":[],"mappings":";;AAEgB,eAAe,CAAC,SAAS,CAAC,sBAAsB,CAAC,MAAM,CAAC,mBAAmB,CAAC,SAAS,CAAC,sBAAsB,CAAC,QAAQ,CAAC,qBAAqB,CAAC;;;;"}
|
package/modern/typings.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type TextAlignProperty = 'center' | 'end' | 'justify' | 'left' | 'match-parent' | 'right' | 'start';
|
package/modern/utils.d.ts
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
interface EmptyProps {
|
|
3
|
+
}
|
|
4
|
+
export declare function isChildInstanceOf<P extends EmptyProps>(child: React.ReactElement, Component: React.ComponentType<P>): boolean;
|
|
5
|
+
export {};
|
package/modern/utils.js
CHANGED
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
|
|
3
3
|
function isChildInstanceOf(child, Component) {
|
|
4
4
|
// мы не можем полагаться на child.type === Component, см. https://github.com/gaearon/react-hot-loader/issues/304
|
|
5
|
-
return child.type === React.createElement(Component).type;
|
|
5
|
+
return child.type === React.createElement(Component, {}).type;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
export { isChildInstanceOf };
|
package/modern/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../src/utils.ts"],"sourcesContent":["import React from 'react';\n\nexport function isChildInstanceOf<P>(child: React.ReactElement
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../src/utils.ts"],"sourcesContent":["import React from 'react';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\ninterface EmptyProps {}\n\nexport function isChildInstanceOf<P extends EmptyProps>(\n child: React.ReactElement,\n Component: React.ComponentType<P>,\n) {\n // мы не можем полагаться на child.type === Component, см. https://github.com/gaearon/react-hot-loader/issues/304\n return child.type === React.createElement(Component, {} as P).type;\n}\n"],"names":[],"mappings":";;AAKgB,SAAA,iBAAiB,CAC7B,KAAyB,EACzB,SAAiC,EAAA;;AAGjC,IAAA,OAAO,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,aAAa,CAAC,SAAS,EAAE,EAAO,CAAC,CAAC,IAAI;AACtE;;;;"}
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { Pagination, Table as TableComponent, TBody, TCell, TExpandableRow, THead, THeadCell, TRow, TSortableHeadCell } from './components';
|
|
3
2
|
export declare const Table: import("react").ForwardRefExoticComponent<import("react").TableHTMLAttributes<HTMLTableElement> & {
|
|
4
|
-
compactView?: boolean
|
|
5
|
-
compactHorizontal?: boolean
|
|
6
|
-
className?: string
|
|
7
|
-
children: import("react").ReactElement
|
|
8
|
-
wrapper?: boolean
|
|
3
|
+
compactView?: boolean;
|
|
4
|
+
compactHorizontal?: boolean;
|
|
5
|
+
className?: string;
|
|
6
|
+
children: import("react").ReactElement | import("react").ReactElement[];
|
|
7
|
+
wrapper?: boolean;
|
|
9
8
|
pagination?: import("react").ReactNode;
|
|
10
|
-
dataTestId?: string
|
|
11
|
-
stickyHeader?: boolean
|
|
9
|
+
dataTestId?: string;
|
|
10
|
+
stickyHeader?: boolean;
|
|
12
11
|
} & import("react").RefAttributes<HTMLTableElement>> & {
|
|
13
12
|
TBody: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLTableSectionElement> & {
|
|
14
|
-
className?: string
|
|
15
|
-
dataTestId?: string
|
|
13
|
+
className?: string;
|
|
14
|
+
dataTestId?: string;
|
|
16
15
|
} & import("react").RefAttributes<HTMLTableSectionElement>>;
|
|
17
16
|
THead: import("react").FC<import("./components").THeadProps>;
|
|
18
17
|
THeadCell: ({ children, className, dataTestId, style, width, textAlign, hidden, ...restProps }: import("./components").THeadCellProps) => import("react").JSX.Element | null;
|
|
@@ -20,23 +19,23 @@ export declare const Table: import("react").ForwardRefExoticComponent<import("re
|
|
|
20
19
|
TCell: ({ className, style, dataTestId, children, index, ...restProps }: import("./components").TCellProps) => import("react").JSX.Element | null;
|
|
21
20
|
TRow: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLTableRowElement> & {
|
|
22
21
|
children: import("react").ReactElement<import("./components").TCellProps, ({ className, style, dataTestId, children, index, ...restProps }: import("./components").TCellProps) => import("react").JSX.Element | null> | import("react").ReactElement<import("./components").TCellProps, ({ className, style, dataTestId, children, index, ...restProps }: import("./components").TCellProps) => import("react").JSX.Element | null>[];
|
|
23
|
-
className?: string
|
|
24
|
-
selected?: boolean
|
|
25
|
-
withoutBorder?: boolean
|
|
26
|
-
dataTestId?: string
|
|
22
|
+
className?: string;
|
|
23
|
+
selected?: boolean;
|
|
24
|
+
withoutBorder?: boolean;
|
|
25
|
+
dataTestId?: string;
|
|
27
26
|
} & import("react").RefAttributes<HTMLTableRowElement>>;
|
|
28
27
|
TExpandableRow: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLTableRowElement> & {
|
|
29
28
|
children: import("react").ReactElement<import("./components").TCellProps, ({ className, style, dataTestId, children, index, ...restProps }: import("./components").TCellProps) => import("react").JSX.Element | null> | import("react").ReactElement<import("./components").TCellProps, ({ className, style, dataTestId, children, index, ...restProps }: import("./components").TCellProps) => import("react").JSX.Element | null>[];
|
|
30
|
-
className?: string
|
|
31
|
-
selected?: boolean
|
|
32
|
-
withoutBorder?: boolean
|
|
33
|
-
dataTestId?: string
|
|
29
|
+
className?: string;
|
|
30
|
+
selected?: boolean;
|
|
31
|
+
withoutBorder?: boolean;
|
|
32
|
+
dataTestId?: string;
|
|
34
33
|
} & {
|
|
35
|
-
defaultExpanded?: boolean
|
|
36
|
-
expanded?: boolean
|
|
37
|
-
onToggle?: (
|
|
34
|
+
defaultExpanded?: boolean;
|
|
35
|
+
expanded?: boolean;
|
|
36
|
+
onToggle?: (expanded: boolean) => void;
|
|
38
37
|
renderContent: (expanded: boolean) => import("react").ReactNode;
|
|
39
|
-
rowRef?: import("react").Ref<HTMLTableRowElement
|
|
38
|
+
rowRef?: import("react").Ref<HTMLTableRowElement>;
|
|
40
39
|
} & import("react").RefAttributes<HTMLTableRowElement>>;
|
|
41
40
|
Pagination: import("react").FC<import("./components").PaginationProps>;
|
|
42
41
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type FC } from 'react';
|
|
2
2
|
import { type PaginationProps as CorePaginationProps } from '@alfalab/core-components-pagination/moderncssm';
|
|
3
|
-
export
|
|
3
|
+
export type PaginationProps = CorePaginationProps & {
|
|
4
4
|
/**
|
|
5
5
|
* Количество строк на страницу
|
|
6
6
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component.js","sources":["../../../src/components/pagination/Component.tsx"],"sourcesContent":["import React, { type FC, useCallback, useContext, useMemo } from 'react';\nimport cn from 'classnames';\n\nimport {\n Pagination as CorePagination,\n type PaginationProps as CorePaginationProps,\n} from '@alfalab/core-components-pagination';\nimport { SelectDesktop, type SelectDesktopProps } from '@alfalab/core-components-select/desktop';\nimport { type BaseSelectChangePayload } from '@alfalab/core-components-select/shared';\n\nimport { TableContext } from '../table-context';\n\nimport { CustomSelectField } from './select-field';\n\nimport styles from './index.module.css';\n\nexport type PaginationProps = CorePaginationProps & {\n /**\n * Количество строк на страницу\n */\n perPage?: number;\n\n /**\n * Возможные варианты разбивки\n */\n possiblePerPage?: number[];\n\n /**\n * Обработчик переключения perPage\n */\n onPerPageChange?: (perPage: number) => void;\n\n /**\n * Скрывает переключатель количества строк на страницу\n */\n hidePerPageSelect?: boolean;\n\n /**\n * Идентификатор для систем автоматизированного тестирования\n */\n dataTestId?: string;\n};\n\nexport const Pagination: FC<PaginationProps> = ({\n perPage = 25,\n possiblePerPage = [25, 50, 100],\n onPerPageChange = () => null,\n hidePerPageSelect = false,\n pagesCount,\n onPageChange = () => null,\n className,\n dataTestId,\n ...restPaginationProps\n}) => {\n const { wrapperRef } = useContext(TableContext);\n\n const options = useMemo(\n () =>\n Array.from(new Set<number>(possiblePerPage.concat(perPage)))\n .sort((a, b) => a - b)\n .map((value) => ({\n key: value.toString(),\n content: `Показывать по ${value}`,\n })),\n [perPage, possiblePerPage],\n );\n\n const handlePerPageChange: SelectDesktopProps['onChange'] = useCallback(\n ({ selected }: BaseSelectChangePayload) => {\n onPerPageChange(Number(selected?.key));\n },\n [onPerPageChange],\n );\n\n const handlePageChange = useCallback(\n (pageIndex: number) => {\n onPageChange(pageIndex);\n\n setTimeout(() => {\n if (wrapperRef.current) {\n wrapperRef.current.scrollIntoView();\n }\n }, 0);\n },\n [onPageChange, wrapperRef],\n );\n\n return (\n <div className={cn(styles.component, className)} data-test-id={dataTestId}>\n {hidePerPageSelect === false && (\n <SelectDesktop\n options={options}\n selected={perPage.toString()}\n onChange={handlePerPageChange}\n preventFlip={false}\n size={48}\n className={styles.select}\n optionsListClassName={styles.menu}\n optionClassName={styles.option}\n Field={CustomSelectField}\n />\n )}\n\n {pagesCount > 1 && (\n <CorePagination\n pagesCount={pagesCount}\n onPageChange={handlePageChange}\n className={styles.pagination}\n {...restPaginationProps}\n />\n )}\n </div>\n );\n};\n"],"names":["CorePagination"],"mappings":";;;;;;;;MA2Ca,UAAU,GAAwB,CAAC,EAC5C,OAAO,GAAG,EAAE,EACZ,eAAe,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,EAC/B,eAAe,GAAG,MAAM,IAAI,EAC5B,iBAAiB,GAAG,KAAK,EACzB,UAAU,EACV,YAAY,GAAG,MAAM,IAAI,EACzB,SAAS,EACT,UAAU,EACV,GAAG,mBAAmB,EACzB,KAAI;IACD,MAAM,EAAE,UAAU,EAAE,GAAG,UAAU,CAAC,YAAY,CAAC;IAE/C,MAAM,OAAO,GAAG,OAAO,CACnB,MACI,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAS,eAAe,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;SACtD,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC;AACpB,SAAA,GAAG,CAAC,CAAC,KAAK,MAAM;AACb,QAAA,GAAG,EAAE,KAAK,CAAC,QAAQ,EAAE;QACrB,OAAO,EAAE,CAAiB,cAAA,EAAA,KAAK,CAAE,CAAA;KACpC,CAAC,CAAC,EACX,CAAC,OAAO,EAAE,eAAe,CAAC,CAC7B;IAED,MAAM,mBAAmB,GAAmC,WAAW,CACnE,CAAC,EAAE,QAAQ,EAA2B,KAAI;QACtC,eAAe,CAAC,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;AAC1C,KAAC,EACD,CAAC,eAAe,CAAC,CACpB;AAED,IAAA,MAAM,gBAAgB,GAAG,WAAW,CAChC,CAAC,SAAiB,KAAI;QAClB,YAAY,CAAC,SAAS,CAAC;QAEvB,UAAU,CAAC,MAAK;
|
|
1
|
+
{"version":3,"file":"Component.js","sources":["../../../src/components/pagination/Component.tsx"],"sourcesContent":["import React, { type FC, useCallback, useContext, useMemo } from 'react';\nimport cn from 'classnames';\n\nimport {\n Pagination as CorePagination,\n type PaginationProps as CorePaginationProps,\n} from '@alfalab/core-components-pagination';\nimport { SelectDesktop, type SelectDesktopProps } from '@alfalab/core-components-select/desktop';\nimport { type BaseSelectChangePayload } from '@alfalab/core-components-select/shared';\n\nimport { TableContext } from '../table-context';\n\nimport { CustomSelectField } from './select-field';\n\nimport styles from './index.module.css';\n\nexport type PaginationProps = CorePaginationProps & {\n /**\n * Количество строк на страницу\n */\n perPage?: number;\n\n /**\n * Возможные варианты разбивки\n */\n possiblePerPage?: number[];\n\n /**\n * Обработчик переключения perPage\n */\n onPerPageChange?: (perPage: number) => void;\n\n /**\n * Скрывает переключатель количества строк на страницу\n */\n hidePerPageSelect?: boolean;\n\n /**\n * Идентификатор для систем автоматизированного тестирования\n */\n dataTestId?: string;\n};\n\nexport const Pagination: FC<PaginationProps> = ({\n perPage = 25,\n possiblePerPage = [25, 50, 100],\n onPerPageChange = () => null,\n hidePerPageSelect = false,\n pagesCount,\n onPageChange = () => null,\n className,\n dataTestId,\n ...restPaginationProps\n}) => {\n const { wrapperRef } = useContext(TableContext);\n\n const options = useMemo(\n () =>\n Array.from(new Set<number>(possiblePerPage.concat(perPage)))\n .sort((a, b) => a - b)\n .map((value) => ({\n key: value.toString(),\n content: `Показывать по ${value}`,\n })),\n [perPage, possiblePerPage],\n );\n\n const handlePerPageChange: SelectDesktopProps['onChange'] = useCallback(\n ({ selected }: BaseSelectChangePayload) => {\n onPerPageChange(Number(selected?.key));\n },\n [onPerPageChange],\n );\n\n const handlePageChange = useCallback(\n (pageIndex: number) => {\n onPageChange(pageIndex);\n\n setTimeout(() => {\n if (wrapperRef.current) {\n wrapperRef.current.scrollIntoView();\n }\n }, 0);\n },\n [onPageChange, wrapperRef],\n );\n\n return (\n <div className={cn(styles.component, className)} data-test-id={dataTestId}>\n {hidePerPageSelect === false && (\n <SelectDesktop\n options={options}\n selected={perPage.toString()}\n onChange={handlePerPageChange}\n preventFlip={false}\n size={48}\n className={styles.select}\n optionsListClassName={styles.menu}\n optionClassName={styles.option}\n Field={CustomSelectField}\n />\n )}\n\n {pagesCount > 1 && (\n <CorePagination\n pagesCount={pagesCount}\n onPageChange={handlePageChange}\n className={styles.pagination}\n {...restPaginationProps}\n />\n )}\n </div>\n );\n};\n"],"names":["CorePagination"],"mappings":";;;;;;;;MA2Ca,UAAU,GAAwB,CAAC,EAC5C,OAAO,GAAG,EAAE,EACZ,eAAe,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,EAC/B,eAAe,GAAG,MAAM,IAAI,EAC5B,iBAAiB,GAAG,KAAK,EACzB,UAAU,EACV,YAAY,GAAG,MAAM,IAAI,EACzB,SAAS,EACT,UAAU,EACV,GAAG,mBAAmB,EACzB,KAAI;IACD,MAAM,EAAE,UAAU,EAAE,GAAG,UAAU,CAAC,YAAY,CAAC;IAE/C,MAAM,OAAO,GAAG,OAAO,CACnB,MACI,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAS,eAAe,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;SACtD,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC;AACpB,SAAA,GAAG,CAAC,CAAC,KAAK,MAAM;AACb,QAAA,GAAG,EAAE,KAAK,CAAC,QAAQ,EAAE;QACrB,OAAO,EAAE,CAAiB,cAAA,EAAA,KAAK,CAAE,CAAA;KACpC,CAAC,CAAC,EACX,CAAC,OAAO,EAAE,eAAe,CAAC,CAC7B;IAED,MAAM,mBAAmB,GAAmC,WAAW,CACnE,CAAC,EAAE,QAAQ,EAA2B,KAAI;QACtC,eAAe,CAAC,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;AAC1C,KAAC,EACD,CAAC,eAAe,CAAC,CACpB;AAED,IAAA,MAAM,gBAAgB,GAAG,WAAW,CAChC,CAAC,SAAiB,KAAI;QAClB,YAAY,CAAC,SAAS,CAAC;QAEvB,UAAU,CAAC,MAAK;AACZ,YAAA,IAAI,UAAU,CAAC,OAAO,EAAE;AACpB,gBAAA,UAAU,CAAC,OAAO,CAAC,cAAc,EAAE;;SAE1C,EAAE,CAAC,CAAC;AACT,KAAC,EACD,CAAC,YAAY,EAAE,UAAU,CAAC,CAC7B;AAED,IAAA,QACI,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,EAAE,SAAS,CAAC,kBAAgB,UAAU,EAAA;QACpE,iBAAiB,KAAK,KAAK,KACxB,KAAA,CAAA,aAAA,CAAC,aAAa,EACV,EAAA,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,EAC5B,QAAQ,EAAE,mBAAmB,EAC7B,WAAW,EAAE,KAAK,EAClB,IAAI,EAAE,EAAE,EACR,SAAS,EAAE,MAAM,CAAC,MAAM,EACxB,oBAAoB,EAAE,MAAM,CAAC,IAAI,EACjC,eAAe,EAAE,MAAM,CAAC,MAAM,EAC9B,KAAK,EAAE,iBAAiB,EAAA,CAC1B,CACL;QAEA,UAAU,GAAG,CAAC,KACX,KAAA,CAAA,aAAA,CAACA,YAAc,EAAA,EACX,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,gBAAgB,EAC9B,SAAS,EAAE,MAAM,CAAC,UAAU,EACxB,GAAA,mBAAmB,EACzB,CAAA,CACL,CACC;AAEd;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { type ReactNode, type TableHTMLAttributes } from 'react';
|
|
2
|
-
export
|
|
2
|
+
export type TableProps = TableHTMLAttributes<HTMLTableElement> & {
|
|
3
3
|
/**
|
|
4
4
|
* Компактный вид
|
|
5
5
|
*/
|
|
@@ -37,15 +37,15 @@ export declare const Table: React.ForwardRefExoticComponent<React.TableHTMLAttri
|
|
|
37
37
|
/**
|
|
38
38
|
* Компактный вид
|
|
39
39
|
*/
|
|
40
|
-
compactView?: boolean
|
|
40
|
+
compactView?: boolean;
|
|
41
41
|
/**
|
|
42
42
|
* Уменьшение горизонтальных паддингов
|
|
43
43
|
*/
|
|
44
|
-
compactHorizontal?: boolean
|
|
44
|
+
compactHorizontal?: boolean;
|
|
45
45
|
/**
|
|
46
46
|
* Дополнительный класс
|
|
47
47
|
*/
|
|
48
|
-
className?: string
|
|
48
|
+
className?: string;
|
|
49
49
|
/**
|
|
50
50
|
* Дочерние компоненты
|
|
51
51
|
*/
|
|
@@ -53,7 +53,7 @@ export declare const Table: React.ForwardRefExoticComponent<React.TableHTMLAttri
|
|
|
53
53
|
/**
|
|
54
54
|
* Оборачивает таблицу в стилизованный контейнер
|
|
55
55
|
*/
|
|
56
|
-
wrapper?: boolean
|
|
56
|
+
wrapper?: boolean;
|
|
57
57
|
/**
|
|
58
58
|
* Слот для пагинации
|
|
59
59
|
*/
|
|
@@ -61,9 +61,9 @@ export declare const Table: React.ForwardRefExoticComponent<React.TableHTMLAttri
|
|
|
61
61
|
/**
|
|
62
62
|
* Идентификатор для систем автоматизированного тестирования
|
|
63
63
|
*/
|
|
64
|
-
dataTestId?: string
|
|
64
|
+
dataTestId?: string;
|
|
65
65
|
/**
|
|
66
66
|
* Если true то заголовок будет фиксироваться при скроле
|
|
67
67
|
*/
|
|
68
|
-
stickyHeader?: boolean
|
|
68
|
+
stickyHeader?: boolean;
|
|
69
69
|
} & React.RefAttributes<HTMLTableElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../src/components/table/utils.ts"],"sourcesContent":["import React from 'react';\n\nimport { isChildInstanceOf } from '../../utils';\nimport { THead } from '../thead';\nimport { type THeadCellProps } from '../thead-cell';\n\nexport function findAllHeadCellsProps(children: React.ReactElement | React.ReactElement[]) {\n const result: THeadCellProps[] = [];\n\n React.Children.forEach(children, (child) => {\n if (isChildInstanceOf(child, THead)) {\n React.Children.forEach(child.props.children, (headChild) => {\n result.push(headChild.props);\n });\n }\n });\n\n return result;\n}\n"],"names":[],"mappings":";;;;AAMM,SAAU,qBAAqB,CAAC,QAAmD,EAAA;IACrF,MAAM,MAAM,GAAqB,EAAE;IAEnC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,KAAK,KAAI;AACvC,QAAA,IAAI,iBAAiB,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE;AACjC,YAAA,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,SAAS,KAAI;AACvD,gBAAA,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;AAChC,aAAC,CAAC
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../src/components/table/utils.ts"],"sourcesContent":["import React from 'react';\n\nimport { isChildInstanceOf } from '../../utils';\nimport { THead } from '../thead';\nimport { type THeadCellProps } from '../thead-cell';\n\nexport function findAllHeadCellsProps(children: React.ReactElement | React.ReactElement[]) {\n const result: THeadCellProps[] = [];\n\n React.Children.forEach(children, (child) => {\n if (isChildInstanceOf(child, THead)) {\n React.Children.forEach(child.props.children, (headChild) => {\n result.push(headChild.props);\n });\n }\n });\n\n return result;\n}\n"],"names":[],"mappings":";;;;AAMM,SAAU,qBAAqB,CAAC,QAAmD,EAAA;IACrF,MAAM,MAAM,GAAqB,EAAE;IAEnC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,KAAK,KAAI;AACvC,QAAA,IAAI,iBAAiB,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE;AACjC,YAAA,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,SAAS,KAAI;AACvD,gBAAA,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;AAChC,aAAC,CAAC;;AAEV,KAAC,CAAC;AAEF,IAAA,OAAO,MAAM;AACjB;;;;"}
|