@semcore/data-table 1.4.6 → 1.5.0
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/DataTable.js +1 -1
- package/lib/cjs/Head.js +4 -4
- package/lib/cjs/Head.js.map +1 -1
- package/lib/es6/DataTable.js +1 -1
- package/lib/es6/Head.js +4 -4
- package/lib/es6/Head.js.map +1 -1
- package/package.json +2 -2
- package/src/Head.js +4 -4
package/CHANGELOG.md
CHANGED
package/lib/cjs/DataTable.js
CHANGED
|
@@ -60,7 +60,7 @@ var style = (
|
|
|
60
60
|
/*__reshadow_css_start__*/
|
|
61
61
|
_core.sstyled.insert(
|
|
62
62
|
/*__inner_css_start__*/
|
|
63
|
-
".___SDataTable_1ji8l_gg_,.___SHeadWrapper_1ji8l_gg_{position:relative}.___SHeadWrapper_1ji8l_gg_.__sticky_1ji8l_gg_{position:sticky;top:0;z-index:2}.___SHead_1ji8l_gg_{flex-direction:row;min-width:-webkit-fit-content;min-width:-moz-fit-content;min-width:fit-content;z-index:0}.___SColumn_1ji8l_gg_,.___SHead_1ji8l_gg_{display:flex;position:relative}.___SColumn_1ji8l_gg_{flex-grow:1;font-size:12px;line-height:18px;color:#333;box-sizing:border-box}.___SColumn_1ji8l_gg_:focus{outline:none;box-shadow:inset 0 0 0 3px rgba(43,148,225,.3)}.___SColumn_1ji8l_gg_.__hidden_1ji8l_gg_{height:0!important;padding:0!important;overflow:hidden!important;border:none!important}.___SColumn_1ji8l_gg_._use_primary_1ji8l_gg_{padding:12px;border-right:1px solid #dee3e5;border-bottom:1px solid #dee3e5;background-color:#f2f3f4}.___SColumn_1ji8l_gg_._use_secondary_1ji8l_gg_{padding:8px;border-bottom:1px solid #a6b0b3;background-color:transparent}.___SColumn_1ji8l_gg_.__use_1ji8l_gg_:last-child{border-right:none}.___SColumn_1ji8l_gg_.__group_1ji8l_gg_.__use_1ji8l_gg_{display:flex;flex-wrap:wrap;flex-direction:column;border-bottom:none;padding:0}.___SColumn_1ji8l_gg_.__groupHead_1ji8l_gg_.__use_1ji8l_gg_{justify-content:center;border-right:none;z-index:1}.___SColumn_1ji8l_gg_.__groupHead_1ji8l_gg_._use_primary_1ji8l_gg_{border-bottom:1px solid #dee3e5}.___SColumn_1ji8l_gg_.__groupHead_1ji8l_gg_._use_secondary_1ji8l_gg_{border-bottom:1px solid #a6b0b3}.___SColumn_1ji8l_gg_.__sortable_1ji8l_gg_{cursor:pointer}.___SColumn_1ji8l_gg_.__active_1ji8l_gg_._use_primary_1ji8l_gg_,.___SColumn_1ji8l_gg_.__sortable_1ji8l_gg_._use_primary_1ji8l_gg_:hover{background-color:#e4e7e8}.___SColumn_1ji8l_gg_.__resizable_1ji8l_gg_:hover:after{background:#a6b0b3}.___SColumn_1ji8l_gg_.__resizable_1ji8l_gg_:after{content:\"\";position:absolute;bottom:0;right:-1px;height:100vh;width:1px;background:transparent;cursor:col-resize}.___SColumn_1ji8l_gg_.__fixed_1ji8l_gg_{position:sticky;z-index:2}.___SSortIcon_1ji8l_gg_{margin-top:2px;margin-left:4px;color:#bdc4c6}.___SSortIcon_1ji8l_gg_.__active_1ji8l_gg_{fill:#64787e}.___SBodyWrapper_1ji8l_gg_{position:relative}.___SBody_1ji8l_gg_{flex-direction:column;min-width:-webkit-fit-content;min-width:-moz-fit-content;min-width:fit-content}.___SBody_1ji8l_gg_,.___SRow_1ji8l_gg_{display:flex;position:relative}.___SRow_1ji8l_gg_{flex-direction:row}.___SRow_1ji8l_gg_:hover .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_),.___SRow_1ji8l_gg_.__active_1ji8l_gg_ .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_){background-color:#f6f7f7}.___SRow_1ji8l_gg_._theme_muted_1ji8l_gg_ .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_){background-color:#f2f3f4}.___SRow_1ji8l_gg_:hover .___SCell_1ji8l_gg_._theme_muted_1ji8l_gg_,.___SRow_1ji8l_gg_._theme_muted_1ji8l_gg_:hover .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_),.___SRow_1ji8l_gg_._theme_muted_1ji8l_gg_.__active_1ji8l_gg_ .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_){background-color:#f6f7f7}.___SRow_1ji8l_gg_._theme_info_1ji8l_gg_ .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_){background-color:#d5eaf9}.___SRow_1ji8l_gg_:hover .___SCell_1ji8l_gg_._theme_info_1ji8l_gg_,.___SRow_1ji8l_gg_._theme_info_1ji8l_gg_:hover .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_),.___SRow_1ji8l_gg_._theme_info_1ji8l_gg_.__active_1ji8l_gg_ .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_){background-color:#cae4f8}.___SRow_1ji8l_gg_._theme_success_1ji8l_gg_ .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_){background-color:#e5f3e0}.___SRow_1ji8l_gg_:hover .___SCell_1ji8l_gg_._theme_success_1ji8l_gg_,.___SRow_1ji8l_gg_._theme_success_1ji8l_gg_:hover .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_),.___SRow_1ji8l_gg_._theme_success_1ji8l_gg_.__active_1ji8l_gg_ .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_){background-color:#dcefd6}.___SRow_1ji8l_gg_._theme_warning_1ji8l_gg_ .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_){background-color:#fef3e6}.___SRow_1ji8l_gg_:hover .___SCell_1ji8l_gg_._theme_warning_1ji8l_gg_,.___SRow_1ji8l_gg_._theme_warning_1ji8l_gg_:hover .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_),.___SRow_1ji8l_gg_._theme_warning_1ji8l_gg_.__active_1ji8l_gg_ .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_){background-color:#feefde}.___SRow_1ji8l_gg_._theme_danger_1ji8l_gg_ .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_){background-color:#fdeaea}.___SRow_1ji8l_gg_:hover .___SCell_1ji8l_gg_._theme_danger_1ji8l_gg_,.___SRow_1ji8l_gg_._theme_danger_1ji8l_gg_:hover .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_),.___SRow_1ji8l_gg_._theme_danger_1ji8l_gg_.__active_1ji8l_gg_ .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_){background-color:#fce0e0}.___SCell_1ji8l_gg_{display:flex;flex:0 0 auto;font-size:14px;color:#333;line-height:20px;box-sizing:border-box;border-bottom:1px solid #dee3e5;overflow:hidden;white-space:nowrap}.___SCell_1ji8l_gg_._use_primary_1ji8l_gg_{padding:12px;min-height:45px;background-color:#fff}.___SCell_1ji8l_gg_._use_secondary_1ji8l_gg_{padding:8px;min-height:37px;background-color:transparent}.___SCell_1ji8l_gg_.__fixed_1ji8l_gg_{position:sticky;z-index:1}.___SCell_1ji8l_gg_._theme_muted_1ji8l_gg_{background-color:#f2f3f4}.___SCell_1ji8l_gg_._theme_info_1ji8l_gg_{background-color:#d5eaf9}.___SCell_1ji8l_gg_._theme_success_1ji8l_gg_{background-color:#e5f3e0}.___SCell_1ji8l_gg_._theme_warning_1ji8l_gg_{background-color:#fef3e6}.___SCell_1ji8l_gg_._theme_danger_1ji8l_gg_{background-color:#fdeaea}.___SScrollAreaBar_1ji8l_gg_._orientation_horizontal_1ji8l_gg_{position:sticky;bottom:0;left:0;margin-top:-12px;z-index:2}.___SScrollAreaBar_1ji8l_gg_._orientation_vertical_1ji8l_gg_{width:12px}.___SScrollAreaBar_1ji8l_gg_._orientation_horizontal_1ji8l_gg_{margin-left:calc(var(--left_1b2nebp) + 4px);margin-right:calc(var(--right_1b2nebp) + 4px);width:calc(100% - var(--offsetSum_1b2nebp) - 8px)}"
|
|
63
|
+
".___SDataTable_1ji8l_gg_,.___SHeadWrapper_1ji8l_gg_{position:relative}.___SHeadWrapper_1ji8l_gg_.__sticky_1ji8l_gg_{position:-webkit-sticky;position:sticky;top:0;z-index:2}.___SHead_1ji8l_gg_{flex-direction:row;min-width:-webkit-fit-content;min-width:-moz-fit-content;min-width:fit-content;z-index:0}.___SColumn_1ji8l_gg_,.___SHead_1ji8l_gg_{display:flex;position:relative}.___SColumn_1ji8l_gg_{flex-grow:1;font-size:12px;line-height:18px;color:#333;box-sizing:border-box}.___SColumn_1ji8l_gg_:focus{outline:none;box-shadow:inset 0 0 0 3px rgba(43,148,225,.3)}.___SColumn_1ji8l_gg_.__hidden_1ji8l_gg_{height:0!important;padding:0!important;overflow:hidden!important;border:none!important}.___SColumn_1ji8l_gg_._use_primary_1ji8l_gg_{padding:12px;border-right:1px solid #dee3e5;border-bottom:1px solid #dee3e5;background-color:#f2f3f4}.___SColumn_1ji8l_gg_._use_secondary_1ji8l_gg_{padding:8px;border-bottom:1px solid #a6b0b3;background-color:transparent}.___SColumn_1ji8l_gg_.__use_1ji8l_gg_:last-child{border-right:none}.___SColumn_1ji8l_gg_.__group_1ji8l_gg_.__use_1ji8l_gg_{display:flex;flex-wrap:wrap;flex-direction:column;border-bottom:none;padding:0}.___SColumn_1ji8l_gg_.__groupHead_1ji8l_gg_.__use_1ji8l_gg_{justify-content:center;border-right:none;z-index:1}.___SColumn_1ji8l_gg_.__groupHead_1ji8l_gg_._use_primary_1ji8l_gg_{border-bottom:1px solid #dee3e5}.___SColumn_1ji8l_gg_.__groupHead_1ji8l_gg_._use_secondary_1ji8l_gg_{border-bottom:1px solid #a6b0b3}.___SColumn_1ji8l_gg_.__sortable_1ji8l_gg_{cursor:pointer}.___SColumn_1ji8l_gg_.__active_1ji8l_gg_._use_primary_1ji8l_gg_,.___SColumn_1ji8l_gg_.__sortable_1ji8l_gg_._use_primary_1ji8l_gg_:hover{background-color:#e4e7e8}.___SColumn_1ji8l_gg_.__resizable_1ji8l_gg_:hover:after{background:#a6b0b3}.___SColumn_1ji8l_gg_.__resizable_1ji8l_gg_:after{content:\"\";position:absolute;bottom:0;right:-1px;height:100vh;width:1px;background:transparent;cursor:col-resize}.___SColumn_1ji8l_gg_.__fixed_1ji8l_gg_{position:-webkit-sticky;position:sticky;z-index:2}.___SSortIcon_1ji8l_gg_{margin-top:2px;margin-left:4px;color:#bdc4c6}.___SSortIcon_1ji8l_gg_.__active_1ji8l_gg_{fill:#64787e}.___SBodyWrapper_1ji8l_gg_{position:relative}.___SBody_1ji8l_gg_{flex-direction:column;min-width:-webkit-fit-content;min-width:-moz-fit-content;min-width:fit-content}.___SBody_1ji8l_gg_,.___SRow_1ji8l_gg_{display:flex;position:relative}.___SRow_1ji8l_gg_{flex-direction:row}.___SRow_1ji8l_gg_:hover .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_),.___SRow_1ji8l_gg_.__active_1ji8l_gg_ .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_){background-color:#f6f7f7}.___SRow_1ji8l_gg_._theme_muted_1ji8l_gg_ .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_){background-color:#f2f3f4}.___SRow_1ji8l_gg_:hover .___SCell_1ji8l_gg_._theme_muted_1ji8l_gg_,.___SRow_1ji8l_gg_._theme_muted_1ji8l_gg_:hover .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_),.___SRow_1ji8l_gg_._theme_muted_1ji8l_gg_.__active_1ji8l_gg_ .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_){background-color:#f6f7f7}.___SRow_1ji8l_gg_._theme_info_1ji8l_gg_ .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_){background-color:#d5eaf9}.___SRow_1ji8l_gg_:hover .___SCell_1ji8l_gg_._theme_info_1ji8l_gg_,.___SRow_1ji8l_gg_._theme_info_1ji8l_gg_:hover .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_),.___SRow_1ji8l_gg_._theme_info_1ji8l_gg_.__active_1ji8l_gg_ .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_){background-color:#cae4f8}.___SRow_1ji8l_gg_._theme_success_1ji8l_gg_ .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_){background-color:#e5f3e0}.___SRow_1ji8l_gg_:hover .___SCell_1ji8l_gg_._theme_success_1ji8l_gg_,.___SRow_1ji8l_gg_._theme_success_1ji8l_gg_:hover .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_),.___SRow_1ji8l_gg_._theme_success_1ji8l_gg_.__active_1ji8l_gg_ .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_){background-color:#dcefd6}.___SRow_1ji8l_gg_._theme_warning_1ji8l_gg_ .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_){background-color:#fef3e6}.___SRow_1ji8l_gg_:hover .___SCell_1ji8l_gg_._theme_warning_1ji8l_gg_,.___SRow_1ji8l_gg_._theme_warning_1ji8l_gg_:hover .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_),.___SRow_1ji8l_gg_._theme_warning_1ji8l_gg_.__active_1ji8l_gg_ .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_){background-color:#feefde}.___SRow_1ji8l_gg_._theme_danger_1ji8l_gg_ .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_){background-color:#fdeaea}.___SRow_1ji8l_gg_:hover .___SCell_1ji8l_gg_._theme_danger_1ji8l_gg_,.___SRow_1ji8l_gg_._theme_danger_1ji8l_gg_:hover .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_),.___SRow_1ji8l_gg_._theme_danger_1ji8l_gg_.__active_1ji8l_gg_ .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_){background-color:#fce0e0}.___SCell_1ji8l_gg_{display:flex;flex:0 0 auto;font-size:14px;color:#333;line-height:20px;box-sizing:border-box;border-bottom:1px solid #dee3e5;overflow:hidden;white-space:nowrap}.___SCell_1ji8l_gg_._use_primary_1ji8l_gg_{padding:12px;min-height:45px;background-color:#fff}.___SCell_1ji8l_gg_._use_secondary_1ji8l_gg_{padding:8px;min-height:37px;background-color:transparent}.___SCell_1ji8l_gg_.__fixed_1ji8l_gg_{position:-webkit-sticky;position:sticky;z-index:1}.___SCell_1ji8l_gg_._theme_muted_1ji8l_gg_{background-color:#f2f3f4}.___SCell_1ji8l_gg_._theme_info_1ji8l_gg_{background-color:#d5eaf9}.___SCell_1ji8l_gg_._theme_success_1ji8l_gg_{background-color:#e5f3e0}.___SCell_1ji8l_gg_._theme_warning_1ji8l_gg_{background-color:#fef3e6}.___SCell_1ji8l_gg_._theme_danger_1ji8l_gg_{background-color:#fdeaea}.___SScrollAreaBar_1ji8l_gg_._orientation_horizontal_1ji8l_gg_{position:-webkit-sticky;position:sticky;bottom:0;left:0;margin-top:-12px;z-index:2}.___SScrollAreaBar_1ji8l_gg_._orientation_vertical_1ji8l_gg_{width:12px}.___SScrollAreaBar_1ji8l_gg_._orientation_horizontal_1ji8l_gg_{margin-left:calc(var(--left_1b2nebp) + 4px);margin-right:calc(var(--right_1b2nebp) + 4px);width:calc(100% - var(--offsetSum_1b2nebp) - 8px)}"
|
|
64
64
|
/*__inner_css_end__*/
|
|
65
65
|
, "1b2nebp_gg_")
|
|
66
66
|
/*__reshadow_css_end__*/
|
package/lib/cjs/Head.js
CHANGED
|
@@ -31,9 +31,9 @@ var _flexBox = require("@semcore/flex-box");
|
|
|
31
31
|
|
|
32
32
|
var _scrollArea = _interopRequireDefault(require("@semcore/scroll-area"));
|
|
33
33
|
|
|
34
|
-
var
|
|
34
|
+
var _m = _interopRequireDefault(require("@semcore/icon/SortDesc/m"));
|
|
35
35
|
|
|
36
|
-
var
|
|
36
|
+
var _m2 = _interopRequireDefault(require("@semcore/icon/SortAsc/m"));
|
|
37
37
|
|
|
38
38
|
var _assignProps2 = require("@semcore/utils/lib/assignProps");
|
|
39
39
|
|
|
@@ -64,8 +64,8 @@ _core.sstyled.insert(
|
|
|
64
64
|
"--right": "--right_1jfuf14"
|
|
65
65
|
});
|
|
66
66
|
var SORTING_ICON = {
|
|
67
|
-
desc:
|
|
68
|
-
asc:
|
|
67
|
+
desc: _m["default"],
|
|
68
|
+
asc: _m2["default"]
|
|
69
69
|
};
|
|
70
70
|
|
|
71
71
|
var Head = /*#__PURE__*/function (_Component) {
|
package/lib/cjs/Head.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Head.js"],"names":["SORTING_ICON","desc","
|
|
1
|
+
{"version":3,"sources":["../../src/Head.js"],"names":["SORTING_ICON","desc","SortDesc","asc","SortAsc","Head","name","e","asProps","$onSortClick","keyCode","columns","width","map","column","renderColumn","styles","use","hidden","SColumn","Flex","SHead","Box","SSortIcon","sortDirection","isGroup","cSize","length","value","style","props","flex","undefined","fixed","resizable","sortable","active","onClick","bindHandlerSortClick","onKeyDown","bindHandlerKeyDown","children","renderColumns","Children","columnsChildren","onResize","$scrollRef","sticky","SHeadWrapper","offsetLeftSum","offsetRightSum","logger","warn","displayName","scrollStyles","origin","Component"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA;;AADA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;AAIA,IAAMA,YAAY,GAAG;AACnBC,EAAAA,IAAI,EAAEC,aADa;AAEnBC,EAAAA,GAAG,EAAEC;AAFc,CAArB;;IAKMC,I;;;;;;;;;;;;;;;gGACM,E;6GAEa,UAACC,IAAD;AAAA,aAAU,UAACC,CAAD,EAAO;AACtC,cAAKC,OAAL,CAAaC,YAAb,CAA0BH,IAA1B,EAAgCC,CAAhC;AACD,OAFsB;AAAA,K;2GAIF,UAACD,IAAD;AAAA,aAAU,UAACC,CAAD,EAAO;AACpC,YAAIA,CAAC,CAACG,OAAF,KAAc,EAAlB,EAAsB;AACpB,gBAAKF,OAAL,CAAaC,YAAb,CAA0BH,IAA1B,EAAgCC,CAAhC;AACD;AACF,OAJoB;AAAA,K;;;;;;WAMrB,uBAAcI,OAAd,EAAuBC,KAAvB,EAA8B;AAAA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AA,UAOAsC,aAPA;AAAA,UAOeC,cAPf;;AASPC,yBAAOC,IAAP,CACEL,MADF,EAEE,0DAFF,EAGE,KAAKvC,OAAL,CAAa,cAAb,KAAgCH,IAAI,CAACgD,WAHvC;;AAMA,qBAAO,mBAAQrC,MAAR,CAAP,eACE,gCAAC,YAAD;AAAA,kBAAsB+B;AAAtB,uBACE,gCAAC,sBAAD;AAAA,kBACUO,YADV;AAAA,8BAEeL,aAFf;AAAA,+BAGgBC,cAHhB;AAAA;AAAA,oBAKYL;AALZ,uBAOE,gCAAC,sBAAD,CAAY,SAAZ;AAAsB,QAAA,GAAG,EAAEC;AAA3B,sBACE,gCAAC,KAAD,0EACG,KAAKJ,aAAL,CAAmBE,eAAnB,EAAoC,MAAM,KAAKjC,OAAL,CAAagB,MAAvD,CADH,CADF,CAPF,CADF,EAcGgB,QAAQ,CAACY,MAdZ,CADF;AAkBD;;;EAvGgBC,e;;eA0GJnD,I","sourcesContent":["import React from 'react';\nimport { Component, sstyled, Root } from '@semcore/core';\nimport { Box, Flex } from '@semcore/flex-box';\nimport ScrollArea from '@semcore/scroll-area';\nimport SortDesc from '@semcore/icon/SortDesc/m';\nimport SortAsc from '@semcore/icon/SortAsc/m';\nimport { callAllEventHandlers } from '@semcore/utils/lib/assignProps';\nimport { flattenColumns, getFixedStyle, getScrollOffsetValue } from './utils';\nimport logger from '@semcore/utils/lib/logger';\n\nimport scrollStyles from './style/scroll-area.shadow.css';\n\nconst SORTING_ICON = {\n desc: SortDesc,\n asc: SortAsc,\n};\n\nclass Head extends Component {\n columns = [];\n\n bindHandlerSortClick = (name) => (e) => {\n this.asProps.$onSortClick(name, e);\n };\n\n bindHandlerKeyDown = (name) => (e) => {\n if (e.keyCode === 13) {\n this.asProps.$onSortClick(name, e);\n }\n };\n\n renderColumns(columns, width) {\n return columns.map((column) => this.renderColumn(column, width));\n }\n\n renderColumn(column, width) {\n const { styles, use, hidden } = this.asProps;\n const SColumn = Flex;\n const SHead = Box;\n const SSortIcon = SORTING_ICON[column.sortDirection];\n const isGroup = !!column.columns;\n const cSize = isGroup ? flattenColumns(column.columns).length : 1;\n const [name, value] = getFixedStyle(column, this.columns);\n const style = {\n [name]: value,\n flexBasis: column.props.flex === undefined && `${width * cSize}%`,\n ...column.props.style,\n };\n\n return sstyled(styles)(\n <SColumn\n key={column.name}\n use={use}\n fixed={column.fixed}\n resizable={column.resizable}\n sortable={column.sortable}\n active={column.active}\n group={isGroup}\n tabIndex={column.sortable && 0}\n {...column.props}\n onClick={callAllEventHandlers(\n column.props.onClick,\n column.sortable ? this.bindHandlerSortClick(column.name) : undefined,\n )}\n onKeyDown={callAllEventHandlers(\n column.props.onKeyDown,\n column.sortable ? this.bindHandlerKeyDown(column.name) : undefined,\n )}\n style={style}\n hidden={hidden}\n >\n {isGroup ? (\n <>\n <SColumn groupHead use={use}>\n <div>{column.props.children}</div>\n </SColumn>\n <SHead>{this.renderColumns(column.columns, 100 / cSize)}</SHead>\n </>\n ) : (\n <>\n <div>{column.props.children}</div>\n {column.sortable ? <SSortIcon active={column.active} /> : null}\n </>\n )}\n </SColumn>,\n );\n }\n\n render() {\n const SHead = Root;\n const { Children, styles, columnsChildren, onResize, $scrollRef, sticky } = this.asProps;\n const SHeadWrapper = Box;\n\n this.columns = flattenColumns(columnsChildren);\n\n const [offsetLeftSum, offsetRightSum] = getScrollOffsetValue(this.columns);\n\n logger.warn(\n sticky,\n \"'sticky' property is deprecated, use '<Sticky/>' wrapper\",\n this.asProps['data-ui-name'] || Head.displayName,\n );\n\n return sstyled(styles)(\n <SHeadWrapper sticky={sticky}>\n <ScrollArea\n styles={scrollStyles}\n use:left={`${offsetLeftSum}px`}\n use:right={`${offsetRightSum}px`}\n shadow\n onResize={onResize}\n >\n <ScrollArea.Container ref={$scrollRef}>\n <SHead render={Box}>\n {this.renderColumns(columnsChildren, 100 / this.columns.length)}\n </SHead>\n </ScrollArea.Container>\n </ScrollArea>\n {Children.origin}\n </SHeadWrapper>,\n );\n }\n}\n\nexport default Head;\n"],"file":"Head.js"}
|
package/lib/es6/DataTable.js
CHANGED
|
@@ -34,7 +34,7 @@ var style = (
|
|
|
34
34
|
/*__reshadow_css_start__*/
|
|
35
35
|
_sstyled.insert(
|
|
36
36
|
/*__inner_css_start__*/
|
|
37
|
-
".___SDataTable_1ji8l_gg_,.___SHeadWrapper_1ji8l_gg_{position:relative}.___SHeadWrapper_1ji8l_gg_.__sticky_1ji8l_gg_{position:sticky;top:0;z-index:2}.___SHead_1ji8l_gg_{flex-direction:row;min-width:-webkit-fit-content;min-width:-moz-fit-content;min-width:fit-content;z-index:0}.___SColumn_1ji8l_gg_,.___SHead_1ji8l_gg_{display:flex;position:relative}.___SColumn_1ji8l_gg_{flex-grow:1;font-size:12px;line-height:18px;color:#333;box-sizing:border-box}.___SColumn_1ji8l_gg_:focus{outline:none;box-shadow:inset 0 0 0 3px rgba(43,148,225,.3)}.___SColumn_1ji8l_gg_.__hidden_1ji8l_gg_{height:0!important;padding:0!important;overflow:hidden!important;border:none!important}.___SColumn_1ji8l_gg_._use_primary_1ji8l_gg_{padding:12px;border-right:1px solid #dee3e5;border-bottom:1px solid #dee3e5;background-color:#f2f3f4}.___SColumn_1ji8l_gg_._use_secondary_1ji8l_gg_{padding:8px;border-bottom:1px solid #a6b0b3;background-color:transparent}.___SColumn_1ji8l_gg_.__use_1ji8l_gg_:last-child{border-right:none}.___SColumn_1ji8l_gg_.__group_1ji8l_gg_.__use_1ji8l_gg_{display:flex;flex-wrap:wrap;flex-direction:column;border-bottom:none;padding:0}.___SColumn_1ji8l_gg_.__groupHead_1ji8l_gg_.__use_1ji8l_gg_{justify-content:center;border-right:none;z-index:1}.___SColumn_1ji8l_gg_.__groupHead_1ji8l_gg_._use_primary_1ji8l_gg_{border-bottom:1px solid #dee3e5}.___SColumn_1ji8l_gg_.__groupHead_1ji8l_gg_._use_secondary_1ji8l_gg_{border-bottom:1px solid #a6b0b3}.___SColumn_1ji8l_gg_.__sortable_1ji8l_gg_{cursor:pointer}.___SColumn_1ji8l_gg_.__active_1ji8l_gg_._use_primary_1ji8l_gg_,.___SColumn_1ji8l_gg_.__sortable_1ji8l_gg_._use_primary_1ji8l_gg_:hover{background-color:#e4e7e8}.___SColumn_1ji8l_gg_.__resizable_1ji8l_gg_:hover:after{background:#a6b0b3}.___SColumn_1ji8l_gg_.__resizable_1ji8l_gg_:after{content:\"\";position:absolute;bottom:0;right:-1px;height:100vh;width:1px;background:transparent;cursor:col-resize}.___SColumn_1ji8l_gg_.__fixed_1ji8l_gg_{position:sticky;z-index:2}.___SSortIcon_1ji8l_gg_{margin-top:2px;margin-left:4px;color:#bdc4c6}.___SSortIcon_1ji8l_gg_.__active_1ji8l_gg_{fill:#64787e}.___SBodyWrapper_1ji8l_gg_{position:relative}.___SBody_1ji8l_gg_{flex-direction:column;min-width:-webkit-fit-content;min-width:-moz-fit-content;min-width:fit-content}.___SBody_1ji8l_gg_,.___SRow_1ji8l_gg_{display:flex;position:relative}.___SRow_1ji8l_gg_{flex-direction:row}.___SRow_1ji8l_gg_:hover .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_),.___SRow_1ji8l_gg_.__active_1ji8l_gg_ .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_){background-color:#f6f7f7}.___SRow_1ji8l_gg_._theme_muted_1ji8l_gg_ .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_){background-color:#f2f3f4}.___SRow_1ji8l_gg_:hover .___SCell_1ji8l_gg_._theme_muted_1ji8l_gg_,.___SRow_1ji8l_gg_._theme_muted_1ji8l_gg_:hover .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_),.___SRow_1ji8l_gg_._theme_muted_1ji8l_gg_.__active_1ji8l_gg_ .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_){background-color:#f6f7f7}.___SRow_1ji8l_gg_._theme_info_1ji8l_gg_ .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_){background-color:#d5eaf9}.___SRow_1ji8l_gg_:hover .___SCell_1ji8l_gg_._theme_info_1ji8l_gg_,.___SRow_1ji8l_gg_._theme_info_1ji8l_gg_:hover .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_),.___SRow_1ji8l_gg_._theme_info_1ji8l_gg_.__active_1ji8l_gg_ .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_){background-color:#cae4f8}.___SRow_1ji8l_gg_._theme_success_1ji8l_gg_ .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_){background-color:#e5f3e0}.___SRow_1ji8l_gg_:hover .___SCell_1ji8l_gg_._theme_success_1ji8l_gg_,.___SRow_1ji8l_gg_._theme_success_1ji8l_gg_:hover .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_),.___SRow_1ji8l_gg_._theme_success_1ji8l_gg_.__active_1ji8l_gg_ .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_){background-color:#dcefd6}.___SRow_1ji8l_gg_._theme_warning_1ji8l_gg_ .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_){background-color:#fef3e6}.___SRow_1ji8l_gg_:hover .___SCell_1ji8l_gg_._theme_warning_1ji8l_gg_,.___SRow_1ji8l_gg_._theme_warning_1ji8l_gg_:hover .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_),.___SRow_1ji8l_gg_._theme_warning_1ji8l_gg_.__active_1ji8l_gg_ .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_){background-color:#feefde}.___SRow_1ji8l_gg_._theme_danger_1ji8l_gg_ .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_){background-color:#fdeaea}.___SRow_1ji8l_gg_:hover .___SCell_1ji8l_gg_._theme_danger_1ji8l_gg_,.___SRow_1ji8l_gg_._theme_danger_1ji8l_gg_:hover .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_),.___SRow_1ji8l_gg_._theme_danger_1ji8l_gg_.__active_1ji8l_gg_ .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_){background-color:#fce0e0}.___SCell_1ji8l_gg_{display:flex;flex:0 0 auto;font-size:14px;color:#333;line-height:20px;box-sizing:border-box;border-bottom:1px solid #dee3e5;overflow:hidden;white-space:nowrap}.___SCell_1ji8l_gg_._use_primary_1ji8l_gg_{padding:12px;min-height:45px;background-color:#fff}.___SCell_1ji8l_gg_._use_secondary_1ji8l_gg_{padding:8px;min-height:37px;background-color:transparent}.___SCell_1ji8l_gg_.__fixed_1ji8l_gg_{position:sticky;z-index:1}.___SCell_1ji8l_gg_._theme_muted_1ji8l_gg_{background-color:#f2f3f4}.___SCell_1ji8l_gg_._theme_info_1ji8l_gg_{background-color:#d5eaf9}.___SCell_1ji8l_gg_._theme_success_1ji8l_gg_{background-color:#e5f3e0}.___SCell_1ji8l_gg_._theme_warning_1ji8l_gg_{background-color:#fef3e6}.___SCell_1ji8l_gg_._theme_danger_1ji8l_gg_{background-color:#fdeaea}.___SScrollAreaBar_1ji8l_gg_._orientation_horizontal_1ji8l_gg_{position:sticky;bottom:0;left:0;margin-top:-12px;z-index:2}.___SScrollAreaBar_1ji8l_gg_._orientation_vertical_1ji8l_gg_{width:12px}.___SScrollAreaBar_1ji8l_gg_._orientation_horizontal_1ji8l_gg_{margin-left:calc(var(--left_1b2nebp) + 4px);margin-right:calc(var(--right_1b2nebp) + 4px);width:calc(100% - var(--offsetSum_1b2nebp) - 8px)}"
|
|
37
|
+
".___SDataTable_1ji8l_gg_,.___SHeadWrapper_1ji8l_gg_{position:relative}.___SHeadWrapper_1ji8l_gg_.__sticky_1ji8l_gg_{position:-webkit-sticky;position:sticky;top:0;z-index:2}.___SHead_1ji8l_gg_{flex-direction:row;min-width:-webkit-fit-content;min-width:-moz-fit-content;min-width:fit-content;z-index:0}.___SColumn_1ji8l_gg_,.___SHead_1ji8l_gg_{display:flex;position:relative}.___SColumn_1ji8l_gg_{flex-grow:1;font-size:12px;line-height:18px;color:#333;box-sizing:border-box}.___SColumn_1ji8l_gg_:focus{outline:none;box-shadow:inset 0 0 0 3px rgba(43,148,225,.3)}.___SColumn_1ji8l_gg_.__hidden_1ji8l_gg_{height:0!important;padding:0!important;overflow:hidden!important;border:none!important}.___SColumn_1ji8l_gg_._use_primary_1ji8l_gg_{padding:12px;border-right:1px solid #dee3e5;border-bottom:1px solid #dee3e5;background-color:#f2f3f4}.___SColumn_1ji8l_gg_._use_secondary_1ji8l_gg_{padding:8px;border-bottom:1px solid #a6b0b3;background-color:transparent}.___SColumn_1ji8l_gg_.__use_1ji8l_gg_:last-child{border-right:none}.___SColumn_1ji8l_gg_.__group_1ji8l_gg_.__use_1ji8l_gg_{display:flex;flex-wrap:wrap;flex-direction:column;border-bottom:none;padding:0}.___SColumn_1ji8l_gg_.__groupHead_1ji8l_gg_.__use_1ji8l_gg_{justify-content:center;border-right:none;z-index:1}.___SColumn_1ji8l_gg_.__groupHead_1ji8l_gg_._use_primary_1ji8l_gg_{border-bottom:1px solid #dee3e5}.___SColumn_1ji8l_gg_.__groupHead_1ji8l_gg_._use_secondary_1ji8l_gg_{border-bottom:1px solid #a6b0b3}.___SColumn_1ji8l_gg_.__sortable_1ji8l_gg_{cursor:pointer}.___SColumn_1ji8l_gg_.__active_1ji8l_gg_._use_primary_1ji8l_gg_,.___SColumn_1ji8l_gg_.__sortable_1ji8l_gg_._use_primary_1ji8l_gg_:hover{background-color:#e4e7e8}.___SColumn_1ji8l_gg_.__resizable_1ji8l_gg_:hover:after{background:#a6b0b3}.___SColumn_1ji8l_gg_.__resizable_1ji8l_gg_:after{content:\"\";position:absolute;bottom:0;right:-1px;height:100vh;width:1px;background:transparent;cursor:col-resize}.___SColumn_1ji8l_gg_.__fixed_1ji8l_gg_{position:-webkit-sticky;position:sticky;z-index:2}.___SSortIcon_1ji8l_gg_{margin-top:2px;margin-left:4px;color:#bdc4c6}.___SSortIcon_1ji8l_gg_.__active_1ji8l_gg_{fill:#64787e}.___SBodyWrapper_1ji8l_gg_{position:relative}.___SBody_1ji8l_gg_{flex-direction:column;min-width:-webkit-fit-content;min-width:-moz-fit-content;min-width:fit-content}.___SBody_1ji8l_gg_,.___SRow_1ji8l_gg_{display:flex;position:relative}.___SRow_1ji8l_gg_{flex-direction:row}.___SRow_1ji8l_gg_:hover .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_),.___SRow_1ji8l_gg_.__active_1ji8l_gg_ .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_){background-color:#f6f7f7}.___SRow_1ji8l_gg_._theme_muted_1ji8l_gg_ .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_){background-color:#f2f3f4}.___SRow_1ji8l_gg_:hover .___SCell_1ji8l_gg_._theme_muted_1ji8l_gg_,.___SRow_1ji8l_gg_._theme_muted_1ji8l_gg_:hover .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_),.___SRow_1ji8l_gg_._theme_muted_1ji8l_gg_.__active_1ji8l_gg_ .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_){background-color:#f6f7f7}.___SRow_1ji8l_gg_._theme_info_1ji8l_gg_ .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_){background-color:#d5eaf9}.___SRow_1ji8l_gg_:hover .___SCell_1ji8l_gg_._theme_info_1ji8l_gg_,.___SRow_1ji8l_gg_._theme_info_1ji8l_gg_:hover .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_),.___SRow_1ji8l_gg_._theme_info_1ji8l_gg_.__active_1ji8l_gg_ .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_){background-color:#cae4f8}.___SRow_1ji8l_gg_._theme_success_1ji8l_gg_ .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_){background-color:#e5f3e0}.___SRow_1ji8l_gg_:hover .___SCell_1ji8l_gg_._theme_success_1ji8l_gg_,.___SRow_1ji8l_gg_._theme_success_1ji8l_gg_:hover .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_),.___SRow_1ji8l_gg_._theme_success_1ji8l_gg_.__active_1ji8l_gg_ .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_){background-color:#dcefd6}.___SRow_1ji8l_gg_._theme_warning_1ji8l_gg_ .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_){background-color:#fef3e6}.___SRow_1ji8l_gg_:hover .___SCell_1ji8l_gg_._theme_warning_1ji8l_gg_,.___SRow_1ji8l_gg_._theme_warning_1ji8l_gg_:hover .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_),.___SRow_1ji8l_gg_._theme_warning_1ji8l_gg_.__active_1ji8l_gg_ .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_){background-color:#feefde}.___SRow_1ji8l_gg_._theme_danger_1ji8l_gg_ .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_){background-color:#fdeaea}.___SRow_1ji8l_gg_:hover .___SCell_1ji8l_gg_._theme_danger_1ji8l_gg_,.___SRow_1ji8l_gg_._theme_danger_1ji8l_gg_:hover .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_),.___SRow_1ji8l_gg_._theme_danger_1ji8l_gg_.__active_1ji8l_gg_ .___SCell_1ji8l_gg_:not(.__theme_1ji8l_gg_){background-color:#fce0e0}.___SCell_1ji8l_gg_{display:flex;flex:0 0 auto;font-size:14px;color:#333;line-height:20px;box-sizing:border-box;border-bottom:1px solid #dee3e5;overflow:hidden;white-space:nowrap}.___SCell_1ji8l_gg_._use_primary_1ji8l_gg_{padding:12px;min-height:45px;background-color:#fff}.___SCell_1ji8l_gg_._use_secondary_1ji8l_gg_{padding:8px;min-height:37px;background-color:transparent}.___SCell_1ji8l_gg_.__fixed_1ji8l_gg_{position:-webkit-sticky;position:sticky;z-index:1}.___SCell_1ji8l_gg_._theme_muted_1ji8l_gg_{background-color:#f2f3f4}.___SCell_1ji8l_gg_._theme_info_1ji8l_gg_{background-color:#d5eaf9}.___SCell_1ji8l_gg_._theme_success_1ji8l_gg_{background-color:#e5f3e0}.___SCell_1ji8l_gg_._theme_warning_1ji8l_gg_{background-color:#fef3e6}.___SCell_1ji8l_gg_._theme_danger_1ji8l_gg_{background-color:#fdeaea}.___SScrollAreaBar_1ji8l_gg_._orientation_horizontal_1ji8l_gg_{position:-webkit-sticky;position:sticky;bottom:0;left:0;margin-top:-12px;z-index:2}.___SScrollAreaBar_1ji8l_gg_._orientation_vertical_1ji8l_gg_{width:12px}.___SScrollAreaBar_1ji8l_gg_._orientation_horizontal_1ji8l_gg_{margin-left:calc(var(--left_1b2nebp) + 4px);margin-right:calc(var(--right_1b2nebp) + 4px);width:calc(100% - var(--offsetSum_1b2nebp) - 8px)}"
|
|
38
38
|
/*__inner_css_end__*/
|
|
39
39
|
, "1b2nebp_gg_")
|
|
40
40
|
/*__reshadow_css_end__*/
|
package/lib/es6/Head.js
CHANGED
|
@@ -21,8 +21,8 @@ import React from 'react';
|
|
|
21
21
|
import { Component, sstyled, Root } from '@semcore/core';
|
|
22
22
|
import { Box, Flex } from '@semcore/flex-box';
|
|
23
23
|
import ScrollArea from '@semcore/scroll-area';
|
|
24
|
-
import
|
|
25
|
-
import
|
|
24
|
+
import SortDesc from '@semcore/icon/SortDesc/m';
|
|
25
|
+
import SortAsc from '@semcore/icon/SortAsc/m';
|
|
26
26
|
import { callAllEventHandlers } from '@semcore/utils/lib/assignProps';
|
|
27
27
|
import { flattenColumns, getFixedStyle, getScrollOffsetValue } from './utils';
|
|
28
28
|
import logger from '@semcore/utils/lib/logger';
|
|
@@ -42,8 +42,8 @@ _sstyled.insert(
|
|
|
42
42
|
"--right": "--right_1jfuf14"
|
|
43
43
|
});
|
|
44
44
|
var SORTING_ICON = {
|
|
45
|
-
desc:
|
|
46
|
-
asc:
|
|
45
|
+
desc: SortDesc,
|
|
46
|
+
asc: SortAsc
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
var Head = /*#__PURE__*/function (_Component) {
|
package/lib/es6/Head.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Head.js"],"names":["React","Component","sstyled","Root","Box","Flex","ScrollArea","
|
|
1
|
+
{"version":3,"sources":["../../src/Head.js"],"names":["React","Component","sstyled","Root","Box","Flex","ScrollArea","SortDesc","SortAsc","callAllEventHandlers","flattenColumns","getFixedStyle","getScrollOffsetValue","logger","SORTING_ICON","desc","asc","Head","name","e","asProps","$onSortClick","keyCode","columns","width","map","column","renderColumn","styles","use","hidden","SColumn","SHead","SSortIcon","sortDirection","isGroup","cSize","length","value","style","props","flex","undefined","fixed","resizable","sortable","active","onClick","bindHandlerSortClick","onKeyDown","bindHandlerKeyDown","children","renderColumns","Children","columnsChildren","onResize","$scrollRef","sticky","SHeadWrapper","offsetLeftSum","offsetRightSum","warn","displayName","scrollStyles","origin"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,SAAT,EAAoBC,OAApB,EAA6BC,IAA7B,QAAyC,eAAzC;AACA,SAASC,GAAT,EAAcC,IAAd,QAA0B,mBAA1B;AACA,OAAOC,UAAP,MAAuB,sBAAvB;AACA,OAAOC,QAAP,MAAqB,0BAArB;AACA,OAAOC,OAAP,MAAoB,yBAApB;AACA,SAASC,oBAAT,QAAqC,gCAArC;AACA,SAASC,cAAT,EAAyBC,aAAzB,EAAwCC,oBAAxC,QAAoE,SAApE;AACA,OAAOC,MAAP,MAAmB,2BAAnB;;;;;;;;;;;;;;;;AAIA,IAAMC,YAAY,GAAG;AACnBC,EAAAA,IAAI,EAAER,QADa;AAEnBS,EAAAA,GAAG,EAAER;AAFc,CAArB;;IAKMS,I;;;;;;;;;;;;;;;;8DACM,E;;2EAEa,UAACC,IAAD;AAAA,aAAU,UAACC,CAAD,EAAO;AACtC,cAAKC,OAAL,CAAaC,YAAb,CAA0BH,IAA1B,EAAgCC,CAAhC;AACD,OAFsB;AAAA,K;;yEAIF,UAACD,IAAD;AAAA,aAAU,UAACC,CAAD,EAAO;AACpC,YAAIA,CAAC,CAACG,OAAF,KAAc,EAAlB,EAAsB;AACpB,gBAAKF,OAAL,CAA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;AAAA,UAE0DC,MAF1D,kBAE0DA,MAF1D;AAGP,UAAMC,YAAY,GAAGtD,GAArB;AAEA,WAAKmB,OAAL,GAAeb,cAAc,CAAC4C,eAAD,CAA7B;;AALO,kCAOiC1C,oBAAoB,CAAC,KAAKW,OAAN,CAPrD;AAAA;AAAA,UAOAoC,aAPA;AAAA,UAOeC,cAPf;;AASP/C,MAAAA,MAAM,CAACgD,IAAP,CACEJ,MADF,EAEE,0DAFF,EAGE,KAAKrC,OAAL,CAAa,cAAb,KAAgCH,IAAI,CAAC6C,WAHvC;AAMA,qBAAO5D,OAAO,CAAC0B,MAAD,CAAd,eACE,oBAAC,YAAD;AAAA,kBAAsB6B;AAAtB,uBACE,oBAAC,UAAD;AAAA,kBACUM,YADV;AAAA,8BAEeJ,aAFf;AAAA,+BAGgBC,cAHhB;AAAA;AAAA,oBAKYL;AALZ,uBAOE,oBAAC,UAAD,CAAY,SAAZ;AAAsB,QAAA,GAAG,EAAEC;AAA3B,sBACE,oBAAC,KAAD,gEACG,KAAKJ,aAAL,CAAmBE,eAAnB,EAAoC,MAAM,KAAK/B,OAAL,CAAac,MAAvD,CADH,CADF,CAPF,CADF,EAcGgB,QAAQ,CAACW,MAdZ,CADF;AAkBD;;;;EAvGgB/D,S;;AA0GnB,eAAegB,IAAf","sourcesContent":["import React from 'react';\nimport { Component, sstyled, Root } from '@semcore/core';\nimport { Box, Flex } from '@semcore/flex-box';\nimport ScrollArea from '@semcore/scroll-area';\nimport SortDesc from '@semcore/icon/SortDesc/m';\nimport SortAsc from '@semcore/icon/SortAsc/m';\nimport { callAllEventHandlers } from '@semcore/utils/lib/assignProps';\nimport { flattenColumns, getFixedStyle, getScrollOffsetValue } from './utils';\nimport logger from '@semcore/utils/lib/logger';\n\nimport scrollStyles from './style/scroll-area.shadow.css';\n\nconst SORTING_ICON = {\n desc: SortDesc,\n asc: SortAsc,\n};\n\nclass Head extends Component {\n columns = [];\n\n bindHandlerSortClick = (name) => (e) => {\n this.asProps.$onSortClick(name, e);\n };\n\n bindHandlerKeyDown = (name) => (e) => {\n if (e.keyCode === 13) {\n this.asProps.$onSortClick(name, e);\n }\n };\n\n renderColumns(columns, width) {\n return columns.map((column) => this.renderColumn(column, width));\n }\n\n renderColumn(column, width) {\n const { styles, use, hidden } = this.asProps;\n const SColumn = Flex;\n const SHead = Box;\n const SSortIcon = SORTING_ICON[column.sortDirection];\n const isGroup = !!column.columns;\n const cSize = isGroup ? flattenColumns(column.columns).length : 1;\n const [name, value] = getFixedStyle(column, this.columns);\n const style = {\n [name]: value,\n flexBasis: column.props.flex === undefined && `${width * cSize}%`,\n ...column.props.style,\n };\n\n return sstyled(styles)(\n <SColumn\n key={column.name}\n use={use}\n fixed={column.fixed}\n resizable={column.resizable}\n sortable={column.sortable}\n active={column.active}\n group={isGroup}\n tabIndex={column.sortable && 0}\n {...column.props}\n onClick={callAllEventHandlers(\n column.props.onClick,\n column.sortable ? this.bindHandlerSortClick(column.name) : undefined,\n )}\n onKeyDown={callAllEventHandlers(\n column.props.onKeyDown,\n column.sortable ? this.bindHandlerKeyDown(column.name) : undefined,\n )}\n style={style}\n hidden={hidden}\n >\n {isGroup ? (\n <>\n <SColumn groupHead use={use}>\n <div>{column.props.children}</div>\n </SColumn>\n <SHead>{this.renderColumns(column.columns, 100 / cSize)}</SHead>\n </>\n ) : (\n <>\n <div>{column.props.children}</div>\n {column.sortable ? <SSortIcon active={column.active} /> : null}\n </>\n )}\n </SColumn>,\n );\n }\n\n render() {\n const SHead = Root;\n const { Children, styles, columnsChildren, onResize, $scrollRef, sticky } = this.asProps;\n const SHeadWrapper = Box;\n\n this.columns = flattenColumns(columnsChildren);\n\n const [offsetLeftSum, offsetRightSum] = getScrollOffsetValue(this.columns);\n\n logger.warn(\n sticky,\n \"'sticky' property is deprecated, use '<Sticky/>' wrapper\",\n this.asProps['data-ui-name'] || Head.displayName,\n );\n\n return sstyled(styles)(\n <SHeadWrapper sticky={sticky}>\n <ScrollArea\n styles={scrollStyles}\n use:left={`${offsetLeftSum}px`}\n use:right={`${offsetRightSum}px`}\n shadow\n onResize={onResize}\n >\n <ScrollArea.Container ref={$scrollRef}>\n <SHead render={Box}>\n {this.renderColumns(columnsChildren, 100 / this.columns.length)}\n </SHead>\n </ScrollArea.Container>\n </ScrollArea>\n {Children.origin}\n </SHeadWrapper>,\n );\n }\n}\n\nexport default Head;\n"],"file":"Head.js"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/data-table",
|
|
3
3
|
"description": "SEMRush DataTable Component",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.5.0",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@semcore/utils": "^3.22",
|
|
17
17
|
"@semcore/flex-box": "^4",
|
|
18
|
-
"@semcore/icon": "^2",
|
|
18
|
+
"@semcore/icon": "^2.16",
|
|
19
19
|
"@semcore/scroll-area": "^3.2"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
package/src/Head.js
CHANGED
|
@@ -2,8 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import { Component, sstyled, Root } from '@semcore/core';
|
|
3
3
|
import { Box, Flex } from '@semcore/flex-box';
|
|
4
4
|
import ScrollArea from '@semcore/scroll-area';
|
|
5
|
-
import
|
|
6
|
-
import
|
|
5
|
+
import SortDesc from '@semcore/icon/SortDesc/m';
|
|
6
|
+
import SortAsc from '@semcore/icon/SortAsc/m';
|
|
7
7
|
import { callAllEventHandlers } from '@semcore/utils/lib/assignProps';
|
|
8
8
|
import { flattenColumns, getFixedStyle, getScrollOffsetValue } from './utils';
|
|
9
9
|
import logger from '@semcore/utils/lib/logger';
|
|
@@ -11,8 +11,8 @@ import logger from '@semcore/utils/lib/logger';
|
|
|
11
11
|
import scrollStyles from './style/scroll-area.shadow.css';
|
|
12
12
|
|
|
13
13
|
const SORTING_ICON = {
|
|
14
|
-
desc:
|
|
15
|
-
asc:
|
|
14
|
+
desc: SortDesc,
|
|
15
|
+
asc: SortAsc,
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
class Head extends Component {
|