@economic/taco 2.40.2 → 2.41.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/OverflowGroup/OverflowGroup.d.ts +1 -0
- package/dist/components/Tabs/Tabs.d.ts +5 -0
- package/dist/esm/index.css +2 -2
- package/dist/esm/packages/taco/src/components/BadgeIcon/BadgeIcon.js +1 -1
- package/dist/esm/packages/taco/src/components/BadgeIcon/BadgeIcon.js.map +1 -1
- package/dist/esm/packages/taco/src/components/OverflowGroup/OverflowGroup.js +4 -1
- package/dist/esm/packages/taco/src/components/OverflowGroup/OverflowGroup.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Search.js +0 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Search.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/Cell.js +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/Cell.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/CreateRowButton.js +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/CreateRowButton.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Tabs/Tabs.js +17 -3
- package/dist/esm/packages/taco/src/components/Tabs/Tabs.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Drag.js +5 -44
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Drag.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Selection.js +8 -5
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Selection.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Footer/Summary.js +2 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Footer/Summary.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Menu.js +3 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Menu.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Resizer.js +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Resizer.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/BuiltIns/DisplayRow.js +33 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/BuiltIns/DisplayRow.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableStyleGrid.js +2 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableStyleGrid.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/types.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowSelection.js +4 -3
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowSelection.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableRowSelectionListener.js +13 -10
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableRowSelectionListener.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableSearchListener.js +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableSearchListener.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/useTableManager.js +8 -6
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/useTableManager.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/presets.js +2 -2
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/presets.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/setup.js +7 -2
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/setup.js.map +1 -1
- package/dist/index.css +2 -2
- package/dist/primitives/Table/types.d.ts +7 -4
- package/dist/primitives/Table/useTableManager/useTableManager.d.ts +1 -0
- package/dist/taco.cjs.development.js +108 -85
- 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
|
@@ -3765,7 +3765,7 @@ const BadgeIcon = /*#__PURE__*/React.forwardRef(function Badge(props, ref) {
|
|
|
3765
3765
|
small,
|
|
3766
3766
|
...otherProps
|
|
3767
3767
|
} = props;
|
|
3768
|
-
const className = cn(`rounded-full border overflow-hidden whitespace-nowrap inline-flex items-center justify-center border-transparent [&>*]:max-h-full`, {
|
|
3768
|
+
const className = cn(`rounded-full border overflow-hidden whitespace-nowrap inline-flex items-center justify-center border-transparent [&>*]:max-h-full shrink-0`, {
|
|
3769
3769
|
'w-5 h-5': !small
|
|
3770
3770
|
}, {
|
|
3771
3771
|
'w-4 h-4 text-xs': small
|
|
@@ -8941,6 +8941,7 @@ const OverflowGroup = /*#__PURE__*/React__default.forwardRef(function OverflowGr
|
|
|
8941
8941
|
var _moreButton;
|
|
8942
8942
|
const {
|
|
8943
8943
|
moreButton,
|
|
8944
|
+
wrapChild,
|
|
8944
8945
|
...attributes
|
|
8945
8946
|
} = props;
|
|
8946
8947
|
const internalRef = useMergedRef(ref);
|
|
@@ -8974,7 +8975,9 @@ const OverflowGroup = /*#__PURE__*/React__default.forwardRef(function OverflowGr
|
|
|
8974
8975
|
})), hiddenChildren.length ? /*#__PURE__*/React__default.cloneElement(MoreButton, {
|
|
8975
8976
|
className: cn('sticky right-0 order-[99]', MoreButton.props.className),
|
|
8976
8977
|
'data-observer-ignore': true,
|
|
8977
|
-
menu: menuProps => (/*#__PURE__*/React__default.createElement(Menu$1, Object.assign({}, menuProps), /*#__PURE__*/React__default.createElement(Menu$1.Content, null, hiddenChildren.map(
|
|
8978
|
+
menu: menuProps => (/*#__PURE__*/React__default.createElement(Menu$1, Object.assign({}, menuProps), /*#__PURE__*/React__default.createElement(Menu$1.Content, null, hiddenChildren.map((child, index) => wrapChild ? (/*#__PURE__*/React__default.createElement(Menu$1.Item, {
|
|
8979
|
+
key: index
|
|
8980
|
+
}, child)) : sanitizeButtonPropsForMenuItem(child, index))))),
|
|
8978
8981
|
ref: buttonRefCallback
|
|
8979
8982
|
}) : null);
|
|
8980
8983
|
});
|
|
@@ -10079,6 +10082,7 @@ function processChildren(child, columns, defaultSizing, defaultSorting, defaultV
|
|
|
10079
10082
|
aggregationFn,
|
|
10080
10083
|
defaultHidden,
|
|
10081
10084
|
defaultWidth,
|
|
10085
|
+
enableEditing = !!child.props.control,
|
|
10082
10086
|
enableFiltering: enableColumnFilter = true,
|
|
10083
10087
|
enableGrouping = false,
|
|
10084
10088
|
enableHiding = true,
|
|
@@ -10130,6 +10134,7 @@ function processChildren(child, columns, defaultSizing, defaultSorting, defaultV
|
|
|
10130
10134
|
enableOrdering: isGrouped ? false : enableOrdering,
|
|
10131
10135
|
enablePrinting,
|
|
10132
10136
|
enableTruncate,
|
|
10137
|
+
enableEditing,
|
|
10133
10138
|
header,
|
|
10134
10139
|
renderer
|
|
10135
10140
|
}
|
|
@@ -10228,6 +10233,9 @@ function mapTableChildrenToColumns(props, settings, options, internalColumns) {
|
|
|
10228
10233
|
function configureReactTableOptions(options, props) {
|
|
10229
10234
|
var _options$enableFilter, _options$enableColumn, _options$enableRowExp, _options$enableColumn2, _options$enableColumn3, _options$enableSortin;
|
|
10230
10235
|
const enableRowSelection = options.enableRowSelection || options.enableRowSelectionSingle;
|
|
10236
|
+
// We don't want to expose internal Tanstack Table row, so we need to wrap enableRowSelection callback into additional function,
|
|
10237
|
+
// which receives the React Table Row object and passes row.original to a callback.
|
|
10238
|
+
const reactTableEnableRowSelection = typeof enableRowSelection === 'function' ? row => enableRowSelection(row.original) : enableRowSelection;
|
|
10231
10239
|
const tableOptions = {
|
|
10232
10240
|
defaultColumn: {
|
|
10233
10241
|
enableColumnFilter: options.enableFiltering || true,
|
|
@@ -10246,8 +10254,8 @@ function configureReactTableOptions(options, props) {
|
|
|
10246
10254
|
enableGrouping: true,
|
|
10247
10255
|
enableHiding: (_options$enableColumn2 = options.enableColumnHiding) !== null && _options$enableColumn2 !== void 0 ? _options$enableColumn2 : false,
|
|
10248
10256
|
enablePinning: (_options$enableColumn3 = options.enableColumnFreezing) !== null && _options$enableColumn3 !== void 0 ? _options$enableColumn3 : false,
|
|
10249
|
-
enableRowSelection:
|
|
10250
|
-
enableMultiRowSelection: options.enableRowSelectionSingle
|
|
10257
|
+
enableRowSelection: reactTableEnableRowSelection !== null && reactTableEnableRowSelection !== void 0 ? reactTableEnableRowSelection : false,
|
|
10258
|
+
enableMultiRowSelection: !options.enableRowSelectionSingle && reactTableEnableRowSelection,
|
|
10251
10259
|
enableSorting: (_options$enableSortin = options.enableSorting) !== null && _options$enableSortin !== void 0 ? _options$enableSortin : false,
|
|
10252
10260
|
// models for default features
|
|
10253
10261
|
getExpandedRowModel: reactTable.getExpandedRowModel(),
|
|
@@ -10447,8 +10455,8 @@ function getTableFeaturePreset(props) {
|
|
|
10447
10455
|
enableColumnHiding: (_props$enableColumnHi = props.enableColumnHiding) !== null && _props$enableColumnHi !== void 0 ? _props$enableColumnHi : presetOptions.enableColumnHiding,
|
|
10448
10456
|
enableColumnResizing: (_props$enableColumnRe = props.enableColumnResizing) !== null && _props$enableColumnRe !== void 0 ? _props$enableColumnRe : presetOptions.enableColumnResizing,
|
|
10449
10457
|
enableRowExpansion: enableRowExpansion && !!props.rowExpansionRenderer,
|
|
10450
|
-
enableRowSelection:
|
|
10451
|
-
enableRowSelectionSingle:
|
|
10458
|
+
enableRowSelection: !!props.onRowSelect && enableRowSelection,
|
|
10459
|
+
enableRowSelectionSingle: !!props.onRowSelect && enableRowSelectionSingle,
|
|
10452
10460
|
// custom -- common between all table types
|
|
10453
10461
|
enableColumnOrdering: (_props$enableColumnOr = props.enableColumnOrdering) !== null && _props$enableColumnOr !== void 0 ? _props$enableColumnOr : presetOptions.enableColumnOrdering,
|
|
10454
10462
|
enableFontSize: (_props$enableFontSize = props.enableFontSize) !== null && _props$enableFontSize !== void 0 ? _props$enableFontSize : presetOptions.enableFontSize,
|
|
@@ -10745,11 +10753,12 @@ function useTableRowSelection(isEnabled = false) {
|
|
|
10745
10753
|
const rows = table.getRowModel().rows;
|
|
10746
10754
|
const tableMeta = table.options.meta;
|
|
10747
10755
|
if (event.key === ' ') {
|
|
10756
|
+
var _rows$rowActiveIndex;
|
|
10748
10757
|
event.preventDefault();
|
|
10749
10758
|
const rowActiveIndex = tableMeta.rowActive.rowActiveIndex;
|
|
10750
|
-
if (rowActiveIndex !== undefined) {
|
|
10751
|
-
var _rows$
|
|
10752
|
-
(_rows$
|
|
10759
|
+
if (rowActiveIndex !== undefined && (_rows$rowActiveIndex = rows[rowActiveIndex]) !== null && _rows$rowActiveIndex !== void 0 && _rows$rowActiveIndex.getCanSelect()) {
|
|
10760
|
+
var _rows$rowActiveIndex2;
|
|
10761
|
+
(_rows$rowActiveIndex2 = rows[rowActiveIndex]) === null || _rows$rowActiveIndex2 === void 0 ? void 0 : _rows$rowActiveIndex2.toggleSelected();
|
|
10753
10762
|
}
|
|
10754
10763
|
return;
|
|
10755
10764
|
} else if ((event.ctrlKey || event.metaKey) && event.key === 'a') {
|
|
@@ -11365,22 +11374,24 @@ function useTableRowHeightListener(table) {
|
|
|
11365
11374
|
}
|
|
11366
11375
|
|
|
11367
11376
|
function useTableRowSelectionListener(table, onRowSelect) {
|
|
11368
|
-
const
|
|
11377
|
+
const rows = table.getSelectedRowModel().flatRows;
|
|
11378
|
+
const rowSelection = React__default.useMemo(() => rows.map(row => row.original), [rows]);
|
|
11369
11379
|
useLazyEffect(() => {
|
|
11370
|
-
const selectedRows = table.getSelectedRowModel().rows;
|
|
11371
11380
|
if (table.options.enableRowSelection && typeof onRowSelect === 'function') {
|
|
11372
11381
|
if (table.options.enableMultiRowSelection) {
|
|
11373
|
-
onRowSelect(
|
|
11382
|
+
onRowSelect(rowSelection);
|
|
11374
11383
|
} else {
|
|
11375
|
-
var _ref
|
|
11376
|
-
onRowSelect((_ref = [
|
|
11384
|
+
var _ref;
|
|
11385
|
+
onRowSelect((_ref = [rowSelection[0]]) !== null && _ref !== void 0 ? _ref : []);
|
|
11377
11386
|
}
|
|
11378
11387
|
}
|
|
11379
|
-
|
|
11380
|
-
|
|
11381
|
-
|
|
11382
|
-
|
|
11383
|
-
|
|
11388
|
+
/**
|
|
11389
|
+
* Casting to a boolean, since enableRowSelection and enableMultiRowSelection can be a functions,
|
|
11390
|
+
* and setting a function as depoendency will lead to infinity loop. And in case of row selection useEffect,
|
|
11391
|
+
* we only need to know if selection was enabled or disabled, because enableRowSelection/enableMultiRowSelection functions
|
|
11392
|
+
* will be applied directly to particular rows.
|
|
11393
|
+
*/
|
|
11394
|
+
}, [!!table.options.enableRowSelection, !!table.options.enableMultiRowSelection, rowSelection]);
|
|
11384
11395
|
}
|
|
11385
11396
|
|
|
11386
11397
|
function resetHighlightedColumnIndexes(value, table) {
|
|
@@ -11445,7 +11456,7 @@ function useTableSearchListener(table, onChangeSearch) {
|
|
|
11445
11456
|
onChangeSearch(query);
|
|
11446
11457
|
}
|
|
11447
11458
|
}
|
|
11448
|
-
}, [meta.server.loadAllStatus, meta.search.isEnabled, meta.search.enableGlobalFilter, table.getRowModel().rows
|
|
11459
|
+
}, [meta.server.loadAllStatus, meta.search.isEnabled, meta.search.enableGlobalFilter, table.getRowModel().rows, table.getState().globalFilter, JSON.stringify(table.getState().sorting), JSON.stringify(table.getState().columnVisibility), onChangeSearch]);
|
|
11449
11460
|
}
|
|
11450
11461
|
|
|
11451
11462
|
function useTableSettingsListener(table, onChangeSettings) {
|
|
@@ -11556,14 +11567,19 @@ function useTableRowDrop(isEnabled = false, onRowDrop) {
|
|
|
11556
11567
|
};
|
|
11557
11568
|
}
|
|
11558
11569
|
|
|
11570
|
+
// Placed this array outside the hook to avoid creating a new array reference on each hook re-render
|
|
11571
|
+
const DEFAULT_EMPTY_ARRAY = [];
|
|
11559
11572
|
function useTableManager(props, meta, internalColumns) {
|
|
11560
|
-
var _props$data, _props$length, _instance$options$met;
|
|
11573
|
+
var _props$data, _props$length, _meta$editing, _instance$options$met;
|
|
11561
11574
|
// CSS.escape would be best here, but it doesn't seem to work very well
|
|
11562
11575
|
const safeId = props.id.replace('.', '_');
|
|
11563
11576
|
// configure table options, merging props with presets
|
|
11564
11577
|
const options = getTableFeaturePreset(props);
|
|
11565
11578
|
// load any persisted table settings and merge them with any defaults
|
|
11566
11579
|
const [settings, setSettings] = useTableSettings(options.enableSaveSettings, safeId, props.defaultSettings, props.onChangeSettings);
|
|
11580
|
+
// ensure data is always valid
|
|
11581
|
+
const data = (_props$data = props.data) !== null && _props$data !== void 0 ? _props$data : DEFAULT_EMPTY_ARRAY;
|
|
11582
|
+
const length = (_props$length = props.length) !== null && _props$length !== void 0 ? _props$length : data.length;
|
|
11567
11583
|
// configure common custom features
|
|
11568
11584
|
const columnFreezing = useTableColumnFreezing(options.enableColumnFreezing);
|
|
11569
11585
|
const columnOrdering = useTableColumnOrdering(options.enableColumnOrdering);
|
|
@@ -11573,13 +11589,13 @@ function useTableManager(props, meta, internalColumns) {
|
|
|
11573
11589
|
const rowActive = useTableRowActive(options.enableRowActive, props.defaultRowActiveIndex);
|
|
11574
11590
|
const rowActions = useTableRowActions(options.enableRowActions, props.rowActions, props.rowActionsLength);
|
|
11575
11591
|
const rowClick = useTableRowClick(options.enableRowClick, props.onRowClick);
|
|
11576
|
-
const rowDrag = useTableRowDrag(options.enableRowDrag, props.onRowDrag);
|
|
11592
|
+
const rowDrag = useTableRowDrag(options.enableRowDrag && !(meta !== null && meta !== void 0 && (_meta$editing = meta.editing) !== null && _meta$editing !== void 0 && _meta$editing.isEditing), props.onRowDrag);
|
|
11577
11593
|
const rowDrop = useTableRowDrop(options.enableRowDrop, props.onRowDrop);
|
|
11578
11594
|
const rowExpansion = useTableRowExpansion(options.enableRowExpansion, props.rowExpansionRenderer);
|
|
11579
11595
|
const rowGoto = useTableRowGoto(options.enableRowGoto, props.onRowGoto);
|
|
11580
11596
|
const rowGroups = useTableRowGroups(props.rowActionsForGroup);
|
|
11581
11597
|
const rowHeight = useTableRowHeight(options.enableRowHeight, settings.rowHeight);
|
|
11582
|
-
const rowSelection = useTableRowSelection(options.enableRowSelection);
|
|
11598
|
+
const rowSelection = useTableRowSelection(!!options.enableRowSelection);
|
|
11583
11599
|
const search = useTableSearch(options.enableSearch, settings.excludeUnmatchedRecordsInSearch);
|
|
11584
11600
|
const server = useTableServerLoading(props.loadPage, props.loadAll, props.pageSize);
|
|
11585
11601
|
// TODO: memoise
|
|
@@ -11590,9 +11606,6 @@ function useTableManager(props, meta, internalColumns) {
|
|
|
11590
11606
|
} = mapTableChildrenToColumns(props, settings, options, internalColumns);
|
|
11591
11607
|
// configure initial table state
|
|
11592
11608
|
const initialState = useReactTableInitialState(props, columns, settings, defaultState);
|
|
11593
|
-
// ensure data is always valid
|
|
11594
|
-
const data = (_props$data = props.data) !== null && _props$data !== void 0 ? _props$data : [];
|
|
11595
|
-
const length = (_props$length = props.length) !== null && _props$length !== void 0 ? _props$length : data.length;
|
|
11596
11609
|
// create a react-table instance
|
|
11597
11610
|
const instance = reactTable.useReactTable({
|
|
11598
11611
|
data,
|
|
@@ -11705,8 +11718,9 @@ function useTableStyleGrid(tableId, table, fontSize) {
|
|
|
11705
11718
|
// printing grid
|
|
11706
11719
|
// we have to be specific so that nested tables don't inherit the same css
|
|
11707
11720
|
const hiddenColumns = printHiddenColumns.map(id => `table[data-taco^='table']#${tableId} > thead > tr > th[data-cell-id='${id}']\n,table[data-taco^='table']#${tableId} > tbody > tr > td[data-cell-id='${id}']\n`).join(',');
|
|
11721
|
+
// Ensure that tfoot cells are not hidden so that the summary and footer cells appear in the printed document
|
|
11708
11722
|
const stylesheet = `@media print { table[data-taco^='table']#${tableId} { grid-template-columns: repeat(${printGridTemplateColumns}, auto) !important; }
|
|
11709
|
-
table[data-taco^='table']#${tableId} [data-cell-id^='__']${hiddenColumns ? `, ${hiddenColumns}` : ''} { display: none; }}`;
|
|
11723
|
+
table[data-taco^='table']#${tableId} &:not(tfoot) [data-cell-id^='__']${hiddenColumns ? `, ${hiddenColumns}` : ''} { display: none; } table[data-taco^='table']#${tableId} tr { page-break-inside: avoid; break-inside: avoid;}}`;
|
|
11710
11724
|
return {
|
|
11711
11725
|
style,
|
|
11712
11726
|
stylesheet
|
|
@@ -12251,58 +12265,18 @@ const renderer = {
|
|
|
12251
12265
|
}
|
|
12252
12266
|
};
|
|
12253
12267
|
|
|
12254
|
-
const GHOST_ELEMENT_ID = 'taco_table_dragging';
|
|
12255
12268
|
function Header$2() {
|
|
12256
12269
|
return null;
|
|
12257
12270
|
}
|
|
12258
|
-
function Cell$1(
|
|
12259
|
-
const {
|
|
12260
|
-
row,
|
|
12261
|
-
table
|
|
12262
|
-
} = context;
|
|
12271
|
+
function Cell$1() {
|
|
12263
12272
|
const {
|
|
12264
12273
|
texts
|
|
12265
12274
|
} = useLocalization();
|
|
12266
|
-
|
|
12267
|
-
const onDragStart = event => {
|
|
12268
|
-
var _tableMeta$rowDrag$se, _tableMeta$rowDrag, _tableMeta$rowDrag$ha, _tableMeta$rowDrag2;
|
|
12269
|
-
let rows = [row];
|
|
12270
|
-
if (table.options.enableRowSelection) {
|
|
12271
|
-
rows = row.getIsSelected() ? table.getSelectedRowModel().rows : [row, ...table.getSelectedRowModel().rows];
|
|
12272
|
-
}
|
|
12273
|
-
const data = rows.map(row => row.original);
|
|
12274
|
-
(_tableMeta$rowDrag$se = (_tableMeta$rowDrag = tableMeta.rowDrag).setDragging) === null || _tableMeta$rowDrag$se === void 0 ? void 0 : _tableMeta$rowDrag$se.call(_tableMeta$rowDrag, rows.reduce((dragging, rowBeingDragged) => ({
|
|
12275
|
-
...dragging,
|
|
12276
|
-
[rowBeingDragged.id]: true
|
|
12277
|
-
}), {}));
|
|
12278
|
-
// set a default data value so that the consumer doesn't have to
|
|
12279
|
-
event.dataTransfer.setData('text', JSON.stringify(data));
|
|
12280
|
-
const showPlaceholder = text => {
|
|
12281
|
-
const ghost = document.createElement('div');
|
|
12282
|
-
ghost.id = GHOST_ELEMENT_ID;
|
|
12283
|
-
ghost.className = 'wcag-blue rounded flex w-48 p-4 absolute -ml-[100vw]';
|
|
12284
|
-
ghost.innerText = text;
|
|
12285
|
-
document.body.appendChild(ghost);
|
|
12286
|
-
event.dataTransfer.setDragImage(ghost, 0, 0);
|
|
12287
|
-
};
|
|
12288
|
-
const setDataTransfer = text => event.dataTransfer.setData('text', text);
|
|
12289
|
-
(_tableMeta$rowDrag$ha = (_tableMeta$rowDrag2 = tableMeta.rowDrag).handleRowDrag) === null || _tableMeta$rowDrag$ha === void 0 ? void 0 : _tableMeta$rowDrag$ha.call(_tableMeta$rowDrag2, data, showPlaceholder, setDataTransfer);
|
|
12290
|
-
};
|
|
12291
|
-
const handleDragEnd = () => {
|
|
12292
|
-
var _document$getElementB, _tableMeta$rowDrag$se2, _tableMeta$rowDrag3;
|
|
12293
|
-
(_document$getElementB = document.getElementById(GHOST_ELEMENT_ID)) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.remove();
|
|
12294
|
-
(_tableMeta$rowDrag$se2 = (_tableMeta$rowDrag3 = tableMeta.rowDrag).setDragging) === null || _tableMeta$rowDrag$se2 === void 0 ? void 0 : _tableMeta$rowDrag$se2.call(_tableMeta$rowDrag3, {});
|
|
12295
|
-
};
|
|
12296
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
12297
|
-
draggable: true,
|
|
12298
|
-
onDragStart: onDragStart,
|
|
12299
|
-
onDragOver: event => event.preventDefault(),
|
|
12300
|
-
onDragEnd: handleDragEnd
|
|
12301
|
-
}, /*#__PURE__*/React__default.createElement(Icon, {
|
|
12275
|
+
return /*#__PURE__*/React__default.createElement(Icon, {
|
|
12302
12276
|
"aria-label": texts.table.columns.drag.tooltip,
|
|
12303
12277
|
name: "drag",
|
|
12304
|
-
className: "text-grey-darkest invisible -mt-1 ml-[2px] cursor-grab active:cursor-grabbing group-hover/row:visible group-[[aria-grabbed='true']]/row:text-white"
|
|
12305
|
-
})
|
|
12278
|
+
className: cn("text-grey-darkest invisible -mt-1 ml-[2px] cursor-grab active:cursor-grabbing group-hover/row:visible group-[[aria-grabbed='true']]/row:text-white", '[[data-table-editing-mode]_&]:!invisible')
|
|
12279
|
+
});
|
|
12306
12280
|
}
|
|
12307
12281
|
const renderer$1 = {
|
|
12308
12282
|
header: Header$2,
|
|
@@ -12416,9 +12390,8 @@ function Header$4(context) {
|
|
|
12416
12390
|
}, /*#__PURE__*/React__default.createElement(Checkbox, {
|
|
12417
12391
|
"aria-label": title,
|
|
12418
12392
|
className: "hover:border-blue !-mt-px",
|
|
12419
|
-
key: String(`${isAllRowsSelected}_${isSomeRowsSelected}`),
|
|
12420
12393
|
checked: isAllRowsSelected,
|
|
12421
|
-
indeterminate: isSomeRowsSelected,
|
|
12394
|
+
indeterminate: isSomeRowsSelected && !isAllRowsSelected,
|
|
12422
12395
|
loading: tableMeta.server.loadAllStatus === exports.TableServerLoadAllState.Loading,
|
|
12423
12396
|
onChange: handleChange
|
|
12424
12397
|
}));
|
|
@@ -12447,6 +12420,7 @@ function Cell$3(context) {
|
|
|
12447
12420
|
return null;
|
|
12448
12421
|
}
|
|
12449
12422
|
const isSelected = row.getIsGrouped() ? row.getIsAllSubRowsSelected() : row.getIsSelected();
|
|
12423
|
+
const canSelect = row.getCanSelect();
|
|
12450
12424
|
const title = isSelected ? texts.table.columns.select.deselect : texts.table.columns.select.select;
|
|
12451
12425
|
if (table.options.enableMultiRowSelection) {
|
|
12452
12426
|
const handleClick = function (event) {
|
|
@@ -12465,7 +12439,7 @@ function Cell$3(context) {
|
|
|
12465
12439
|
function _temp4() {
|
|
12466
12440
|
table.setRowSelection(currentRowSelection => ({
|
|
12467
12441
|
...currentRowSelection,
|
|
12468
|
-
...selectedRows.reduce((state, row) => ({
|
|
12442
|
+
...selectedRows.filter(row => row.getCanSelect()).reduce((state, row) => ({
|
|
12469
12443
|
...state,
|
|
12470
12444
|
[row.id]: true
|
|
12471
12445
|
}), {})
|
|
@@ -12493,6 +12467,7 @@ function Cell$3(context) {
|
|
|
12493
12467
|
}
|
|
12494
12468
|
};
|
|
12495
12469
|
return /*#__PURE__*/React__default.createElement(Tooltip, {
|
|
12470
|
+
hidden: !canSelect,
|
|
12496
12471
|
title: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, title, /*#__PURE__*/React__default.createElement(Shortcut, {
|
|
12497
12472
|
className: "ml-2",
|
|
12498
12473
|
keys: "Space"
|
|
@@ -12502,11 +12477,12 @@ function Cell$3(context) {
|
|
|
12502
12477
|
className: "!mt-0",
|
|
12503
12478
|
checked: isSelected,
|
|
12504
12479
|
onClick: handleClick,
|
|
12480
|
+
disabled: !canSelect,
|
|
12505
12481
|
// this is necessary to remove console spam from eslint
|
|
12506
12482
|
onChange: () => false
|
|
12507
12483
|
}));
|
|
12508
12484
|
} else {
|
|
12509
|
-
const className = cn('!mt-0', getRadioClassnames());
|
|
12485
|
+
const className = cn('!mt-0', getRadioClassnames(!canSelect));
|
|
12510
12486
|
const handleClick = event => {
|
|
12511
12487
|
event.stopPropagation();
|
|
12512
12488
|
row.toggleSelected();
|
|
@@ -12514,7 +12490,8 @@ function Cell$3(context) {
|
|
|
12514
12490
|
};
|
|
12515
12491
|
return /*#__PURE__*/React__default.createElement("button", {
|
|
12516
12492
|
className: className,
|
|
12517
|
-
"aria-checked": isSelected,
|
|
12493
|
+
"aria-checked": canSelect && isSelected,
|
|
12494
|
+
disabled: !canSelect,
|
|
12518
12495
|
onClick: handleClick,
|
|
12519
12496
|
role: "radio",
|
|
12520
12497
|
type: "button"
|
|
@@ -12767,6 +12744,37 @@ const DisplayRow = /*#__PURE__*/React__default.memo(function DisplayRow(props) {
|
|
|
12767
12744
|
// row drag
|
|
12768
12745
|
if (tableMeta.rowDrag.isEnabled) {
|
|
12769
12746
|
attributes['aria-grabbed'] = !!tableMeta.rowDrag.dragging[row.id];
|
|
12747
|
+
attributes.draggable = true;
|
|
12748
|
+
const GHOST_ELEMENT_ID = 'taco_table_dragging';
|
|
12749
|
+
attributes.onDragStart = event => {
|
|
12750
|
+
var _tableMeta$rowDrag$se, _tableMeta$rowDrag, _tableMeta$rowDrag$ha, _tableMeta$rowDrag2;
|
|
12751
|
+
let rows = [row];
|
|
12752
|
+
if (row.getCanSelect()) {
|
|
12753
|
+
rows = row.getIsSelected() ? table.getSelectedRowModel().rows : [row, ...table.getSelectedRowModel().rows];
|
|
12754
|
+
}
|
|
12755
|
+
const data = rows.map(row => row.original);
|
|
12756
|
+
(_tableMeta$rowDrag$se = (_tableMeta$rowDrag = tableMeta.rowDrag).setDragging) === null || _tableMeta$rowDrag$se === void 0 ? void 0 : _tableMeta$rowDrag$se.call(_tableMeta$rowDrag, rows.reduce((dragging, rowBeingDragged) => ({
|
|
12757
|
+
...dragging,
|
|
12758
|
+
[rowBeingDragged.id]: true
|
|
12759
|
+
}), {}));
|
|
12760
|
+
// set a default data value so that the consumer doesn't have to
|
|
12761
|
+
event.dataTransfer.setData('text', JSON.stringify(data));
|
|
12762
|
+
const showPlaceholder = text => {
|
|
12763
|
+
const ghost = document.createElement('div');
|
|
12764
|
+
ghost.id = GHOST_ELEMENT_ID;
|
|
12765
|
+
ghost.className = 'wcag-blue rounded flex w-48 p-4 absolute -ml-[100vw]';
|
|
12766
|
+
ghost.innerText = text;
|
|
12767
|
+
document.body.appendChild(ghost);
|
|
12768
|
+
event.dataTransfer.setDragImage(ghost, 0, 0);
|
|
12769
|
+
};
|
|
12770
|
+
const setDataTransfer = text => event.dataTransfer.setData('text', text);
|
|
12771
|
+
(_tableMeta$rowDrag$ha = (_tableMeta$rowDrag2 = tableMeta.rowDrag).handleRowDrag) === null || _tableMeta$rowDrag$ha === void 0 ? void 0 : _tableMeta$rowDrag$ha.call(_tableMeta$rowDrag2, data, showPlaceholder, setDataTransfer);
|
|
12772
|
+
};
|
|
12773
|
+
attributes.onDragEnd = () => {
|
|
12774
|
+
var _document$getElementB, _tableMeta$rowDrag$se2, _tableMeta$rowDrag3;
|
|
12775
|
+
(_document$getElementB = document.getElementById(GHOST_ELEMENT_ID)) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.remove();
|
|
12776
|
+
(_tableMeta$rowDrag$se2 = (_tableMeta$rowDrag3 = tableMeta.rowDrag).setDragging) === null || _tableMeta$rowDrag$se2 === void 0 ? void 0 : _tableMeta$rowDrag$se2.call(_tableMeta$rowDrag3, {});
|
|
12777
|
+
};
|
|
12770
12778
|
}
|
|
12771
12779
|
// row drop
|
|
12772
12780
|
const [isDraggedOver, dropTargetProps] = useDropTarget(event => {
|
|
@@ -12785,7 +12793,7 @@ const DisplayRow = /*#__PURE__*/React__default.memo(function DisplayRow(props) {
|
|
|
12785
12793
|
attributes['data-row-group'] = row.getIsGrouped() ? true : undefined;
|
|
12786
12794
|
}
|
|
12787
12795
|
// row selection
|
|
12788
|
-
if (
|
|
12796
|
+
if (row.getCanSelect()) {
|
|
12789
12797
|
attributes['data-row-selected'] = row.getIsSelected() || row.getIsAllSubRowsSelected() ? true : undefined;
|
|
12790
12798
|
}
|
|
12791
12799
|
// row expansion
|
|
@@ -12806,6 +12814,7 @@ const DisplayRow = /*#__PURE__*/React__default.memo(function DisplayRow(props) {
|
|
|
12806
12814
|
const isExpanded = !!attributes['data-row-expanded'];
|
|
12807
12815
|
useSetVirtualisedRowHeight(measureRow, ref.current, expansionRef.current, isExpanded);
|
|
12808
12816
|
const className = cn('group/row', {
|
|
12817
|
+
'hover:cursor-grab': tableMeta.rowDrag.isEnabled && typeof attributes.onClick !== 'function',
|
|
12809
12818
|
'hover:cursor-pointer': typeof attributes.onClick === 'function'
|
|
12810
12819
|
});
|
|
12811
12820
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("tr", Object.assign({}, attributes, {
|
|
@@ -12956,7 +12965,7 @@ function Resizer(props) {
|
|
|
12956
12965
|
}
|
|
12957
12966
|
};
|
|
12958
12967
|
const handle = /*#__PURE__*/React__default.createElement("div", {
|
|
12959
|
-
className: cn('invisible absolute right-0 top-0 z-10 -mr-2 flex h-full w-4 cursor-col-resize touch-none select-none justify-center rounded py-0.5', 'group-hover/header:visible', '[th:last-child>&]:!mr-0 [th:last-child>&]:w-2', {
|
|
12968
|
+
className: cn('invisible absolute right-0 top-0 z-10 -mr-2 flex h-full w-4 cursor-col-resize touch-none select-none justify-center rounded py-0.5', 'group-hover/header:visible print:hidden', '[th:last-child>&]:!mr-0 [th:last-child>&]:w-2', {
|
|
12960
12969
|
'!visible': isResizing
|
|
12961
12970
|
}),
|
|
12962
12971
|
onClick: handleClick,
|
|
@@ -13191,7 +13200,9 @@ function HeaderMenu(props) {
|
|
|
13191
13200
|
// visible - expanded
|
|
13192
13201
|
'aria-expanded:!w-6 aria-expanded:!min-w-[theme(spacing.6)]',
|
|
13193
13202
|
// visible - focus
|
|
13194
|
-
'focus:!w-6 focus:!min-w-[theme(spacing.6)]',
|
|
13203
|
+
'focus:!w-6 focus:!min-w-[theme(spacing.6)]',
|
|
13204
|
+
// print styles
|
|
13205
|
+
'print:!hidden', {
|
|
13195
13206
|
'!w-6 !min-w-[theme(spacing.6)]': !!popoverElement
|
|
13196
13207
|
}, props.className);
|
|
13197
13208
|
return /*#__PURE__*/React__default.createElement(IconButton, {
|
|
@@ -13591,7 +13602,8 @@ function Summary(props) {
|
|
|
13591
13602
|
count = /*#__PURE__*/React__default.createElement("strong", null, new Intl.NumberFormat(locale).format(length));
|
|
13592
13603
|
}
|
|
13593
13604
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
13594
|
-
|
|
13605
|
+
// translate-y-1 is used to prevent the summary cell's box shadow from clipping the border
|
|
13606
|
+
className: "sticky left-0 z-20 flex h-full w-fit items-center whitespace-nowrap bg-white pr-1 shadow-[12px_0px_6px_white] print:!translate-y-1",
|
|
13595
13607
|
"data-taco": "table-footer-summary"
|
|
13596
13608
|
}, label, "\u00A0", count);
|
|
13597
13609
|
}
|
|
@@ -15331,7 +15343,6 @@ const Search$2 = /*#__PURE__*/React__default.forwardRef(function ListboxSearch(p
|
|
|
15331
15343
|
invalid: !!validationError,
|
|
15332
15344
|
message: validationError === null || validationError === void 0 ? void 0 : validationError.message
|
|
15333
15345
|
}, /*#__PURE__*/React__default.createElement(Input, Object.assign({}, otherProps, {
|
|
15334
|
-
"aria-hidden": true,
|
|
15335
15346
|
autoFocus: true,
|
|
15336
15347
|
invalid: !!validationError,
|
|
15337
15348
|
onChange: handleChange,
|
|
@@ -19208,7 +19219,7 @@ function Cell$5(props) {
|
|
|
19208
19219
|
const tableMeta = cell.getContext().table.options.meta;
|
|
19209
19220
|
const columnMeta = cell.column.columnDef.meta;
|
|
19210
19221
|
if (tableMeta.editing.isEditing) {
|
|
19211
|
-
if (columnMeta.control) {
|
|
19222
|
+
if (columnMeta.control && columnMeta.enableEditing) {
|
|
19212
19223
|
const isActiveRow = tableMeta.rowActive.rowActiveIndex === rowIndex;
|
|
19213
19224
|
const cellError = tableMeta.editing.getCellError(cell);
|
|
19214
19225
|
const hasErrorAndIsEditing = cellError ? tableMeta.editing.isEditing : true;
|
|
@@ -19602,7 +19613,7 @@ function CreateNewRowButton(props) {
|
|
|
19602
19613
|
}, [rowCreated]);
|
|
19603
19614
|
return /*#__PURE__*/React__default.createElement("tr", {
|
|
19604
19615
|
onClick: handleCreate,
|
|
19605
|
-
className: "border-grey-300 hover:bg-grey-100 group !sticky bottom-10 left-0 z-[21] !block cursor-pointer border-t"
|
|
19616
|
+
className: "border-grey-300 hover:bg-grey-100 group !sticky bottom-10 left-0 z-[21] !block cursor-pointer border-t print:!hidden"
|
|
19606
19617
|
}, /*#__PURE__*/React__default.createElement("td", {
|
|
19607
19618
|
className: "!border-t-0 !bg-transparent"
|
|
19608
19619
|
}, /*#__PURE__*/React__default.createElement(Button$1, {
|
|
@@ -19726,11 +19737,23 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(props, ref) {
|
|
|
19726
19737
|
}), children);
|
|
19727
19738
|
});
|
|
19728
19739
|
const TabList = /*#__PURE__*/React.forwardRef(function Tab(props, ref) {
|
|
19740
|
+
const {
|
|
19741
|
+
children
|
|
19742
|
+
} = props;
|
|
19729
19743
|
const className = cn('border-grey-300 flex flex-row m-0 mb-4 print:hidden', 'aria-orientation-horizontal:border-b', 'aria-orientation-vertical:border-r aria-orientation-vertical:m-0 aria-orientation-vertical:mr-4 aria-orientation-vertical:flex-col', props.className);
|
|
19730
19744
|
return /*#__PURE__*/React.createElement(TabsPrimitive.List, Object.assign({}, props, {
|
|
19731
19745
|
className: className,
|
|
19732
19746
|
ref: ref
|
|
19733
|
-
})
|
|
19747
|
+
}), /*#__PURE__*/React.createElement(OverflowGroup, {
|
|
19748
|
+
wrapChild: true,
|
|
19749
|
+
className: 'w-full [[aria-orientation="vertical"]_&]:flex-col',
|
|
19750
|
+
moreButton: text => /*#__PURE__*/React.createElement(Button$1, null, text)
|
|
19751
|
+
}, React.Children.toArray(children).filter(child => {
|
|
19752
|
+
if (/*#__PURE__*/React.isValidElement(child)) {
|
|
19753
|
+
return !child.props.hidden;
|
|
19754
|
+
}
|
|
19755
|
+
return true;
|
|
19756
|
+
})));
|
|
19734
19757
|
});
|
|
19735
19758
|
const TabTrigger = /*#__PURE__*/React.forwardRef(function Tab(props, ref) {
|
|
19736
19759
|
const {
|
|
@@ -19740,7 +19763,7 @@ const TabTrigger = /*#__PURE__*/React.forwardRef(function Tab(props, ref) {
|
|
|
19740
19763
|
tooltip,
|
|
19741
19764
|
...otherProps
|
|
19742
19765
|
} = props;
|
|
19743
|
-
const triggerClassName = cn('group relative p-0.5 outline-none disabled:cursor-not-allowed disabled:text-black/50',
|
|
19766
|
+
const triggerClassName = cn(props.className, 'group relative p-0.5 outline-none disabled:cursor-not-allowed disabled:text-black/50',
|
|
19744
19767
|
// horizontal
|
|
19745
19768
|
'[[aria-orientation="horizontal"]_&]:pb-1',
|
|
19746
19769
|
// horizontal
|