@semcore/data-table 4.50.0 → 4.50.1

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.
@@ -1,442 +1,589 @@
1
- import W from "@babel/runtime/helpers/esm/objectSpread2";
2
- import B from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- import E from "@babel/runtime/helpers/esm/createForOfIteratorHelper";
4
- import q from "@babel/runtime/helpers/esm/classCallCheck";
5
- import j from "@babel/runtime/helpers/esm/createClass";
6
- import f from "@babel/runtime/helpers/esm/assertThisInitialized";
7
- import L from "@babel/runtime/helpers/esm/inherits";
8
- import U from "@babel/runtime/helpers/esm/createSuper";
9
- import g from "@babel/runtime/helpers/esm/defineProperty";
10
- import { sstyled as O } from "@semcore/utils/lib/core/index";
11
- import K, { sstyled as J, assignProps as N, Component as Q } from "@semcore/core";
12
- import D from "react";
13
- import { Box as X } from "@semcore/flex-box";
14
- import Y from "@semcore/utils/lib/syncScroll";
15
- import { callAllEventHandlers as Z } from "@semcore/utils/lib/assignProps";
16
- import __ from "@semcore/utils/lib/fire";
17
- import { flattenColumns as G } from "./utils.mjs";
18
- import e_ from "./Head.mjs";
19
- import o_ from "./Body.mjs";
20
- import r_ from "@semcore/utils/lib/uniqueID";
21
- import { localizedMessages as t_ } from "./translations/__intergalactic-dynamic-locales.mjs";
22
- import a_ from "@semcore/utils/lib/enhances/i18nEnhance";
23
- import { hasFocusableIn as i_, isFocusInside as I } from "@semcore/utils/lib/use/useFocusLock";
24
- import s_ from "@semcore/utils/lib/enhances/focusSourceEnhance";
25
- var l_ = ["children", "name", "fixed", "resizable", "sortable", "flex", "vBorders", "active"], n_ = ["name", "children"], g_ = (
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
+ import _createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIteratorHelper";
4
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
5
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
6
+ import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
7
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
8
+ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
9
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
10
+ import { sstyled } from "@semcore/utils/lib/core/index";
11
+ import createComponent, { sstyled as sstyled$1, assignProps, Component } from "@semcore/core";
12
+ import React from "react";
13
+ import { Box } from "@semcore/flex-box";
14
+ import syncScroll from "@semcore/utils/lib/syncScroll";
15
+ import { callAllEventHandlers } from "@semcore/utils/lib/assignProps";
16
+ import fire from "@semcore/utils/lib/fire";
17
+ import { flattenColumns } from "./utils.mjs";
18
+ import Head from "./Head.mjs";
19
+ import Body from "./Body.mjs";
20
+ import uniqueIDEnhancement from "@semcore/utils/lib/uniqueID";
21
+ import { localizedMessages } from "./translations/__intergalactic-dynamic-locales.mjs";
22
+ import i18nEnhance from "@semcore/utils/lib/enhances/i18nEnhance";
23
+ import { hasFocusableIn, isFocusInside } from "@semcore/utils/lib/use/useFocusLock";
24
+ import focusSourceEnhance from "@semcore/utils/lib/enhances/focusSourceEnhance";
25
+ var _excluded = ["children", "name", "fixed", "resizable", "sortable", "flex", "vBorders", "active"], _excluded2 = ["name", "children"];
26
+ /*!__reshadow-styles__:"./style/data-table.shadow.css"*/
27
+ var style = (
26
28
  /*__reshadow_css_start__*/
27
- (O.insert(
29
+ (sstyled.insert(
28
30
  /*__inner_css_start__*/
29
- '.___SDataTable_1o36s_gg_,.___SHeadWrapper_1o36s_gg_{position:relative}.___SDataTable_1o36s_gg_.__compact_1o36s_gg_ .___SCell_1o36s_gg_,.___SDataTable_1o36s_gg_.__compact_1o36s_gg_ .___SColumn_1o36s_gg_{padding:var(--intergalactic-spacing-3x, 12px) var(--intergalactic-spacing-2x, 8px)}.___SHeadWrapper_1o36s_gg_.__animationsDisabled_1o36s_gg_ .___SColumn_1o36s_gg_{transition:none}.___SHeadWrapper_1o36s_gg_.__sticky_1o36s_gg_{position:sticky;top:0;z-index:2}.___SHead_1o36s_gg_{display:flex;position:relative;flex-direction:row;min-width:-moz-fit-content;min-width:fit-content;z-index:0}.___SColumn_1o36s_gg_{display:flex;align-items:flex-start;flex-grow:1;font-size:var(--intergalactic-fs-100, 12px);line-height:var(--intergalactic-lh-100, 133%);color:var(--intergalactic-text-primary, #191b23);box-sizing:border-box;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}.___SColumn_1o36s_gg_:focus-visible{outline:0;box-shadow:inset var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5))}.___SColumn_1o36s_gg_.__hidden_1o36s_gg_{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border-width:0!important}.___SColumn_1o36s_gg_._use_primary_1o36s_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_1o36s_gg_._use_secondary_1o36s_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_1o36s_gg_.__group_1o36s_gg_.__use_1o36s_gg_{display:flex;flex-wrap:wrap;flex-direction:column;align-items:normal;border-bottom:none;padding:0}.___SColumn_1o36s_gg_.__groupHead_1o36s_gg_{justify-content:center;z-index:1;border-bottom:none}.___SColumn_1o36s_gg_.__sortable_1o36s_gg_{cursor:pointer}.___SColumn_1o36s_gg_.__sortable_1o36s_gg_._use_primary_1o36s_gg_:focus{background-color:var(--intergalactic-table-th-primary-cell-hover, #e0e1e9)}@media (hover:hover){.___SColumn_1o36s_gg_.__sortable_1o36s_gg_._use_primary_1o36s_gg_:hover{background-color:var(--intergalactic-table-th-primary-cell-hover, #e0e1e9)}}.___SColumn_1o36s_gg_.__sortable_1o36s_gg_._justifyContent_right_1o36s_gg_:focus .___SSortWrapper_1o36s_gg_{position:absolute;flex-basis:0;right:var(--intergalactic-spacing-3x, 12px)}@media (hover:hover){.___SColumn_1o36s_gg_.__sortable_1o36s_gg_._justifyContent_right_1o36s_gg_:hover .___SSortWrapper_1o36s_gg_{position:absolute;flex-basis:0;right:var(--intergalactic-spacing-3x, 12px)}}.___SColumn_1o36s_gg_.__sortable_1o36s_gg_._justifyContent_right_1o36s_gg_.__active_1o36s_gg_ .___SSortWrapper_1o36s_gg_{position:relative;flex-basis:inherit;right:0}.___SColumn_1o36s_gg_.__sortable_1o36s_gg_.__active_1o36s_gg_ .___SSortWrapper_1o36s_gg_,.___SColumn_1o36s_gg_.__sortable_1o36s_gg_:focus .___SSortWrapper_1o36s_gg_{flex-basis:calc(var(--intergalactic-spacing-1x, 4px) + 16px);opacity:1}@media (hover:hover){.___SColumn_1o36s_gg_.__sortable_1o36s_gg_:hover .___SSortWrapper_1o36s_gg_{flex-basis:calc(var(--intergalactic-spacing-1x, 4px) + 16px);opacity:1}}.___SColumn_1o36s_gg_.__sortable_1o36s_gg_.__active_1o36s_gg_ .___SSortWrapper_1o36s_gg_:before,.___SColumn_1o36s_gg_.__sortable_1o36s_gg_:focus .___SSortIcon_1o36s_gg_,.___SColumn_1o36s_gg_.__sortable_1o36s_gg_:focus .___SSortWrapper_1o36s_gg_:before{display:block;opacity:1}@media (hover:hover){.___SColumn_1o36s_gg_.__sortable_1o36s_gg_:hover .___SSortWrapper_1o36s_gg_:before{display:block;opacity:1}}@media (hover:hover){.___SColumn_1o36s_gg_.__sortable_1o36s_gg_:hover .___SSortIcon_1o36s_gg_{display:block;opacity:1}}.___SColumn_1o36s_gg_._use_primary_1o36s_gg_.__active_1o36s_gg_{background-color:var(--intergalactic-table-th-primary-cell-active, #e0e1e9);width:100%}.___SColumn_1o36s_gg_.__active_1o36s_gg_ .___SSortIcon_1o36s_gg_{display:block;opacity:1}.___SColumn_1o36s_gg_.__resizable_1o36s_gg_{border-right:1px solid transparent}@media (hover:hover){.___SColumn_1o36s_gg_.__resizable_1o36s_gg_:hover:after{border-right-color:var(--intergalactic-border-table-accent, #a9abb6)}}.___SColumn_1o36s_gg_.__resizable_1o36s_gg_:after{content:"";position:absolute;bottom:0;right:-1px;height:100%;width:5px;background:0 0;cursor:col-resize;border-right:1px solid transparent}.___SColumn_1o36s_gg_.__fixed_1o36s_gg_{position:sticky;z-index:2}.___SCell_1o36s_gg_.__borderLeft_1o36s_gg_,.___SColumn_1o36s_gg_.__borderLeft_1o36s_gg_{border-left:1px solid var(--intergalactic-border-secondary, #e0e1e9)}.___SCell_1o36s_gg_.__borderRight_1o36s_gg_,.___SColumn_1o36s_gg_.__borderRight_1o36s_gg_{border-right:1px solid var(--intergalactic-border-secondary, #e0e1e9)}.___SSortWrapper_1o36s_gg_{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}.___SSortIcon_1o36s_gg_,.___SSortWrapper_1o36s_gg_:before{display:none;position:absolute;right:0;opacity:0;transition:opacity .3s ease}.___SSortWrapper_1o36s_gg_:before{content:"";top:0;width:20px;height:100%}.___SSortIcon_1o36s_gg_{fill:var(--intergalactic-icon-secondary-neutral-hover-active, #878992);top:calc(1em*1.25 - 16px);margin-left:var(--intergalactic-spacing-1x, 4px)}.___SColumn_1o36s_gg_._use_primary_1o36s_gg_ .___SSortWrapper_1o36s_gg_:before{background:linear-gradient(270deg,var(--intergalactic-table-th-primary-cell-hover, #e0e1e9) 67.5%,rgba(224,225,233,0) 105%)}.___SColumn_1o36s_gg_._use_secondary_1o36s_gg_ .___SSortWrapper_1o36s_gg_:before{background:linear-gradient(270deg,var(--intergalactic-table-th-secondary-cell, #ffffff) 67.5%,rgba(255,255,255,0) 105%)}.___SBodyWrapper_1o36s_gg_{position:relative}.___SBody_1o36s_gg_{display:flex;flex-direction:column;position:relative;min-width:-moz-fit-content;min-width:fit-content}.___SRow_1o36s_gg_{display:flex;flex-direction:row;position:relative}.___SRow_1o36s_gg_.__active_1o36s_gg_>.___SCell_1o36s_gg_:not(.__theme_1o36s_gg_),.___SRow_1o36s_gg_._theme_muted_1o36s_gg_.__active_1o36s_gg_>.___SCell_1o36s_gg_:not(.__theme_1o36s_gg_){background-color:var(--intergalactic-table-td-cell-active, #e6e7ed)}@media (hover:hover){.___SRow_1o36s_gg_ .___SCell_1o36s_gg_:hover+.___SGroupCell_1o36s_gg_ .___SCell_1o36s_gg_:not(.__theme_1o36s_gg_),.___SRow_1o36s_gg_:hover>.___SCell_1o36s_gg_:not(.__theme_1o36s_gg_){background-color:var(--intergalactic-table-td-cell-hover, #f0f0f4)}}.___SRow_1o36s_gg_._theme_muted_1o36s_gg_ .___SCell_1o36s_gg_:not(.__theme_1o36s_gg_){background-color:var(--intergalactic-table-td-cell-unread, #f4f5f9)}@media (hover:hover){.___SRow_1o36s_gg_._theme_muted_1o36s_gg_ .___SCell_1o36s_gg_:hover+.___SGroupCell_1o36s_gg_ .___SCell_1o36s_gg_:not(.__theme_1o36s_gg_),.___SRow_1o36s_gg_._theme_muted_1o36s_gg_:hover>.___SCell_1o36s_gg_:not(.__theme_1o36s_gg_),.___SRow_1o36s_gg_:hover>.___SCell_1o36s_gg_._theme_muted_1o36s_gg_{background-color:var(--intergalactic-table-td-cell-hover, #f0f0f4)}}.___SRow_1o36s_gg_._theme_info_1o36s_gg_ .___SCell_1o36s_gg_:not(.__theme_1o36s_gg_){background-color:var(--intergalactic-table-td-cell-selected, #e9f7ff)}.___SRow_1o36s_gg_._theme_info_1o36s_gg_.__active_1o36s_gg_>.___SCell_1o36s_gg_:not(.__theme_1o36s_gg_){background-color:var(--intergalactic-table-td-cell-selected-active, #c4e5fe)}@media (hover:hover){.___SRow_1o36s_gg_._theme_info_1o36s_gg_ .___SCell_1o36s_gg_:hover+.___SGroupCell_1o36s_gg_ .___SCell_1o36s_gg_:not(.__theme_1o36s_gg_),.___SRow_1o36s_gg_._theme_info_1o36s_gg_:hover>.___SCell_1o36s_gg_:not(.__theme_1o36s_gg_),.___SRow_1o36s_gg_:hover>.___SCell_1o36s_gg_._theme_info_1o36s_gg_{background-color:var(--intergalactic-table-td-cell-selected-hover, #c4e5fe)}}.___SRow_1o36s_gg_._theme_success_1o36s_gg_ .___SCell_1o36s_gg_:not(.__theme_1o36s_gg_){background-color:var(--intergalactic-table-td-cell-new, #dbfee8)}.___SRow_1o36s_gg_._theme_success_1o36s_gg_.__active_1o36s_gg_>.___SCell_1o36s_gg_:not(.__theme_1o36s_gg_){background-color:var(--intergalactic-table-td-cell-new-active, #9ef2c9)}@media (hover:hover){.___SRow_1o36s_gg_._theme_success_1o36s_gg_ .___SCell_1o36s_gg_:hover+.___SGroupCell_1o36s_gg_ .___SCell_1o36s_gg_:not(.__theme_1o36s_gg_),.___SRow_1o36s_gg_._theme_success_1o36s_gg_:hover>.___SCell_1o36s_gg_:not(.__theme_1o36s_gg_),.___SRow_1o36s_gg_:hover>.___SCell_1o36s_gg_._theme_success_1o36s_gg_{background-color:var(--intergalactic-table-td-cell-new-hover, #9ef2c9)}}.___SRow_1o36s_gg_._theme_warning_1o36s_gg_ .___SCell_1o36s_gg_:not(.__theme_1o36s_gg_){background-color:var(--intergalactic-table-td-cell-warning, #fff3d9)}.___SRow_1o36s_gg_._theme_warning_1o36s_gg_.__active_1o36s_gg_>.___SCell_1o36s_gg_:not(.__theme_1o36s_gg_){background-color:var(--intergalactic-table-td-cell-warning-active, #ffdca2)}@media (hover:hover){.___SRow_1o36s_gg_._theme_warning_1o36s_gg_ .___SCell_1o36s_gg_:hover+.___SGroupCell_1o36s_gg_ .___SCell_1o36s_gg_:not(.__theme_1o36s_gg_),.___SRow_1o36s_gg_._theme_warning_1o36s_gg_:hover>.___SCell_1o36s_gg_:not(.__theme_1o36s_gg_),.___SRow_1o36s_gg_:hover>.___SCell_1o36s_gg_._theme_warning_1o36s_gg_{background-color:var(--intergalactic-table-td-cell-warning-hover, #ffdca2)}}.___SRow_1o36s_gg_._theme_danger_1o36s_gg_ .___SCell_1o36s_gg_:not(.__theme_1o36s_gg_){background-color:var(--intergalactic-table-td-cell-critical, #fff0f7)}.___SRow_1o36s_gg_._theme_danger_1o36s_gg_.__active_1o36s_gg_>.___SCell_1o36s_gg_:not(.__theme_1o36s_gg_){background-color:var(--intergalactic-table-td-cell-critical-active, #ffd7df)}@media (hover:hover){.___SRow_1o36s_gg_._theme_danger_1o36s_gg_ .___SCell_1o36s_gg_:hover+.___SGroupCell_1o36s_gg_ .___SCell_1o36s_gg_:not(.__theme_1o36s_gg_),.___SRow_1o36s_gg_._theme_danger_1o36s_gg_:hover>.___SCell_1o36s_gg_:not(.__theme_1o36s_gg_),.___SRow_1o36s_gg_:hover>.___SCell_1o36s_gg_._theme_danger_1o36s_gg_{background-color:var(--intergalactic-table-td-cell-critical-hover, #ffd7df)}}.___SRow_1o36s_gg_.__positioned_1o36s_gg_{position:absolute}.___SBody_1o36s_gg_.__animationsDisabled_1o36s_gg_ .___SCell_1o36s_gg_{transition:none}.___SCell_1o36s_gg_{display:flex;flex:1;flex-basis:auto;font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%);color:var(--intergalactic-text-primary, #191b23);box-sizing:border-box;border-bottom:1px solid var(--intergalactic-border-secondary, #e0e1e9);overflow:hidden;white-space:nowrap;font-feature-settings:"tnum";font-variant-numeric:tabular-nums;transition:width calc(var(--intergalactic-duration-extra-fast, 100)*1ms) ease-in-out;outline:0}.___SCell_1o36s_gg_._use_primary_1o36s_gg_{padding:var(--intergalactic-spacing-3x, 12px);min-height:45px;background-color:var(--intergalactic-bg-primary-neutral, #ffffff)}.___SCell_1o36s_gg_._use_secondary_1o36s_gg_{padding:var(--intergalactic-spacing-2x, 8px);min-height:37px;background-color:var(--intergalactic-bg-primary-neutral, #ffffff)}.___SCell_1o36s_gg_.__fixed_1o36s_gg_{position:sticky;z-index:1}.___SCell_1o36s_gg_._theme_muted_1o36s_gg_{background-color:var(--intergalactic-table-td-cell-unread, #f4f5f9)}.___SCell_1o36s_gg_._theme_info_1o36s_gg_{background-color:var(--intergalactic-table-td-cell-selected, #e9f7ff)}.___SCell_1o36s_gg_._theme_success_1o36s_gg_{background-color:var(--intergalactic-table-td-cell-new, #dbfee8)}.___SCell_1o36s_gg_._theme_warning_1o36s_gg_{background-color:var(--intergalactic-table-td-cell-warning, #fff3d9)}.___SCell_1o36s_gg_._theme_danger_1o36s_gg_{background-color:var(--intergalactic-table-td-cell-critical, #fff0f7)}.___SCell_1o36s_gg_:focus-visible:not(.__fixed_1o36s_gg_){position:relative}.___SCell_1o36s_gg_:focus-visible::after{position:absolute;display:block;content:"";top:3px;right:3px;bottom:3px;left:3px;box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5));pointer-events:none}.___SHeightHold_1o36s_gg_{position:absolute;top:0;width:100%;pointer-events:none;z-index:-1}',
30
- "1o36s_gg_"
31
- ), {
32
- __SDataTable: "___SDataTable_1o36s_gg_",
33
- __SHeadWrapper: "___SHeadWrapper_1o36s_gg_",
34
- _sticky: "__sticky_1o36s_gg_",
35
- __SHead: "___SHead_1o36s_gg_",
36
- __SColumn: "___SColumn_1o36s_gg_",
37
- _hidden: "__hidden_1o36s_gg_",
38
- _use_primary: "_use_primary_1o36s_gg_",
39
- _use_secondary: "_use_secondary_1o36s_gg_",
40
- _group: "__group_1o36s_gg_",
41
- _use: "__use_1o36s_gg_",
42
- _groupHead: "__groupHead_1o36s_gg_",
43
- _active: "__active_1o36s_gg_",
44
- __SSortIcon: "___SSortIcon_1o36s_gg_",
45
- _fixed: "__fixed_1o36s_gg_",
46
- _borderLeft: "__borderLeft_1o36s_gg_",
47
- __SCell: "___SCell_1o36s_gg_",
48
- _borderRight: "__borderRight_1o36s_gg_",
49
- __SSortWrapper: "___SSortWrapper_1o36s_gg_",
50
- __SBodyWrapper: "___SBodyWrapper_1o36s_gg_",
51
- __SBody: "___SBody_1o36s_gg_",
52
- __SRow: "___SRow_1o36s_gg_",
53
- _theme: "__theme_1o36s_gg_",
54
- __SGroupCell: "___SGroupCell_1o36s_gg_",
55
- _theme_muted: "_theme_muted_1o36s_gg_",
56
- _theme_info: "_theme_info_1o36s_gg_",
57
- _theme_success: "_theme_success_1o36s_gg_",
58
- _theme_warning: "_theme_warning_1o36s_gg_",
59
- _theme_danger: "_theme_danger_1o36s_gg_",
60
- _positioned: "__positioned_1o36s_gg_",
61
- _animationsDisabled: "__animationsDisabled_1o36s_gg_",
62
- __SHeightHold: "___SHeightHold_1o36s_gg_",
63
- _compact: "__compact_1o36s_gg_",
64
- _sortable: "__sortable_1o36s_gg_",
65
- _justifyContent_right: "_justifyContent_right_1o36s_gg_",
66
- _resizable: "__resizable_1o36s_gg_"
31
+ '.___SDataTable_1471i_gg_,.___SHeadWrapper_1471i_gg_{position:relative}.___SDataTable_1471i_gg_.__compact_1471i_gg_ .___SCell_1471i_gg_,.___SDataTable_1471i_gg_.__compact_1471i_gg_ .___SColumn_1471i_gg_{padding:var(--intergalactic-spacing-3x, 12px) var(--intergalactic-spacing-2x, 8px)}.___SHeadWrapper_1471i_gg_.__animationsDisabled_1471i_gg_ .___SColumn_1471i_gg_{transition:none}.___SHeadWrapper_1471i_gg_.__sticky_1471i_gg_{position:sticky;top:0;z-index:2}.___SHead_1471i_gg_{display:flex;position:relative;flex-direction:row;min-width:-moz-fit-content;min-width:fit-content;z-index:0}.___SColumn_1471i_gg_{display:flex;align-items:flex-start;flex-grow:1;font-size:var(--intergalactic-fs-100, 12px);line-height:var(--intergalactic-lh-100, 133%);color:var(--intergalactic-text-primary, #191b23);box-sizing:border-box;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}.___SColumn_1471i_gg_:focus-visible{outline:0;box-shadow:inset var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5))}.___SColumn_1471i_gg_.__hidden_1471i_gg_{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border-width:0!important}.___SColumn_1471i_gg_._use_primary_1471i_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_1471i_gg_._use_secondary_1471i_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_1471i_gg_.__group_1471i_gg_.__use_1471i_gg_{display:flex;flex-wrap:wrap;flex-direction:column;align-items:normal;border-bottom:none;padding:0}.___SColumn_1471i_gg_.__groupHead_1471i_gg_{justify-content:center;z-index:1;border-bottom:none}.___SColumn_1471i_gg_.__sortable_1471i_gg_{cursor:pointer}.___SColumn_1471i_gg_.__sortable_1471i_gg_._use_primary_1471i_gg_:focus{background-color:var(--intergalactic-table-th-primary-cell-hover, #e0e1e9)}@media (hover:hover){.___SColumn_1471i_gg_.__sortable_1471i_gg_._use_primary_1471i_gg_:hover{background-color:var(--intergalactic-table-th-primary-cell-hover, #e0e1e9)}}.___SColumn_1471i_gg_.__sortable_1471i_gg_._justifyContent_right_1471i_gg_:focus .___SSortWrapper_1471i_gg_{position:absolute;flex-basis:0;right:var(--intergalactic-spacing-3x, 12px)}@media (hover:hover){.___SColumn_1471i_gg_.__sortable_1471i_gg_._justifyContent_right_1471i_gg_:hover .___SSortWrapper_1471i_gg_{position:absolute;flex-basis:0;right:var(--intergalactic-spacing-3x, 12px)}}.___SColumn_1471i_gg_.__sortable_1471i_gg_._justifyContent_right_1471i_gg_.__active_1471i_gg_ .___SSortWrapper_1471i_gg_{position:relative;flex-basis:inherit;right:0}.___SColumn_1471i_gg_.__sortable_1471i_gg_.__active_1471i_gg_ .___SSortWrapper_1471i_gg_,.___SColumn_1471i_gg_.__sortable_1471i_gg_:focus .___SSortWrapper_1471i_gg_{flex-basis:calc(var(--intergalactic-spacing-1x, 4px) + 16px);opacity:1}@media (hover:hover){.___SColumn_1471i_gg_.__sortable_1471i_gg_:hover .___SSortWrapper_1471i_gg_{flex-basis:calc(var(--intergalactic-spacing-1x, 4px) + 16px);opacity:1}}.___SColumn_1471i_gg_.__sortable_1471i_gg_.__active_1471i_gg_ .___SSortWrapper_1471i_gg_:before,.___SColumn_1471i_gg_.__sortable_1471i_gg_:focus .___SSortIcon_1471i_gg_,.___SColumn_1471i_gg_.__sortable_1471i_gg_:focus .___SSortWrapper_1471i_gg_:before{display:block;opacity:1}@media (hover:hover){.___SColumn_1471i_gg_.__sortable_1471i_gg_:hover .___SSortWrapper_1471i_gg_:before{display:block;opacity:1}}@media (hover:hover){.___SColumn_1471i_gg_.__sortable_1471i_gg_:hover .___SSortIcon_1471i_gg_{display:block;opacity:1}}.___SColumn_1471i_gg_._use_primary_1471i_gg_.__active_1471i_gg_{background-color:var(--intergalactic-table-th-primary-cell-active, #e0e1e9);width:100%}.___SColumn_1471i_gg_.__active_1471i_gg_ .___SSortIcon_1471i_gg_{display:block;opacity:1}.___SColumn_1471i_gg_.__resizable_1471i_gg_{border-right:1px solid transparent}@media (hover:hover){.___SColumn_1471i_gg_.__resizable_1471i_gg_:hover:after{border-right-color:var(--intergalactic-border-table-accent, #a9abb6)}}.___SColumn_1471i_gg_.__resizable_1471i_gg_:after{content:"";position:absolute;bottom:0;right:-1px;height:100%;width:5px;background:0 0;cursor:col-resize;border-right:1px solid transparent}.___SColumn_1471i_gg_.__fixed_1471i_gg_{position:sticky;z-index:2}.___SCell_1471i_gg_.__borderLeft_1471i_gg_,.___SColumn_1471i_gg_.__borderLeft_1471i_gg_{border-left:1px solid var(--intergalactic-border-secondary, #e0e1e9)}.___SCell_1471i_gg_.__borderRight_1471i_gg_,.___SColumn_1471i_gg_.__borderRight_1471i_gg_{border-right:1px solid var(--intergalactic-border-secondary, #e0e1e9)}.___SSortWrapper_1471i_gg_{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}.___SSortIcon_1471i_gg_,.___SSortWrapper_1471i_gg_:before{display:none;position:absolute;right:0;opacity:0;transition:opacity .3s ease}.___SSortWrapper_1471i_gg_:before{content:"";top:0;width:20px;height:100%}.___SSortIcon_1471i_gg_{fill:var(--intergalactic-icon-secondary-neutral-hover-active, #878992);top:calc(1em*1.25 - 16px);margin-left:var(--intergalactic-spacing-1x, 4px)}.___SColumn_1471i_gg_._use_primary_1471i_gg_ .___SSortWrapper_1471i_gg_:before{background:linear-gradient(270deg,var(--intergalactic-table-th-primary-cell-hover, #e0e1e9) 67.5%,rgba(224,225,233,0) 105%)}.___SColumn_1471i_gg_._use_secondary_1471i_gg_ .___SSortWrapper_1471i_gg_:before{background:linear-gradient(270deg,var(--intergalactic-table-th-secondary-cell, #ffffff) 67.5%,rgba(255,255,255,0) 105%)}.___SBodyWrapper_1471i_gg_{position:relative}.___SBody_1471i_gg_{display:flex;flex-direction:column;position:relative;min-width:-moz-fit-content;min-width:fit-content}.___SRow_1471i_gg_{display:flex;flex-direction:row;position:relative}.___SRow_1471i_gg_.__active_1471i_gg_>.___SCell_1471i_gg_:not(.__theme_1471i_gg_),.___SRow_1471i_gg_._theme_muted_1471i_gg_.__active_1471i_gg_>.___SCell_1471i_gg_:not(.__theme_1471i_gg_){background-color:var(--intergalactic-table-td-cell-active, #e6e7ed)}@media (hover:hover){.___SRow_1471i_gg_ .___SCell_1471i_gg_:hover+.___SGroupCell_1471i_gg_ .___SCell_1471i_gg_:not(.__theme_1471i_gg_),.___SRow_1471i_gg_:hover>.___SCell_1471i_gg_:not(.__theme_1471i_gg_){background-color:var(--intergalactic-table-td-cell-hover, #f0f0f4)}}.___SRow_1471i_gg_._theme_muted_1471i_gg_ .___SCell_1471i_gg_:not(.__theme_1471i_gg_){background-color:var(--intergalactic-table-td-cell-unread, #f4f5f9)}@media (hover:hover){.___SRow_1471i_gg_._theme_muted_1471i_gg_ .___SCell_1471i_gg_:hover+.___SGroupCell_1471i_gg_ .___SCell_1471i_gg_:not(.__theme_1471i_gg_),.___SRow_1471i_gg_._theme_muted_1471i_gg_:hover>.___SCell_1471i_gg_:not(.__theme_1471i_gg_),.___SRow_1471i_gg_:hover>.___SCell_1471i_gg_._theme_muted_1471i_gg_{background-color:var(--intergalactic-table-td-cell-hover, #f0f0f4)}}.___SRow_1471i_gg_._theme_info_1471i_gg_ .___SCell_1471i_gg_:not(.__theme_1471i_gg_){background-color:var(--intergalactic-table-td-cell-selected, #e9f7ff)}.___SRow_1471i_gg_._theme_info_1471i_gg_.__active_1471i_gg_>.___SCell_1471i_gg_:not(.__theme_1471i_gg_){background-color:var(--intergalactic-table-td-cell-selected-active, #c4e5fe)}@media (hover:hover){.___SRow_1471i_gg_._theme_info_1471i_gg_ .___SCell_1471i_gg_:hover+.___SGroupCell_1471i_gg_ .___SCell_1471i_gg_:not(.__theme_1471i_gg_),.___SRow_1471i_gg_._theme_info_1471i_gg_:hover>.___SCell_1471i_gg_:not(.__theme_1471i_gg_),.___SRow_1471i_gg_:hover>.___SCell_1471i_gg_._theme_info_1471i_gg_{background-color:var(--intergalactic-table-td-cell-selected-hover, #c4e5fe)}}.___SRow_1471i_gg_._theme_success_1471i_gg_ .___SCell_1471i_gg_:not(.__theme_1471i_gg_){background-color:var(--intergalactic-table-td-cell-new, #dbfee8)}.___SRow_1471i_gg_._theme_success_1471i_gg_.__active_1471i_gg_>.___SCell_1471i_gg_:not(.__theme_1471i_gg_){background-color:var(--intergalactic-table-td-cell-new-active, #9ef2c9)}@media (hover:hover){.___SRow_1471i_gg_._theme_success_1471i_gg_ .___SCell_1471i_gg_:hover+.___SGroupCell_1471i_gg_ .___SCell_1471i_gg_:not(.__theme_1471i_gg_),.___SRow_1471i_gg_._theme_success_1471i_gg_:hover>.___SCell_1471i_gg_:not(.__theme_1471i_gg_),.___SRow_1471i_gg_:hover>.___SCell_1471i_gg_._theme_success_1471i_gg_{background-color:var(--intergalactic-table-td-cell-new-hover, #9ef2c9)}}.___SRow_1471i_gg_._theme_warning_1471i_gg_ .___SCell_1471i_gg_:not(.__theme_1471i_gg_){background-color:var(--intergalactic-table-td-cell-warning, #fff3d9)}.___SRow_1471i_gg_._theme_warning_1471i_gg_.__active_1471i_gg_>.___SCell_1471i_gg_:not(.__theme_1471i_gg_){background-color:var(--intergalactic-table-td-cell-warning-active, #ffdca2)}@media (hover:hover){.___SRow_1471i_gg_._theme_warning_1471i_gg_ .___SCell_1471i_gg_:hover+.___SGroupCell_1471i_gg_ .___SCell_1471i_gg_:not(.__theme_1471i_gg_),.___SRow_1471i_gg_._theme_warning_1471i_gg_:hover>.___SCell_1471i_gg_:not(.__theme_1471i_gg_),.___SRow_1471i_gg_:hover>.___SCell_1471i_gg_._theme_warning_1471i_gg_{background-color:var(--intergalactic-table-td-cell-warning-hover, #ffdca2)}}.___SRow_1471i_gg_._theme_danger_1471i_gg_ .___SCell_1471i_gg_:not(.__theme_1471i_gg_){background-color:var(--intergalactic-table-td-cell-critical, #fff0f7)}.___SRow_1471i_gg_._theme_danger_1471i_gg_.__active_1471i_gg_>.___SCell_1471i_gg_:not(.__theme_1471i_gg_){background-color:var(--intergalactic-table-td-cell-critical-active, #ffd7df)}@media (hover:hover){.___SRow_1471i_gg_._theme_danger_1471i_gg_ .___SCell_1471i_gg_:hover+.___SGroupCell_1471i_gg_ .___SCell_1471i_gg_:not(.__theme_1471i_gg_),.___SRow_1471i_gg_._theme_danger_1471i_gg_:hover>.___SCell_1471i_gg_:not(.__theme_1471i_gg_),.___SRow_1471i_gg_:hover>.___SCell_1471i_gg_._theme_danger_1471i_gg_{background-color:var(--intergalactic-table-td-cell-critical-hover, #ffd7df)}}.___SRow_1471i_gg_.__positioned_1471i_gg_{position:absolute}.___SBody_1471i_gg_.__animationsDisabled_1471i_gg_ .___SCell_1471i_gg_{transition:none}.___SCell_1471i_gg_{display:flex;flex:1;flex-basis:auto;font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%);color:var(--intergalactic-text-primary, #191b23);box-sizing:border-box;border-bottom:1px solid var(--intergalactic-border-secondary, #e0e1e9);overflow:hidden;white-space:nowrap;font-feature-settings:"tnum";font-variant-numeric:tabular-nums;transition:width calc(var(--intergalactic-duration-extra-fast, 100)*1ms) ease-in-out;outline:0}.___SCell_1471i_gg_._use_primary_1471i_gg_{padding:var(--intergalactic-spacing-3x, 12px);min-height:45px;background-color:var(--intergalactic-bg-primary-neutral, #ffffff)}.___SCell_1471i_gg_._use_secondary_1471i_gg_{padding:var(--intergalactic-spacing-2x, 8px);min-height:37px;background-color:var(--intergalactic-bg-primary-neutral, #ffffff)}.___SCell_1471i_gg_.__fixed_1471i_gg_{position:sticky;z-index:1}.___SCell_1471i_gg_._theme_muted_1471i_gg_{background-color:var(--intergalactic-table-td-cell-unread, #f4f5f9)}.___SCell_1471i_gg_._theme_info_1471i_gg_{background-color:var(--intergalactic-table-td-cell-selected, #e9f7ff)}.___SCell_1471i_gg_._theme_success_1471i_gg_{background-color:var(--intergalactic-table-td-cell-new, #dbfee8)}.___SCell_1471i_gg_._theme_warning_1471i_gg_{background-color:var(--intergalactic-table-td-cell-warning, #fff3d9)}.___SCell_1471i_gg_._theme_danger_1471i_gg_{background-color:var(--intergalactic-table-td-cell-critical, #fff0f7)}.___SCell_1471i_gg_:focus-visible:not(.__fixed_1471i_gg_){position:relative}.___SCell_1471i_gg_:focus-visible::after{position:absolute;display:block;content:"";top:3px;right:3px;bottom:3px;left:3px;box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5));pointer-events:none}.___SHeightHold_1471i_gg_{position:absolute;top:0;width:100%;pointer-events:none;z-index:-1}',
32
+ /*__inner_css_end__*/
33
+ "1471i_gg_"
34
+ ), /*__reshadow_css_end__*/
35
+ {
36
+ "__SDataTable": "___SDataTable_1471i_gg_",
37
+ "__SHeadWrapper": "___SHeadWrapper_1471i_gg_",
38
+ "_sticky": "__sticky_1471i_gg_",
39
+ "__SHead": "___SHead_1471i_gg_",
40
+ "__SColumn": "___SColumn_1471i_gg_",
41
+ "_hidden": "__hidden_1471i_gg_",
42
+ "_use_primary": "_use_primary_1471i_gg_",
43
+ "_use_secondary": "_use_secondary_1471i_gg_",
44
+ "_group": "__group_1471i_gg_",
45
+ "_use": "__use_1471i_gg_",
46
+ "_groupHead": "__groupHead_1471i_gg_",
47
+ "_active": "__active_1471i_gg_",
48
+ "__SSortIcon": "___SSortIcon_1471i_gg_",
49
+ "_fixed": "__fixed_1471i_gg_",
50
+ "_borderLeft": "__borderLeft_1471i_gg_",
51
+ "__SCell": "___SCell_1471i_gg_",
52
+ "_borderRight": "__borderRight_1471i_gg_",
53
+ "__SSortWrapper": "___SSortWrapper_1471i_gg_",
54
+ "__SBodyWrapper": "___SBodyWrapper_1471i_gg_",
55
+ "__SBody": "___SBody_1471i_gg_",
56
+ "__SRow": "___SRow_1471i_gg_",
57
+ "_theme": "__theme_1471i_gg_",
58
+ "__SGroupCell": "___SGroupCell_1471i_gg_",
59
+ "_theme_muted": "_theme_muted_1471i_gg_",
60
+ "_theme_info": "_theme_info_1471i_gg_",
61
+ "_theme_success": "_theme_success_1471i_gg_",
62
+ "_theme_warning": "_theme_warning_1471i_gg_",
63
+ "_theme_danger": "_theme_danger_1471i_gg_",
64
+ "_positioned": "__positioned_1471i_gg_",
65
+ "_animationsDisabled": "__animationsDisabled_1471i_gg_",
66
+ "__SHeightHold": "___SHeightHold_1471i_gg_",
67
+ "_compact": "__compact_1471i_gg_",
68
+ "_sortable": "__sortable_1471i_gg_",
69
+ "_justifyContent_right": "_justifyContent_right_1471i_gg_",
70
+ "_resizable": "__resizable_1471i_gg_"
67
71
  })
68
- ), c_ = {
72
+ );
73
+ var reversedSortDirection = {
69
74
  desc: "asc",
70
75
  asc: "desc"
71
- }, d_ = "desc", u_ = Symbol("ROW_GROUP"), f_ = /[:;\W]/g, V = function(b) {
72
- return "--".concat(b.replace(f_, "_"), "_width");
73
76
  };
74
- function F(T, b) {
75
- var R = T[0], p = T[T.length - 1];
76
- R && (!b || b === "left") && (R.borderLeft = !0, R.columns && F(R.columns, "left")), p && (!b || b === "right") && (p.borderRight = !0, p.columns && F(p.columns, "right"));
77
+ var defaultSortDirection = "desc";
78
+ var ROW_GROUP = Symbol("ROW_GROUP");
79
+ var cssVarReg = /[:;\W]/g;
80
+ var createCssVarForWidth = function createCssVarForWidth2(name) {
81
+ return "--".concat(name.replace(cssVarReg, "_"), "_width");
82
+ };
83
+ function setBorderGroupColumns(columns, side) {
84
+ var firstColumn = columns[0];
85
+ var lastColumn = columns[columns.length - 1];
86
+ if (firstColumn && (!side || side === "left")) {
87
+ firstColumn.borderLeft = true;
88
+ if (firstColumn.columns) {
89
+ setBorderGroupColumns(firstColumn.columns, "left");
90
+ }
91
+ }
92
+ if (lastColumn && (!side || side === "right")) {
93
+ lastColumn.borderRight = true;
94
+ if (lastColumn.columns) {
95
+ setBorderGroupColumns(lastColumn.columns, "right");
96
+ }
97
+ }
77
98
  }
78
- var $ = /* @__PURE__ */ function(T) {
79
- L(R, T);
80
- var b = U(R);
81
- function R(p) {
82
- var _;
83
- q(this, R), _ = b.call(this, p), g(f(_), "focusedCell", [-1, -1]), g(f(_), "columns", []), g(f(_), "tableRef", /* @__PURE__ */ D.createRef()), g(f(_), "scrollBodyRef", null), g(f(_), "scrollHeadRef", null), g(f(_), "handlerSortClick", function(e, r) {
84
- var o = _.columns.find(function(a) {
85
- return a.name === e;
99
+ var RootDefinitionTable = /* @__PURE__ */ function(_Component) {
100
+ _inherits(RootDefinitionTable2, _Component);
101
+ var _super = _createSuper(RootDefinitionTable2);
102
+ function RootDefinitionTable2(props) {
103
+ var _this;
104
+ _classCallCheck(this, RootDefinitionTable2);
105
+ _this = _super.call(this, props);
106
+ _defineProperty(_assertThisInitialized(_this), "focusedCell", [-1, -1]);
107
+ _defineProperty(_assertThisInitialized(_this), "columns", []);
108
+ _defineProperty(_assertThisInitialized(_this), "tableRef", /* @__PURE__ */ React.createRef());
109
+ _defineProperty(_assertThisInitialized(_this), "scrollBodyRef", null);
110
+ _defineProperty(_assertThisInitialized(_this), "scrollHeadRef", null);
111
+ _defineProperty(_assertThisInitialized(_this), "handlerSortClick", function(name, event) {
112
+ var column = _this.columns.find(function(column2) {
113
+ return column2.name === name;
86
114
  });
87
- return __(f(_), "onSortChange", [o.name, o.active ? c_[o.sortDirection] : o.sortDirection], r);
88
- }), g(f(_), "handlerResize", function() {
89
- _.forceUpdate();
90
- }), g(f(_), "scrollToUp", function() {
91
- var e, r;
92
- (e = _.tableRef) === null || e === void 0 || (r = e.current) === null || r === void 0 || r.scrollIntoView({
115
+ return fire(_assertThisInitialized(_this), "onSortChange", [column.name, column.active ? reversedSortDirection[column.sortDirection] : column.sortDirection], event);
116
+ });
117
+ _defineProperty(_assertThisInitialized(_this), "handlerResize", function() {
118
+ _this.forceUpdate();
119
+ });
120
+ _defineProperty(_assertThisInitialized(_this), "scrollToUp", function() {
121
+ var _this$tableRef, _this$tableRef$curren;
122
+ (_this$tableRef = _this.tableRef) === null || _this$tableRef === void 0 ? void 0 : (_this$tableRef$curren = _this$tableRef.current) === null || _this$tableRef$curren === void 0 ? void 0 : _this$tableRef$curren.scrollIntoView({
93
123
  block: "nearest",
94
124
  inline: "nearest",
95
125
  behavior: "smooth"
96
126
  });
97
- }), g(f(_), "hasFocusableInHeader", function() {
98
- var e = _.columns.some(function(r) {
99
- var o = r.props.ref.current;
100
- return r.sortable || o && i_(o);
127
+ });
128
+ _defineProperty(_assertThisInitialized(_this), "hasFocusableInHeader", function() {
129
+ var hasFocusable = _this.columns.some(function(column) {
130
+ var columnElement = column.props.ref.current;
131
+ return column.sortable || columnElement && hasFocusableIn(columnElement);
101
132
  });
102
- return e;
103
- }), g(f(_), "changeFocusCell", function(e, r) {
104
- var o, a, s = _.hasFocusableInHeader(), l = _.columns.length - 1, u = _.totalRows, n = (o = _.tableRef.current) === null || o === void 0 ? void 0 : o.querySelector('[aria-rowindex="'.concat(_.focusedCell[0] + 1, '"]')), w = (a = _.tableRef.current) === null || a === void 0 ? void 0 : a.querySelector('[aria-rowindex="1"]'), c = w == null ? void 0 : w.querySelectorAll("[role=columnheader]"), d = n == null ? void 0 : n.querySelectorAll("[role=gridcell]").item(_.focusedCell[1]), m = c == null ? void 0 : c.item(_.focusedCell[1]), k = !0, S = _.focusedCell[0] + e, v = _.focusedCell[1] + r;
105
- if ((s && S < 0 || !s && S < 1 || S > u) && S !== _.focusedCell[0] && (k = !1), (v < 0 || v > l) && v !== _.focusedCell[1] && (k = !1), !!k) {
106
- _.focusedCell = [S, v];
107
- var P = _.getRow(S), h = P == null ? void 0 : P.querySelectorAll("[role=gridcell], [role=columnheader]").item(v);
108
- if (h instanceof HTMLElement && d !== h) {
109
- d == null || d.setAttribute("inert", ""), d !== m && (d == null || d.removeAttribute("aria-describedby"));
110
- var t = c == null ? void 0 : c.item(v), C = t == null ? void 0 : t.getAttribute("aria-describedby");
111
- if (h.removeAttribute("inert"), t !== h && C && h.setAttribute("aria-describedby", C), h == null || h.focus(), S !== 0) {
112
- m == null || m.setAttribute("inert", "");
113
- var y = c == null ? void 0 : c.item(v);
114
- y == null || y.removeAttribute("inert");
115
- }
116
- } else d === h && _.changeFocusCell(e, r);
133
+ return hasFocusable;
134
+ });
135
+ _defineProperty(_assertThisInitialized(_this), "changeFocusCell", function(rowIndex, colIndex) {
136
+ var _this$tableRef$curren2, _this$tableRef$curren3;
137
+ var hasFocusable = _this.hasFocusableInHeader();
138
+ var maxCol = _this.columns.length - 1;
139
+ var maxRow = _this.totalRows;
140
+ var currentRow = (_this$tableRef$curren2 = _this.tableRef.current) === null || _this$tableRef$curren2 === void 0 ? void 0 : _this$tableRef$curren2.querySelector('[aria-rowindex="'.concat(_this.focusedCell[0] + 1, '"]'));
141
+ var headerRow = (_this$tableRef$curren3 = _this.tableRef.current) === null || _this$tableRef$curren3 === void 0 ? void 0 : _this$tableRef$curren3.querySelector('[aria-rowindex="1"]');
142
+ var headerCells = headerRow === null || headerRow === void 0 ? void 0 : headerRow.querySelectorAll("[role=columnheader]");
143
+ var currentCell = currentRow === null || currentRow === void 0 ? void 0 : currentRow.querySelectorAll("[role=gridcell]").item(_this.focusedCell[1]);
144
+ var currentHeaderCell = headerCells === null || headerCells === void 0 ? void 0 : headerCells.item(_this.focusedCell[1]);
145
+ var changed = true;
146
+ var newRow = _this.focusedCell[0] + rowIndex;
147
+ var newCol = _this.focusedCell[1] + colIndex;
148
+ if ((hasFocusable && newRow < 0 || !hasFocusable && newRow < 1 || newRow > maxRow) && newRow !== _this.focusedCell[0]) {
149
+ changed = false;
150
+ }
151
+ if ((newCol < 0 || newCol > maxCol) && newCol !== _this.focusedCell[1]) {
152
+ changed = false;
153
+ }
154
+ if (!changed) return;
155
+ _this.focusedCell = [newRow, newCol];
156
+ var row = _this.getRow(newRow);
157
+ var cell = row === null || row === void 0 ? void 0 : row.querySelectorAll("[role=gridcell], [role=columnheader]").item(newCol);
158
+ if (cell instanceof HTMLElement && currentCell !== cell) {
159
+ currentCell === null || currentCell === void 0 ? void 0 : currentCell.setAttribute("inert", "");
160
+ if (currentCell !== currentHeaderCell) {
161
+ currentCell === null || currentCell === void 0 ? void 0 : currentCell.removeAttribute("aria-describedby");
162
+ }
163
+ var headerCell = headerCells === null || headerCells === void 0 ? void 0 : headerCells.item(newCol);
164
+ var describedBy = headerCell === null || headerCell === void 0 ? void 0 : headerCell.getAttribute("aria-describedby");
165
+ cell.removeAttribute("inert");
166
+ if (headerCell !== cell && describedBy) {
167
+ cell.setAttribute("aria-describedby", describedBy);
168
+ }
169
+ cell === null || cell === void 0 ? void 0 : cell.focus();
170
+ if (newRow !== 0) {
171
+ currentHeaderCell === null || currentHeaderCell === void 0 ? void 0 : currentHeaderCell.setAttribute("inert", "");
172
+ var _headerCell = headerCells === null || headerCells === void 0 ? void 0 : headerCells.item(newCol);
173
+ _headerCell === null || _headerCell === void 0 ? void 0 : _headerCell.removeAttribute("inert");
174
+ }
175
+ } else if (currentCell === cell) {
176
+ _this.changeFocusCell(rowIndex, colIndex);
117
177
  }
118
- }), g(f(_), "handleKeyDown", function(e) {
178
+ });
179
+ _defineProperty(_assertThisInitialized(_this), "handleKeyDown", function(e) {
119
180
  switch (e.key) {
120
181
  case "Tab": {
121
- _.setInert(!0);
182
+ _this.setInert(true);
122
183
  break;
123
184
  }
124
185
  case "ArrowLeft": {
125
- e.preventDefault(), _.changeFocusCell(0, -1);
186
+ e.preventDefault();
187
+ _this.changeFocusCell(0, -1);
126
188
  break;
127
189
  }
128
190
  case "ArrowRight": {
129
- e.preventDefault(), _.changeFocusCell(0, 1);
191
+ e.preventDefault();
192
+ _this.changeFocusCell(0, 1);
130
193
  break;
131
194
  }
132
195
  case "ArrowUp": {
133
- e.preventDefault(), _.changeFocusCell(-1, 0);
196
+ e.preventDefault();
197
+ _this.changeFocusCell(-1, 0);
134
198
  break;
135
199
  }
136
200
  case "ArrowDown": {
137
- e.preventDefault(), _.changeFocusCell(1, 0);
201
+ e.preventDefault();
202
+ _this.changeFocusCell(1, 0);
138
203
  break;
139
204
  }
140
205
  }
141
- }), g(f(_), "initFocusableCell", function() {
142
- var e = _.hasFocusableInHeader();
143
- e ? _.focusedCell = [0, 0] : _.focusedCell = [1, 0];
144
- }), g(f(_), "getRow", function(e) {
145
- var r, o;
146
- return e === 0 ? (r = _.tableRef.current) === null || r === void 0 ? void 0 : r.querySelector("[role=row]") : (o = _.tableRef.current) === null || o === void 0 ? void 0 : o.querySelector('[aria-rowindex="'.concat(e + 1, '"]'));
147
- }), g(f(_), "handleFocus", function(e) {
148
- var r;
149
- if ((!e.relatedTarget || !I(e.currentTarget, e.relatedTarget)) && ((r = _.asProps.focusSourceRef) === null || r === void 0 ? void 0 : r.current) === "keyboard") {
150
- var o;
151
- _.focusedCell[0] === -1 && _.focusedCell[1] === -1 && _.initFocusableCell(), _.setInert(!0);
152
- var a = _.getRow(_.focusedCell[0]);
153
- a || (_.initFocusableCell(), a = _.getRow(_.focusedCell[0]));
154
- var s = (o = a) === null || o === void 0 ? void 0 : o.querySelectorAll("[role=gridcell], [role=columnheader]").item(_.focusedCell[1]);
155
- s == null || s.removeAttribute("inert"), s instanceof HTMLElement && s.focus(), e.currentTarget.setAttribute("tabIndex", "-1");
206
+ });
207
+ _defineProperty(_assertThisInitialized(_this), "initFocusableCell", function() {
208
+ var hasFocusable = _this.hasFocusableInHeader();
209
+ if (hasFocusable) {
210
+ _this.focusedCell = [0, 0];
211
+ } else {
212
+ _this.focusedCell = [1, 0];
213
+ }
214
+ });
215
+ _defineProperty(_assertThisInitialized(_this), "getRow", function(index) {
216
+ var _this$tableRef$curren4, _this$tableRef$curren5;
217
+ return index === 0 ? (_this$tableRef$curren4 = _this.tableRef.current) === null || _this$tableRef$curren4 === void 0 ? void 0 : _this$tableRef$curren4.querySelector("[role=row]") : (_this$tableRef$curren5 = _this.tableRef.current) === null || _this$tableRef$curren5 === void 0 ? void 0 : _this$tableRef$curren5.querySelector('[aria-rowindex="'.concat(index + 1, '"]'));
218
+ });
219
+ _defineProperty(_assertThisInitialized(_this), "handleFocus", function(e) {
220
+ var _this$asProps$focusSo;
221
+ if ((!e.relatedTarget || !isFocusInside(e.currentTarget, e.relatedTarget)) && ((_this$asProps$focusSo = _this.asProps.focusSourceRef) === null || _this$asProps$focusSo === void 0 ? void 0 : _this$asProps$focusSo.current) === "keyboard") {
222
+ var _row2;
223
+ if (_this.focusedCell[0] === -1 && _this.focusedCell[1] === -1) {
224
+ _this.initFocusableCell();
225
+ }
226
+ _this.setInert(true);
227
+ var _row = _this.getRow(_this.focusedCell[0]);
228
+ if (!_row) {
229
+ _this.initFocusableCell();
230
+ _row = _this.getRow(_this.focusedCell[0]);
231
+ }
232
+ var cell = (_row2 = _row) === null || _row2 === void 0 ? void 0 : _row2.querySelectorAll("[role=gridcell], [role=columnheader]").item(_this.focusedCell[1]);
233
+ cell === null || cell === void 0 ? void 0 : cell.removeAttribute("inert");
234
+ cell instanceof HTMLElement && cell.focus();
235
+ e.currentTarget.setAttribute("tabIndex", "-1");
236
+ }
237
+ });
238
+ _defineProperty(_assertThisInitialized(_this), "handleBlur", function(e) {
239
+ var _this$asProps$focusSo2;
240
+ var relatedTarget = e.relatedTarget;
241
+ var tableElement = _this.tableRef.current;
242
+ if (tableElement && (!relatedTarget || !isFocusInside(tableElement, relatedTarget) || ((_this$asProps$focusSo2 = _this.asProps.focusSourceRef) === null || _this$asProps$focusSo2 === void 0 ? void 0 : _this$asProps$focusSo2.current) !== "keyboard")) {
243
+ _this.setInert(false);
244
+ tableElement.setAttribute("tabIndex", "0");
156
245
  }
157
- }), g(f(_), "handleBlur", function(e) {
158
- var r, o = e.relatedTarget, a = _.tableRef.current;
159
- a && (!o || !I(a, o) || ((r = _.asProps.focusSourceRef) === null || r === void 0 ? void 0 : r.current) !== "keyboard") && (_.setInert(!1), a.setAttribute("tabIndex", "0"));
160
- }), g(f(_), "handleMouseMove", function() {
161
- _.setInert(!1);
162
246
  });
163
- var i = Y();
164
- return _.scrollBodyRef = i("body"), _.scrollHeadRef = i("head"), _;
247
+ _defineProperty(_assertThisInitialized(_this), "handleMouseMove", function() {
248
+ _this.setInert(false);
249
+ });
250
+ var createRef = syncScroll();
251
+ _this.scrollBodyRef = createRef("body");
252
+ _this.scrollHeadRef = createRef("head");
253
+ return _this;
165
254
  }
166
- return j(R, [{
255
+ _createClass(RootDefinitionTable2, [{
167
256
  key: "setVarStyle",
168
- value: function(_) {
169
- var i = this, e = _.flatMap(function(o) {
170
- var a, s;
171
- return (a = o.props.ref.current) === null || a === void 0 || (s = a.getAnimations) === null || s === void 0 ? void 0 : s.call(a);
172
- }).filter(function(o) {
173
- return o !== void 0;
174
- }), r = Promise.resolve();
175
- e.length > 0 && (r = Promise.all(e.map(function(o) {
176
- return o.finished;
177
- }))), r.then(function() {
178
- var o = E(_), a;
257
+ value: function setVarStyle(columns) {
258
+ var _this2 = this;
259
+ var animations = columns.flatMap(function(column) {
260
+ var _column$props$ref$cur, _column$props$ref$cur2;
261
+ return (_column$props$ref$cur = column.props.ref.current) === null || _column$props$ref$cur === void 0 ? void 0 : (_column$props$ref$cur2 = _column$props$ref$cur.getAnimations) === null || _column$props$ref$cur2 === void 0 ? void 0 : _column$props$ref$cur2.call(_column$props$ref$cur);
262
+ }).filter(function(a) {
263
+ return a !== void 0;
264
+ });
265
+ var animationPromise = Promise.resolve();
266
+ if (animations.length > 0) {
267
+ animationPromise = Promise.all(animations.map(function(animation) {
268
+ return animation.finished;
269
+ }));
270
+ }
271
+ animationPromise.then(function() {
272
+ var _iterator = _createForOfIteratorHelper(columns), _step;
179
273
  try {
180
- for (o.s(); !(a = o.n()).done; ) {
181
- var s = a.value;
182
- if (s.setVar) {
183
- var l;
184
- (l = i.tableRef.current) === null || l === void 0 || l.style.setProperty(s.varWidth, "".concat(s.width, "px"));
274
+ for (_iterator.s(); !(_step = _iterator.n()).done; ) {
275
+ var column = _step.value;
276
+ if (column.setVar) {
277
+ var _this2$tableRef$curre;
278
+ (_this2$tableRef$curre = _this2.tableRef.current) === null || _this2$tableRef$curre === void 0 ? void 0 : _this2$tableRef$curre.style.setProperty(column.varWidth, "".concat(column.width, "px"));
185
279
  }
186
280
  }
187
- } catch (u) {
188
- o.e(u);
281
+ } catch (err) {
282
+ _iterator.e(err);
189
283
  } finally {
190
- o.f();
284
+ _iterator.f();
191
285
  }
192
- }).catch(function(o) {
193
- console.error(o);
286
+ })["catch"](function(err) {
287
+ console.error(err);
194
288
  });
195
289
  }
196
290
  }, {
197
291
  key: "childrenToColumns",
198
- value: function(_) {
199
- var i = this, e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
292
+ value: function childrenToColumns(children) {
293
+ var _this3 = this;
294
+ var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
200
295
  fixed: void 0
201
- }, r = this.asProps.sort, o = [];
202
- return D.Children.forEach(_, function(a) {
203
- var s;
204
- if (/* @__PURE__ */ D.isValidElement(a) && a.type === z.Column) {
205
- var l = a.props, u = l.children, n = l.name, w = l.fixed, c = w === void 0 ? e.fixed : w, d = l.resizable, m = l.sortable, k = l.flex, S = l.vBorders, v = l.active, P = B(l, l_), h = o[o.length - 1], t = !n, C;
206
- if (t) {
207
- if (C = i.childrenToColumns(u, {
208
- fixed: c
209
- }), v = typeof v == "boolean" ? v : C.some(function(x) {
210
- return x.active;
211
- }), S && F(C), n = G(C).map(function(x) {
212
- var M = x.name;
213
- return M;
214
- }).join("/"), !C.length) return;
215
- u = D.Children.toArray(u).filter(function(x) {
216
- return !(/* @__PURE__ */ D.isValidElement(x) && x.type === z.Column);
217
- });
296
+ };
297
+ var sort = this.asProps.sort;
298
+ var columnsChildren = [];
299
+ React.Children.forEach(children, function(child) {
300
+ var _column$props;
301
+ if (!/* @__PURE__ */ React.isValidElement(child)) return;
302
+ if (child.type !== DefinitionTable.Column) return;
303
+ var _ref3 = child.props, children2 = _ref3.children, name = _ref3.name, _ref3$fixed = _ref3.fixed, fixed = _ref3$fixed === void 0 ? options.fixed : _ref3$fixed, resizable = _ref3.resizable, sortable = _ref3.sortable, flex = _ref3.flex, vBorders = _ref3.vBorders, active = _ref3.active, props = _objectWithoutProperties(_ref3, _excluded);
304
+ var lastColumnChildren = columnsChildren[columnsChildren.length - 1];
305
+ var isGroup = !name;
306
+ var columns;
307
+ if (isGroup) {
308
+ columns = _this3.childrenToColumns(children2, {
309
+ fixed
310
+ });
311
+ active = typeof active === "boolean" ? active : columns.some(function(c) {
312
+ return c.active;
313
+ });
314
+ if (vBorders) {
315
+ setBorderGroupColumns(columns);
218
316
  }
219
- var y = i.columns.find(function(x) {
220
- return x.name === n;
221
- }), H = {
222
- get width() {
223
- var x;
224
- return ((x = this.props.ref.current) === null || x === void 0 ? void 0 : x.getBoundingClientRect().width) || 0;
225
- },
226
- name: n,
227
- varWidth: V(n),
228
- setVar: k !== "inherit",
229
- fixed: c,
230
- resizable: d,
231
- active: typeof v == "boolean" ? v : r[0] === n,
232
- sortable: m,
233
- borderLeft: (h == null ? void 0 : h.borderRight) === !0 ? !1 : S,
234
- borderRight: S,
235
- sortDirection: r[0] === n ? r[1] : (y == null ? void 0 : y.sortDirection) || (typeof m == "string" ? m : d_),
236
- props: W(W({
237
- name: n,
238
- flex: k === "inherit" ? void 0 : k
239
- }, P), {}, {
240
- // @ts-ignore
241
- forwardRef: a.ref,
242
- children: u,
243
- ref: (y == null || (s = y.props) === null || s === void 0 ? void 0 : s.ref) || /* @__PURE__ */ D.createRef()
244
- }),
245
- parentColumns: []
246
- };
247
- C && (H.columns = C, C.forEach(function(x) {
248
- return x.parentColumns.unshift(H);
249
- })), o.push(H);
317
+ name = flattenColumns(columns).map(function(_ref4) {
318
+ var name2 = _ref4.name;
319
+ return name2;
320
+ }).join("/");
321
+ if (!columns.length) return;
322
+ children2 = React.Children.toArray(children2).filter(function(child2) {
323
+ return !(/* @__PURE__ */ React.isValidElement(child2) && child2.type === DefinitionTable.Column);
324
+ });
325
+ }
326
+ var column = _this3.columns.find(function(column2) {
327
+ return column2.name === name;
328
+ });
329
+ var columnChildren = {
330
+ get width() {
331
+ var _this$props$ref$curre;
332
+ return ((_this$props$ref$curre = this.props.ref.current) === null || _this$props$ref$curre === void 0 ? void 0 : _this$props$ref$curre.getBoundingClientRect().width) || 0;
333
+ },
334
+ name,
335
+ varWidth: createCssVarForWidth(name),
336
+ setVar: flex !== "inherit",
337
+ fixed,
338
+ resizable,
339
+ active: typeof active === "boolean" ? active : sort[0] === name,
340
+ sortable,
341
+ borderLeft: (lastColumnChildren === null || lastColumnChildren === void 0 ? void 0 : lastColumnChildren.borderRight) === true ? false : vBorders,
342
+ borderRight: vBorders,
343
+ sortDirection: sort[0] === name ? sort[1] : (column === null || column === void 0 ? void 0 : column.sortDirection) || (typeof sortable === "string" ? sortable : defaultSortDirection),
344
+ props: _objectSpread(_objectSpread({
345
+ name,
346
+ flex: flex === "inherit" ? void 0 : flex
347
+ }, props), {}, {
348
+ // @ts-ignore
349
+ forwardRef: child.ref,
350
+ children: children2,
351
+ ref: (column === null || column === void 0 ? void 0 : (_column$props = column.props) === null || _column$props === void 0 ? void 0 : _column$props.ref) || /* @__PURE__ */ React.createRef()
352
+ }),
353
+ parentColumns: []
354
+ };
355
+ if (columns) {
356
+ columnChildren.columns = columns;
357
+ columns.forEach(function(column2) {
358
+ return column2.parentColumns.unshift(columnChildren);
359
+ });
250
360
  }
251
- }), o;
361
+ columnsChildren.push(columnChildren);
362
+ });
363
+ return columnsChildren;
252
364
  }
253
365
  }, {
254
366
  key: "getHeadProps",
255
- value: function(_) {
256
- var i = this.asProps, e = i.use, r = i.uid, o = i.getI18nText, a = this.childrenToColumns(_.children);
257
- return this.columns = G(a), {
258
- $onSortClick: Z(this.handlerSortClick, this.scrollToUp),
259
- columnsChildren: a,
260
- use: e,
367
+ value: function getHeadProps(props) {
368
+ var _this$asProps = this.asProps, use = _this$asProps.use, uid = _this$asProps.uid, getI18nText = _this$asProps.getI18nText;
369
+ var columnsChildren = this.childrenToColumns(props.children);
370
+ this.columns = flattenColumns(columnsChildren);
371
+ return {
372
+ $onSortClick: callAllEventHandlers(this.handlerSortClick, this.scrollToUp),
373
+ columnsChildren,
374
+ use,
261
375
  onResize: this.handlerResize,
262
376
  $scrollRef: this.scrollHeadRef,
263
- uid: r,
264
- getI18nText: o
377
+ uid,
378
+ getI18nText
265
379
  };
266
380
  }
267
381
  }, {
268
382
  key: "getBodyProps",
269
- value: function(_) {
270
- var i = this.asProps, e = i.data, r = i.use, o = i.uniqueKey, a = i.uid, s = {}, l = [];
271
- return D.Children.forEach(_.children, function(u) {
272
- if (/* @__PURE__ */ D.isValidElement(u)) {
273
- var n = u.props, w = n.name, c = n.children, d = B(n, n_);
274
- u.type === z.Cell && w && w.split("/").forEach(function(m) {
275
- s[m] = s[m] || [], s[m].push(W(W({}, d), {}, {
276
- childrenPropsGetter: c
383
+ value: function getBodyProps(props) {
384
+ var _this$asProps2 = this.asProps, data = _this$asProps2.data, use = _this$asProps2.use, uniqueKey = _this$asProps2.uniqueKey, uid = _this$asProps2.uid;
385
+ var cellPropsLayers = {};
386
+ var rowPropsLayers = [];
387
+ React.Children.forEach(props.children, function(child) {
388
+ if (/* @__PURE__ */ React.isValidElement(child)) {
389
+ var _ref5 = child.props, name = _ref5.name, children = _ref5.children, other = _objectWithoutProperties(_ref5, _excluded2);
390
+ if (child.type === DefinitionTable.Cell && name) {
391
+ name.split("/").forEach(function(name2) {
392
+ cellPropsLayers[name2] = cellPropsLayers[name2] || [];
393
+ cellPropsLayers[name2].push(_objectSpread(_objectSpread({}, other), {}, {
394
+ childrenPropsGetter: children
395
+ }));
396
+ });
397
+ }
398
+ if (child.type === DefinitionTable.Row) {
399
+ rowPropsLayers.push(_objectSpread(_objectSpread({}, other), {}, {
400
+ childrenPropsGetter: children
277
401
  }));
278
- }), u.type === z.Row && l.push(W(W({}, d), {}, {
279
- childrenPropsGetter: c
280
- }));
402
+ }
281
403
  }
282
- }), {
404
+ });
405
+ return {
283
406
  columns: this.columns,
284
- rows: this.dataToRows(e, s),
285
- uniqueKey: o,
286
- use: r,
287
- rowPropsLayers: l,
407
+ rows: this.dataToRows(data, cellPropsLayers),
408
+ uniqueKey,
409
+ use,
410
+ rowPropsLayers,
288
411
  $scrollRef: this.scrollBodyRef,
289
- uid: a
412
+ uid
290
413
  };
291
414
  }
292
415
  }, {
293
416
  key: "dataToRows",
294
- value: function(_, i) {
295
- var e = this, r = function o(a, s) {
296
- return a.map(function(l) {
297
- var u = {}, n = {};
298
- for (var w in l) {
299
- var c = w.split("/");
300
- if (c.length >= 2) {
301
- var d = E(c), m;
417
+ value: function dataToRows(data, cellPropsLayers) {
418
+ var _this4 = this;
419
+ var parseData = function parseData2(data2, exclude) {
420
+ return data2.map(function(row) {
421
+ var groupByName = {};
422
+ var columnsWithoutRowGroup = {};
423
+ for (var rowKey in row) {
424
+ var columnNames = rowKey.split("/");
425
+ if (columnNames.length >= 2) {
426
+ var _iterator2 = _createForOfIteratorHelper(columnNames), _step2;
302
427
  try {
303
- for (d.s(); !(m = d.n()).done; ) {
304
- var k = m.value;
305
- u[k] = {
306
- groupedColumns: c,
307
- groupData: l[w]
308
- }, n[k] = !0;
428
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
429
+ var column = _step2.value;
430
+ groupByName[column] = {
431
+ groupedColumns: columnNames,
432
+ groupData: row[rowKey]
433
+ };
434
+ columnsWithoutRowGroup[column] = true;
309
435
  }
310
- } catch (t) {
311
- d.e(t);
436
+ } catch (err) {
437
+ _iterator2.e(err);
312
438
  } finally {
313
- d.f();
439
+ _iterator2.f();
314
440
  }
315
- } else
316
- n[w] = !0;
317
- }
318
- var S = l[u_] || [], v = Object.fromEntries(S.flatMap(function(t) {
319
- return Object.keys(t);
320
- }).flatMap(function(t) {
321
- return t.split("/");
322
- }).map(function(t) {
323
- return [t, !0];
324
- })), P = !1, h = e.columns.map(function(t) {
325
- if (u[t.name]) {
326
- var C = u[t.name], y = C.groupedColumns, H = C.groupData;
327
- if (y[0] === t.name)
328
- return {
329
- name: y.join("/"),
330
- cssVar: y.map(V),
331
- fixed: t.fixed,
332
- data: H,
333
- cellPropsLayers: i[t.name] || []
334
- };
335
441
  } else {
336
- if (t.name in l)
337
- return {
338
- name: t.name,
339
- cssVar: t.varWidth,
340
- fixed: t.fixed,
341
- data: l[t.name],
342
- cellPropsLayers: i[t.name] || []
343
- };
344
- if (!P && v[t.name])
345
- return P = !0, o(S, W(W({}, s), n));
346
- if (!s[t.name] && !v[t.name])
442
+ columnsWithoutRowGroup[rowKey] = true;
443
+ }
444
+ }
445
+ var rowsGroup = row[ROW_GROUP] || [];
446
+ var rowsGroupedNames = Object.fromEntries(rowsGroup.flatMap(function(subRow) {
447
+ return Object.keys(subRow);
448
+ }).flatMap(function(key) {
449
+ return key.split("/");
450
+ }).map(function(key) {
451
+ return [key, true];
452
+ }));
453
+ var isGroup = false;
454
+ var cells = _this4.columns.map(function(column2) {
455
+ if (groupByName[column2.name]) {
456
+ var _groupByName$column$n = groupByName[column2.name], groupedColumns = _groupByName$column$n.groupedColumns, groupData = _groupByName$column$n.groupData;
457
+ if (groupedColumns[0] === column2.name) {
347
458
  return {
348
- name: t.name,
349
- cssVar: t.varWidth,
350
- fixed: t.fixed,
351
- data: null,
352
- cellPropsLayers: i[t.name] || []
459
+ name: groupedColumns.join("/"),
460
+ cssVar: groupedColumns.map(createCssVarForWidth),
461
+ fixed: column2.fixed,
462
+ data: groupData,
463
+ cellPropsLayers: cellPropsLayers[column2.name] || []
353
464
  };
465
+ }
466
+ } else if (column2.name in row) {
467
+ return {
468
+ name: column2.name,
469
+ cssVar: column2.varWidth,
470
+ fixed: column2.fixed,
471
+ data: row[column2.name],
472
+ cellPropsLayers: cellPropsLayers[column2.name] || []
473
+ };
474
+ } else if (!isGroup && rowsGroupedNames[column2.name]) {
475
+ isGroup = true;
476
+ return parseData2(rowsGroup, _objectSpread(_objectSpread({}, exclude), columnsWithoutRowGroup));
477
+ } else if (!exclude[column2.name] && !rowsGroupedNames[column2.name]) {
478
+ return {
479
+ name: column2.name,
480
+ cssVar: column2.varWidth,
481
+ fixed: column2.fixed,
482
+ data: null,
483
+ cellPropsLayers: cellPropsLayers[column2.name] || []
484
+ };
354
485
  }
355
- }).filter(function(t) {
356
- return t;
357
- }).map(function(t) {
358
- return t;
486
+ }).filter(function(column2) {
487
+ return column2;
488
+ }).map(function(column2) {
489
+ return column2;
359
490
  });
360
- return h.flatRowData = l, h;
491
+ cells.flatRowData = row;
492
+ return cells;
361
493
  });
362
494
  };
363
- return r(_, {});
495
+ return parseData(data, {});
364
496
  }
365
497
  }, {
366
498
  key: "componentDidMount",
367
- value: function() {
499
+ value: function componentDidMount() {
368
500
  this.setVarStyle(this.columns);
369
501
  }
370
502
  }, {
371
503
  key: "componentDidUpdate",
372
- value: function(_) {
373
- if (this.setVarStyle(this.columns), _.data !== this.props.data) {
374
- var i = this.focusedCell[0], e = i === 0 && this.hasFocusableInHeader();
375
- this.tableRef.current && !I(this.tableRef.current) && !e && (this.focusedCell = [-1, -1]);
504
+ value: function componentDidUpdate(prevProps) {
505
+ this.setVarStyle(this.columns);
506
+ if (prevProps.data !== this.props.data) {
507
+ var focusedRow = this.focusedCell[0];
508
+ var isFocusInHeader = focusedRow === 0 && this.hasFocusableInHeader();
509
+ if (this.tableRef.current && !isFocusInside(this.tableRef.current) && !isFocusInHeader) {
510
+ this.focusedCell = [-1, -1];
511
+ }
376
512
  }
377
513
  }
378
514
  }, {
379
515
  key: "totalRows",
380
- get: function() {
381
- var _ = this.asProps, i = _.data, e = _.totalRows;
382
- return e ?? (i ?? []).length;
516
+ get: function get() {
517
+ var _this$asProps3 = this.asProps, data = _this$asProps3.data, totalRows = _this$asProps3.totalRows;
518
+ return totalRows !== null && totalRows !== void 0 ? totalRows : (data !== null && data !== void 0 ? data : []).length;
383
519
  }
384
520
  }, {
385
521
  key: "setInert",
386
- value: function(_) {
387
- var i, e = (i = this.tableRef.current) === null || i === void 0 ? void 0 : i.querySelectorAll("[role=gridcell], [role=columnheader]");
388
- e == null || e.forEach(function(r) {
389
- _ === !0 ? r.setAttribute("inert", "") : r.removeAttribute("inert");
522
+ value: function setInert(value) {
523
+ var _this$tableRef$curren6;
524
+ var cells = (_this$tableRef$curren6 = this.tableRef.current) === null || _this$tableRef$curren6 === void 0 ? void 0 : _this$tableRef$curren6.querySelectorAll("[role=gridcell], [role=columnheader]");
525
+ cells === null || cells === void 0 ? void 0 : cells.forEach(function(cell) {
526
+ if (value === true) {
527
+ cell.setAttribute("inert", "");
528
+ } else {
529
+ cell.removeAttribute("inert");
530
+ }
390
531
  });
391
532
  }
392
533
  }, {
393
534
  key: "render",
394
- value: function() {
395
- var _ = this.asProps, i, e = X, r = this.asProps, o = r.Children, a = r.styles;
396
- return i = J(a), /* @__PURE__ */ D.createElement(e, i.cn("SDataTable", W({}, N({
397
- __excludeProps: ["data"],
398
- ref: this.tableRef,
399
- role: "grid",
400
- onKeyDown: this.handleKeyDown,
401
- onMouseMove: this.handleMouseMove,
402
- tabIndex: 0,
403
- onFocus: this.handleFocus,
404
- onBlur: this.handleBlur,
535
+ value: function render() {
536
+ var _ref = this.asProps, _ref2;
537
+ var SDataTable = Box;
538
+ var _this$asProps4 = this.asProps, Children = _this$asProps4.Children, styles = _this$asProps4.styles;
539
+ return _ref2 = sstyled$1(styles), /* @__PURE__ */ React.createElement(SDataTable, _ref2.cn("SDataTable", _objectSpread({}, assignProps({
540
+ "__excludeProps": ["data"],
541
+ "ref": this.tableRef,
542
+ "role": "grid",
543
+ "onKeyDown": this.handleKeyDown,
544
+ "onMouseMove": this.handleMouseMove,
545
+ "tabIndex": 0,
546
+ "onFocus": this.handleFocus,
547
+ "onBlur": this.handleBlur,
405
548
  "aria-rowcount": this.totalRows,
406
549
  "aria-colcount": this.columns.length
407
- }, _))), /* @__PURE__ */ D.createElement(o, i.cn("Children", {})));
550
+ }, _ref))), /* @__PURE__ */ React.createElement(Children, _ref2.cn("Children", {})));
408
551
  }
409
- }]), R;
410
- }(Q);
411
- g($, "displayName", "DefinitionTable");
412
- g($, "style", g_);
413
- g($, "enhance", [r_(), a_(t_), s_()]);
414
- g($, "defaultProps", {
552
+ }]);
553
+ return RootDefinitionTable2;
554
+ }(Component);
555
+ _defineProperty(RootDefinitionTable, "displayName", "DefinitionTable");
556
+ _defineProperty(RootDefinitionTable, "style", style);
557
+ _defineProperty(RootDefinitionTable, "enhance", [uniqueIDEnhancement(), i18nEnhance(localizedMessages), focusSourceEnhance()]);
558
+ _defineProperty(RootDefinitionTable, "defaultProps", {
415
559
  use: "primary",
416
560
  uniqueKey: "id",
417
561
  sort: [],
418
562
  data: []
419
563
  });
420
- function A() {
564
+ function ComponentDefinition() {
421
565
  return null;
422
566
  }
423
- var z = K($, {
424
- Head: e_,
425
- Body: o_,
426
- Column: A,
427
- Cell: A,
428
- Row: A
429
- }, {}), G_ = function(b) {
430
- return b;
431
- }, V_ = function(b) {
432
- return b;
433
- }, M_ = function(b) {
434
- return b;
567
+ var DefinitionTable = createComponent(RootDefinitionTable, {
568
+ Head,
569
+ Body,
570
+ Column: ComponentDefinition,
571
+ Cell: ComponentDefinition,
572
+ Row: ComponentDefinition
573
+ }, {});
574
+ var wrapDataTable = function wrapDataTable2(wrapper) {
575
+ return wrapper;
576
+ };
577
+ var wrapDataTableRow = function wrapDataTableRow2(wrapper) {
578
+ return wrapper;
579
+ };
580
+ var wrapDataTableCell = function wrapDataTableCell2(wrapper) {
581
+ return wrapper;
435
582
  };
436
583
  export {
437
- u_ as ROW_GROUP,
438
- z as default,
439
- G_ as wrapDataTable,
440
- M_ as wrapDataTableCell,
441
- V_ as wrapDataTableRow
584
+ ROW_GROUP,
585
+ DefinitionTable as default,
586
+ wrapDataTable,
587
+ wrapDataTableCell,
588
+ wrapDataTableRow
442
589
  };