@economic/taco 1.22.3 → 1.22.5
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/dist/components/Table2/Table2.d.ts +2 -3
- package/dist/components/Table2/Table2.stories.d.ts +0 -1
- package/dist/components/Table2/hooks/useColumnDefinitions.d.ts +4 -5
- package/dist/components/Table2/hooks/useTable.d.ts +2 -2
- package/dist/components/Table2/types.d.ts +4 -3
- package/dist/esm/packages/taco/src/components/Provider/Localization.js +2 -2
- package/dist/esm/packages/taco/src/components/Provider/Localization.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Option.js +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Option.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table2/Table2.js +10 -23
- package/dist/esm/packages/taco/src/components/Table2/Table2.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table2/components/column/Cell.js +9 -12
- package/dist/esm/packages/taco/src/components/Table2/components/column/Cell.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table2/hooks/useColumnDefinitions.js +9 -7
- package/dist/esm/packages/taco/src/components/Table2/hooks/useColumnDefinitions.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table2/hooks/useTable.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table2/types.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table2/utilities/cell.js +2 -2
- package/dist/esm/packages/taco/src/components/Table2/utilities/cell.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table2/utilities/columns.js +25 -18
- package/dist/esm/packages/taco/src/components/Table2/utilities/columns.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Tag/Tag.js +2 -1
- package/dist/esm/packages/taco/src/components/Tag/Tag.js.map +1 -1
- package/dist/taco.cjs.development.js +60 -165
- package/dist/taco.cjs.development.js.map +1 -1
- package/dist/taco.cjs.production.min.js +1 -1
- package/dist/taco.cjs.production.min.js.map +1 -1
- package/package.json +2 -2
- package/types.json +15 -15
- package/dist/components/Table2/hooks/useSeparatedChildren.d.ts +0 -1
- package/dist/esm/packages/taco/src/components/Table2/components/ShortcutsGuideButton.js +0 -92
- package/dist/esm/packages/taco/src/components/Table2/components/ShortcutsGuideButton.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/hooks/useSeparatedChildren.js +0 -21
- package/dist/esm/packages/taco/src/components/Table2/hooks/useSeparatedChildren.js.map +0 -1
@@ -3656,9 +3656,9 @@ const defaultLocalisationTexts = {
|
|
3656
3656
|
}
|
3657
3657
|
},
|
3658
3658
|
columnSettings: {
|
3659
|
-
columnsOther: '
|
3659
|
+
columnsOther: 'Other columns',
|
3660
3660
|
columnsOtherDrop: 'Drop column here to unpin',
|
3661
|
-
columnsPinned: '
|
3661
|
+
columnsPinned: 'Pinned columns',
|
3662
3662
|
columnsPinnedDrop: 'Drop column here to pin',
|
3663
3663
|
search: 'Search column...',
|
3664
3664
|
tooltip: 'Column settings'
|
@@ -7890,7 +7890,8 @@ const Tag$1 = /*#__PURE__*/React__default.forwardRef((props, ref) => {
|
|
7890
7890
|
}, color ? TAG_COLORS[color] : TAG_COLORS.grey, props.className);
|
7891
7891
|
return /*#__PURE__*/React__default.createElement("span", Object.assign({}, otherProps, {
|
7892
7892
|
className: className,
|
7893
|
-
ref: ref
|
7893
|
+
ref: ref,
|
7894
|
+
"data-taco": "tag"
|
7894
7895
|
}), /*#__PURE__*/React__default.createElement("span", {
|
7895
7896
|
className: "truncate px-2",
|
7896
7897
|
ref: textRef
|
@@ -8173,7 +8174,7 @@ const Option$1 = /*#__PURE__*/React__default.forwardRef(function Select2Option(p
|
|
8173
8174
|
name: "tick",
|
8174
8175
|
className: "pointer-events-none invisible -mx-0.5 !h-4 !w-4 group-aria-selected:visible"
|
8175
8176
|
}) : null, isTag ? /*#__PURE__*/React__default.createElement(Tag$1, {
|
8176
|
-
className: "pointer-events-none",
|
8177
|
+
className: "pointer-events-none my-1",
|
8177
8178
|
color: color,
|
8178
8179
|
icon: icon
|
8179
8180
|
}, children) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, icon ? typeof icon === 'string' ? /*#__PURE__*/React__default.createElement(Icon, {
|
@@ -10568,7 +10569,6 @@ function createRowDraggableColumn(onRowDrag, texts) {
|
|
10568
10569
|
meta: {
|
10569
10570
|
align: 'center',
|
10570
10571
|
className: 'items-center !px-0',
|
10571
|
-
disableTruncation: true,
|
10572
10572
|
headerClassName: 'items-center !px-0'
|
10573
10573
|
},
|
10574
10574
|
// sizing
|
@@ -10606,7 +10606,7 @@ const SelectCell = /*#__PURE__*/React__default.memo(({
|
|
10606
10606
|
}))
|
10607
10607
|
}, /*#__PURE__*/React__default.createElement(Checkbox, {
|
10608
10608
|
"aria-label": isSelected ? texts.table2.columns.select.select : texts.table2.columns.select.deselect,
|
10609
|
-
className: "hover:border-blue !mt-
|
10609
|
+
className: "hover:border-blue !mt-0",
|
10610
10610
|
checked: isSelected,
|
10611
10611
|
onClick: handleClick,
|
10612
10612
|
// this is necessary to remove console spam from eslint
|
@@ -10682,7 +10682,6 @@ function createRowSelectionColumn(enableMultipleRowSelection, lastSelectedRowInd
|
|
10682
10682
|
meta: {
|
10683
10683
|
align: 'center',
|
10684
10684
|
className: onRowDrag ? '!pl-0 !pr-3' : '!px-3',
|
10685
|
-
disableTruncation: true,
|
10686
10685
|
headerClassName: onRowDrag ? '!pl-0 !pr-3' : '!px-3'
|
10687
10686
|
},
|
10688
10687
|
// sizing
|
@@ -10744,7 +10743,6 @@ function createRowExpansionColumn(expandedRowRenderer, texts) {
|
|
10744
10743
|
meta: {
|
10745
10744
|
align: 'center',
|
10746
10745
|
className: 'items-center !p-0',
|
10747
|
-
disableTruncation: true,
|
10748
10746
|
headerClassName: 'items-center hover:!bg-white !p-0'
|
10749
10747
|
},
|
10750
10748
|
// sizing
|
@@ -10757,6 +10755,8 @@ const RowActionsCell = /*#__PURE__*/React__default.memo(({
|
|
10757
10755
|
row,
|
10758
10756
|
actions,
|
10759
10757
|
moreActions,
|
10758
|
+
isEditing,
|
10759
|
+
shouldPauseHoverState,
|
10760
10760
|
table,
|
10761
10761
|
texts
|
10762
10762
|
}) => {
|
@@ -10764,7 +10764,7 @@ const RowActionsCell = /*#__PURE__*/React__default.memo(({
|
|
10764
10764
|
isActive,
|
10765
10765
|
isHovered
|
10766
10766
|
} = useRowContext();
|
10767
|
-
if (!
|
10767
|
+
if (!isActive && (!isHovered || shouldPauseHoverState) || isEditing) {
|
10768
10768
|
return null;
|
10769
10769
|
}
|
10770
10770
|
const isVisible = action => typeof action.visible !== 'undefined' ? typeof action.visible === 'function' ? action.visible(row.original) : action.visible : true;
|
@@ -10775,7 +10775,7 @@ const RowActionsCell = /*#__PURE__*/React__default.memo(({
|
|
10775
10775
|
// only actions in the active row should be tabbable
|
10776
10776
|
const tabIndex = table.options.meta.activeRowIndex === row.index ? 0 : -1;
|
10777
10777
|
return /*#__PURE__*/React__default.createElement("span", {
|
10778
|
-
className: "-mb-2 -mt-
|
10778
|
+
className: "-mb-2 -mt-2 flex justify-end text-right"
|
10779
10779
|
}, visibleActions.map((action, i) => /*#__PURE__*/React__default.createElement(IconButton, {
|
10780
10780
|
key: i,
|
10781
10781
|
className: actionClassName,
|
@@ -10823,20 +10823,28 @@ function createRowActionsColumn(rowActions, texts) {
|
|
10823
10823
|
cell: ({
|
10824
10824
|
row,
|
10825
10825
|
table
|
10826
|
-
}) =>
|
10827
|
-
|
10828
|
-
|
10829
|
-
|
10830
|
-
|
10831
|
-
|
10832
|
-
|
10826
|
+
}) => {
|
10827
|
+
var _table$options$meta, _table$options$meta2;
|
10828
|
+
return /*#__PURE__*/React__default.createElement(RowActionsCell, {
|
10829
|
+
row: row,
|
10830
|
+
actions: actions,
|
10831
|
+
moreActions: moreActions,
|
10832
|
+
texts: texts,
|
10833
|
+
table: table,
|
10834
|
+
isEditing: !!((_table$options$meta = table.options.meta) !== null && _table$options$meta !== void 0 && _table$options$meta.editMode.isEditing),
|
10835
|
+
shouldPauseHoverState: !!((_table$options$meta2 = table.options.meta) !== null && _table$options$meta2 !== void 0 && _table$options$meta2.shouldPauseHoverState)
|
10836
|
+
});
|
10837
|
+
},
|
10833
10838
|
meta: {
|
10834
10839
|
align: 'right',
|
10835
|
-
className:
|
10836
|
-
|
10837
|
-
'
|
10838
|
-
|
10839
|
-
|
10840
|
+
className: (row, table) => {
|
10841
|
+
var _table$options$meta3;
|
10842
|
+
return cn('items-center print:opacity-0 group-[[aria-current]]/row:sticky group-hover/row:sticky right-0 bg-transparent !px-1', {
|
10843
|
+
'group-[[aria-current]]/row:!shadow-[-6px_0px_6px_theme(colors.grey.200)]': !row.getIsSelected(),
|
10844
|
+
'group-hover/row:!shadow-[-6px_0px_6px_theme(colors.grey.100)]': !row.getIsSelected() && (!((_table$options$meta3 = table.options.meta) !== null && _table$options$meta3 !== void 0 && _table$options$meta3.shouldPauseHoverState) || table.options.meta.editMode.isEditing),
|
10845
|
+
'shadow-[-6px_0px_6px_theme(colors.blue.100)]': row.getIsSelected()
|
10846
|
+
});
|
10847
|
+
},
|
10840
10848
|
headerClassName: 'hover:!bg-white !px-1'
|
10841
10849
|
},
|
10842
10850
|
// sizing
|
@@ -10844,7 +10852,7 @@ function createRowActionsColumn(rowActions, texts) {
|
|
10844
10852
|
};
|
10845
10853
|
}
|
10846
10854
|
|
10847
|
-
const
|
10855
|
+
const getDensitySizing = (density, editing = false) => {
|
10848
10856
|
switch (density) {
|
10849
10857
|
case 'compact':
|
10850
10858
|
return editing ? 'py-0' : 'py-1.5';
|
@@ -10857,7 +10865,7 @@ const getDensityPadding = (density, editing = false) => {
|
|
10857
10865
|
}
|
10858
10866
|
};
|
10859
10867
|
const getCellSizingClasses = (density = 'normal', editing = false) => {
|
10860
|
-
return cn('min-h-0 flex items-start',
|
10868
|
+
return cn('min-h-0 flex items-start', getDensitySizing(density, editing), editing ? 'px-[7px]' : 'px-4');
|
10861
10869
|
};
|
10862
10870
|
const getCellAlignmentClasses = (alignment = 'left') => ({
|
10863
10871
|
'justify-start text-left': alignment === 'left',
|
@@ -11303,7 +11311,7 @@ const willRowMoveAfterSorting = (value, cell, rowIndex, rows, desc) => {
|
|
11303
11311
|
};
|
11304
11312
|
|
11305
11313
|
const Cell = function Cell(props) {
|
11306
|
-
var _cell$column$columnDe, _cell$column$columnDe2,
|
11314
|
+
var _cell$column$columnDe, _cell$column$columnDe2, _table$options$meta;
|
11307
11315
|
const {
|
11308
11316
|
cell,
|
11309
11317
|
index,
|
@@ -11331,14 +11339,13 @@ const Cell = function Cell(props) {
|
|
11331
11339
|
const hasValidationErrorsInRow = !!validationErrors;
|
11332
11340
|
const internalRef = React__default.useRef(null);
|
11333
11341
|
const controlRef = React__default.useRef(null);
|
11334
|
-
const
|
11335
|
-
const cellClassName = (_cell$column$columnDe2 = cell.column.columnDef.meta) === null || _cell$column$columnDe2 === void 0 ? void 0 : _cell$column$columnDe2.className;
|
11342
|
+
const cellClassName = (_cell$column$columnDe = cell.column.columnDef.meta) === null || _cell$column$columnDe === void 0 ? void 0 : _cell$column$columnDe.className;
|
11336
11343
|
const isActiveRow = meta.activeRowIndex === rowIndex;
|
11337
11344
|
const isPinned = !!cell.column.getIsPinned();
|
11338
11345
|
const isDragging = meta.dragging[cell.row.id];
|
11339
11346
|
const isSelected = cell.row.getIsSelected();
|
11340
11347
|
const isDataColumn = !isInternalColumn(cell.column.id);
|
11341
|
-
const hasCellControl = !!((_cell$column$
|
11348
|
+
const hasCellControl = !!((_cell$column$columnDe2 = cell.column.columnDef.meta) !== null && _cell$column$columnDe2 !== void 0 && _cell$column$columnDe2.control);
|
11342
11349
|
const allVisibleColumns = table.getVisibleLeafColumns();
|
11343
11350
|
const lastColumnIndex = allVisibleColumns.length > 0 ? allVisibleColumns.length - 1 : 0;
|
11344
11351
|
// editing
|
@@ -11358,7 +11365,7 @@ const Cell = function Cell(props) {
|
|
11358
11365
|
return (_tableRef$current2 = tableRef.current) === null || _tableRef$current2 === void 0 ? void 0 : _tableRef$current2.classList.remove('pb-4');
|
11359
11366
|
};
|
11360
11367
|
}, [isIndicatorVisible, isLastRow]);
|
11361
|
-
const className = cn({
|
11368
|
+
const className = cn('[&>[data-taco="tag"]]:-my-0.5', {
|
11362
11369
|
'border-b': !isLastRow,
|
11363
11370
|
'sticky z-[1]': isPinned,
|
11364
11371
|
// use isHoveredRow rather than css group-hover/row because we want to hide hover state when keyboard navigating
|
@@ -11376,7 +11383,7 @@ const Cell = function Cell(props) {
|
|
11376
11383
|
'border-blue !border-y-2 border-x-0': isIndicatorVisible,
|
11377
11384
|
'border-l-2 rounded-l': isIndicatorVisible && index === 0,
|
11378
11385
|
'border-r-2 rounded-r': isIndicatorVisible && index === lastColumnIndex
|
11379
|
-
}, getCellSizingClasses((_table$options$meta = table.options.meta) === null || _table$options$meta === void 0 ? void 0 : _table$options$meta.rowDensity, (isEditingThisRow || isHoveringThisRowWhileEditing) && hasCellControl), typeof cellClassName === 'function' ? cellClassName(cell.row) : cellClassName);
|
11386
|
+
}, getCellSizingClasses((_table$options$meta = table.options.meta) === null || _table$options$meta === void 0 ? void 0 : _table$options$meta.rowDensity, (isEditingThisRow || isHoveringThisRowWhileEditing) && hasCellControl), typeof cellClassName === 'function' ? cellClassName(cell.row, table) : cellClassName);
|
11380
11387
|
const handleMouseDown = event => {
|
11381
11388
|
// only detect left clicks
|
11382
11389
|
if (event.button === 0) {
|
@@ -11590,12 +11597,10 @@ const Cell = function Cell(props) {
|
|
11590
11597
|
};
|
11591
11598
|
}
|
11592
11599
|
}
|
11593
|
-
return /*#__PURE__*/React__default.createElement(ColumnBase, Object.assign({}, attributes),
|
11594
|
-
className: disableTruncation ? '-my-[0.45rem]' : 'truncate'
|
11595
|
-
}, reactTable$1.flexRender(cell.column.columnDef.cell, cell.getContext())));
|
11600
|
+
return /*#__PURE__*/React__default.createElement(ColumnBase, Object.assign({}, attributes), reactTable$1.flexRender(cell.column.columnDef.cell, cell.getContext()));
|
11596
11601
|
};
|
11597
11602
|
const EditingCell = /*#__PURE__*/React__default.memo( /*#__PURE__*/React__default.forwardRef((props, ref) => {
|
11598
|
-
var _cell$column$
|
11603
|
+
var _cell$column$columnDe3, _cell$column$columnDe4, _cellRef$current2, _cellRef$current2$par, _rowMoveReason$cellId;
|
11599
11604
|
const {
|
11600
11605
|
cell,
|
11601
11606
|
cellRef,
|
@@ -11756,7 +11761,7 @@ const EditingCell = /*#__PURE__*/React__default.memo( /*#__PURE__*/React__defaul
|
|
11756
11761
|
return newState;
|
11757
11762
|
});
|
11758
11763
|
};
|
11759
|
-
const cellControl = (_cell$column$
|
11764
|
+
const cellControl = (_cell$column$columnDe3 = cell.column.columnDef.meta) === null || _cell$column$columnDe3 === void 0 ? void 0 : _cell$column$columnDe3.control;
|
11760
11765
|
const attributes = {
|
11761
11766
|
'aria-label': ariaLabel,
|
11762
11767
|
onBlur: saveIfChanged,
|
@@ -11768,7 +11773,7 @@ const EditingCell = /*#__PURE__*/React__default.memo( /*#__PURE__*/React__defaul
|
|
11768
11773
|
// keyboard shortcut works as expected.
|
11769
11774
|
'data-inline-editing-component': 'true'
|
11770
11775
|
};
|
11771
|
-
const className = cn(getCellAlignmentClasses((_cell$column$
|
11776
|
+
const className = cn(getCellAlignmentClasses((_cell$column$columnDe4 = cell.column.columnDef.meta) === null || _cell$column$columnDe4 === void 0 ? void 0 : _cell$column$columnDe4.align));
|
11772
11777
|
const indicatorMountNode = (_cellRef$current2 = cellRef.current) === null || _cellRef$current2 === void 0 ? void 0 : (_cellRef$current2$par = _cellRef$current2.parentElement) === null || _cellRef$current2$par === void 0 ? void 0 : _cellRef$current2$par.querySelector(':first-child');
|
11773
11778
|
let controlComponent;
|
11774
11779
|
if (cellControl) {
|
@@ -12018,7 +12023,7 @@ function useColumnDefinitions(children, options, tableRef) {
|
|
12018
12023
|
const defaultColumnVisibility = {};
|
12019
12024
|
const defaultSorting = [];
|
12020
12025
|
const footers = {};
|
12021
|
-
React__default.Children.toArray(children).forEach(child => {
|
12026
|
+
React__default.Children.toArray(children).filter(child => !!child).forEach(child => {
|
12022
12027
|
if ( /*#__PURE__*/React__default.isValidElement(child)) {
|
12023
12028
|
var _child$props$minWidth;
|
12024
12029
|
if (child.props.defaultPinned && options.enableColumnPinning) {
|
@@ -12043,13 +12048,16 @@ function useColumnDefinitions(children, options, tableRef) {
|
|
12043
12048
|
accessorKey: child.props.accessor,
|
12044
12049
|
id: child.props.accessor,
|
12045
12050
|
cell: props => {
|
12046
|
-
|
12051
|
+
const value = props.getValue();
|
12047
12052
|
if (typeof child.props.renderer === 'function') {
|
12048
|
-
return child.props.renderer(
|
12053
|
+
return child.props.renderer(value, props.row.original);
|
12054
|
+
}
|
12055
|
+
if (typeof value === 'string' || typeof value === 'number') {
|
12056
|
+
return /*#__PURE__*/React__default.createElement("span", {
|
12057
|
+
className: "truncate"
|
12058
|
+
}, value);
|
12049
12059
|
}
|
12050
|
-
|
12051
|
-
// a valid child value.
|
12052
|
-
return (_props$getValue = props.getValue()) !== null && _props$getValue !== void 0 ? _props$getValue : null;
|
12060
|
+
return value !== null && value !== void 0 ? value : null;
|
12053
12061
|
},
|
12054
12062
|
header: child.props.header,
|
12055
12063
|
meta: {
|
@@ -12059,7 +12067,6 @@ function useColumnDefinitions(children, options, tableRef) {
|
|
12059
12067
|
dataType: child.props.dataType,
|
12060
12068
|
defaultWidth: child.props.defaultWidth,
|
12061
12069
|
disableReordering: child.props.disableReordering,
|
12062
|
-
disableTruncation: child.props.disableTruncation,
|
12063
12070
|
menu: child.props.menu,
|
12064
12071
|
tooltip: child.props.tooltip
|
12065
12072
|
},
|
@@ -12883,23 +12890,6 @@ const ExpandedRow = ({
|
|
12883
12890
|
}));
|
12884
12891
|
};
|
12885
12892
|
|
12886
|
-
const useSeparatedChildren$1 = initialChildren => {
|
12887
|
-
return React__default.useMemo(() => {
|
12888
|
-
const columns = [];
|
12889
|
-
let toolbar;
|
12890
|
-
React__default.Children.toArray(initialChildren).filter(child => !!child) // skip falsey columns
|
12891
|
-
.forEach(child => {
|
12892
|
-
var _child$type, _child$type2;
|
12893
|
-
if (((_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.displayName) === 'Table2Column') {
|
12894
|
-
columns.push(child);
|
12895
|
-
} else if (((_child$type2 = child.type) === null || _child$type2 === void 0 ? void 0 : _child$type2.displayName) === 'Table2Toolbar') {
|
12896
|
-
toolbar = child;
|
12897
|
-
}
|
12898
|
-
});
|
12899
|
-
return [columns, toolbar];
|
12900
|
-
}, [initialChildren]);
|
12901
|
-
};
|
12902
|
-
|
12903
12893
|
const useBoundaryOverflowDetection = (ref, dependencies = []) => {
|
12904
12894
|
const [boundaryIndex, setBoundaryIndex] = React__default.useState();
|
12905
12895
|
React__default.useEffect(() => {
|
@@ -13445,90 +13435,6 @@ const Search$2 = props => {
|
|
13445
13435
|
}));
|
13446
13436
|
};
|
13447
13437
|
|
13448
|
-
const ShortcutsGuideButton = ({
|
13449
|
-
table
|
13450
|
-
}) => {
|
13451
|
-
const meta = table.options.meta;
|
13452
|
-
const {
|
13453
|
-
texts
|
13454
|
-
} = useLocalization();
|
13455
|
-
const shortcuts = [];
|
13456
|
-
if (table.options.enableGlobalFilter) {
|
13457
|
-
shortcuts.push({
|
13458
|
-
feature: texts.table2.shortcuts.search,
|
13459
|
-
keys: ['Ctrl', 'F']
|
13460
|
-
});
|
13461
|
-
}
|
13462
|
-
if (table.options.enableColumnFilters) {
|
13463
|
-
shortcuts.push({
|
13464
|
-
feature: texts.table2.shortcuts.filter,
|
13465
|
-
keys: ['Ctrl', 'Shift', 'F']
|
13466
|
-
});
|
13467
|
-
}
|
13468
|
-
shortcuts.push({
|
13469
|
-
feature: texts.table2.shortcuts.previousRow,
|
13470
|
-
keys: ['Up']
|
13471
|
-
});
|
13472
|
-
shortcuts.push({
|
13473
|
-
feature: texts.table2.shortcuts.nextRow,
|
13474
|
-
keys: ['Down']
|
13475
|
-
});
|
13476
|
-
if (meta.editMode.enableEditMode) {
|
13477
|
-
shortcuts.push({
|
13478
|
-
feature: texts.table2.shortcuts.editCell,
|
13479
|
-
keys: ['Enter']
|
13480
|
-
});
|
13481
|
-
shortcuts.push({
|
13482
|
-
feature: texts.table2.shortcuts.previousColumn,
|
13483
|
-
keys: ['Arrow-Left']
|
13484
|
-
});
|
13485
|
-
shortcuts.push({
|
13486
|
-
feature: texts.table2.shortcuts.nextColumn,
|
13487
|
-
keys: ['Arrow-Right']
|
13488
|
-
});
|
13489
|
-
} else if (meta.onRowClick) {
|
13490
|
-
shortcuts.push({
|
13491
|
-
feature: texts.table2.shortcuts.rowClick,
|
13492
|
-
keys: ['Enter']
|
13493
|
-
});
|
13494
|
-
}
|
13495
|
-
if (table.options.enableRowSelection) {
|
13496
|
-
shortcuts.push({
|
13497
|
-
feature: texts.table2.shortcuts.selectRow,
|
13498
|
-
keys: ['Space']
|
13499
|
-
});
|
13500
|
-
shortcuts.push({
|
13501
|
-
feature: texts.table2.shortcuts.selectAllRows,
|
13502
|
-
keys: ['Ctrl', 'A']
|
13503
|
-
});
|
13504
|
-
}
|
13505
|
-
if (table.options.enableExpanding) {
|
13506
|
-
shortcuts.push({
|
13507
|
-
feature: texts.table2.shortcuts.expandRow,
|
13508
|
-
keys: ['Ctrl', 'Right']
|
13509
|
-
});
|
13510
|
-
shortcuts.push({
|
13511
|
-
feature: texts.table2.shortcuts.collapseRow,
|
13512
|
-
keys: ['Ctrl', 'Left']
|
13513
|
-
});
|
13514
|
-
}
|
13515
|
-
return /*#__PURE__*/React__default.createElement(IconButton, {
|
13516
|
-
"aria-label": texts.table2.shortcuts.tooltip,
|
13517
|
-
icon: "shortcuts",
|
13518
|
-
popover: popoverProps => /*#__PURE__*/React__default.createElement(Popover, Object.assign({}, popoverProps), /*#__PURE__*/React__default.createElement(Popover.Content, {
|
13519
|
-
align: "end"
|
13520
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
13521
|
-
className: "flex flex-col gap-y-1"
|
13522
|
-
}, shortcuts.map(shortcut => /*#__PURE__*/React__default.createElement("span", {
|
13523
|
-
className: "flex items-center justify-between gap-x-8",
|
13524
|
-
key: shortcut.feature
|
13525
|
-
}, /*#__PURE__*/React__default.createElement("span", null, shortcut.feature), /*#__PURE__*/React__default.createElement(Shortcut$1, {
|
13526
|
-
keys: shortcut.keys
|
13527
|
-
})))))),
|
13528
|
-
rounded: true
|
13529
|
-
});
|
13530
|
-
};
|
13531
|
-
|
13532
13438
|
const EditModeButton = /*#__PURE__*/React__default.forwardRef(function EditModeButton(props, ref) {
|
13533
13439
|
const {
|
13534
13440
|
scrollToIndex,
|
@@ -13599,13 +13505,6 @@ function Column$2(_) {
|
|
13599
13505
|
return null;
|
13600
13506
|
}
|
13601
13507
|
Column$2.displayName = 'Table2Column';
|
13602
|
-
function Toolbar(props) {
|
13603
|
-
const className = cn('flex-grow', props.className);
|
13604
|
-
return /*#__PURE__*/React__default.createElement("div", Object.assign({}, props, {
|
13605
|
-
className: className
|
13606
|
-
}));
|
13607
|
-
}
|
13608
|
-
Toolbar.displayName = 'Table2Toolbar';
|
13609
13508
|
const Table2 = /*#__PURE__*/React__default.forwardRef(function Table2(props, ref) {
|
13610
13509
|
// dom
|
13611
13510
|
const {
|
@@ -13614,18 +13513,19 @@ const Table2 = /*#__PURE__*/React__default.forwardRef(function Table2(props, ref
|
|
13614
13513
|
length = props.data.length,
|
13615
13514
|
loadMore,
|
13616
13515
|
onRowClick,
|
13516
|
+
toolbarLeft,
|
13517
|
+
toolbarRight,
|
13617
13518
|
_experimentalActionsForTable,
|
13618
13519
|
_experimentalActionsForTableSummary
|
13619
13520
|
} = props;
|
13620
13521
|
const tableRef = useMergedRef(ref);
|
13621
13522
|
const timeoutIdRef = React__default.useRef();
|
13622
13523
|
// react-table
|
13623
|
-
const [columns, toolbar] = useSeparatedChildren$1(props.children);
|
13624
13524
|
const {
|
13625
13525
|
rows,
|
13626
13526
|
table,
|
13627
13527
|
footers
|
13628
|
-
} = useTable$1(
|
13528
|
+
} = useTable$1(props.children, props, tableRef);
|
13629
13529
|
const meta = table.options.meta;
|
13630
13530
|
const {
|
13631
13531
|
columnVisibility,
|
@@ -13732,11 +13632,9 @@ const Table2 = /*#__PURE__*/React__default.forwardRef(function Table2(props, ref
|
|
13732
13632
|
return;
|
13733
13633
|
}
|
13734
13634
|
if (event.ctrlKey || event.metaKey) {
|
13735
|
-
event.
|
13736
|
-
|
13737
|
-
|
13738
|
-
table.toggleAllRowsSelected();
|
13739
|
-
}
|
13635
|
+
if (event.key === 'a' && table.options.enableRowSelection) {
|
13636
|
+
event.preventDefault();
|
13637
|
+
table.toggleAllRowsSelected();
|
13740
13638
|
}
|
13741
13639
|
return;
|
13742
13640
|
}
|
@@ -13832,7 +13730,7 @@ const Table2 = /*#__PURE__*/React__default.forwardRef(function Table2(props, ref
|
|
13832
13730
|
const className = cn('bg-white border border-grey-300 focus:yt-focus focus:border-blue-500 grid auto-rows-max overflow-auto relative rounded group', props.className);
|
13833
13731
|
const enableSettingsButton = table.options.enablePinning || table.options.enableHiding || meta.enableColumnReordering;
|
13834
13732
|
const hasInternalToolbar = enableSettingsButton || meta.editMode.enableEditMode || table.options.enableColumnFilters || meta.enableRowDensity || table.options.enableGlobalFilter;
|
13835
|
-
const hasToolbar = !!
|
13733
|
+
const hasToolbar = hasInternalToolbar || !!toolbarLeft || !toolbarRight;
|
13836
13734
|
const hasFooters = React__default.useMemo(() => {
|
13837
13735
|
const summaryIds = Object.keys(footers);
|
13838
13736
|
const visibleIds = Object.keys(columnVisibility).filter(c => !columnVisibility[c]);
|
@@ -13842,7 +13740,7 @@ const Table2 = /*#__PURE__*/React__default.forwardRef(function Table2(props, ref
|
|
13842
13740
|
className: "-m-0.5 flex h-full w-[calc(100%_+_0.25rem)] flex-col gap-4 overflow-hidden p-0.5"
|
13843
13741
|
}, hasToolbar ? /*#__PURE__*/React__default.createElement("div", {
|
13844
13742
|
className: "flex flex-wrap gap-2"
|
13845
|
-
},
|
13743
|
+
}, toolbarLeft, hasInternalToolbar ? /*#__PURE__*/React__default.createElement(Group, {
|
13846
13744
|
className: "ml-auto flex-shrink-0 print:hidden"
|
13847
13745
|
}, meta.editMode.enableEditMode ? /*#__PURE__*/React__default.createElement(EditModeButton, {
|
13848
13746
|
ref: editButtonRef,
|
@@ -13852,7 +13750,7 @@ const Table2 = /*#__PURE__*/React__default.forwardRef(function Table2(props, ref
|
|
13852
13750
|
}) : null, table.options.enableColumnFilters ? /*#__PURE__*/React__default.createElement(FiltersButton, {
|
13853
13751
|
length: length,
|
13854
13752
|
table: table
|
13855
|
-
}) : null, meta.enableRowDensity ? /*#__PURE__*/React__default.createElement(RowDensityButton, {
|
13753
|
+
}) : null, toolbarRight, meta.enableRowDensity ? /*#__PURE__*/React__default.createElement(RowDensityButton, {
|
13856
13754
|
table: table
|
13857
13755
|
}) : null, enableSettingsButton ? /*#__PURE__*/React__default.createElement(ColumnSettingsButton, {
|
13858
13756
|
table: table
|
@@ -13860,9 +13758,7 @@ const Table2 = /*#__PURE__*/React__default.forwardRef(function Table2(props, ref
|
|
13860
13758
|
disabled: meta.shouldDisableTableActions,
|
13861
13759
|
onSearch: table.setGlobalFilter,
|
13862
13760
|
value: globalFilter
|
13863
|
-
}) : null) : null, /*#__PURE__*/React__default.createElement(
|
13864
|
-
table: table
|
13865
|
-
})) : null, /*#__PURE__*/React__default.createElement("div", {
|
13761
|
+
}) : null) : null) : null, /*#__PURE__*/React__default.createElement("div", {
|
13866
13762
|
className: className,
|
13867
13763
|
"data-taco": "table2",
|
13868
13764
|
onBlur: handleBlur,
|
@@ -13959,7 +13855,6 @@ const Table2 = /*#__PURE__*/React__default.forwardRef(function Table2(props, ref
|
|
13959
13855
|
}) : null);
|
13960
13856
|
});
|
13961
13857
|
Table2.Column = Column$2;
|
13962
|
-
Table2.Toolbar = Toolbar;
|
13963
13858
|
|
13964
13859
|
const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(props, ref) {
|
13965
13860
|
const {
|