@semcore/data-table 16.5.3-prerelease.4 → 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,9 +1,3 @@
|
|
|
1
|
-
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
5
|
-
import _callSuper from "@babel/runtime/helpers/callSuper";
|
|
6
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
2
|
import { sstyled as _sstyled } from "@semcore/core";
|
|
9
3
|
import { assignProps as _assignProps } from "@semcore/core";
|
|
@@ -19,99 +13,93 @@ import SortAsc from '@semcore/icon/SortAsc/m';
|
|
|
19
13
|
import SortDesc from '@semcore/icon/SortDesc/m';
|
|
20
14
|
import * as React from 'react';
|
|
21
15
|
/*!__reshadow-styles__:"./style.shadow.css"*/
|
|
22
|
-
|
|
16
|
+
const style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".___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%))}", /*__inner_css_end__*/"16i6f_gg_"),
|
|
23
17
|
/*__reshadow_css_end__*/
|
|
24
18
|
{
|
|
25
|
-
"__SHead": "
|
|
26
|
-
"__SGroupContainer": "
|
|
27
|
-
"_isDataEmpty": "
|
|
28
|
-
"_gridTemplateColumns": "
|
|
29
|
-
"--gridTemplateColumns": "--
|
|
30
|
-
"_animationDuration": "
|
|
31
|
-
"__SColumn": "
|
|
32
|
-
"--animationDuration": "--
|
|
33
|
-
"_sticky": "
|
|
34
|
-
"__SGroup": "
|
|
35
|
-
"_compact": "
|
|
36
|
-
"_use_secondary": "
|
|
37
|
-
"_borders_both": "
|
|
38
|
-
"_borders_left": "
|
|
39
|
-
"_borders_right": "
|
|
40
|
-
"_gridArea": "
|
|
41
|
-
"__SGroupTitle": "
|
|
42
|
-
"--gridArea": "--
|
|
43
|
-
"_fixed": "
|
|
44
|
-
"_sortable": "
|
|
45
|
-
"__SSortWrapper": "
|
|
46
|
-
"__SSortButton": "
|
|
47
|
-
"__SHeadCheckboxCol": "
|
|
48
|
-
"_use_primary": "
|
|
49
|
-
"_visibleSort": "
|
|
50
|
-
"_justifyContent_right": "
|
|
51
|
-
"_changeSortSize": "
|
|
52
|
-
"_isSorted": "
|
|
53
|
-
"_sideIndents_wide": "
|
|
54
|
-
"_shadowVertical": "
|
|
55
|
-
"_fixed_left": "
|
|
56
|
-
"_shadowVertical_median": "
|
|
57
|
-
"_shadowVertical_start": "
|
|
58
|
-
"_fixed_right": "
|
|
59
|
-
"_shadowVertical_end": "
|
|
19
|
+
"__SHead": "___SHead_16i6f_gg_",
|
|
20
|
+
"__SGroupContainer": "___SGroupContainer_16i6f_gg_",
|
|
21
|
+
"_isDataEmpty": "__isDataEmpty_16i6f_gg_",
|
|
22
|
+
"_gridTemplateColumns": "__gridTemplateColumns_16i6f_gg_",
|
|
23
|
+
"--gridTemplateColumns": "--gridTemplateColumns_16i6f",
|
|
24
|
+
"_animationDuration": "__animationDuration_16i6f_gg_",
|
|
25
|
+
"__SColumn": "___SColumn_16i6f_gg_",
|
|
26
|
+
"--animationDuration": "--animationDuration_16i6f",
|
|
27
|
+
"_sticky": "__sticky_16i6f_gg_",
|
|
28
|
+
"__SGroup": "___SGroup_16i6f_gg_",
|
|
29
|
+
"_compact": "__compact_16i6f_gg_",
|
|
30
|
+
"_use_secondary": "_use_secondary_16i6f_gg_",
|
|
31
|
+
"_borders_both": "_borders_both_16i6f_gg_",
|
|
32
|
+
"_borders_left": "_borders_left_16i6f_gg_",
|
|
33
|
+
"_borders_right": "_borders_right_16i6f_gg_",
|
|
34
|
+
"_gridArea": "__gridArea_16i6f_gg_",
|
|
35
|
+
"__SGroupTitle": "___SGroupTitle_16i6f_gg_",
|
|
36
|
+
"--gridArea": "--gridArea_16i6f",
|
|
37
|
+
"_fixed": "__fixed_16i6f_gg_",
|
|
38
|
+
"_sortable": "__sortable_16i6f_gg_",
|
|
39
|
+
"__SSortWrapper": "___SSortWrapper_16i6f_gg_",
|
|
40
|
+
"__SSortButton": "___SSortButton_16i6f_gg_",
|
|
41
|
+
"__SHeadCheckboxCol": "___SHeadCheckboxCol_16i6f_gg_",
|
|
42
|
+
"_use_primary": "_use_primary_16i6f_gg_",
|
|
43
|
+
"_visibleSort": "__visibleSort_16i6f_gg_",
|
|
44
|
+
"_justifyContent_right": "_justifyContent_right_16i6f_gg_",
|
|
45
|
+
"_changeSortSize": "__changeSortSize_16i6f_gg_",
|
|
46
|
+
"_isSorted": "__isSorted_16i6f_gg_",
|
|
47
|
+
"_sideIndents_wide": "_sideIndents_wide_16i6f_gg_",
|
|
48
|
+
"_shadowVertical": "__shadowVertical_16i6f_gg_",
|
|
49
|
+
"_fixed_left": "_fixed_left_16i6f_gg_",
|
|
50
|
+
"_shadowVertical_median": "_shadowVertical_median_16i6f_gg_",
|
|
51
|
+
"_shadowVertical_start": "_shadowVertical_start_16i6f_gg_",
|
|
52
|
+
"_fixed_right": "_fixed_right_16i6f_gg_",
|
|
53
|
+
"_shadowVertical_end": "_shadowVertical_end_16i6f_gg_"
|
|
60
54
|
});
|
|
61
55
|
import { handleFocusCell, handleKeydownFocusCell } from '../../enhancers/focusableCell';
|
|
62
|
-
|
|
56
|
+
const SORTING_ICON = {
|
|
63
57
|
desc: SortDesc,
|
|
64
58
|
asc: SortAsc
|
|
65
59
|
};
|
|
66
|
-
|
|
60
|
+
const ARIA_SORT = {
|
|
67
61
|
desc: 'descending',
|
|
68
62
|
asc: 'ascending'
|
|
69
63
|
};
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
64
|
+
const SORT_ICON_WIDTH = 20;
|
|
65
|
+
const DEFAULT_DIRECTION = 'desc';
|
|
66
|
+
const reversedSortDirection = {
|
|
73
67
|
desc: 'asc',
|
|
74
68
|
asc: 'desc'
|
|
75
69
|
};
|
|
76
|
-
export
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
_this = _callSuper(this, Column, [].concat(args));
|
|
84
|
-
_defineProperty(_this, "lockedCell", [null, false]);
|
|
85
|
-
_defineProperty(_this, "columnRef", /*#__PURE__*/React.createRef());
|
|
86
|
-
_defineProperty(_this, "sortWrapperRef", /*#__PURE__*/React.createRef());
|
|
87
|
-
_defineProperty(_this, "state", {
|
|
70
|
+
export class Column extends Component {
|
|
71
|
+
constructor(...args) {
|
|
72
|
+
super(...args);
|
|
73
|
+
_defineProperty(this, "lockedCell", [null, false]);
|
|
74
|
+
_defineProperty(this, "columnRef", /*#__PURE__*/React.createRef());
|
|
75
|
+
_defineProperty(this, "sortWrapperRef", /*#__PURE__*/React.createRef());
|
|
76
|
+
_defineProperty(this, "state", {
|
|
88
77
|
sortVisible: false
|
|
89
78
|
});
|
|
90
|
-
_defineProperty(
|
|
91
|
-
|
|
79
|
+
_defineProperty(this, "calculateActiveColumnMinWidth", () => {
|
|
80
|
+
const node = this.columnRef.current;
|
|
92
81
|
if (node) {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
if (_this.sortWrapperRef.current !== node) {
|
|
82
|
+
const clonedColumn = document.createElement('div');
|
|
83
|
+
const computedStyle = window.getComputedStyle(node);
|
|
84
|
+
node.childNodes.forEach(node => {
|
|
85
|
+
if (this.sortWrapperRef.current !== node) {
|
|
98
86
|
clonedColumn.append(node.cloneNode(true));
|
|
99
87
|
}
|
|
100
88
|
});
|
|
101
89
|
clonedColumn.style.setProperty('visibility', 'hidden', 'important');
|
|
102
|
-
|
|
103
|
-
styles.forEach(
|
|
90
|
+
const styles = ['display', 'flex', 'margin', 'padding', 'background', 'font-style', 'font-width', 'font-size', 'font-weight'];
|
|
91
|
+
styles.forEach(key => {
|
|
104
92
|
clonedColumn.style.setProperty(key, computedStyle.getPropertyValue(key), computedStyle.getPropertyPriority(key));
|
|
105
93
|
});
|
|
106
94
|
clonedColumn.style.setProperty('width', 'fit-content', 'important');
|
|
107
95
|
document.body.appendChild(clonedColumn);
|
|
108
|
-
|
|
96
|
+
const computedWidth = Math.ceil(clonedColumn.getBoundingClientRect().width);
|
|
109
97
|
document.body.removeChild(clonedColumn);
|
|
110
|
-
|
|
98
|
+
const defaultNodeWidth = this.columnRef.current?.clientWidth ?? 0;
|
|
111
99
|
if (computedWidth >= defaultNodeWidth) {
|
|
112
100
|
return defaultNodeWidth + SORT_ICON_WIDTH;
|
|
113
101
|
} else {
|
|
114
|
-
|
|
102
|
+
const freeSpace = defaultNodeWidth - computedWidth;
|
|
115
103
|
if (freeSpace < SORT_ICON_WIDTH) {
|
|
116
104
|
return computedWidth + SORT_ICON_WIDTH;
|
|
117
105
|
}
|
|
@@ -119,194 +107,179 @@ export var Column = /*#__PURE__*/function (_Component) {
|
|
|
119
107
|
}
|
|
120
108
|
return null;
|
|
121
109
|
});
|
|
122
|
-
_defineProperty(
|
|
123
|
-
|
|
110
|
+
_defineProperty(this, "handleMouseEnter", () => {
|
|
111
|
+
this.setState({
|
|
124
112
|
sortVisible: true
|
|
125
113
|
});
|
|
126
114
|
});
|
|
127
|
-
_defineProperty(
|
|
128
|
-
|
|
115
|
+
_defineProperty(this, "handleMouseLeave", () => {
|
|
116
|
+
this.setState({
|
|
129
117
|
sortVisible: false
|
|
130
118
|
});
|
|
131
119
|
});
|
|
132
|
-
_defineProperty(
|
|
133
|
-
|
|
120
|
+
_defineProperty(this, "handleBlur", e => {
|
|
121
|
+
const relatedTarget = e.relatedTarget;
|
|
134
122
|
if (!isFocusInside(e.currentTarget, relatedTarget) && lastInteraction.isKeyboard()) {
|
|
135
|
-
|
|
123
|
+
this.setState({
|
|
136
124
|
sortVisible: false
|
|
137
125
|
});
|
|
138
126
|
}
|
|
139
127
|
});
|
|
140
|
-
_defineProperty(
|
|
128
|
+
_defineProperty(this, "handleSortClick", e => {
|
|
141
129
|
e.stopPropagation();
|
|
142
|
-
|
|
143
|
-
sort
|
|
144
|
-
onSortChange
|
|
145
|
-
name
|
|
146
|
-
sortable
|
|
130
|
+
const {
|
|
131
|
+
sort,
|
|
132
|
+
onSortChange,
|
|
133
|
+
name,
|
|
134
|
+
sortable
|
|
135
|
+
} = this.asProps;
|
|
147
136
|
if (lastInteraction.isMouse() || lastInteraction.isKeyboard() && e.target === e.currentTarget) {
|
|
148
137
|
if (sortable && onSortChange) {
|
|
149
|
-
|
|
138
|
+
const sortDirection = sort?.[0] === name ? reversedSortDirection[sort[1]] : this.defaultDirection;
|
|
150
139
|
onSortChange([name, sortDirection], e);
|
|
151
140
|
}
|
|
152
141
|
}
|
|
153
142
|
});
|
|
154
|
-
_defineProperty(
|
|
155
|
-
handleKeydownFocusCell(
|
|
143
|
+
_defineProperty(this, "handleFocusableCellKeyDown", e => {
|
|
144
|
+
handleKeydownFocusCell(this.lockedCell, e);
|
|
156
145
|
});
|
|
157
|
-
_defineProperty(
|
|
158
|
-
|
|
159
|
-
|
|
146
|
+
_defineProperty(this, "handleFocusableCellFocus", e => {
|
|
147
|
+
const cellElement = e.currentTarget;
|
|
148
|
+
const target = e.target;
|
|
160
149
|
if (lastInteraction.isKeyboard()) {
|
|
161
|
-
|
|
150
|
+
this.setState({
|
|
162
151
|
sortVisible: true
|
|
163
|
-
},
|
|
164
|
-
handleFocusCell(
|
|
152
|
+
}, () => {
|
|
153
|
+
handleFocusCell(this.lockedCell, target, cellElement);
|
|
165
154
|
});
|
|
166
155
|
} else {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
if (isInteractiveElement(e.target) && _this.columnRef.current && focusableChildren.length > 1) {
|
|
172
|
-
_this.lockedCell[0] = _this.columnRef.current;
|
|
173
|
-
_this.lockedCell[1] = true;
|
|
156
|
+
const focusableChildren = Array.from(this.columnRef.current?.children ?? []).flatMap(node => getFocusableIn(node));
|
|
157
|
+
if (isInteractiveElement(e.target) && this.columnRef.current && focusableChildren.length > 1) {
|
|
158
|
+
this.lockedCell[0] = this.columnRef.current;
|
|
159
|
+
this.lockedCell[1] = true;
|
|
174
160
|
}
|
|
175
161
|
}
|
|
176
162
|
});
|
|
177
|
-
_defineProperty(
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
163
|
+
_defineProperty(this, "handleClick", e => {
|
|
164
|
+
const {
|
|
165
|
+
sortable,
|
|
166
|
+
onClick,
|
|
167
|
+
columnIndex
|
|
168
|
+
} = this.asProps;
|
|
183
169
|
if (sortable) {
|
|
184
|
-
|
|
170
|
+
this.handleSortClick(e);
|
|
185
171
|
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
_this.lockedCell[0] = _this.columnRef.current;
|
|
191
|
-
_this.lockedCell[1] = true;
|
|
172
|
+
const focusableChildren = Array.from(this.columnRef.current?.children ?? []).flatMap(node => getFocusableIn(node));
|
|
173
|
+
if (isInteractiveElement(e.target) && this.columnRef.current && focusableChildren.length > 1) {
|
|
174
|
+
this.lockedCell[0] = this.columnRef.current;
|
|
175
|
+
this.lockedCell[1] = true;
|
|
192
176
|
}
|
|
193
|
-
onClick
|
|
177
|
+
onClick?.(e, {
|
|
194
178
|
rowIndex: -1,
|
|
195
179
|
colIndex: columnIndex
|
|
196
180
|
});
|
|
197
181
|
});
|
|
198
|
-
return _this;
|
|
199
182
|
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
var groupRectHeight = (_groupElement$getBoun = groupElement === null || groupElement === void 0 ? void 0 : groupElement.getBoundingClientRect().height) !== null && _groupElement$getBoun !== void 0 ? _groupElement$getBoun : 0;
|
|
216
|
-
var topOffset = groupElement instanceof HTMLElement ? cssToIntDefault(groupElement.style.top) : 0;
|
|
217
|
-
columnElement === null || columnElement === void 0 || columnElement.style.setProperty('top', "".concat(groupRectHeight + topOffset, "px"));
|
|
218
|
-
}
|
|
219
|
-
if (canUseDOM() && changeSortSize && (sort === null || sort === void 0 ? void 0 : sort[0]) === name) {
|
|
220
|
-
this.changeTemplateColumnBySort();
|
|
221
|
-
}
|
|
183
|
+
componentDidMount() {
|
|
184
|
+
const {
|
|
185
|
+
parent,
|
|
186
|
+
sticky,
|
|
187
|
+
changeSortSize,
|
|
188
|
+
name,
|
|
189
|
+
sort,
|
|
190
|
+
scrollDirection
|
|
191
|
+
} = this.asProps;
|
|
192
|
+
if (parent && sticky && scrollDirection !== 'horizontal') {
|
|
193
|
+
const columnElement = this.columnRef.current;
|
|
194
|
+
const groupElement = columnElement?.parentElement?.children.item(0);
|
|
195
|
+
const groupRectHeight = groupElement?.getBoundingClientRect().height ?? 0;
|
|
196
|
+
const topOffset = groupElement instanceof HTMLElement ? cssToIntDefault(groupElement.style.top) : 0;
|
|
197
|
+
columnElement?.style.setProperty('top', `${groupRectHeight + topOffset}px`);
|
|
222
198
|
}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
199
|
+
if (canUseDOM() && changeSortSize && sort?.[0] === name) {
|
|
200
|
+
this.changeTemplateColumnBySort();
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
componentDidUpdate(prevProps) {
|
|
204
|
+
if (this.asProps.changeSortSize && canUseDOM() && prevProps.sort?.[0] !== this.asProps.sort?.[0]) {
|
|
205
|
+
this.changeTemplateColumnBySort();
|
|
230
206
|
}
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
207
|
+
}
|
|
208
|
+
changeTemplateColumnBySort() {
|
|
209
|
+
const {
|
|
210
|
+
tableRef,
|
|
211
|
+
gridTemplateColumns,
|
|
212
|
+
columnIndex,
|
|
213
|
+
sort,
|
|
214
|
+
name
|
|
215
|
+
} = this.asProps;
|
|
216
|
+
if (sort?.[0] === name) {
|
|
217
|
+
const newWidth = this.calculateActiveColumnMinWidth();
|
|
218
|
+
setTimeout(() => {
|
|
219
|
+
if (tableRef.current && newWidth !== null) {
|
|
220
|
+
tableRef.current.style.setProperty('grid-template-columns', gridTemplateColumns.map((gtcWidth, index) => {
|
|
221
|
+
if (index === columnIndex) {
|
|
222
|
+
return `${newWidth}px`;
|
|
223
|
+
}
|
|
224
|
+
return gtcWidth;
|
|
225
|
+
}).join(' '));
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
} else if (sort?.[0] !== name) {
|
|
229
|
+
setTimeout(() => {
|
|
230
|
+
if (tableRef.current) {
|
|
231
|
+
const currentGridTemplateColumns = tableRef.current.style.getPropertyValue('grid-template-columns');
|
|
232
|
+
if (currentGridTemplateColumns) {
|
|
233
|
+
tableRef.current.style.setProperty('grid-template-columns', currentGridTemplateColumns.split(' ').map((gtcWidth, index) => {
|
|
245
234
|
if (index === columnIndex) {
|
|
246
|
-
return
|
|
235
|
+
return gridTemplateColumns[index];
|
|
247
236
|
}
|
|
248
237
|
return gtcWidth;
|
|
249
238
|
}).join(' '));
|
|
250
239
|
}
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
setTimeout(function () {
|
|
254
|
-
if (tableRef.current) {
|
|
255
|
-
var currentGridTemplateColumns = tableRef.current.style.getPropertyValue('grid-template-columns');
|
|
256
|
-
if (currentGridTemplateColumns) {
|
|
257
|
-
tableRef.current.style.setProperty('grid-template-columns', currentGridTemplateColumns.split(' ').map(function (gtcWidth, index) {
|
|
258
|
-
if (index === columnIndex) {
|
|
259
|
-
return gridTemplateColumns[index];
|
|
260
|
-
}
|
|
261
|
-
return gtcWidth;
|
|
262
|
-
}).join(' '));
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
});
|
|
266
|
-
}
|
|
240
|
+
}
|
|
241
|
+
});
|
|
267
242
|
}
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
return DEFAULT_DIRECTION;
|
|
243
|
+
}
|
|
244
|
+
get defaultDirection() {
|
|
245
|
+
const {
|
|
246
|
+
sortable
|
|
247
|
+
} = this.asProps;
|
|
248
|
+
if (typeof sortable === 'string') {
|
|
249
|
+
return sortable;
|
|
276
250
|
}
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
return _ref2 = sstyled(styles), /*#__PURE__*/React.createElement(SColumn, _ref2.cn("SColumn", _objectSpread({}, _assignProps({
|
|
251
|
+
return DEFAULT_DIRECTION;
|
|
252
|
+
}
|
|
253
|
+
render() {
|
|
254
|
+
var _ref = this.asProps,
|
|
255
|
+
_ref2;
|
|
256
|
+
const SColumn = Flex;
|
|
257
|
+
const SSortWrapper = 'div';
|
|
258
|
+
const SSortButton = ButtonLink;
|
|
259
|
+
const {
|
|
260
|
+
styles,
|
|
261
|
+
sortable,
|
|
262
|
+
sort,
|
|
263
|
+
uid,
|
|
264
|
+
name,
|
|
265
|
+
parent,
|
|
266
|
+
sortableColumnDescribeId,
|
|
267
|
+
Children
|
|
268
|
+
} = this.asProps;
|
|
269
|
+
const [sortBy, sortDirection] = sort ?? [undefined, undefined];
|
|
270
|
+
const isSorted = sortBy === name && !!sortDirection;
|
|
271
|
+
const SSortIcon = isSorted ? SORTING_ICON[sortDirection] : SORTING_ICON[this.defaultDirection];
|
|
272
|
+
const visibleSort = Boolean(sortable) && (this.state.sortVisible || isSorted);
|
|
273
|
+
const ariaDescribedBy = [];
|
|
274
|
+
if (sortable) {
|
|
275
|
+
ariaDescribedBy.push(sortableColumnDescribeId);
|
|
276
|
+
}
|
|
277
|
+
if (parent) {
|
|
278
|
+
ariaDescribedBy.push(`igc-table-${uid}-${parent.name}-group`);
|
|
279
|
+
}
|
|
280
|
+
const ariaSortValue = isSorted ? ARIA_SORT[sortDirection] : undefined;
|
|
281
|
+
return _ref2 = sstyled(styles), /*#__PURE__*/React.createElement(SColumn, _ref2.cn("SColumn", {
|
|
282
|
+
..._assignProps({
|
|
310
283
|
"ref": this.columnRef,
|
|
311
284
|
"role": 'columnheader',
|
|
312
285
|
"tabIndex": -1,
|
|
@@ -321,18 +294,18 @@ export var Column = /*#__PURE__*/function (_Component) {
|
|
|
321
294
|
"aria-describedby": ariaDescribedBy.length > 0 ? ariaDescribedBy.join(' ') : undefined,
|
|
322
295
|
"aria-sort": ariaSortValue,
|
|
323
296
|
"use:onClick": this.handleClick
|
|
324
|
-
}, _ref)
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
}
|
|
297
|
+
}, _ref)
|
|
298
|
+
}), /*#__PURE__*/React.createElement(Children, _ref2.cn("Children", {})), sortable && /*#__PURE__*/React.createElement(SSortWrapper, _ref2.cn("SSortWrapper", {
|
|
299
|
+
"ref": this.sortWrapperRef
|
|
300
|
+
}), /*#__PURE__*/React.createElement(SSortButton, _ref2.cn("SSortButton", {
|
|
301
|
+
"onClick": this.handleSortClick,
|
|
302
|
+
"aria-label": ariaSortValue,
|
|
303
|
+
"color": '--intergalactic-icon-primary-neutral'
|
|
304
|
+
}), /*#__PURE__*/React.createElement(SSortButton.Addon, {
|
|
305
|
+
tag: SSortIcon
|
|
306
|
+
}))));
|
|
307
|
+
}
|
|
308
|
+
}
|
|
336
309
|
_defineProperty(Column, "displayName", 'Column');
|
|
337
310
|
_defineProperty(Column, "style", style);
|
|
338
311
|
//# sourceMappingURL=Column.js.map
|