@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,12 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
5
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
6
|
-
import _callSuper from "@babel/runtime/helpers/esm/callSuper";
|
|
7
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
8
2
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
9
|
-
import { createComponent, sstyled, assignProps
|
|
3
|
+
import { createComponent, Component, sstyled, assignProps } from "@semcore/core";
|
|
10
4
|
import { Box, ScreenReaderOnly } from "@semcore/base-components";
|
|
11
5
|
import Checkbox from "@semcore/checkbox";
|
|
12
6
|
import React__default from "react";
|
|
@@ -14,249 +8,270 @@ import { Column } from "./Column.mjs";
|
|
|
14
8
|
import { Group } from "./Group.mjs";
|
|
15
9
|
import { UNIQ_ROW_KEY, SELECT_ALL, DataTable } from "../DataTable/DataTable.mjs";
|
|
16
10
|
/*!__reshadow-styles__:"./style.shadow.css"*/
|
|
17
|
-
|
|
11
|
+
const style = (
|
|
18
12
|
/*__reshadow_css_start__*/
|
|
19
13
|
(sstyled.insert(
|
|
20
14
|
/*__inner_css_start__*/
|
|
21
|
-
'.
|
|
15
|
+
'.___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%))}',
|
|
22
16
|
/*__inner_css_end__*/
|
|
23
|
-
"
|
|
17
|
+
"16i6f_gg_"
|
|
24
18
|
), /*__reshadow_css_end__*/
|
|
25
19
|
{
|
|
26
|
-
"__SHead": "
|
|
27
|
-
"__SGroupContainer": "
|
|
28
|
-
"_isDataEmpty": "
|
|
29
|
-
"_gridTemplateColumns": "
|
|
30
|
-
"--gridTemplateColumns": "--
|
|
31
|
-
"_animationDuration": "
|
|
32
|
-
"__SColumn": "
|
|
33
|
-
"--animationDuration": "--
|
|
34
|
-
"_sticky": "
|
|
35
|
-
"__SGroup": "
|
|
36
|
-
"_compact": "
|
|
37
|
-
"_use_secondary": "
|
|
38
|
-
"_borders_both": "
|
|
39
|
-
"_borders_left": "
|
|
40
|
-
"_borders_right": "
|
|
41
|
-
"_gridArea": "
|
|
42
|
-
"__SGroupTitle": "
|
|
43
|
-
"--gridArea": "--
|
|
44
|
-
"_fixed": "
|
|
45
|
-
"_sortable": "
|
|
46
|
-
"__SSortWrapper": "
|
|
47
|
-
"__SSortButton": "
|
|
48
|
-
"__SHeadCheckboxCol": "
|
|
49
|
-
"_use_primary": "
|
|
50
|
-
"_visibleSort": "
|
|
51
|
-
"_justifyContent_right": "
|
|
52
|
-
"_changeSortSize": "
|
|
53
|
-
"_isSorted": "
|
|
54
|
-
"_sideIndents_wide": "
|
|
55
|
-
"_shadowVertical": "
|
|
56
|
-
"_fixed_left": "
|
|
57
|
-
"_shadowVertical_median": "
|
|
58
|
-
"_shadowVertical_start": "
|
|
59
|
-
"_fixed_right": "
|
|
60
|
-
"_shadowVertical_end": "
|
|
20
|
+
"__SHead": "___SHead_16i6f_gg_",
|
|
21
|
+
"__SGroupContainer": "___SGroupContainer_16i6f_gg_",
|
|
22
|
+
"_isDataEmpty": "__isDataEmpty_16i6f_gg_",
|
|
23
|
+
"_gridTemplateColumns": "__gridTemplateColumns_16i6f_gg_",
|
|
24
|
+
"--gridTemplateColumns": "--gridTemplateColumns_16i6f",
|
|
25
|
+
"_animationDuration": "__animationDuration_16i6f_gg_",
|
|
26
|
+
"__SColumn": "___SColumn_16i6f_gg_",
|
|
27
|
+
"--animationDuration": "--animationDuration_16i6f",
|
|
28
|
+
"_sticky": "__sticky_16i6f_gg_",
|
|
29
|
+
"__SGroup": "___SGroup_16i6f_gg_",
|
|
30
|
+
"_compact": "__compact_16i6f_gg_",
|
|
31
|
+
"_use_secondary": "_use_secondary_16i6f_gg_",
|
|
32
|
+
"_borders_both": "_borders_both_16i6f_gg_",
|
|
33
|
+
"_borders_left": "_borders_left_16i6f_gg_",
|
|
34
|
+
"_borders_right": "_borders_right_16i6f_gg_",
|
|
35
|
+
"_gridArea": "__gridArea_16i6f_gg_",
|
|
36
|
+
"__SGroupTitle": "___SGroupTitle_16i6f_gg_",
|
|
37
|
+
"--gridArea": "--gridArea_16i6f",
|
|
38
|
+
"_fixed": "__fixed_16i6f_gg_",
|
|
39
|
+
"_sortable": "__sortable_16i6f_gg_",
|
|
40
|
+
"__SSortWrapper": "___SSortWrapper_16i6f_gg_",
|
|
41
|
+
"__SSortButton": "___SSortButton_16i6f_gg_",
|
|
42
|
+
"__SHeadCheckboxCol": "___SHeadCheckboxCol_16i6f_gg_",
|
|
43
|
+
"_use_primary": "_use_primary_16i6f_gg_",
|
|
44
|
+
"_visibleSort": "__visibleSort_16i6f_gg_",
|
|
45
|
+
"_justifyContent_right": "_justifyContent_right_16i6f_gg_",
|
|
46
|
+
"_changeSortSize": "__changeSortSize_16i6f_gg_",
|
|
47
|
+
"_isSorted": "__isSorted_16i6f_gg_",
|
|
48
|
+
"_sideIndents_wide": "_sideIndents_wide_16i6f_gg_",
|
|
49
|
+
"_shadowVertical": "__shadowVertical_16i6f_gg_",
|
|
50
|
+
"_fixed_left": "_fixed_left_16i6f_gg_",
|
|
51
|
+
"_shadowVertical_median": "_shadowVertical_median_16i6f_gg_",
|
|
52
|
+
"_shadowVertical_start": "_shadowVertical_start_16i6f_gg_",
|
|
53
|
+
"_fixed_right": "_fixed_right_16i6f_gg_",
|
|
54
|
+
"_shadowVertical_end": "_shadowVertical_end_16i6f_gg_"
|
|
61
55
|
})
|
|
62
56
|
);
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
var _this$asProps$onChang, _this$asProps;
|
|
73
|
-
var _this$asProps$selecte = _this.asProps.selectedRows, selectedRows = _this$asProps$selecte === void 0 ? [] : _this$asProps$selecte;
|
|
74
|
-
var idsSet = new Set(selectedRows);
|
|
57
|
+
class HeadRoot extends Component {
|
|
58
|
+
constructor(...args) {
|
|
59
|
+
super(...args);
|
|
60
|
+
_defineProperty(this, "handleSelectAll", (value, event) => {
|
|
61
|
+
var _a, _b;
|
|
62
|
+
const {
|
|
63
|
+
selectedRows = []
|
|
64
|
+
} = this.asProps;
|
|
65
|
+
const idsSet = new Set(selectedRows);
|
|
75
66
|
if (value) {
|
|
76
|
-
|
|
67
|
+
this.selectableRows.forEach((row) => {
|
|
77
68
|
idsSet.add(row[UNIQ_ROW_KEY]);
|
|
78
69
|
});
|
|
79
70
|
} else {
|
|
80
|
-
|
|
81
|
-
idsSet
|
|
71
|
+
this.selectableRows.forEach((row) => {
|
|
72
|
+
idsSet.delete(row[UNIQ_ROW_KEY]);
|
|
82
73
|
});
|
|
83
74
|
}
|
|
84
|
-
(
|
|
75
|
+
(_b = (_a = this.asProps).onChangeSelectAll) == null ? void 0 : _b.call(_a, Array.from(idsSet), event);
|
|
85
76
|
});
|
|
86
|
-
_defineProperty(
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
_this.handleSelectAll(value, event);
|
|
91
|
-
};
|
|
77
|
+
_defineProperty(this, "handleClickSelectAll", (value) => (event) => {
|
|
78
|
+
event == null ? void 0 : event.preventDefault();
|
|
79
|
+
event == null ? void 0 : event.stopPropagation();
|
|
80
|
+
this.handleSelectAll(value, event);
|
|
92
81
|
});
|
|
93
|
-
return _this;
|
|
94
82
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
style2[_name] = _value;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
if (top && scrollDirection !== "horizontal") {
|
|
130
|
-
style2.top = "".concat(top, "px");
|
|
83
|
+
sortableColumnDescribeId() {
|
|
84
|
+
const {
|
|
85
|
+
uid
|
|
86
|
+
} = this.asProps;
|
|
87
|
+
return `${uid}-column-sortable-describer`;
|
|
88
|
+
}
|
|
89
|
+
getGroupProps(props, index) {
|
|
90
|
+
const {
|
|
91
|
+
fixed,
|
|
92
|
+
columns
|
|
93
|
+
} = props;
|
|
94
|
+
const {
|
|
95
|
+
use,
|
|
96
|
+
gridAreaGroupMap,
|
|
97
|
+
children,
|
|
98
|
+
getFixedStyle,
|
|
99
|
+
shadowVertical,
|
|
100
|
+
top,
|
|
101
|
+
scrollDirection
|
|
102
|
+
} = this.asProps;
|
|
103
|
+
const groupColumns = columns ?? [];
|
|
104
|
+
const firstColumn = groupColumns[0];
|
|
105
|
+
const lastColumn = groupColumns[groupColumns.length - 1];
|
|
106
|
+
const style2 = {};
|
|
107
|
+
if (fixed === "left" && firstColumn) {
|
|
108
|
+
const [name, value] = getFixedStyle({
|
|
109
|
+
name: firstColumn.name,
|
|
110
|
+
fixed: "left"
|
|
111
|
+
});
|
|
112
|
+
if (name !== void 0 && value !== void 0) {
|
|
113
|
+
style2[name] = value;
|
|
131
114
|
}
|
|
132
|
-
return {
|
|
133
|
-
use,
|
|
134
|
-
gridArea: gridAreaGroupMap.get(index),
|
|
135
|
-
withConfig: children === void 0,
|
|
136
|
-
getFixedStyle,
|
|
137
|
-
shadowVertical: firstColumn.showShadowVertical || lastColumn.showShadowVertical ? shadowVertical : void 0,
|
|
138
|
-
style: style2,
|
|
139
|
-
scrollDirection
|
|
140
|
-
};
|
|
141
115
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
if (index === 0 && selectedRows && columns[index + 1].fixed) {
|
|
148
|
-
column.fixed = "left";
|
|
149
|
-
}
|
|
150
|
-
var _getFixedStyle5 = getFixedStyle(column), _getFixedStyle6 = _slicedToArray(_getFixedStyle5, 2), name = _getFixedStyle6[0], value = _getFixedStyle6[1];
|
|
151
|
-
var style2 = {};
|
|
152
|
-
if (top && scrollDirection !== "horizontal") {
|
|
153
|
-
style2.top = "".concat(top, "px");
|
|
154
|
-
}
|
|
116
|
+
if (fixed === "right" && lastColumn) {
|
|
117
|
+
const [name, value] = getFixedStyle({
|
|
118
|
+
name: lastColumn.name,
|
|
119
|
+
fixed: "right"
|
|
120
|
+
});
|
|
155
121
|
if (name !== void 0 && value !== void 0) {
|
|
156
122
|
style2[name] = value;
|
|
157
123
|
}
|
|
158
|
-
return {
|
|
159
|
-
use,
|
|
160
|
-
"aria-colindex": index + 1,
|
|
161
|
-
style: style2,
|
|
162
|
-
"gridArea": column.gridArea,
|
|
163
|
-
"fixed": column.fixed,
|
|
164
|
-
sticky,
|
|
165
|
-
"borders": column.borders,
|
|
166
|
-
sort,
|
|
167
|
-
onSortChange,
|
|
168
|
-
"parent": column.parent,
|
|
169
|
-
"sortableColumnDescribeId": this.sortableColumnDescribeId(),
|
|
170
|
-
"columnIndex": index,
|
|
171
|
-
tableRef,
|
|
172
|
-
gridTemplateColumns,
|
|
173
|
-
gridTemplateAreas,
|
|
174
|
-
h,
|
|
175
|
-
"onClick": onCellClick,
|
|
176
|
-
"shadowVertical": column.showShadowVertical ? shadowVertical : void 0,
|
|
177
|
-
scrollDirection
|
|
178
|
-
};
|
|
179
124
|
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
get: function get() {
|
|
183
|
-
var _this$asProps$selecte2 = this.asProps.selectedRows, selectedRows = _this$asProps$selecte2 === void 0 ? [] : _this$asProps$selecte2;
|
|
184
|
-
return selectedRows.length > 0 && this.selectableRows.every(function(row) {
|
|
185
|
-
return selectedRows === null || selectedRows === void 0 ? void 0 : selectedRows.includes(row[UNIQ_ROW_KEY]);
|
|
186
|
-
});
|
|
125
|
+
if (top && scrollDirection !== "horizontal") {
|
|
126
|
+
style2.top = `${top}px`;
|
|
187
127
|
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
128
|
+
return {
|
|
129
|
+
use,
|
|
130
|
+
gridArea: gridAreaGroupMap.get(index),
|
|
131
|
+
withConfig: children === void 0,
|
|
132
|
+
getFixedStyle,
|
|
133
|
+
shadowVertical: firstColumn.showShadowVertical || lastColumn.showShadowVertical ? shadowVertical : void 0,
|
|
134
|
+
style: style2,
|
|
135
|
+
scrollDirection
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
getColumnProps(_, index) {
|
|
139
|
+
const {
|
|
140
|
+
use,
|
|
141
|
+
columns,
|
|
142
|
+
sort,
|
|
143
|
+
onSortChange,
|
|
144
|
+
tableRef,
|
|
145
|
+
gridTemplateColumns,
|
|
146
|
+
gridTemplateAreas,
|
|
147
|
+
sticky,
|
|
148
|
+
top,
|
|
149
|
+
selectedRows,
|
|
150
|
+
h,
|
|
151
|
+
getFixedStyle,
|
|
152
|
+
onCellClick,
|
|
153
|
+
shadowVertical,
|
|
154
|
+
scrollDirection
|
|
155
|
+
} = this.asProps;
|
|
156
|
+
const column = columns[index];
|
|
157
|
+
if (index === 0 && selectedRows && columns[index + 1].fixed) {
|
|
158
|
+
column.fixed = "left";
|
|
195
159
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
var mappedFlatRows = flatRows.filter(function(r) {
|
|
201
|
-
var _columns$;
|
|
202
|
-
var nextColumnName = (_columns$ = columns[1]) === null || _columns$ === void 0 ? void 0 : _columns$.name;
|
|
203
|
-
return r[nextColumnName] !== void 0;
|
|
204
|
-
});
|
|
205
|
-
return mappedFlatRows;
|
|
160
|
+
const [name, value] = getFixedStyle(column);
|
|
161
|
+
const style2 = {};
|
|
162
|
+
if (top && scrollDirection !== "horizontal") {
|
|
163
|
+
style2.top = `${top}px`;
|
|
206
164
|
}
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
165
|
+
if (name !== void 0 && value !== void 0) {
|
|
166
|
+
style2[name] = value;
|
|
167
|
+
}
|
|
168
|
+
return {
|
|
169
|
+
use,
|
|
170
|
+
"aria-colindex": index + 1,
|
|
171
|
+
style: style2,
|
|
172
|
+
"gridArea": column.gridArea,
|
|
173
|
+
"fixed": column.fixed,
|
|
174
|
+
sticky,
|
|
175
|
+
"borders": column.borders,
|
|
176
|
+
sort,
|
|
177
|
+
onSortChange,
|
|
178
|
+
"parent": column.parent,
|
|
179
|
+
"sortableColumnDescribeId": this.sortableColumnDescribeId(),
|
|
180
|
+
"columnIndex": index,
|
|
181
|
+
tableRef,
|
|
182
|
+
gridTemplateColumns,
|
|
183
|
+
gridTemplateAreas,
|
|
184
|
+
h,
|
|
185
|
+
"onClick": onCellClick,
|
|
186
|
+
"shadowVertical": column.showShadowVertical ? shadowVertical : void 0,
|
|
187
|
+
scrollDirection
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
get areAllRowsSelected() {
|
|
191
|
+
const {
|
|
192
|
+
selectedRows = []
|
|
193
|
+
} = this.asProps;
|
|
194
|
+
return selectedRows.length > 0 && this.selectableRows.every((row) => selectedRows == null ? void 0 : selectedRows.includes(row[UNIQ_ROW_KEY]));
|
|
195
|
+
}
|
|
196
|
+
get isIndeterminate() {
|
|
197
|
+
const {
|
|
198
|
+
selectedRows
|
|
199
|
+
} = this.asProps;
|
|
200
|
+
return this.selectableRows.some((row) => selectedRows == null ? void 0 : selectedRows.includes(row[UNIQ_ROW_KEY]));
|
|
201
|
+
}
|
|
202
|
+
get selectableRows() {
|
|
203
|
+
const {
|
|
204
|
+
columns,
|
|
205
|
+
flatRows
|
|
206
|
+
} = this.asProps;
|
|
207
|
+
const mappedFlatRows = flatRows.filter((r) => {
|
|
208
|
+
var _a;
|
|
209
|
+
const nextColumnName = (_a = columns[1]) == null ? void 0 : _a.name;
|
|
210
|
+
return r[nextColumnName] !== void 0;
|
|
211
|
+
});
|
|
212
|
+
return mappedFlatRows;
|
|
213
|
+
}
|
|
214
|
+
render() {
|
|
215
|
+
var _ref = this.asProps, _ref2;
|
|
216
|
+
const SHead = Box;
|
|
217
|
+
const SHeadCheckboxCol = Head.Column;
|
|
218
|
+
const {
|
|
219
|
+
Children,
|
|
220
|
+
styles,
|
|
221
|
+
getI18nText,
|
|
222
|
+
children,
|
|
223
|
+
treeColumns,
|
|
224
|
+
selectedRows,
|
|
225
|
+
sticky,
|
|
226
|
+
animationDuration,
|
|
227
|
+
isDataEmpty,
|
|
228
|
+
gridTemplateColumns
|
|
229
|
+
} = this.asProps;
|
|
230
|
+
const areAllRowsSelected = this.areAllRowsSelected;
|
|
231
|
+
const indeterminate = this.isIndeterminate && !areAllRowsSelected;
|
|
232
|
+
return _ref2 = sstyled(styles), /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(SHead, _ref2.cn("SHead", {
|
|
233
|
+
...assignProps({
|
|
217
234
|
"role": "row",
|
|
218
235
|
"aria-rowindex": 1,
|
|
219
236
|
"sticky": sticky,
|
|
220
|
-
"use:animationDuration": animationDuration ?
|
|
237
|
+
"use:animationDuration": animationDuration ? `${animationDuration}ms` : void 0,
|
|
221
238
|
"isDataEmpty": isDataEmpty,
|
|
222
239
|
"use:gridTemplateColumns": gridTemplateColumns.join(" "),
|
|
223
240
|
"tabIndex": isDataEmpty ? 0 : void 0
|
|
224
|
-
}, _ref)
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
}]);
|
|
256
|
-
})(Component);
|
|
241
|
+
}, _ref)
|
|
242
|
+
}), selectedRows && /* @__PURE__ */ React__default.createElement(SHeadCheckboxCol, _ref2.cn("SHeadCheckboxCol", {
|
|
243
|
+
"name": SELECT_ALL.toString(),
|
|
244
|
+
"onClick": this.handleClickSelectAll(!areAllRowsSelected)
|
|
245
|
+
}), /* @__PURE__ */ React__default.createElement(Checkbox, _ref2.cn("Checkbox", {
|
|
246
|
+
"checked": areAllRowsSelected,
|
|
247
|
+
"indeterminate": indeterminate,
|
|
248
|
+
"aria-label": getI18nText("DataTable.Header.selectAllCheckbox:aria-label"),
|
|
249
|
+
"onChange": this.handleSelectAll
|
|
250
|
+
}), /* @__PURE__ */ React__default.createElement(Checkbox.Value, null, /* @__PURE__ */ React__default.createElement(Checkbox.Value.Control, null), /* @__PURE__ */ React__default.createElement(Checkbox.Value.CheckMark, {
|
|
251
|
+
mt: 0
|
|
252
|
+
})))), children ? /* @__PURE__ */ React__default.createElement(Children, _ref2.cn("Children", {})) : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, treeColumns.map((column, _i) => {
|
|
253
|
+
var _a;
|
|
254
|
+
if ("columns" in column) {
|
|
255
|
+
const columnsName = (_a = column.columns) == null ? void 0 : _a.map((c) => c.name).join("/");
|
|
256
|
+
return /* @__PURE__ */ React__default.createElement(DataTable.Head.Group, _extends({
|
|
257
|
+
key: columnsName
|
|
258
|
+
}, column, {
|
|
259
|
+
name: columnsName,
|
|
260
|
+
title: ""
|
|
261
|
+
}));
|
|
262
|
+
}
|
|
263
|
+
return /* @__PURE__ */ React__default.createElement(DataTable.Head.Column, _extends({
|
|
264
|
+
key: column.name
|
|
265
|
+
}, column));
|
|
266
|
+
}))), /* @__PURE__ */ React__default.createElement(ScreenReaderOnly, _ref2.cn("ScreenReaderOnly", {
|
|
267
|
+
"aria-hidden": true,
|
|
268
|
+
"id": this.sortableColumnDescribeId()
|
|
269
|
+
}), getI18nText("sortableColumn")));
|
|
270
|
+
}
|
|
271
|
+
}
|
|
257
272
|
_defineProperty(HeadRoot, "displayName", "Head");
|
|
258
273
|
_defineProperty(HeadRoot, "style", style);
|
|
259
|
-
|
|
274
|
+
const Head = createComponent(HeadRoot, {
|
|
260
275
|
Column,
|
|
261
276
|
Group
|
|
262
277
|
});
|
|
@@ -6,9 +6,7 @@ function handleFocusCell(lockedCell, target, currentTarget) {
|
|
|
6
6
|
block: "center",
|
|
7
7
|
inline: "center"
|
|
8
8
|
});
|
|
9
|
-
|
|
10
|
-
return getFocusableIn(node);
|
|
11
|
-
});
|
|
9
|
+
const focusableChildren = Array.from(currentTarget.children).flatMap((node) => getFocusableIn(node));
|
|
12
10
|
if (focusableChildren.length === 1) {
|
|
13
11
|
focusableChildren[0].focus({
|
|
14
12
|
focusVisible: true
|
|
@@ -25,14 +23,12 @@ function handleFocusCell(lockedCell, target, currentTarget) {
|
|
|
25
23
|
}
|
|
26
24
|
}
|
|
27
25
|
function handleKeydownFocusCell(lockedCell, e) {
|
|
26
|
+
var _a, _b, _c, _d;
|
|
28
27
|
if (e.currentTarget === lockedCell[0]) {
|
|
29
|
-
|
|
30
|
-
return getFocusableIn(node);
|
|
31
|
-
});
|
|
28
|
+
const focusableChildren = Array.from(lockedCell[0].children).flatMap((node) => getFocusableIn(node));
|
|
32
29
|
if (lockedCell[1]) {
|
|
33
30
|
if (e.key === "Escape") {
|
|
34
|
-
|
|
35
|
-
(_lockedCell$ = lockedCell[0]) === null || _lockedCell$ === void 0 || _lockedCell$.focus({
|
|
31
|
+
(_a = lockedCell[0]) == null ? void 0 : _a.focus({
|
|
36
32
|
focusVisible: true
|
|
37
33
|
});
|
|
38
34
|
lockedCell[1] = false;
|
|
@@ -43,14 +39,12 @@ function handleKeydownFocusCell(lockedCell, e) {
|
|
|
43
39
|
}
|
|
44
40
|
if (e.key === "Tab") {
|
|
45
41
|
if (e.target === focusableChildren[0] && e.shiftKey) {
|
|
46
|
-
|
|
47
|
-
(_focusableChildren = focusableChildren[focusableChildren.length - 1]) === null || _focusableChildren === void 0 || _focusableChildren.focus({
|
|
42
|
+
(_b = focusableChildren[focusableChildren.length - 1]) == null ? void 0 : _b.focus({
|
|
48
43
|
focusVisible: true
|
|
49
44
|
});
|
|
50
45
|
e.preventDefault();
|
|
51
46
|
} else if (e.target === focusableChildren[focusableChildren.length - 1] && !e.shiftKey) {
|
|
52
|
-
|
|
53
|
-
(_focusableChildren$ = focusableChildren[0]) === null || _focusableChildren$ === void 0 || _focusableChildren$.focus({
|
|
47
|
+
(_c = focusableChildren[0]) == null ? void 0 : _c.focus({
|
|
54
48
|
focusVisible: true
|
|
55
49
|
});
|
|
56
50
|
e.preventDefault();
|
|
@@ -58,11 +52,10 @@ function handleKeydownFocusCell(lockedCell, e) {
|
|
|
58
52
|
e.stopPropagation();
|
|
59
53
|
}
|
|
60
54
|
} else if (e.key === "Enter") {
|
|
61
|
-
var _focusableChildren$2;
|
|
62
55
|
e.preventDefault();
|
|
63
56
|
e.stopPropagation();
|
|
64
57
|
lockedCell[1] = true;
|
|
65
|
-
(
|
|
58
|
+
(_d = focusableChildren[0]) == null ? void 0 : _d.focus({
|
|
66
59
|
focusVisible: true
|
|
67
60
|
});
|
|
68
61
|
}
|
package/lib/esm/index.mjs
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { MergedColumnsCell, MergedRowsCell } from "./components/Body/MergedCells.mjs";
|
|
2
|
-
import { ACCORDION, DataTable, ROW_GROUP
|
|
3
|
-
|
|
4
|
-
return wrapper;
|
|
5
|
-
};
|
|
2
|
+
import { ACCORDION, DataTable, ROW_GROUP } from "./components/DataTable/DataTable.mjs";
|
|
3
|
+
const wrapDataTable = (wrapper) => wrapper;
|
|
6
4
|
export {
|
|
7
5
|
ACCORDION,
|
|
8
6
|
DataTable,
|
|
9
7
|
MergedColumnsCell,
|
|
10
8
|
MergedRowsCell,
|
|
11
9
|
ROW_GROUP,
|
|
12
|
-
UNIQ_ROW_KEY,
|
|
13
10
|
wrapDataTable
|
|
14
11
|
};
|