@semcore/data-table 16.5.3 → 17.0.0-prerelease.17
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/CHANGELOG.md +6 -0
- package/lib/cjs/components/AccordionRows/AccordionRows.js +144 -157
- package/lib/cjs/components/AccordionRows/AccordionRows.js.map +1 -1
- package/lib/cjs/components/Body/Body.js +373 -395
- package/lib/cjs/components/Body/Body.js.map +1 -1
- package/lib/cjs/components/Body/Cell.js +135 -151
- package/lib/cjs/components/Body/Cell.js.map +1 -1
- package/lib/cjs/components/Body/LimitOverlay.js +142 -158
- package/lib/cjs/components/Body/LimitOverlay.js.map +1 -1
- package/lib/cjs/components/Body/MergedCells.js +25 -23
- package/lib/cjs/components/Body/MergedCells.js.map +1 -1
- package/lib/cjs/components/Body/Row.js +498 -539
- package/lib/cjs/components/Body/Row.js.map +1 -1
- package/lib/cjs/components/DataTable/DataTable.js +867 -938
- package/lib/cjs/components/DataTable/DataTable.js.map +1 -1
- package/lib/cjs/components/Head/Column.js +208 -234
- package/lib/cjs/components/Head/Column.js.map +1 -1
- package/lib/cjs/components/Head/Group.js +79 -92
- package/lib/cjs/components/Head/Group.js.map +1 -1
- package/lib/cjs/components/Head/Head.js +229 -263
- package/lib/cjs/components/Head/Head.js.map +1 -1
- package/lib/cjs/enhancers/focusableCell.js +6 -14
- package/lib/cjs/enhancers/focusableCell.js.map +1 -1
- package/lib/cjs/index.js +7 -14
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js +16 -16
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/es6/components/AccordionRows/AccordionRows.js +142 -156
- package/lib/es6/components/AccordionRows/AccordionRows.js.map +1 -1
- package/lib/es6/components/Body/Body.js +370 -392
- package/lib/es6/components/Body/Body.js.map +1 -1
- package/lib/es6/components/Body/Cell.js +131 -147
- package/lib/es6/components/Body/Cell.js.map +1 -1
- package/lib/es6/components/Body/LimitOverlay.js +138 -154
- package/lib/es6/components/Body/LimitOverlay.js.map +1 -1
- package/lib/es6/components/Body/MergedCells.js +22 -22
- package/lib/es6/components/Body/MergedCells.js.map +1 -1
- package/lib/es6/components/Body/Row.js +493 -535
- package/lib/es6/components/Body/Row.js.map +1 -1
- package/lib/es6/components/DataTable/DataTable.js +861 -932
- package/lib/es6/components/DataTable/DataTable.js.map +1 -1
- package/lib/es6/components/Head/Column.js +201 -228
- package/lib/es6/components/Head/Column.js.map +1 -1
- package/lib/es6/components/Head/Group.js +74 -88
- package/lib/es6/components/Head/Group.js.map +1 -1
- package/lib/es6/components/Head/Head.js +228 -262
- package/lib/es6/components/Head/Head.js.map +1 -1
- package/lib/es6/enhancers/focusableCell.js +6 -14
- package/lib/es6/enhancers/focusableCell.js.map +1 -1
- package/lib/es6/index.js +3 -9
- package/lib/es6/index.js.map +1 -1
- package/lib/es6/translations/__intergalactic-dynamic-locales.js +15 -15
- package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/esm/components/AccordionRows/AccordionRows.mjs +143 -134
- package/lib/esm/components/Body/Body.mjs +377 -343
- package/lib/esm/components/Body/Cell.mjs +136 -135
- package/lib/esm/components/Body/LimitOverlay.mjs +141 -144
- package/lib/esm/components/Body/MergedCells.mjs +22 -22
- package/lib/esm/components/Body/Row.mjs +498 -458
- package/lib/esm/components/DataTable/DataTable.mjs +866 -842
- package/lib/esm/components/Head/Column.mjs +208 -201
- package/lib/esm/components/Head/Group.mjs +76 -84
- package/lib/esm/components/Head/Head.mjs +231 -216
- package/lib/esm/enhancers/focusableCell.mjs +7 -14
- package/lib/esm/index.mjs +2 -5
- package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +1 -1
- package/lib/types/components/Body/Cell.d.ts +1 -3
- package/lib/types/components/Body/Row.d.ts +1 -1
- package/lib/types/components/Head/Column.d.ts +2 -2
- package/lib/types/components/Head/Group.d.ts +1 -1
- package/lib/types/index.d.ts +2 -6
- package/package.json +20 -22
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
4
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
5
|
-
import _callSuper from "@babel/runtime/helpers/esm/callSuper";
|
|
6
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
7
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
8
|
-
import {
|
|
2
|
+
import { Component, lastInteraction, sstyled, assignProps } from "@semcore/core";
|
|
9
3
|
import { Flex } from "@semcore/base-components";
|
|
10
4
|
import { ButtonLink } from "@semcore/button";
|
|
11
5
|
import canUseDOM from "@semcore/core/lib/utils/canUseDOM";
|
|
@@ -18,105 +12,100 @@ import SortDesc from "@semcore/icon/SortDesc/m";
|
|
|
18
12
|
import * as React from "react";
|
|
19
13
|
import { handleKeydownFocusCell, handleFocusCell } from "../../enhancers/focusableCell.mjs";
|
|
20
14
|
/*!__reshadow-styles__:"./style.shadow.css"*/
|
|
21
|
-
|
|
15
|
+
const style = (
|
|
22
16
|
/*__reshadow_css_start__*/
|
|
23
17
|
(sstyled.insert(
|
|
24
18
|
/*__inner_css_start__*/
|
|
25
|
-
'.
|
|
19
|
+
'.___SGroupContainer_16i6f_gg_,.___SHead_16i6f_gg_{display:contents}.___SHead_16i6f_gg_.__isDataEmpty_16i6f_gg_.__gridTemplateColumns_16i6f_gg_{display:grid;grid-template-columns:var(--gridTemplateColumns_16i6f);overflow:auto;scrollbar-width:thin}.___SHead_16i6f_gg_.__animationDuration_16i6f_gg_>.___SColumn_16i6f_gg_{transition:top var(--animationDuration_16i6f) ease-out}.___SHead_16i6f_gg_.__sticky_16i6f_gg_ .___SColumn_16i6f_gg_,.___SHead_16i6f_gg_.__sticky_16i6f_gg_ .___SGroup_16i6f_gg_{position:sticky;top:0;z-index:18}.___SHead_16i6f_gg_.__sticky_16i6f_gg_ .___SGroupContainer_16i6f_gg_>.___SColumn_16i6f_gg_{position:sticky;z-index:18}.___SHead_16i6f_gg_.__compact_16i6f_gg_ .___SColumn_16i6f_gg_{padding:var(--intergalactic-spacing-3x, 12px) var(--intergalactic-spacing-2x, 8px)}.___SColumn_16i6f_gg_,.___SGroup_16i6f_gg_{display:flex;align-items:flex-start;font-size:var(--intergalactic-fs-100, 12px);color:var(--intergalactic-text-primary, #191b23);box-sizing:border-box;height:100%;position:relative;transition:width calc(var(--intergalactic-duration-extra-fast, 100)*1ms) ease-in-out,min-width calc(var(--intergalactic-duration-extra-fast, 100)*1ms) ease-in-out,max-width calc(var(--intergalactic-duration-extra-fast, 100)*1ms) ease-in-out;overflow:hidden;line-height:var(--intergalactic-lh-100, 133%)}.___SGroup_16i6f_gg_{justify-content:center;text-align:center;background-color:var(--intergalactic-table-th-primary-cell, #f4f5f9)}.___SGroup_16i6f_gg_._use_primary_16i6f_gg_{padding:var(--intergalactic-spacing-3x, 12px)}.___SGroup_16i6f_gg_._use_primary_16i6f_gg_:has(~.___SColumn_16i6f_gg_.__visibleSort_16i6f_gg_){background-color:var(--intergalactic-table-th-primary-cell-hover, #e0e1e9)}.___SGroup_16i6f_gg_._use_secondary_16i6f_gg_{padding:var(--intergalactic-spacing-2x, 8px)}.___SColumn_16i6f_gg_._borders_both_16i6f_gg_,.___SColumn_16i6f_gg_._borders_left_16i6f_gg_,.___SGroup_16i6f_gg_._borders_both_16i6f_gg_,.___SGroup_16i6f_gg_._borders_left_16i6f_gg_{border-left:1px solid var(--intergalactic-border-secondary, #e0e1e9)}.___SColumn_16i6f_gg_._borders_both_16i6f_gg_,.___SColumn_16i6f_gg_._borders_right_16i6f_gg_,.___SGroup_16i6f_gg_._borders_both_16i6f_gg_,.___SGroup_16i6f_gg_._borders_right_16i6f_gg_{border-right:1px solid var(--intergalactic-border-secondary, #e0e1e9)}.___SColumn_16i6f_gg_._use_primary_16i6f_gg_{padding:var(--intergalactic-spacing-3x, 12px);border-bottom:1px solid var(--intergalactic-border-secondary, #e0e1e9);background-color:var(--intergalactic-table-th-primary-cell, #f4f5f9)}.___SColumn_16i6f_gg_._use_primary_16i6f_gg_ .___SSortWrapper_16i6f_gg_::before{background:linear-gradient(270deg,var(--intergalactic-table-th-primary-cell-hover, #e0e1e9) 67.5%,rgba(224,225,233,0) 105%)}.___SColumn_16i6f_gg_._use_primary_16i6f_gg_.__visibleSort_16i6f_gg_{background-color:var(--intergalactic-table-th-primary-cell-hover, #e0e1e9)}.___SColumn_16i6f_gg_._use_primary_16i6f_gg_.__visibleSort_16i6f_gg_ .___SSortWrapper_16i6f_gg_{flex-basis:calc(var(--intergalactic-spacing-1x, 4px) + 16px);opacity:1}.___SColumn_16i6f_gg_._use_primary_16i6f_gg_.__visibleSort_16i6f_gg_ .___SSortButton_16i6f_gg_,.___SColumn_16i6f_gg_._use_primary_16i6f_gg_.__visibleSort_16i6f_gg_ .___SSortWrapper_16i6f_gg_::before,.___SColumn_16i6f_gg_._use_secondary_16i6f_gg_.__visibleSort_16i6f_gg_ .___SSortWrapper_16i6f_gg_::before{display:flex;opacity:1}.___SColumn_16i6f_gg_._use_primary_16i6f_gg_._justifyContent_right_16i6f_gg_ .___SSortWrapper_16i6f_gg_{position:absolute}.___SColumn_16i6f_gg_._use_primary_16i6f_gg_._justifyContent_right_16i6f_gg_.__changeSortSize_16i6f_gg_.__isSorted_16i6f_gg_ .___SSortWrapper_16i6f_gg_,.___SColumn_16i6f_gg_._use_secondary_16i6f_gg_._justifyContent_right_16i6f_gg_.__changeSortSize_16i6f_gg_.__isSorted_16i6f_gg_ .___SSortWrapper_16i6f_gg_{position:relative}.___SColumn_16i6f_gg_._use_secondary_16i6f_gg_{padding:var(--intergalactic-spacing-2x, 8px);border-bottom:1px solid var(--intergalactic-border-table-accent, #a9abb6);background-color:var(--intergalactic-table-th-secondary-cell, #ffffff)}.___SColumn_16i6f_gg_._use_secondary_16i6f_gg_ .___SSortWrapper_16i6f_gg_::before{background:linear-gradient(270deg,var(--intergalactic-table-th-secondary-cell, #ffffff) 67.5%,rgba(255,255,255,0) 105%)}.___SColumn_16i6f_gg_._use_secondary_16i6f_gg_.__visibleSort_16i6f_gg_ .___SSortWrapper_16i6f_gg_{flex-basis:calc(var(--intergalactic-spacing-1x, 4px) + 16px);opacity:1}.___SColumn_16i6f_gg_._use_secondary_16i6f_gg_.__visibleSort_16i6f_gg_ .___SSortButton_16i6f_gg_{display:flex;opacity:1}.___SColumn_16i6f_gg_._use_secondary_16i6f_gg_._justifyContent_right_16i6f_gg_ .___SSortWrapper_16i6f_gg_{position:absolute}.___SColumn_16i6f_gg_.__gridArea_16i6f_gg_,.___SGroupTitle_16i6f_gg_.__gridArea_16i6f_gg_,.___SGroup_16i6f_gg_.__gridArea_16i6f_gg_{grid-area:var(--gridArea_16i6f)}.___SHead_16i6f_gg_ .___SColumn_16i6f_gg_.__fixed_16i6f_gg_,.___SHead_16i6f_gg_ .___SGroup_16i6f_gg_.__fixed_16i6f_gg_,.___SHead_16i6f_gg_.__sticky_16i6f_gg_ .___SColumn_16i6f_gg_.__fixed_16i6f_gg_{position:sticky;z-index:19}@media (hover:hover){.___SColumn_16i6f_gg_.__sortable_16i6f_gg_:hover{cursor:pointer}}.___SSortWrapper_16i6f_gg_{align-items:center;display:flex;flex-shrink:1;position:relative;flex-basis:0;min-height:16px;opacity:0;transition:all calc(var(--intergalactic-duration-extra-fast, 100)*1ms) ease-in-out}.___SSortButton_16i6f_gg_,.___SSortWrapper_16i6f_gg_:before{display:none;position:absolute;right:0;opacity:0;transition:opacity .3s ease}.___SSortWrapper_16i6f_gg_:before{content:"";top:0;width:20px;height:100%}.___SSortButton_16i6f_gg_{fill:var(--intergalactic-icon-secondary-neutral-hover-active, #878992);top:calc(-1*(1em*1.25 - 16px));margin-left:var(--intergalactic-spacing-1x, 4px)}.___SHead_16i6f_gg_._sideIndents_wide_16i6f_gg_ .___SColumn_16i6f_gg_:first-child{padding-left:var(--intergalactic-spacing-5x, 20px)}.___SHead_16i6f_gg_._sideIndents_wide_16i6f_gg_ .___SColumn_16i6f_gg_:last-child{padding-right:var(--intergalactic-spacing-5x, 20px)}.___SHeadCheckboxCol_16i6f_gg_{cursor:pointer}.___SColumn_16i6f_gg_.__fixed_16i6f_gg_.__shadowVertical_16i6f_gg_:after,.___SGroup_16i6f_gg_.__fixed_16i6f_gg_.__shadowVertical_16i6f_gg_:after{content:"";position:absolute;pointer-events:none;display:none;top:0;width:5px;height:100%;z-index:5}.___SColumn_16i6f_gg_._fixed_left_16i6f_gg_._shadowVertical_median_16i6f_gg_,.___SColumn_16i6f_gg_._fixed_left_16i6f_gg_._shadowVertical_start_16i6f_gg_,.___SGroup_16i6f_gg_._fixed_left_16i6f_gg_._shadowVertical_median_16i6f_gg_,.___SGroup_16i6f_gg_._fixed_left_16i6f_gg_._shadowVertical_start_16i6f_gg_{margin-right:-5px;border-right-color:transparent}.___SColumn_16i6f_gg_._fixed_left_16i6f_gg_._shadowVertical_median_16i6f_gg_._use_primary_16i6f_gg_,.___SColumn_16i6f_gg_._fixed_left_16i6f_gg_._shadowVertical_start_16i6f_gg_._use_primary_16i6f_gg_,.___SGroup_16i6f_gg_._fixed_left_16i6f_gg_._shadowVertical_median_16i6f_gg_._use_primary_16i6f_gg_,.___SGroup_16i6f_gg_._fixed_left_16i6f_gg_._shadowVertical_start_16i6f_gg_._use_primary_16i6f_gg_{padding-right:calc(var(--intergalactic-spacing-3x, 12px) + 5px)}.___SColumn_16i6f_gg_._fixed_left_16i6f_gg_._shadowVertical_median_16i6f_gg_._use_secondary_16i6f_gg_,.___SColumn_16i6f_gg_._fixed_left_16i6f_gg_._shadowVertical_start_16i6f_gg_._use_secondary_16i6f_gg_,.___SGroup_16i6f_gg_._fixed_left_16i6f_gg_._shadowVertical_median_16i6f_gg_._use_secondary_16i6f_gg_,.___SGroup_16i6f_gg_._fixed_left_16i6f_gg_._shadowVertical_start_16i6f_gg_._use_secondary_16i6f_gg_{padding-right:calc(var(--intergalactic-spacing-2x, 8px) + 5px)}.___SColumn_16i6f_gg_._fixed_left_16i6f_gg_._shadowVertical_median_16i6f_gg_:after,.___SColumn_16i6f_gg_._fixed_left_16i6f_gg_._shadowVertical_start_16i6f_gg_:after,.___SGroup_16i6f_gg_._fixed_left_16i6f_gg_._shadowVertical_median_16i6f_gg_:after,.___SGroup_16i6f_gg_._fixed_left_16i6f_gg_._shadowVertical_start_16i6f_gg_:after{display:block;right:0;background:var(--intergalactic-scroll-area-shadow-left,\n linear-gradient(to right, rgba(25, 27, 35, 0.1) 20.55%, rgba(255, 255, 255, 0.0001) 100%))}.___SColumn_16i6f_gg_._fixed_right_16i6f_gg_._shadowVertical_end_16i6f_gg_,.___SColumn_16i6f_gg_._fixed_right_16i6f_gg_._shadowVertical_median_16i6f_gg_,.___SGroup_16i6f_gg_._fixed_right_16i6f_gg_._shadowVertical_end_16i6f_gg_,.___SGroup_16i6f_gg_._fixed_right_16i6f_gg_._shadowVertical_median_16i6f_gg_{margin-left:-5px;border-left-color:transparent}.___SColumn_16i6f_gg_._fixed_right_16i6f_gg_._shadowVertical_end_16i6f_gg_._use_primary_16i6f_gg_,.___SColumn_16i6f_gg_._fixed_right_16i6f_gg_._shadowVertical_median_16i6f_gg_._use_primary_16i6f_gg_,.___SGroup_16i6f_gg_._fixed_right_16i6f_gg_._shadowVertical_end_16i6f_gg_._use_primary_16i6f_gg_,.___SGroup_16i6f_gg_._fixed_right_16i6f_gg_._shadowVertical_median_16i6f_gg_._use_primary_16i6f_gg_{padding-left:calc(var(--intergalactic-spacing-3x, 12px) + 5px)}.___SColumn_16i6f_gg_._fixed_right_16i6f_gg_._shadowVertical_end_16i6f_gg_._use_secondary_16i6f_gg_,.___SColumn_16i6f_gg_._fixed_right_16i6f_gg_._shadowVertical_median_16i6f_gg_._use_secondary_16i6f_gg_,.___SGroup_16i6f_gg_._fixed_right_16i6f_gg_._shadowVertical_end_16i6f_gg_._use_secondary_16i6f_gg_,.___SGroup_16i6f_gg_._fixed_right_16i6f_gg_._shadowVertical_median_16i6f_gg_._use_secondary_16i6f_gg_{padding-left:calc(var(--intergalactic-spacing-2x, 8px) + 5px)}.___SColumn_16i6f_gg_._fixed_right_16i6f_gg_._shadowVertical_end_16i6f_gg_:after,.___SColumn_16i6f_gg_._fixed_right_16i6f_gg_._shadowVertical_median_16i6f_gg_:after,.___SGroup_16i6f_gg_._fixed_right_16i6f_gg_._shadowVertical_end_16i6f_gg_:after,.___SGroup_16i6f_gg_._fixed_right_16i6f_gg_._shadowVertical_median_16i6f_gg_:after{display:block;left:0;background:var(--intergalactic-scroll-area-shadow-right,\n linear-gradient(to left, rgba(25, 27, 35, 0.1) 20.55%, rgba(255, 255, 255, 0.0001) 100%))}',
|
|
26
20
|
/*__inner_css_end__*/
|
|
27
|
-
"
|
|
21
|
+
"16i6f_gg_"
|
|
28
22
|
), /*__reshadow_css_end__*/
|
|
29
23
|
{
|
|
30
|
-
"__SHead": "
|
|
31
|
-
"__SGroupContainer": "
|
|
32
|
-
"_isDataEmpty": "
|
|
33
|
-
"_gridTemplateColumns": "
|
|
34
|
-
"--gridTemplateColumns": "--
|
|
35
|
-
"_animationDuration": "
|
|
36
|
-
"__SColumn": "
|
|
37
|
-
"--animationDuration": "--
|
|
38
|
-
"_sticky": "
|
|
39
|
-
"__SGroup": "
|
|
40
|
-
"_compact": "
|
|
41
|
-
"_use_secondary": "
|
|
42
|
-
"_borders_both": "
|
|
43
|
-
"_borders_left": "
|
|
44
|
-
"_borders_right": "
|
|
45
|
-
"_gridArea": "
|
|
46
|
-
"__SGroupTitle": "
|
|
47
|
-
"--gridArea": "--
|
|
48
|
-
"_fixed": "
|
|
49
|
-
"_sortable": "
|
|
50
|
-
"__SSortWrapper": "
|
|
51
|
-
"__SSortButton": "
|
|
52
|
-
"__SHeadCheckboxCol": "
|
|
53
|
-
"_use_primary": "
|
|
54
|
-
"_visibleSort": "
|
|
55
|
-
"_justifyContent_right": "
|
|
56
|
-
"_changeSortSize": "
|
|
57
|
-
"_isSorted": "
|
|
58
|
-
"_sideIndents_wide": "
|
|
59
|
-
"_shadowVertical": "
|
|
60
|
-
"_fixed_left": "
|
|
61
|
-
"_shadowVertical_median": "
|
|
62
|
-
"_shadowVertical_start": "
|
|
63
|
-
"_fixed_right": "
|
|
64
|
-
"_shadowVertical_end": "
|
|
24
|
+
"__SHead": "___SHead_16i6f_gg_",
|
|
25
|
+
"__SGroupContainer": "___SGroupContainer_16i6f_gg_",
|
|
26
|
+
"_isDataEmpty": "__isDataEmpty_16i6f_gg_",
|
|
27
|
+
"_gridTemplateColumns": "__gridTemplateColumns_16i6f_gg_",
|
|
28
|
+
"--gridTemplateColumns": "--gridTemplateColumns_16i6f",
|
|
29
|
+
"_animationDuration": "__animationDuration_16i6f_gg_",
|
|
30
|
+
"__SColumn": "___SColumn_16i6f_gg_",
|
|
31
|
+
"--animationDuration": "--animationDuration_16i6f",
|
|
32
|
+
"_sticky": "__sticky_16i6f_gg_",
|
|
33
|
+
"__SGroup": "___SGroup_16i6f_gg_",
|
|
34
|
+
"_compact": "__compact_16i6f_gg_",
|
|
35
|
+
"_use_secondary": "_use_secondary_16i6f_gg_",
|
|
36
|
+
"_borders_both": "_borders_both_16i6f_gg_",
|
|
37
|
+
"_borders_left": "_borders_left_16i6f_gg_",
|
|
38
|
+
"_borders_right": "_borders_right_16i6f_gg_",
|
|
39
|
+
"_gridArea": "__gridArea_16i6f_gg_",
|
|
40
|
+
"__SGroupTitle": "___SGroupTitle_16i6f_gg_",
|
|
41
|
+
"--gridArea": "--gridArea_16i6f",
|
|
42
|
+
"_fixed": "__fixed_16i6f_gg_",
|
|
43
|
+
"_sortable": "__sortable_16i6f_gg_",
|
|
44
|
+
"__SSortWrapper": "___SSortWrapper_16i6f_gg_",
|
|
45
|
+
"__SSortButton": "___SSortButton_16i6f_gg_",
|
|
46
|
+
"__SHeadCheckboxCol": "___SHeadCheckboxCol_16i6f_gg_",
|
|
47
|
+
"_use_primary": "_use_primary_16i6f_gg_",
|
|
48
|
+
"_visibleSort": "__visibleSort_16i6f_gg_",
|
|
49
|
+
"_justifyContent_right": "_justifyContent_right_16i6f_gg_",
|
|
50
|
+
"_changeSortSize": "__changeSortSize_16i6f_gg_",
|
|
51
|
+
"_isSorted": "__isSorted_16i6f_gg_",
|
|
52
|
+
"_sideIndents_wide": "_sideIndents_wide_16i6f_gg_",
|
|
53
|
+
"_shadowVertical": "__shadowVertical_16i6f_gg_",
|
|
54
|
+
"_fixed_left": "_fixed_left_16i6f_gg_",
|
|
55
|
+
"_shadowVertical_median": "_shadowVertical_median_16i6f_gg_",
|
|
56
|
+
"_shadowVertical_start": "_shadowVertical_start_16i6f_gg_",
|
|
57
|
+
"_fixed_right": "_fixed_right_16i6f_gg_",
|
|
58
|
+
"_shadowVertical_end": "_shadowVertical_end_16i6f_gg_"
|
|
65
59
|
})
|
|
66
60
|
);
|
|
67
|
-
|
|
61
|
+
const SORTING_ICON = {
|
|
68
62
|
desc: SortDesc,
|
|
69
63
|
asc: SortAsc
|
|
70
64
|
};
|
|
71
|
-
|
|
65
|
+
const ARIA_SORT = {
|
|
72
66
|
desc: "descending",
|
|
73
67
|
asc: "ascending"
|
|
74
68
|
};
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
69
|
+
const SORT_ICON_WIDTH = 20;
|
|
70
|
+
const DEFAULT_DIRECTION = "desc";
|
|
71
|
+
const reversedSortDirection = {
|
|
78
72
|
desc: "asc",
|
|
79
73
|
asc: "desc"
|
|
80
74
|
};
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
_this = _callSuper(this, Column2, [].concat(args));
|
|
89
|
-
_defineProperty(_this, "lockedCell", [null, false]);
|
|
90
|
-
_defineProperty(_this, "columnRef", /* @__PURE__ */ React.createRef());
|
|
91
|
-
_defineProperty(_this, "sortWrapperRef", /* @__PURE__ */ React.createRef());
|
|
92
|
-
_defineProperty(_this, "state", {
|
|
75
|
+
class Column extends Component {
|
|
76
|
+
constructor(...args) {
|
|
77
|
+
super(...args);
|
|
78
|
+
_defineProperty(this, "lockedCell", [null, false]);
|
|
79
|
+
_defineProperty(this, "columnRef", /* @__PURE__ */ React.createRef());
|
|
80
|
+
_defineProperty(this, "sortWrapperRef", /* @__PURE__ */ React.createRef());
|
|
81
|
+
_defineProperty(this, "state", {
|
|
93
82
|
sortVisible: false
|
|
94
83
|
});
|
|
95
|
-
_defineProperty(
|
|
96
|
-
var
|
|
84
|
+
_defineProperty(this, "calculateActiveColumnMinWidth", () => {
|
|
85
|
+
var _a;
|
|
86
|
+
const node = this.columnRef.current;
|
|
97
87
|
if (node) {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
if (_this.sortWrapperRef.current !== node2) {
|
|
88
|
+
const clonedColumn = document.createElement("div");
|
|
89
|
+
const computedStyle = window.getComputedStyle(node);
|
|
90
|
+
node.childNodes.forEach((node2) => {
|
|
91
|
+
if (this.sortWrapperRef.current !== node2) {
|
|
103
92
|
clonedColumn.append(node2.cloneNode(true));
|
|
104
93
|
}
|
|
105
94
|
});
|
|
106
95
|
clonedColumn.style.setProperty("visibility", "hidden", "important");
|
|
107
|
-
|
|
108
|
-
styles.forEach(
|
|
96
|
+
const styles = ["display", "flex", "margin", "padding", "background", "font-style", "font-width", "font-size", "font-weight"];
|
|
97
|
+
styles.forEach((key) => {
|
|
109
98
|
clonedColumn.style.setProperty(key, computedStyle.getPropertyValue(key), computedStyle.getPropertyPriority(key));
|
|
110
99
|
});
|
|
111
100
|
clonedColumn.style.setProperty("width", "fit-content", "important");
|
|
112
101
|
document.body.appendChild(clonedColumn);
|
|
113
|
-
|
|
102
|
+
const computedWidth = Math.ceil(clonedColumn.getBoundingClientRect().width);
|
|
114
103
|
document.body.removeChild(clonedColumn);
|
|
115
|
-
|
|
104
|
+
const defaultNodeWidth = ((_a = this.columnRef.current) == null ? void 0 : _a.clientWidth) ?? 0;
|
|
116
105
|
if (computedWidth >= defaultNodeWidth) {
|
|
117
106
|
return defaultNodeWidth + SORT_ICON_WIDTH;
|
|
118
107
|
} else {
|
|
119
|
-
|
|
108
|
+
const freeSpace = defaultNodeWidth - computedWidth;
|
|
120
109
|
if (freeSpace < SORT_ICON_WIDTH) {
|
|
121
110
|
return computedWidth + SORT_ICON_WIDTH;
|
|
122
111
|
}
|
|
@@ -124,164 +113,182 @@ var Column = /* @__PURE__ */ (function(_Component) {
|
|
|
124
113
|
}
|
|
125
114
|
return null;
|
|
126
115
|
});
|
|
127
|
-
_defineProperty(
|
|
128
|
-
|
|
116
|
+
_defineProperty(this, "handleMouseEnter", () => {
|
|
117
|
+
this.setState({
|
|
129
118
|
sortVisible: true
|
|
130
119
|
});
|
|
131
120
|
});
|
|
132
|
-
_defineProperty(
|
|
133
|
-
|
|
121
|
+
_defineProperty(this, "handleMouseLeave", () => {
|
|
122
|
+
this.setState({
|
|
134
123
|
sortVisible: false
|
|
135
124
|
});
|
|
136
125
|
});
|
|
137
|
-
_defineProperty(
|
|
138
|
-
|
|
126
|
+
_defineProperty(this, "handleBlur", (e) => {
|
|
127
|
+
const relatedTarget = e.relatedTarget;
|
|
139
128
|
if (!isFocusInside(e.currentTarget, relatedTarget) && lastInteraction.isKeyboard()) {
|
|
140
|
-
|
|
129
|
+
this.setState({
|
|
141
130
|
sortVisible: false
|
|
142
131
|
});
|
|
143
132
|
}
|
|
144
133
|
});
|
|
145
|
-
_defineProperty(
|
|
134
|
+
_defineProperty(this, "handleSortClick", (e) => {
|
|
146
135
|
e.stopPropagation();
|
|
147
|
-
|
|
136
|
+
const {
|
|
137
|
+
sort,
|
|
138
|
+
onSortChange,
|
|
139
|
+
name,
|
|
140
|
+
sortable
|
|
141
|
+
} = this.asProps;
|
|
148
142
|
if (lastInteraction.isMouse() || lastInteraction.isKeyboard() && e.target === e.currentTarget) {
|
|
149
143
|
if (sortable && onSortChange) {
|
|
150
|
-
|
|
144
|
+
const sortDirection = (sort == null ? void 0 : sort[0]) === name ? reversedSortDirection[sort[1]] : this.defaultDirection;
|
|
151
145
|
onSortChange([name, sortDirection], e);
|
|
152
146
|
}
|
|
153
147
|
}
|
|
154
148
|
});
|
|
155
|
-
_defineProperty(
|
|
156
|
-
handleKeydownFocusCell(
|
|
149
|
+
_defineProperty(this, "handleFocusableCellKeyDown", (e) => {
|
|
150
|
+
handleKeydownFocusCell(this.lockedCell, e);
|
|
157
151
|
});
|
|
158
|
-
_defineProperty(
|
|
159
|
-
var
|
|
160
|
-
|
|
152
|
+
_defineProperty(this, "handleFocusableCellFocus", (e) => {
|
|
153
|
+
var _a;
|
|
154
|
+
const cellElement = e.currentTarget;
|
|
155
|
+
const target = e.target;
|
|
161
156
|
if (lastInteraction.isKeyboard()) {
|
|
162
|
-
|
|
157
|
+
this.setState({
|
|
163
158
|
sortVisible: true
|
|
164
|
-
},
|
|
165
|
-
handleFocusCell(
|
|
159
|
+
}, () => {
|
|
160
|
+
handleFocusCell(this.lockedCell, target, cellElement);
|
|
166
161
|
});
|
|
167
162
|
} else {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
if (isInteractiveElement(e.target) && _this.columnRef.current && focusableChildren.length > 1) {
|
|
173
|
-
_this.lockedCell[0] = _this.columnRef.current;
|
|
174
|
-
_this.lockedCell[1] = true;
|
|
163
|
+
const focusableChildren = Array.from(((_a = this.columnRef.current) == null ? void 0 : _a.children) ?? []).flatMap((node) => getFocusableIn(node));
|
|
164
|
+
if (isInteractiveElement(e.target) && this.columnRef.current && focusableChildren.length > 1) {
|
|
165
|
+
this.lockedCell[0] = this.columnRef.current;
|
|
166
|
+
this.lockedCell[1] = true;
|
|
175
167
|
}
|
|
176
168
|
}
|
|
177
169
|
});
|
|
178
|
-
_defineProperty(
|
|
179
|
-
var
|
|
180
|
-
|
|
170
|
+
_defineProperty(this, "handleClick", (e) => {
|
|
171
|
+
var _a;
|
|
172
|
+
const {
|
|
173
|
+
sortable,
|
|
174
|
+
onClick,
|
|
175
|
+
columnIndex
|
|
176
|
+
} = this.asProps;
|
|
181
177
|
if (sortable) {
|
|
182
|
-
|
|
178
|
+
this.handleSortClick(e);
|
|
183
179
|
}
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
_this.lockedCell[0] = _this.columnRef.current;
|
|
189
|
-
_this.lockedCell[1] = true;
|
|
180
|
+
const focusableChildren = Array.from(((_a = this.columnRef.current) == null ? void 0 : _a.children) ?? []).flatMap((node) => getFocusableIn(node));
|
|
181
|
+
if (isInteractiveElement(e.target) && this.columnRef.current && focusableChildren.length > 1) {
|
|
182
|
+
this.lockedCell[0] = this.columnRef.current;
|
|
183
|
+
this.lockedCell[1] = true;
|
|
190
184
|
}
|
|
191
|
-
onClick
|
|
185
|
+
onClick == null ? void 0 : onClick(e, {
|
|
192
186
|
rowIndex: -1,
|
|
193
187
|
colIndex: columnIndex
|
|
194
188
|
});
|
|
195
189
|
});
|
|
196
|
-
return _this;
|
|
197
190
|
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
}
|
|
191
|
+
componentDidMount() {
|
|
192
|
+
var _a;
|
|
193
|
+
const {
|
|
194
|
+
parent,
|
|
195
|
+
sticky,
|
|
196
|
+
changeSortSize,
|
|
197
|
+
name,
|
|
198
|
+
sort,
|
|
199
|
+
scrollDirection
|
|
200
|
+
} = this.asProps;
|
|
201
|
+
if (parent && sticky && scrollDirection !== "horizontal") {
|
|
202
|
+
const columnElement = this.columnRef.current;
|
|
203
|
+
const groupElement = (_a = columnElement == null ? void 0 : columnElement.parentElement) == null ? void 0 : _a.children.item(0);
|
|
204
|
+
const groupRectHeight = (groupElement == null ? void 0 : groupElement.getBoundingClientRect().height) ?? 0;
|
|
205
|
+
const topOffset = groupElement instanceof HTMLElement ? cssToIntDefault(groupElement.style.top) : 0;
|
|
206
|
+
columnElement == null ? void 0 : columnElement.style.setProperty("top", `${groupRectHeight + topOffset}px`);
|
|
214
207
|
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
208
|
+
if (canUseDOM() && changeSortSize && (sort == null ? void 0 : sort[0]) === name) {
|
|
209
|
+
this.changeTemplateColumnBySort();
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
componentDidUpdate(prevProps) {
|
|
213
|
+
var _a, _b;
|
|
214
|
+
if (this.asProps.changeSortSize && canUseDOM() && ((_a = prevProps.sort) == null ? void 0 : _a[0]) !== ((_b = this.asProps.sort) == null ? void 0 : _b[0])) {
|
|
215
|
+
this.changeTemplateColumnBySort();
|
|
222
216
|
}
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
217
|
+
}
|
|
218
|
+
changeTemplateColumnBySort() {
|
|
219
|
+
const {
|
|
220
|
+
tableRef,
|
|
221
|
+
gridTemplateColumns,
|
|
222
|
+
columnIndex,
|
|
223
|
+
sort,
|
|
224
|
+
name
|
|
225
|
+
} = this.asProps;
|
|
226
|
+
if ((sort == null ? void 0 : sort[0]) === name) {
|
|
227
|
+
const newWidth = this.calculateActiveColumnMinWidth();
|
|
228
|
+
setTimeout(() => {
|
|
229
|
+
if (tableRef.current && newWidth !== null) {
|
|
230
|
+
tableRef.current.style.setProperty("grid-template-columns", gridTemplateColumns.map((gtcWidth, index) => {
|
|
231
|
+
if (index === columnIndex) {
|
|
232
|
+
return `${newWidth}px`;
|
|
233
|
+
}
|
|
234
|
+
return gtcWidth;
|
|
235
|
+
}).join(" "));
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
} else if ((sort == null ? void 0 : sort[0]) !== name) {
|
|
239
|
+
setTimeout(() => {
|
|
240
|
+
if (tableRef.current) {
|
|
241
|
+
const currentGridTemplateColumns = tableRef.current.style.getPropertyValue("grid-template-columns");
|
|
242
|
+
if (currentGridTemplateColumns) {
|
|
243
|
+
tableRef.current.style.setProperty("grid-template-columns", currentGridTemplateColumns.split(" ").map((gtcWidth, index) => {
|
|
232
244
|
if (index === columnIndex) {
|
|
233
|
-
return
|
|
245
|
+
return gridTemplateColumns[index];
|
|
234
246
|
}
|
|
235
247
|
return gtcWidth;
|
|
236
248
|
}).join(" "));
|
|
237
249
|
}
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
setTimeout(function() {
|
|
241
|
-
if (tableRef.current) {
|
|
242
|
-
var currentGridTemplateColumns = tableRef.current.style.getPropertyValue("grid-template-columns");
|
|
243
|
-
if (currentGridTemplateColumns) {
|
|
244
|
-
tableRef.current.style.setProperty("grid-template-columns", currentGridTemplateColumns.split(" ").map(function(gtcWidth, index) {
|
|
245
|
-
if (index === columnIndex) {
|
|
246
|
-
return gridTemplateColumns[index];
|
|
247
|
-
}
|
|
248
|
-
return gtcWidth;
|
|
249
|
-
}).join(" "));
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
});
|
|
253
|
-
}
|
|
250
|
+
}
|
|
251
|
+
});
|
|
254
252
|
}
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
return DEFAULT_DIRECTION;
|
|
253
|
+
}
|
|
254
|
+
get defaultDirection() {
|
|
255
|
+
const {
|
|
256
|
+
sortable
|
|
257
|
+
} = this.asProps;
|
|
258
|
+
if (typeof sortable === "string") {
|
|
259
|
+
return sortable;
|
|
263
260
|
}
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
261
|
+
return DEFAULT_DIRECTION;
|
|
262
|
+
}
|
|
263
|
+
render() {
|
|
264
|
+
var _ref = this.asProps, _ref2;
|
|
265
|
+
const SColumn = Flex;
|
|
266
|
+
const SSortWrapper = "div";
|
|
267
|
+
const SSortButton = ButtonLink;
|
|
268
|
+
const {
|
|
269
|
+
styles,
|
|
270
|
+
sortable,
|
|
271
|
+
sort,
|
|
272
|
+
uid,
|
|
273
|
+
name,
|
|
274
|
+
parent,
|
|
275
|
+
sortableColumnDescribeId,
|
|
276
|
+
Children
|
|
277
|
+
} = this.asProps;
|
|
278
|
+
const [sortBy, sortDirection] = sort ?? [void 0, void 0];
|
|
279
|
+
const isSorted = sortBy === name && !!sortDirection;
|
|
280
|
+
const SSortIcon = isSorted ? SORTING_ICON[sortDirection] : SORTING_ICON[this.defaultDirection];
|
|
281
|
+
const visibleSort = Boolean(sortable) && (this.state.sortVisible || isSorted);
|
|
282
|
+
const ariaDescribedBy = [];
|
|
283
|
+
if (sortable) {
|
|
284
|
+
ariaDescribedBy.push(sortableColumnDescribeId);
|
|
285
|
+
}
|
|
286
|
+
if (parent) {
|
|
287
|
+
ariaDescribedBy.push(`igc-table-${uid}-${parent.name}-group`);
|
|
288
|
+
}
|
|
289
|
+
const ariaSortValue = isSorted ? ARIA_SORT[sortDirection] : void 0;
|
|
290
|
+
return _ref2 = sstyled(styles), /* @__PURE__ */ React.createElement(SColumn, _ref2.cn("SColumn", {
|
|
291
|
+
...assignProps({
|
|
285
292
|
"ref": this.columnRef,
|
|
286
293
|
"role": "columnheader",
|
|
287
294
|
"tabIndex": -1,
|
|
@@ -296,18 +303,18 @@ var Column = /* @__PURE__ */ (function(_Component) {
|
|
|
296
303
|
"aria-describedby": ariaDescribedBy.length > 0 ? ariaDescribedBy.join(" ") : void 0,
|
|
297
304
|
"aria-sort": ariaSortValue,
|
|
298
305
|
"use:onClick": this.handleClick
|
|
299
|
-
}, _ref)
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
}
|
|
306
|
+
}, _ref)
|
|
307
|
+
}), /* @__PURE__ */ React.createElement(Children, _ref2.cn("Children", {})), sortable && /* @__PURE__ */ React.createElement(SSortWrapper, _ref2.cn("SSortWrapper", {
|
|
308
|
+
"ref": this.sortWrapperRef
|
|
309
|
+
}), /* @__PURE__ */ React.createElement(SSortButton, _ref2.cn("SSortButton", {
|
|
310
|
+
"onClick": this.handleSortClick,
|
|
311
|
+
"aria-label": ariaSortValue,
|
|
312
|
+
"color": "--intergalactic-icon-primary-neutral"
|
|
313
|
+
}), /* @__PURE__ */ React.createElement(SSortButton.Addon, {
|
|
314
|
+
tag: SSortIcon
|
|
315
|
+
}))));
|
|
316
|
+
}
|
|
317
|
+
}
|
|
311
318
|
_defineProperty(Column, "displayName", "Column");
|
|
312
319
|
_defineProperty(Column, "style", style);
|
|
313
320
|
export {
|