@semcore/data-table 16.0.1 → 16.0.2-prerelease.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/lib/cjs/components/Body/Body.js +73 -43
- package/lib/cjs/components/Body/Body.js.map +1 -1
- package/lib/cjs/components/Body/Body.types.js.map +1 -1
- package/lib/cjs/components/Body/Cell.js +95 -45
- package/lib/cjs/components/Body/Cell.js.map +1 -1
- package/lib/cjs/components/Body/Cell.types.js.map +1 -1
- package/lib/cjs/components/Body/Row.js +61 -45
- package/lib/cjs/components/Body/Row.js.map +1 -1
- package/lib/cjs/components/Body/Row.types.js.map +1 -1
- package/lib/cjs/components/Body/style.shadow.css +56 -47
- package/lib/cjs/components/DataTable/DataTable.js +30 -28
- package/lib/cjs/components/DataTable/DataTable.js.map +1 -1
- package/lib/cjs/components/DataTable/DataTable.types.js.map +1 -1
- package/lib/cjs/components/Head/Column.js +22 -22
- package/lib/cjs/components/Head/Column.types.js.map +1 -1
- package/lib/cjs/components/Head/Group.js +22 -22
- package/lib/cjs/components/Head/Head.js +22 -22
- package/lib/es6/components/Body/Body.js +73 -43
- package/lib/es6/components/Body/Body.js.map +1 -1
- package/lib/es6/components/Body/Body.types.js.map +1 -1
- package/lib/es6/components/Body/Cell.js +96 -46
- package/lib/es6/components/Body/Cell.js.map +1 -1
- package/lib/es6/components/Body/Cell.types.js.map +1 -1
- package/lib/es6/components/Body/Row.js +61 -45
- package/lib/es6/components/Body/Row.js.map +1 -1
- package/lib/es6/components/Body/Row.types.js.map +1 -1
- package/lib/es6/components/Body/style.shadow.css +56 -47
- package/lib/es6/components/DataTable/DataTable.js +30 -28
- package/lib/es6/components/DataTable/DataTable.js.map +1 -1
- package/lib/es6/components/DataTable/DataTable.types.js.map +1 -1
- package/lib/es6/components/Head/Column.js +22 -22
- package/lib/es6/components/Head/Column.types.js.map +1 -1
- package/lib/es6/components/Head/Group.js +22 -22
- package/lib/es6/components/Head/Head.js +22 -22
- package/lib/esm/components/Body/Body.mjs +73 -45
- package/lib/esm/components/Body/Cell.mjs +80 -41
- package/lib/esm/components/Body/Row.mjs +57 -46
- package/lib/esm/components/Body/style.shadow.css +56 -47
- package/lib/esm/components/DataTable/DataTable.mjs +31 -30
- package/lib/esm/components/Head/Column.mjs +23 -23
- package/lib/esm/components/Head/Group.mjs +23 -23
- package/lib/esm/components/Head/Head.mjs +23 -23
- package/lib/types/components/Body/Body.types.d.ts +1 -0
- package/lib/types/components/Body/Cell.types.d.ts +6 -1
- package/lib/types/components/Body/Row.types.d.ts +5 -0
- package/lib/types/components/DataTable/DataTable.types.d.ts +5 -0
- package/lib/types/components/Head/Column.types.d.ts +1 -1
- package/package.json +12 -12
- package/vite.config.ts +10 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Row.js","names":["React","Component","Root","sstyled","createComponent","Box","Collapse","style","_sstyled","insert","Body","ACCORDION","SELECT_ALL","MergedColumnsCell","MergedRowsCell","Checkbox","RowRoot","_Component","_inherits","_super","_createSuper","_this","_classCallCheck","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty","_assertThisInitialized","value","event","_this$asProps","asProps","row","rowIndex","onSelectRow","preventDefault","stopPropagation","_this$asProps2","e","key","onBackFromAccordion","cellIndex","_createClass","cellHasAccordion","cellValue","Boolean","render","_ref","_ref2","_this2","_scrollAreaRef$curren","_row$ACCORDION","SRow","SCollapseRow","SCell","Cell","SCheckboxCell","_this$asProps3","columns","styles","ariaRowIndex","gridRowIndex","expanded","accordionDataGridArea","expandedRows","onExpandRow","_this$asProps3$ariaL","ariaLevel","scrollAreaRef","selectedRows","uid","getFixedStyle","mergedRow","accordion","accordionType","undefined","cells","Object","values","cellWithAccordionIndex","findIndex","cellWithAccordion","createElement","Fragment","cn","_objectSpread","_assignProps","includes","map","column","i","_ref3","checked","name","toString","handleClickCheckbox","handleSelectRow","index","fixed","_getFixedStyle","_getFixedStyle2","_slicedToArray","id","accordionId","columnIndex","withAccordion","isValidElement","current","clientWidth","handleBackFromAccordion","isArray","subrow","Row","rows","isAccordionRow","parent"],"sources":["../../../../src/components/Body/Row.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Component, Root, sstyled, createComponent } from '@semcore/core';\nimport { DataTableRowProps, RowPropsInner } from './Row.types';\nimport { Box, Collapse } from '@semcore/base-components';\nimport style from './style.shadow.css';\nimport { Body } from './Body';\nimport { ACCORDION, SELECT_ALL } from '../DataTable/DataTable';\nimport { MergedColumnsCell, MergedRowsCell } from './MergedCells';\nimport { DTValue } from '../DataTable/DataTable.types';\nimport Checkbox from '@semcore/checkbox';\n\nclass RowRoot extends Component<DataTableRowProps, {}, {}, [], RowPropsInner> {\n static displayName = 'Row';\n static style = style;\n\n static defaultProps = {\n 'aria-level': undefined,\n };\n\n private cellIndex = -1;\n\n cellHasAccordion(cellValue?: DTValue | MergedColumnsCell | MergedRowsCell): cellValue is DTValue {\n return (\n !(cellValue instanceof MergedRowsCell || cellValue instanceof MergedColumnsCell) &&\n Boolean(cellValue?.[ACCORDION])\n );\n }\n\n handleSelectRow = (value: boolean, event?: React.SyntheticEvent<HTMLElement>) => {\n const { row, rowIndex, onSelectRow } = this.asProps;\n\n onSelectRow?.(value, rowIndex, row, event);\n };\n\n handleClickCheckbox = (value: boolean) => (event?: React.SyntheticEvent<HTMLElement>) => {\n event?.preventDefault();\n event?.stopPropagation();\n const { row, rowIndex, onSelectRow } = this.asProps;\n\n onSelectRow?.(value, rowIndex, row, event);\n };\n\n handleBackFromAccordion = (e: React.KeyboardEvent) => {\n if (e.key === 'Escape') {\n this.asProps.onBackFromAccordion(this.cellIndex);\n }\n };\n\n render() {\n const SRow = Root;\n const SCollapseRow = Collapse;\n const SCell = Body.Cell;\n const SCheckboxCell = Body.Cell;\n const {\n columns,\n row,\n styles,\n rowIndex,\n ariaRowIndex,\n gridRowIndex,\n expanded,\n accordionDataGridArea,\n expandedRows,\n onExpandRow,\n 'aria-level': ariaLevel = 1,\n scrollAreaRef,\n selectedRows,\n uid,\n getFixedStyle,\n mergedRow,\n } = this.asProps;\n\n let accordion = row[ACCORDION];\n const accordionType = accordion && !mergedRow ? 'row' : undefined;\n\n if (!accordion) {\n const cells = Object.values(row);\n const cellWithAccordionIndex = cells.findIndex((value) => {\n return this.cellHasAccordion(value);\n });\n\n this.cellIndex = cellWithAccordionIndex;\n\n const cellWithAccordion = cells[cellWithAccordionIndex] as DTValue | undefined;\n\n accordion = cellWithAccordion?.[ACCORDION];\n }\n\n return sstyled(styles)(\n <>\n <SRow\n render={Box}\n role={'row'}\n aria-rowindex={ariaRowIndex}\n accordionType={accordionType}\n theme={selectedRows?.includes(rowIndex) ? 'info' : undefined}\n use:expanded={expanded && !mergedRow}\n >\n {columns.map((column, i) => {\n if (selectedRows && i === 0) {\n const checked = selectedRows.includes(rowIndex);\n return sstyled(styles)(\n <SCheckboxCell\n key={i}\n row={row}\n rowIndex={rowIndex}\n // @ts-ignore\n column={{ name: SELECT_ALL.toString() }}\n columnIndex={0}\n gridRowIndex={gridRowIndex}\n onClick={this.handleClickCheckbox(!checked)}\n >\n <Checkbox\n checked={checked}\n aria-labelledby={`${uid}_${ariaRowIndex}_1`}\n onChange={this.handleSelectRow}\n />\n </SCheckboxCell>,\n );\n }\n\n const index = i;\n const cellValue: DTValue | MergedRowsCell | MergedColumnsCell | undefined =\n row[column.name];\n\n if (cellValue === undefined) {\n return null;\n }\n\n const style: React.CSSProperties = {};\n\n if (column.fixed) {\n const [name, value] = getFixedStyle(column);\n\n if (name !== undefined && value !== undefined) {\n style[name] = value;\n }\n }\n\n return (\n <Body.Cell\n key={index}\n id={`${uid}_${ariaRowIndex}_${index}`}\n accordionId={`${uid}_${ariaRowIndex + 1}`}\n data-aria-level={index === 0 ? ariaLevel : undefined}\n row={row}\n rowIndex={rowIndex}\n gridRowIndex={gridRowIndex}\n columnIndex={index}\n style={style}\n column={column}\n withAccordion={\n Boolean(cellValue instanceof MergedRowsCell && cellValue.accordion) ||\n this.cellHasAccordion(cellValue)\n }\n />\n );\n })}\n </SRow>\n\n {React.isValidElement(accordion) && (\n <SCollapseRow\n key={rowIndex}\n role={'row'}\n aria-rowindex={ariaRowIndex + 1}\n id={`${uid}_${ariaRowIndex + 1}`}\n visible={expanded}\n interactive\n gridArea={accordionDataGridArea}\n duration={200}\n zIndex={5}\n >\n <SCell\n aria-colindex={1}\n aria-level={ariaLevel + 1}\n aria-setsize={1}\n aria-posinset={1}\n row={row}\n rowIndex={rowIndex + 1}\n columnIndex={1}\n // @ts-ignore\n column={{ name: ACCORDION }}\n position={'sticky'}\n left={0}\n w={scrollAreaRef.current?.clientWidth}\n onKeyDown={this.handleBackFromAccordion}\n >\n {accordion}\n </SCell>\n </SCollapseRow>\n )}\n\n {row[ACCORDION] &&\n Array.isArray(row[ACCORDION]) &&\n expanded &&\n row[ACCORDION]?.map((subrow, i) => {\n return (\n <Row\n key={i}\n row={subrow}\n columns={columns}\n rows={row[ACCORDION]}\n rowIndex={rowIndex}\n aria-posinset={i + 1}\n aria-level={ariaLevel + 1}\n ariaRowIndex={ariaRowIndex + 1 + i}\n gridRowIndex={gridRowIndex + 1 + i}\n isAccordionRow={true}\n getFixedStyle={getFixedStyle}\n />\n );\n })}\n </>,\n );\n }\n}\n\n// @ts-ignore\nexport const Row = createComponent(RowRoot, {}, { parent: Body });\n"],"mappings":";;;;;;;;;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,SAAS,EAAEC,IAAI,EAAEC,OAAO,EAAEC,eAAe,QAAQ,eAAe;AAEzE,SAASC,GAAG,EAAEC,QAAQ,QAAQ,0BAA0B;AAAC;AAAA,IAAAC,KAAA,+BAAAC,QAAA,CAAAC,MAAA;AAAA;AAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EA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,CAAE;UACrB4B,QAAQ,EAAEA,QAAS;UACnB,iBAAeyD,CAAC,GAAG,CAAE;UACrB,cAAYvB,SAAS,GAAG,CAAE;UAC1BP,YAAY,EAAEA,YAAY,GAAG,CAAC,GAAG8B,CAAE;UACnC7B,YAAY,EAAEA,YAAY,GAAG,CAAC,GAAG6B,CAAE;UACnCwB,cAAc,EAAE,IAAK;UACrB3C,aAAa,EAAEA;QAAc,EAC7B;MAEN,CAAC,CAAC,EACH;IAEP;EAAC;EAAA,OAAA7D,OAAA;AAAA,EA3MmBf,SAAS,GA8M/B;AAAA+B,eAAA,CA9MMhB,OAAO,iBACU,KAAK;AAAAgB,eAAA,CADtBhB,OAAO,WAEIT,KAAK;AAAAyB,eAAA,CAFhBhB,OAAO,kBAIW;EACpB,YAAY,EAAEiE;AAChB,CAAC;AAyMH,OAAO,IAAMqC,GAAG,GAAGlH,eAAe,CAACY,OAAO,EAAE,CAAC,CAAC,EAAE;EAAEyG,MAAM,EAAE/G;AAAK,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"Row.js","names":["React","Component","Root","sstyled","createComponent","Box","Collapse","style","_sstyled","insert","Body","ACCORDION","SELECT_ALL","MergedColumnsCell","MergedRowsCell","Checkbox","RowRoot","_Component","_inherits","_super","_createSuper","_this","_classCallCheck","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty","_assertThisInitialized","value","event","_this$asProps","asProps","row","rowIndex","onSelectRow","preventDefault","stopPropagation","_this$asProps2","e","key","onBackFromAccordion","cellIndex","_createClass","cellHasAccordion","cellValue","Boolean","render","_ref","_ref2","_this2","_scrollAreaRef$curren","SRow","SCollapseRow","SAccordionRows","SCell","Cell","SCheckboxCell","_this$asProps3","columns","rows","styles","ariaRowIndex","gridRowIndex","expanded","accordionDataGridArea","_this$asProps3$ariaL","ariaLevel","scrollAreaRef","selectedRows","uid","getFixedStyle","mergedRow","isAccordionRow","animationExpand","accordionRowIndex","accordionDuration","accordion","accordionType","undefined","cells","Object","values","cellWithAccordionIndex","findIndex","cellWithAccordion","accordionId","createElement","Fragment","cn","_objectSpread","_assignProps","includes","map","column","i","_ref3","checked","name","toString","handleClickCheckbox","handleSelectRow","index","fixed","_getFixedStyle","_getFixedStyle2","_slicedToArray","id","columnIndex","withAccordion","isValidElement","current","clientWidth","handleBackFromAccordion","isArray","subrow","Row","parent"],"sources":["../../../../src/components/Body/Row.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Component, Root, sstyled, createComponent } from '@semcore/core';\nimport { DataTableRowProps, RowPropsInner } from './Row.types';\nimport { Box, Collapse } from '@semcore/base-components';\nimport style from './style.shadow.css';\nimport { Body } from './Body';\nimport { ACCORDION, SELECT_ALL } from '../DataTable/DataTable';\nimport { MergedColumnsCell, MergedRowsCell } from './MergedCells';\nimport { DTValue } from '../DataTable/DataTable.types';\nimport Checkbox from '@semcore/checkbox';\n\nclass RowRoot extends Component<DataTableRowProps, {}, {}, [], RowPropsInner> {\n static displayName = 'Row';\n static style = style;\n\n static defaultProps = {\n 'aria-level': undefined,\n };\n\n private cellIndex = -1;\n\n cellHasAccordion(cellValue?: DTValue | MergedColumnsCell | MergedRowsCell): cellValue is DTValue {\n return (\n !(cellValue instanceof MergedRowsCell || cellValue instanceof MergedColumnsCell) &&\n Boolean(cellValue?.[ACCORDION])\n );\n }\n\n handleSelectRow = (value: boolean, event?: React.SyntheticEvent<HTMLElement>) => {\n const { row, rowIndex, onSelectRow } = this.asProps;\n\n onSelectRow?.(value, rowIndex, row, event);\n };\n\n handleClickCheckbox = (value: boolean) => (event?: React.SyntheticEvent<HTMLElement>) => {\n event?.preventDefault();\n event?.stopPropagation();\n const { row, rowIndex, onSelectRow } = this.asProps;\n\n onSelectRow?.(value, rowIndex, row, event);\n };\n\n handleBackFromAccordion = (e: React.KeyboardEvent) => {\n if (e.key === 'Escape') {\n this.asProps.onBackFromAccordion(this.cellIndex);\n }\n };\n\n render() {\n const SRow = Root;\n const SCollapseRow = Collapse;\n const SAccordionRows = Box;\n const SCell = Body.Cell;\n const SCheckboxCell = Body.Cell;\n const {\n columns,\n row,\n rows,\n styles,\n rowIndex,\n ariaRowIndex,\n gridRowIndex,\n expanded,\n accordionDataGridArea,\n 'aria-level': ariaLevel = 1,\n scrollAreaRef,\n selectedRows,\n uid,\n getFixedStyle,\n mergedRow,\n isAccordionRow,\n animationExpand,\n accordionRowIndex,\n accordionDuration,\n } = this.asProps;\n\n let accordion = row[ACCORDION];\n const accordionType = accordion && !mergedRow ? 'row' : undefined;\n\n if (!accordion) {\n const cells = Object.values(row);\n const cellWithAccordionIndex = cells.findIndex((value) => {\n return this.cellHasAccordion(value);\n });\n\n this.cellIndex = cellWithAccordionIndex;\n\n const cellWithAccordion = cells[cellWithAccordionIndex] as DTValue | undefined;\n\n accordion = cellWithAccordion?.[ACCORDION];\n }\n\n const accordionId = `${uid}_${ariaRowIndex + 1}`;\n\n return sstyled(styles)(\n <>\n <SRow\n render={Box}\n role={'row'}\n aria-rowindex={ariaRowIndex}\n accordionType={accordionType}\n theme={selectedRows?.includes(rowIndex) ? 'info' : undefined}\n use:expanded={expanded && !mergedRow}\n >\n {columns.map((column, i) => {\n if (selectedRows && i === 0) {\n const checked = selectedRows.includes(rowIndex);\n return sstyled(styles)(\n <SCheckboxCell\n key={i}\n row={row}\n rowIndex={rowIndex}\n // @ts-ignore\n column={{ name: SELECT_ALL.toString() }}\n columnIndex={0}\n gridRowIndex={gridRowIndex}\n onClick={this.handleClickCheckbox(!checked)}\n >\n <Checkbox\n checked={checked}\n aria-labelledby={`${uid}_${ariaRowIndex}_1`}\n onChange={this.handleSelectRow}\n />\n </SCheckboxCell>,\n );\n }\n\n const index = i;\n const cellValue: DTValue | MergedRowsCell | MergedColumnsCell | undefined =\n row[column.name];\n\n if (cellValue === undefined) {\n return null;\n }\n\n const style: React.CSSProperties = {};\n\n if (column.fixed) {\n const [name, value] = getFixedStyle(column);\n\n if (name !== undefined && value !== undefined) {\n style[name] = value;\n }\n }\n\n return (\n <Body.Cell\n key={index}\n id={`${uid}_${ariaRowIndex}_${index}`}\n accordionId={accordionId}\n data-aria-level={index === 0 ? ariaLevel : undefined}\n row={row}\n rowIndex={rowIndex}\n gridRowIndex={gridRowIndex}\n columnIndex={index}\n style={style}\n column={column}\n withAccordion={\n Boolean(cellValue instanceof MergedRowsCell && cellValue.accordion) ||\n this.cellHasAccordion(cellValue)\n }\n isAccordionRow={isAccordionRow}\n animationExpand={animationExpand}\n accordionRowIndex={accordionRowIndex}\n rows={rows}\n />\n );\n })}\n </SRow>\n\n {React.isValidElement(accordion) && (\n <SCollapseRow\n key={rowIndex}\n role={'row'}\n aria-rowindex={ariaRowIndex + 1}\n id={accordionId}\n visible={expanded}\n interactive\n gridArea={accordionDataGridArea}\n duration={accordionDuration ?? 200}\n zIndex={5}\n >\n <SCell\n aria-colindex={1}\n aria-level={ariaLevel + 1}\n aria-setsize={1}\n aria-posinset={1}\n row={row}\n rowIndex={rowIndex + 1}\n columnIndex={1}\n // @ts-ignore\n column={{ name: ACCORDION }}\n position={'sticky'}\n left={0}\n w={scrollAreaRef.current?.clientWidth}\n onKeyDown={this.handleBackFromAccordion}\n >\n {accordion}\n </SCell>\n </SCollapseRow>\n )}\n\n {row[ACCORDION] && Array.isArray(row[ACCORDION]) && (\n <SAccordionRows id={accordionId} role='rowgroup'>\n {row[ACCORDION].map((subrow, i) => {\n return (\n <Row\n key={i}\n row={subrow}\n columns={columns}\n rows={row[ACCORDION]}\n rowIndex={rowIndex}\n aria-hidden={!expanded}\n aria-posinset={i + 1}\n aria-level={ariaLevel + 1}\n ariaRowIndex={ariaRowIndex + 1 + i}\n gridRowIndex={gridRowIndex + 1 + i}\n isAccordionRow={true}\n getFixedStyle={getFixedStyle}\n animationExpand={expanded}\n accordionRowIndex={i}\n />\n );\n })}\n </SAccordionRows>\n )}\n </>,\n );\n }\n}\n\n// @ts-ignore\nexport const Row = createComponent(RowRoot, {}, { parent: Body });\n"],"mappings":";;;;;;;;;;AAAA,OAAO,KAAKA,KA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,KAAK;AAAAyB,eAAA,CAFhBhB,OAAO,kBAIW;EACpB,YAAY,EAAEoE;AAChB,CAAC;AAuNH,OAAO,IAAMqC,GAAG,GAAGrH,eAAe,CAACY,OAAO,EAAE,CAAC,CAAC,EAAE;EAAE0G,MAAM,EAAEhH;AAAK,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Row.types.js","names":["ACCORDION","ROW_GROUP","ROW_INDEX","UNIQ_ROW_KEY"],"sources":["../../../../src/components/Body/Row.types.ts"],"sourcesContent":["import { DTValue, DTUse, DataTableData } from '../DataTable/DataTable.types';\nimport { DTColumn } from '../Head/Column.types';\nimport { MergedColumnsCell, MergedRowsCell } from './MergedCells';\nimport { ACCORDION, ROW_GROUP, ROW_INDEX, UNIQ_ROW_KEY } from '../DataTable/DataTable';\n\nexport type UniqRowKey = string;\n\nexport type DTRow = {\n [UNIQ_ROW_KEY]: UniqRowKey;\n [ROW_INDEX]: number;\n [key: string]: DTValue | MergedRowsCell | MergedColumnsCell;\n [ACCORDION]?: React.ReactNode | DataTableData | undefined;\n [ROW_GROUP]?: Set<UniqRowKey>;\n};\nexport type DTRows = Array<DTRow | DTRow[]>;\n\nexport type DataTableRowProps = {\n row: DTRow;\n mergedRow?: boolean;\n};\n\nexport type RowPropsInner = JSX.IntrinsicElements['div'] & {\n use: DTUse;\n /**\n * Expanded flag for rows with accordion\n * @default false\n */\n expanded?: boolean;\n\n /**\n * Flag to show is row in a merged list or not.\n */\n mergedRow?: boolean;\n\n columns: DTColumn[];\n row: DTRow | DTRow[];\n rows: DTRows;\n rowIndex: number; // from 0\n ariaRowIndex: number; // from 1 + 1 header\n gridRowIndex: number; // from 1 + 1 (or 2 if it has group) header\n\n expandedRows: Set<string>;\n onExpandRow: (expandedRow: DTRow) => void;\n\n gridTemplateAreas: string[];\n gridTemplateColumns: string[];\n accordionDataGridArea: string;\n\n selectedRows?: number[];\n onSelectRow?: (\n isSelect: boolean,\n selectedRowIndex: number,\n row: DTRow,\n event?: React.SyntheticEvent<HTMLElement>,\n ) => void;\n\n inert?: '';\n\n onBackFromAccordion: (colIndex: number) => void;\n\n scrollAreaRef: React.RefObject<HTMLDivElement>;\n uid: string;\n sideIndents?: 'wide';\n getFixedStyle: (\n cell: Pick<DTColumn, 'name' | 'fixed'>,\n ) => [side: 'left' | 'right', style: string | number] | [side: undefined, style: undefined];\n};\n"],"mappings":"AAGA,SAASA,SAAS,EAAEC,SAAS,EAAEC,SAAS,EAAEC,YAAY,QAAQ,wBAAwB"}
|
|
1
|
+
{"version":3,"file":"Row.types.js","names":["ACCORDION","ROW_GROUP","ROW_INDEX","UNIQ_ROW_KEY"],"sources":["../../../../src/components/Body/Row.types.ts"],"sourcesContent":["import { DTValue, DTUse, DataTableData } from '../DataTable/DataTable.types';\nimport { DTColumn } from '../Head/Column.types';\nimport { MergedColumnsCell, MergedRowsCell } from './MergedCells';\nimport { ACCORDION, ROW_GROUP, ROW_INDEX, UNIQ_ROW_KEY } from '../DataTable/DataTable';\nimport { DataTableCellProps } from './Cell.types';\n\nexport type UniqRowKey = string;\n\nexport type DTRow = {\n [UNIQ_ROW_KEY]: UniqRowKey;\n [ROW_INDEX]: number;\n [key: string]: DTValue | MergedRowsCell | MergedColumnsCell;\n [ACCORDION]?: React.ReactNode | DataTableData | undefined;\n [ROW_GROUP]?: Set<UniqRowKey>;\n};\nexport type DTRows = Array<DTRow | DTRow[]>;\n\nexport type DataTableRowProps = {\n row: DTRow;\n mergedRow?: boolean;\n\n isAccordionRow?: DataTableCellProps['isAccordionRow'];\n animationExpand?: DataTableCellProps['animationExpand'];\n accordionRowIndex?: DataTableCellProps['accordionRowIndex'];\n};\n\nexport type RowPropsInner = JSX.IntrinsicElements['div'] & {\n use: DTUse;\n /**\n * Expanded flag for rows with accordion\n * @default false\n */\n expanded?: boolean;\n\n /**\n * Flag to show is row in a merged list or not.\n */\n mergedRow?: boolean;\n\n columns: DTColumn[];\n row: DTRow | DTRow[];\n rows: DTRows;\n rowIndex: number; // from 0\n ariaRowIndex: number; // from 1 + 1 header\n gridRowIndex: number; // from 1 + 1 (or 2 if it has group) header\n\n expandedRows: Set<string>;\n onExpandRow: (expandedRow: DTRow) => void;\n\n gridTemplateAreas: string[];\n gridTemplateColumns: string[];\n accordionDataGridArea: string;\n\n selectedRows?: number[];\n onSelectRow?: (\n isSelect: boolean,\n selectedRowIndex: number,\n row: DTRow,\n event?: React.SyntheticEvent<HTMLElement>,\n ) => void;\n\n inert?: '';\n\n accordionDuration?: number | [number, number];\n onBackFromAccordion: (colIndex: number) => void;\n\n scrollAreaRef: React.RefObject<HTMLDivElement>;\n uid: string;\n sideIndents?: 'wide';\n getFixedStyle: (\n cell: Pick<DTColumn, 'name' | 'fixed'>,\n ) => [side: 'left' | 'right', style: string | number] | [side: undefined, style: undefined];\n};\n"],"mappings":"AAGA,SAASA,SAAS,EAAEC,SAAS,EAAEC,SAAS,EAAEC,YAAY,QAAQ,wBAAwB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
SBody, SRow, SRowGroup {
|
|
1
|
+
SBody, SRow, SRowGroup, SAccordionRows {
|
|
2
2
|
display: contents;
|
|
3
3
|
}
|
|
4
4
|
|
|
@@ -12,87 +12,96 @@ SBody[compact] {
|
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
SRow[gridArea],
|
|
15
|
+
SRow[gridArea], SCellWrapper[gridArea], SCollapseRow[gridArea] {
|
|
16
16
|
grid-area: var(--gridArea);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
SCellWrapper {
|
|
20
|
+
height: 100%;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
SCollapseRow[gridArea] > SCellWrapper > SCell,
|
|
24
|
+
SAccordionRows > SRow[isAccordionRow]:last-child > SCellWrapper > SCell {
|
|
25
|
+
border-bottom: 1px solid var(--intergalactic-border-table-accent, #a9abb6);
|
|
26
|
+
}
|
|
27
|
+
|
|
19
28
|
SCollapseRow SCell {
|
|
20
29
|
display: block;
|
|
21
30
|
}
|
|
22
31
|
|
|
23
32
|
/* DEFAULT THEME */
|
|
24
|
-
SRow[active] > SCell:not([theme]) {
|
|
33
|
+
SRow[active] > SCellWrapper > SCell:not([theme]) {
|
|
25
34
|
/* The color is hardcoded because need hex(in figma rgba) */
|
|
26
35
|
/* disable-tokens-validator */
|
|
27
36
|
background-color: var(--intergalactic-table-td-cell-active, #e6e7ed);
|
|
28
37
|
}
|
|
29
38
|
|
|
30
|
-
SRow[accordionType='row'][expanded] > SCell:not([theme]),
|
|
39
|
+
SRow[accordionType='row'][expanded] > SCellWrapper > SCell:not([theme]),
|
|
31
40
|
SCell:not([theme])[expanded][withAccordion] {
|
|
32
41
|
background-color: var(--intergalactic-table-td-cell-active, #e6e7ed);
|
|
33
42
|
}
|
|
34
43
|
|
|
35
|
-
SCollapseRow > SCell:not([theme]), SRow[isAccordionRow] > SCell:not([theme]) {
|
|
44
|
+
SCollapseRow > SCellWrapper > SCell:not([theme]), SRow[isAccordionRow] > SCellWrapper > SCell:not([theme]) {
|
|
36
45
|
background-color: var(--intergalactic-table-td-cell-accordion, #f4f5f9);
|
|
37
46
|
}
|
|
38
47
|
|
|
39
48
|
/* we need a media query here because of the postcssHoverMediaFeature plugin. it doesn't handle this type of selectors correctly */
|
|
40
49
|
@media (hover: hover) {
|
|
41
|
-
SRow:not([accordionType='row'][expanded]):hover > SCell:not([theme]):not([expanded][withAccordion]),
|
|
42
|
-
SRowGroup:has(SCell[data-grouped-by='rowgroup']:hover) > SRow > SCell:not([theme]):not([expanded][withAccordion]),
|
|
43
|
-
SRowGroup:has(SCell:hover) > SRow > SCell[data-grouped-by='rowgroup']:not([theme]):not([expanded][withAccordion]) {
|
|
50
|
+
SRow:not([accordionType='row'][expanded]):hover > SCellWrapper > SCell:not([theme]):not([expanded][withAccordion]),
|
|
51
|
+
SRowGroup:has(SCell[data-grouped-by='rowgroup']:hover) > SRow > SCellWrapper > SCell:not([theme]):not([expanded][withAccordion]),
|
|
52
|
+
SRowGroup:has(SCell:hover) > SRow > SCellWrapper > SCell[data-grouped-by='rowgroup']:not([theme]):not([expanded][withAccordion]) {
|
|
44
53
|
background-color: var(--intergalactic-table-td-cell-hover, #f0f0f4);
|
|
45
54
|
}
|
|
46
55
|
|
|
47
56
|
/* MUTED THEME */
|
|
48
|
-
SRow:hover > SCell[theme='muted'],
|
|
49
|
-
SRow[theme='muted']:hover > SCell:not([theme]),
|
|
50
|
-
SRowGroup:has(SCell[data-grouped-by='rowgroup']:hover) > SRow > SCell[theme='muted'],
|
|
51
|
-
SRowGroup:has(SCell[data-grouped-by='rowgroup']:hover) > SRow[theme='muted'] > SCell:not([theme]),
|
|
52
|
-
SRowGroup:has(SCell:hover) > SRow > SCell[data-grouped-by='rowgroup'][theme='muted'],
|
|
53
|
-
SRowGroup:has(SCell:hover) > SRow[theme='muted'] > SCell[data-grouped-by='rowgroup']:not([theme]) {
|
|
57
|
+
SRow:hover > SCellWrapper > SCell[theme='muted'],
|
|
58
|
+
SRow[theme='muted']:hover > SCellWrapper > SCell:not([theme]),
|
|
59
|
+
SRowGroup:has(SCell[data-grouped-by='rowgroup']:hover) > SRow > SCellWrapper > SCell[theme='muted'],
|
|
60
|
+
SRowGroup:has(SCell[data-grouped-by='rowgroup']:hover) > SRow[theme='muted'] > SCellWrapper > SCell:not([theme]),
|
|
61
|
+
SRowGroup:has(SCell:hover) > SRow > SCellWrapper > SCell[data-grouped-by='rowgroup'][theme='muted'],
|
|
62
|
+
SRowGroup:has(SCell:hover) > SRow[theme='muted'] > SCellWrapper > SCell[data-grouped-by='rowgroup']:not([theme]) {
|
|
54
63
|
/* The color is hardcoded because need hex(in figma rgba) */
|
|
55
64
|
/* disable-tokens-validator */
|
|
56
65
|
background-color: var(--intergalactic-table-td-cell-hover, #f0f0f4);
|
|
57
66
|
}
|
|
58
67
|
|
|
59
68
|
/* INFO THEME */
|
|
60
|
-
SRow:hover > SCell[theme='info'],
|
|
61
|
-
SRow[theme='info']:hover > SCell:not([theme]),
|
|
62
|
-
SRowGroup:has(SCell[data-grouped-by='rowgroup']:hover) > SRow > SCell[theme='info'],
|
|
63
|
-
SRowGroup:has(SCell[data-grouped-by='rowgroup']:hover) > SRow[theme='info'] > SCell:not([theme]),
|
|
64
|
-
SRowGroup:has(SCell:hover) > SRow > SCell[data-grouped-by='rowgroup'][theme='info'],
|
|
65
|
-
SRowGroup:has(SCell:hover) > SRow[theme='info'] > SCell[data-grouped-by='rowgroup']:not([theme]) {
|
|
69
|
+
SRow:hover > SCellWrapper > SCell[theme='info'],
|
|
70
|
+
SRow[theme='info']:hover > SCellWrapper > SCell:not([theme]),
|
|
71
|
+
SRowGroup:has(SCell[data-grouped-by='rowgroup']:hover) > SRow > SCellWrapper > SCell[theme='info'],
|
|
72
|
+
SRowGroup:has(SCell[data-grouped-by='rowgroup']:hover) > SRow[theme='info'] > SCellWrapper > SCell:not([theme]),
|
|
73
|
+
SRowGroup:has(SCell:hover) > SRow > SCellWrapper > SCell[data-grouped-by='rowgroup'][theme='info'],
|
|
74
|
+
SRowGroup:has(SCell:hover) > SRow[theme='info'] > SCellWrapper > SCell[data-grouped-by='rowgroup']:not([theme]) {
|
|
66
75
|
background-color: var(--intergalactic-table-td-cell-selected-hover, #c4e5fe);
|
|
67
76
|
}
|
|
68
77
|
|
|
69
78
|
/* SUCCESS THEME */
|
|
70
|
-
SRow:hover > SCell[theme='success'],
|
|
71
|
-
SRow[theme='success']:hover > SCell:not([theme]),
|
|
72
|
-
SRowGroup:has(SCell[data-grouped-by='rowgroup']:hover) > SRow > SCell[theme='success'],
|
|
73
|
-
SRowGroup:has(SCell[data-grouped-by='rowgroup']:hover) > SRow[theme='success'] > SCell:not([theme]),
|
|
74
|
-
SRowGroup:has(SCell:hover) > SRow > SCell[data-grouped-by='rowgroup'][theme='success'],
|
|
75
|
-
SRowGroup:has(SCell:hover) > SRow[theme='success'] > SCell[data-grouped-by='rowgroup']:not([theme]) {
|
|
79
|
+
SRow:hover > SCellWrapper > SCell[theme='success'],
|
|
80
|
+
SRow[theme='success']:hover > SCellWrapper > SCell:not([theme]),
|
|
81
|
+
SRowGroup:has(SCell[data-grouped-by='rowgroup']:hover) > SRow > SCellWrapper > SCell[theme='success'],
|
|
82
|
+
SRowGroup:has(SCell[data-grouped-by='rowgroup']:hover) > SRow[theme='success'] > SCellWrapper > SCell:not([theme]),
|
|
83
|
+
SRowGroup:has(SCell:hover) > SRow > SCellWrapper > SCell[data-grouped-by='rowgroup'][theme='success'],
|
|
84
|
+
SRowGroup:has(SCell:hover) > SRow[theme='success'] > SCellWrapper > SCell[data-grouped-by='rowgroup']:not([theme]) {
|
|
76
85
|
background-color: var(--intergalactic-table-td-cell-new-hover, #9ef2c9);
|
|
77
86
|
}
|
|
78
87
|
|
|
79
88
|
/* WARNING THEME */
|
|
80
|
-
SRow:hover > SCell[theme='warning'],
|
|
81
|
-
SRow[theme='warning']:hover > SCell:not([theme]),
|
|
82
|
-
SRowGroup:has(SCell[data-grouped-by='rowgroup']:hover) > SRow > SCell[theme='warning'],
|
|
83
|
-
SRowGroup:has(SCell[data-grouped-by='rowgroup']:hover) > SRow[theme='warning'] > SCell:not([theme]),
|
|
84
|
-
SRowGroup:has(SCell:hover) > SRow > SCell[data-grouped-by='rowgroup'][theme='warning'],
|
|
85
|
-
SRowGroup:has(SCell:hover) > SRow[theme='warning'] > SCell[data-grouped-by='rowgroup']:not([theme]) {
|
|
89
|
+
SRow:hover > SCellWrapper > SCell[theme='warning'],
|
|
90
|
+
SRow[theme='warning']:hover > SCellWrapper > SCell:not([theme]),
|
|
91
|
+
SRowGroup:has(SCell[data-grouped-by='rowgroup']:hover) > SRow > SCellWrapper > SCell[theme='warning'],
|
|
92
|
+
SRowGroup:has(SCell[data-grouped-by='rowgroup']:hover) > SRow[theme='warning'] > SCellWrapper > SCell:not([theme]),
|
|
93
|
+
SRowGroup:has(SCell:hover) > SRow > SCellWrapper > SCell[data-grouped-by='rowgroup'][theme='warning'],
|
|
94
|
+
SRowGroup:has(SCell:hover) > SRow[theme='warning'] > SCellWrapper > SCell[data-grouped-by='rowgroup']:not([theme]) {
|
|
86
95
|
background-color: var(--intergalactic-table-td-cell-warning-hover, #ffdca2);
|
|
87
96
|
}
|
|
88
97
|
|
|
89
98
|
/* DANGER THEME */
|
|
90
|
-
SRow:hover > SCell[theme='danger'],
|
|
91
|
-
SRow[theme='danger']:hover > SCell:not([theme]),
|
|
92
|
-
SRowGroup:has(SCell[data-grouped-by='rowgroup']:hover) > SRow > SCell[theme='danger'],
|
|
93
|
-
SRowGroup:has(SCell[data-grouped-by='rowgroup']:hover) > SRow[theme='danger'] > SCell:not([theme]),
|
|
94
|
-
SRowGroup:has(SCell:hover) > SRow > SCell[data-grouped-by='rowgroup'][theme='danger'],
|
|
95
|
-
SRowGroup:has(SCell:hover) > SRow[theme='danger'] > SCell[data-grouped-by='rowgroup']:not([theme]) {
|
|
99
|
+
SRow:hover > SCellWrapper > SCell[theme='danger'],
|
|
100
|
+
SRow[theme='danger']:hover > SCellWrapper > SCell:not([theme]),
|
|
101
|
+
SRowGroup:has(SCell[data-grouped-by='rowgroup']:hover) > SRow > SCellWrapper > SCell[theme='danger'],
|
|
102
|
+
SRowGroup:has(SCell[data-grouped-by='rowgroup']:hover) > SRow[theme='danger'] > SCellWrapper > SCell:not([theme]),
|
|
103
|
+
SRowGroup:has(SCell:hover) > SRow > SCellWrapper > SCell[data-grouped-by='rowgroup'][theme='danger'],
|
|
104
|
+
SRowGroup:has(SCell:hover) > SRow[theme='danger'] > SCellWrapper > SCell[data-grouped-by='rowgroup']:not([theme]) {
|
|
96
105
|
background-color: var(--intergalactic-table-td-cell-critical-hover, #ffd7df);
|
|
97
106
|
}
|
|
98
107
|
}
|
|
@@ -102,7 +111,7 @@ SRow[theme='muted'] SCell:not([theme]) {
|
|
|
102
111
|
background-color: var(--intergalactic-table-td-cell-unread, #f4f5f9);
|
|
103
112
|
}
|
|
104
113
|
|
|
105
|
-
SRow[theme='muted'][active] > SCell:not([theme]) {
|
|
114
|
+
SRow[theme='muted'][active] > SCellWrapper > SCell:not([theme]) {
|
|
106
115
|
/* The color is hardcoded because need hex(in figma rgba) */
|
|
107
116
|
/* disable-tokens-validator */
|
|
108
117
|
background-color: var(--intergalactic-table-td-cell-active, #e6e7ed);
|
|
@@ -113,7 +122,7 @@ SRow[theme='info'] SCell:not([theme]) {
|
|
|
113
122
|
background-color: var(--intergalactic-table-td-cell-selected, #e9f7ff);
|
|
114
123
|
}
|
|
115
124
|
|
|
116
|
-
SRow[theme='info'][active] > SCell:not([theme]) {
|
|
125
|
+
SRow[theme='info'][active] > SCellWrapper > SCell:not([theme]) {
|
|
117
126
|
background-color: var(--intergalactic-table-td-cell-selected-active, #c4e5fe);
|
|
118
127
|
}
|
|
119
128
|
|
|
@@ -122,7 +131,7 @@ SRow[theme='success'] SCell:not([theme]) {
|
|
|
122
131
|
background-color: var(--intergalactic-table-td-cell-new, #dbfee8);
|
|
123
132
|
}
|
|
124
133
|
|
|
125
|
-
SRow[theme='success'][active] > SCell:not([theme]) {
|
|
134
|
+
SRow[theme='success'][active] > SCellWrapper > SCell:not([theme]) {
|
|
126
135
|
background-color: var(--intergalactic-table-td-cell-new-active, #9ef2c9);
|
|
127
136
|
}
|
|
128
137
|
|
|
@@ -131,7 +140,7 @@ SRow[theme='warning'] SCell:not([theme]) {
|
|
|
131
140
|
background-color: var(--intergalactic-table-td-cell-warning, #fff3d9);
|
|
132
141
|
}
|
|
133
142
|
|
|
134
|
-
SRow[theme='warning'][active] > SCell:not([theme]) {
|
|
143
|
+
SRow[theme='warning'][active] > SCellWrapper > SCell:not([theme]) {
|
|
135
144
|
background-color: var(--intergalactic-table-td-cell-warning-active, #ffdca2);
|
|
136
145
|
}
|
|
137
146
|
|
|
@@ -140,7 +149,7 @@ SRow[theme='danger'] SCell:not([theme]) {
|
|
|
140
149
|
background-color: var(--intergalactic-table-td-cell-critical, #fff0f7);
|
|
141
150
|
}
|
|
142
151
|
|
|
143
|
-
SRow[theme='danger'][active] > SCell:not([theme]) {
|
|
152
|
+
SRow[theme='danger'][active] > SCellWrapper > SCell:not([theme]) {
|
|
144
153
|
background-color: var(--intergalactic-table-td-cell-critical-active, #ffd7df);
|
|
145
154
|
}
|
|
146
155
|
|
|
@@ -174,7 +183,7 @@ SCell {
|
|
|
174
183
|
}
|
|
175
184
|
}
|
|
176
185
|
|
|
177
|
-
SRow[accordionType='row'] > SCell, SCell[withAccordion], SCheckboxCell {
|
|
186
|
+
SRow[accordionType='row'] > SCellWrapper > SCell, SCell[withAccordion], SCheckboxCell {
|
|
178
187
|
cursor: pointer;
|
|
179
188
|
}
|
|
180
189
|
|
|
@@ -206,7 +215,7 @@ SCell[borders='both'], SCell[borders='right'] {
|
|
|
206
215
|
border-right: 1px solid var(--intergalactic-border-secondary, #e0e1e9);
|
|
207
216
|
}
|
|
208
217
|
|
|
209
|
-
|
|
218
|
+
SCellWrapper[fixed] {
|
|
210
219
|
position: sticky;
|
|
211
220
|
z-index: 2;
|
|
212
221
|
}
|
|
@@ -251,10 +260,10 @@ SEmptyData {
|
|
|
251
260
|
}
|
|
252
261
|
|
|
253
262
|
SRow[sideIndents='wide'] {
|
|
254
|
-
|
|
263
|
+
SCellWrapper:first-child SCell {
|
|
255
264
|
padding-left: var(--intergalactic-spacing-5x, 20px);
|
|
256
265
|
}
|
|
257
|
-
|
|
266
|
+
SCellWrapper:last-child SCell {
|
|
258
267
|
padding-right: var(--intergalactic-spacing-5x, 20px);
|
|
259
268
|
}
|
|
260
269
|
}
|
|
@@ -16,16 +16,16 @@ import { Box, ScreenReaderOnly, ScrollArea } from '@semcore/base-components';
|
|
|
16
16
|
import { Head } from '../Head/Head';
|
|
17
17
|
import { Body } from '../Body/Body';
|
|
18
18
|
/*!__reshadow-styles__:"./dataTable.shadow.css"*/
|
|
19
|
-
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".
|
|
19
|
+
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SDataTable_x73f6_gg_{display:grid;align-items:start;min-width:-moz-fit-content;min-width:fit-content}.___SDataTable_x73f6_gg_.__gridTemplateColumns_x73f6_gg_{grid-template-columns:var(--gridTemplateColumns_x73f6)}.___SDataTable_x73f6_gg_.__gridTemplateAreas_x73f6_gg_{grid-template-areas:var(--gridTemplateAreas_x73f6)}.___SDataTable_x73f6_gg_.__gridTemplateRows_x73f6_gg_{grid-template-rows:var(--gridTemplateRows_x73f6)}", /*__inner_css_end__*/"x73f6_gg_"),
|
|
20
20
|
/*__reshadow_css_end__*/
|
|
21
21
|
{
|
|
22
|
-
"__SDataTable": "
|
|
23
|
-
"_gridTemplateColumns": "
|
|
24
|
-
"--gridTemplateColumns": "--
|
|
25
|
-
"_gridTemplateAreas": "
|
|
26
|
-
"--gridTemplateAreas": "--
|
|
27
|
-
"_gridTemplateRows": "
|
|
28
|
-
"--gridTemplateRows": "--
|
|
22
|
+
"__SDataTable": "___SDataTable_x73f6_gg_",
|
|
23
|
+
"_gridTemplateColumns": "__gridTemplateColumns_x73f6_gg_",
|
|
24
|
+
"--gridTemplateColumns": "--gridTemplateColumns_x73f6",
|
|
25
|
+
"_gridTemplateAreas": "__gridTemplateAreas_x73f6_gg_",
|
|
26
|
+
"--gridTemplateAreas": "--gridTemplateAreas_x73f6",
|
|
27
|
+
"_gridTemplateRows": "__gridTemplateRows_x73f6_gg_",
|
|
28
|
+
"--gridTemplateRows": "--gridTemplateRows_x73f6"
|
|
29
29
|
});
|
|
30
30
|
import { isFocusInside, hasFocusableIn } from '@semcore/core/lib/utils/use/useFocusLock';
|
|
31
31
|
import findComponent from '@semcore/core/lib/utils/findComponent';
|
|
@@ -34,23 +34,23 @@ import i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';
|
|
|
34
34
|
import uniqueIDEnhancement from '@semcore/core/lib/utils/uniqueID';
|
|
35
35
|
import { forkRef } from '@semcore/core/lib/utils/ref';
|
|
36
36
|
/*!__reshadow-styles__:"../../style/scroll-shadows.shadow.css"*/
|
|
37
|
-
var scrollStyles = ( /*__reshadow_css_start__*/_sstyled2.insert( /*__inner_css_start__*/".
|
|
37
|
+
var scrollStyles = ( /*__reshadow_css_start__*/_sstyled2.insert( /*__inner_css_start__*/".___SScrollArea_fq5cd_gg_{width:-moz-fit-content;width:fit-content}.___SScrollArea_fq5cd_gg_ .___SContainer_fq5cd_gg_{overflow:visible;overflow:initial}.___SScrollArea_fq5cd_gg_ .___SContainer_fq5cd_gg_._scrollDirection_both_fq5cd_gg_{overflow:auto}.___SScrollArea_fq5cd_gg_ .___SContainer_fq5cd_gg_._scrollDirection_horizontal_fq5cd_gg_{overflow-x:auto;overflow-y:initial}.___SScrollArea_fq5cd_gg_ .___SContainer_fq5cd_gg_._scrollDirection_vertical_fq5cd_gg_{overflow-x:initial;overflow-y:auto}.___SScrollArea_fq5cd_gg_ .___SContainer_fq5cd_gg_.__loading_fq5cd_gg_{overflow:hidden}.___SScrollArea_fq5cd_gg_ .___SContainer_fq5cd_gg_.__headerHeight_fq5cd_gg_{scroll-padding-top:var(--headerHeight_fq5cd)}.___SScrollArea_fq5cd_gg_ .___SContainer_fq5cd_gg_.__leftScrollPadding_fq5cd_gg_{scroll-padding-left:var(--leftScrollPadding_fq5cd)}.___SScrollArea_fq5cd_gg_ .___SContainer_fq5cd_gg_.__rightScrollPadding_fq5cd_gg_{scroll-padding-right:var(--rightScrollPadding_fq5cd)}.___SScrollArea_fq5cd_gg_ .___SShadowVertical_fq5cd_gg_:before{display:none}.___SScrollArea_fq5cd_gg_ .___SShadowHorizontal_fq5cd_gg_:after,.___SScrollArea_fq5cd_gg_ .___SShadowHorizontal_fq5cd_gg_:before,.___SScrollArea_fq5cd_gg_ .___SShadowVertical_fq5cd_gg_:after{z-index:2}", /*__inner_css_end__*/"fq5cd_gg_"),
|
|
38
38
|
/*__reshadow_css_end__*/
|
|
39
39
|
{
|
|
40
|
-
"__SScrollArea": "
|
|
41
|
-
"__SContainer": "
|
|
42
|
-
"_scrollDirection_both": "
|
|
43
|
-
"_scrollDirection_horizontal": "
|
|
44
|
-
"_scrollDirection_vertical": "
|
|
45
|
-
"_loading": "
|
|
46
|
-
"_headerHeight": "
|
|
47
|
-
"--headerHeight": "--
|
|
48
|
-
"_leftScrollPadding": "
|
|
49
|
-
"--leftScrollPadding": "--
|
|
50
|
-
"_rightScrollPadding": "
|
|
51
|
-
"--rightScrollPadding": "--
|
|
52
|
-
"__SShadowVertical": "
|
|
53
|
-
"__SShadowHorizontal": "
|
|
40
|
+
"__SScrollArea": "___SScrollArea_fq5cd_gg_",
|
|
41
|
+
"__SContainer": "___SContainer_fq5cd_gg_",
|
|
42
|
+
"_scrollDirection_both": "_scrollDirection_both_fq5cd_gg_",
|
|
43
|
+
"_scrollDirection_horizontal": "_scrollDirection_horizontal_fq5cd_gg_",
|
|
44
|
+
"_scrollDirection_vertical": "_scrollDirection_vertical_fq5cd_gg_",
|
|
45
|
+
"_loading": "__loading_fq5cd_gg_",
|
|
46
|
+
"_headerHeight": "__headerHeight_fq5cd_gg_",
|
|
47
|
+
"--headerHeight": "--headerHeight_fq5cd",
|
|
48
|
+
"_leftScrollPadding": "__leftScrollPadding_fq5cd_gg_",
|
|
49
|
+
"--leftScrollPadding": "--leftScrollPadding_fq5cd",
|
|
50
|
+
"_rightScrollPadding": "__rightScrollPadding_fq5cd_gg_",
|
|
51
|
+
"--rightScrollPadding": "--rightScrollPadding_fq5cd",
|
|
52
|
+
"__SShadowVertical": "___SShadowVertical_fq5cd_gg_",
|
|
53
|
+
"__SShadowHorizontal": "___SShadowHorizontal_fq5cd_gg_"
|
|
54
54
|
});
|
|
55
55
|
import { hasParent } from '@semcore/core/lib/utils/hasParent';
|
|
56
56
|
import trottle from '@semcore/core/lib/utils/rafTrottle';
|
|
@@ -125,7 +125,7 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
125
125
|
});
|
|
126
126
|
_defineProperty(_assertThisInitialized(_this), "getRow", function (index) {
|
|
127
127
|
var _this$tableRef$curren;
|
|
128
|
-
return (_this$tableRef$curren = _this.tableRef.current) === null || _this$tableRef$curren === void 0 ? void 0 : _this$tableRef$curren.querySelector("[aria-rowindex=\"".concat(index + 1, "\"]"));
|
|
128
|
+
return (_this$tableRef$curren = _this.tableRef.current) === null || _this$tableRef$curren === void 0 ? void 0 : _this$tableRef$curren.querySelector("[aria-rowindex=\"".concat(index + 1, "\"]:not([aria-hidden=\"true\"])"));
|
|
129
129
|
});
|
|
130
130
|
_defineProperty(_assertThisInitialized(_this), "hasFocusableInHeader", function () {
|
|
131
131
|
return _this.headerRef.current && hasFocusableIn(_this.headerRef.current);
|
|
@@ -162,7 +162,7 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
162
162
|
}
|
|
163
163
|
if (!changed) return;
|
|
164
164
|
var row = _this.getRow(newRow);
|
|
165
|
-
var cell = row === null || row === void 0 ? void 0 : row.querySelector(":scope > [role=gridcell][aria-colindex=\"".concat(newCol + 1, "\"], :scope > [role=columnheader][aria-colindex=\"").concat(newCol + 1, "\"], :scope > div > [role=columnheader][aria-colindex=\"").concat(newCol + 1, "\"]"));
|
|
165
|
+
var cell = row === null || row === void 0 ? void 0 : row.querySelector(":scope > div > [role=gridcell][aria-colindex=\"".concat(newCol + 1, "\"], :scope > [role=columnheader][aria-colindex=\"").concat(newCol + 1, "\"], :scope > div > [role=columnheader][aria-colindex=\"").concat(newCol + 1, "\"]"));
|
|
166
166
|
if (cell instanceof HTMLElement && currentCell !== cell) {
|
|
167
167
|
_this.focusedCell = [newRow, newCol];
|
|
168
168
|
currentCell === null || currentCell === void 0 ? void 0 : currentCell.setAttribute('inert', '');
|
|
@@ -185,14 +185,14 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
185
185
|
var rowI = rowIndex;
|
|
186
186
|
var colI = colIndex;
|
|
187
187
|
if (direction === 'left' || direction === 'right') {
|
|
188
|
-
var _currentCell$parentEl, _currentCell$parentEl2, _row$children;
|
|
188
|
+
var _currentCell$parentEl, _currentCell$parentEl2, _currentCell$parentEl3, _row$children;
|
|
189
189
|
// we need to skip Collapse Element with one big component from keyboard left/right pressing
|
|
190
190
|
if (((_currentCell$parentEl = currentCell.parentElement) === null || _currentCell$parentEl === void 0 ? void 0 : _currentCell$parentEl.dataset.uiName) === 'Collapse') {
|
|
191
191
|
return;
|
|
192
192
|
}
|
|
193
193
|
|
|
194
194
|
// left/right
|
|
195
|
-
if (currentCell.dataset.groupedBy === 'colgroup' || Number((_currentCell$parentEl2 = currentCell.parentElement) === null || _currentCell$parentEl2 === void 0 ? void 0 : _currentCell$parentEl2.getAttribute('aria-rowindex')) === 2 || Array.from((_row$children = row === null || row === void 0 ? void 0 : row.children) !== null && _row$children !== void 0 ? _row$children : []).indexOf(currentCell) > 0) {
|
|
195
|
+
if (currentCell.dataset.groupedBy === 'colgroup' || Number((_currentCell$parentEl2 = currentCell.parentElement) === null || _currentCell$parentEl2 === void 0 ? void 0 : (_currentCell$parentEl3 = _currentCell$parentEl2.parentElement) === null || _currentCell$parentEl3 === void 0 ? void 0 : _currentCell$parentEl3.getAttribute('aria-rowindex')) === 2 || currentCell.parentElement && Array.from((_row$children = row === null || row === void 0 ? void 0 : row.children) !== null && _row$children !== void 0 ? _row$children : []).indexOf(currentCell.parentElement) > 0) {
|
|
196
196
|
colI = direction === 'left' ? colI - 1 : colI + 1;
|
|
197
197
|
} else {
|
|
198
198
|
rowI = rowI - 1;
|
|
@@ -549,11 +549,13 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
549
549
|
headerProps = _this$asProps6.headerProps,
|
|
550
550
|
renderEmptyData = _this$asProps6.renderEmptyData,
|
|
551
551
|
sideIndents = _this$asProps6.sideIndents,
|
|
552
|
-
selectedRows = _this$asProps6.selectedRows
|
|
552
|
+
selectedRows = _this$asProps6.selectedRows,
|
|
553
|
+
accordionDuration = _this$asProps6.accordionDuration;
|
|
553
554
|
var _this$gridSettings2 = this.gridSettings,
|
|
554
555
|
gridTemplateColumns = _this$gridSettings2.gridTemplateColumns,
|
|
555
556
|
gridTemplateAreas = _this$gridSettings2.gridTemplateAreas;
|
|
556
557
|
return {
|
|
558
|
+
accordionDuration: accordionDuration,
|
|
557
559
|
columns: this.columns,
|
|
558
560
|
rows: this.rows,
|
|
559
561
|
flatRows: this.flatRows,
|