@economic/taco 2.37.2 → 2.39.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/OverflowGroup/OverflowGroup.d.ts +1 -0
- package/dist/components/Select2/Select2.d.ts +6 -1
- package/dist/components/Select2/components/Context.d.ts +3 -1
- package/dist/components/Select2/types.d.ts +3 -1
- package/dist/components/Tabs/Tabs.d.ts +5 -0
- package/dist/esm/index.css +5 -1
- package/dist/esm/packages/taco/src/components/OverflowGroup/OverflowGroup.js +3 -1
- package/dist/esm/packages/taco/src/components/OverflowGroup/OverflowGroup.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/Select2.js +10 -5
- package/dist/esm/packages/taco/src/components/Select2/Select2.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Context.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Create.js +35 -12
- package/dist/esm/packages/taco/src/components/Select2/components/Create.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js +15 -17
- package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/utilities.js +1 -1
- package/dist/esm/packages/taco/src/components/Select2/utilities.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Row.js +2 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Row.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/util/editing.js +7 -2
- package/dist/esm/packages/taco/src/components/Table3/util/editing.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Tabs/Tabs.js +12 -3
- package/dist/esm/packages/taco/src/components/Tabs/Tabs.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/Table.js +2 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/Table.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Drag.js +1 -1
- 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/Header/Header.js +3 -0
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/Header.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Resizer.js +15 -9
- 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 +1 -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/useTableRenderer.js +3 -4
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableRenderer.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 +7 -6
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableRowSelectionListener.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/useTableManager.js +1 -1
- 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 +5 -2
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/setup.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/dom.js +9 -1
- package/dist/esm/packages/taco/src/utils/dom.js.map +1 -1
- package/dist/index.css +5 -1
- package/dist/primitives/Table/Core/components/Header/Header.d.ts +1 -0
- package/dist/primitives/Table/Core/components/Header/components/Resizer.d.ts +1 -0
- package/dist/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterColumn.d.ts +1 -1
- package/dist/primitives/Table/types.d.ts +4 -3
- package/dist/taco.cjs.development.js +137 -77
- 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/dist/utils/dom.d.ts +1 -0
- package/package.json +2 -2
@@ -4211,6 +4211,14 @@ function isElementInteractive(element) {
|
|
4211
4211
|
function isElementInsideTable3OrReport(element) {
|
4212
4212
|
return !!(element !== null && element !== void 0 && element.closest('[data-taco^=table]'));
|
4213
4213
|
}
|
4214
|
+
function setDataFocusAttribute(target) {
|
4215
|
+
target.setAttribute('data-focus', 'programmatic');
|
4216
|
+
const cleanup = () => {
|
4217
|
+
target.removeAttribute('data-focus');
|
4218
|
+
target.removeEventListener('blur', cleanup);
|
4219
|
+
};
|
4220
|
+
target.addEventListener('blur', cleanup);
|
4221
|
+
}
|
4214
4222
|
|
4215
4223
|
function isPressingMetaKey(event) {
|
4216
4224
|
return isMacOs() ? event.metaKey : event.ctrlKey;
|
@@ -8966,7 +8974,9 @@ const OverflowGroup = /*#__PURE__*/React__default.forwardRef(function OverflowGr
|
|
8966
8974
|
})), hiddenChildren.length ? /*#__PURE__*/React__default.cloneElement(MoreButton, {
|
8967
8975
|
className: cn('sticky right-0 order-[99]', MoreButton.props.className),
|
8968
8976
|
'data-observer-ignore': true,
|
8969
|
-
menu: menuProps => ( /*#__PURE__*/React__default.createElement(Menu$1, Object.assign({}, menuProps), /*#__PURE__*/React__default.createElement(Menu$1.Content, null, hiddenChildren.map(
|
8977
|
+
menu: menuProps => ( /*#__PURE__*/React__default.createElement(Menu$1, Object.assign({}, menuProps), /*#__PURE__*/React__default.createElement(Menu$1.Content, null, hiddenChildren.map((child, index) => props.wrapChild ? ( /*#__PURE__*/React__default.createElement(Menu$1.Item, {
|
8978
|
+
key: index
|
8979
|
+
}, child)) : sanitizeButtonPropsForMenuItem(child, index))))),
|
8970
8980
|
ref: buttonRefCallback
|
8971
8981
|
}) : null);
|
8972
8982
|
});
|
@@ -10220,6 +10230,9 @@ function mapTableChildrenToColumns(props, settings, options, internalColumns) {
|
|
10220
10230
|
function configureReactTableOptions(options, props) {
|
10221
10231
|
var _options$enableFilter, _options$enableColumn, _options$enableRowExp, _options$enableColumn2, _options$enableColumn3, _options$enableSortin;
|
10222
10232
|
const enableRowSelection = options.enableRowSelection || options.enableRowSelectionSingle;
|
10233
|
+
// We don't want to expose internal Tanstack Table row, so we need to wrap enableRowSelection callback into additional function,
|
10234
|
+
// which receives the React Table Row object and passes row.original to a callback.
|
10235
|
+
const reactTableEnableRowSelection = typeof enableRowSelection === 'function' ? row => enableRowSelection(row.original) : enableRowSelection;
|
10223
10236
|
const tableOptions = {
|
10224
10237
|
defaultColumn: {
|
10225
10238
|
enableColumnFilter: options.enableFiltering || true,
|
@@ -10238,8 +10251,8 @@ function configureReactTableOptions(options, props) {
|
|
10238
10251
|
enableGrouping: true,
|
10239
10252
|
enableHiding: (_options$enableColumn2 = options.enableColumnHiding) !== null && _options$enableColumn2 !== void 0 ? _options$enableColumn2 : false,
|
10240
10253
|
enablePinning: (_options$enableColumn3 = options.enableColumnFreezing) !== null && _options$enableColumn3 !== void 0 ? _options$enableColumn3 : false,
|
10241
|
-
enableRowSelection:
|
10242
|
-
enableMultiRowSelection: options.enableRowSelectionSingle
|
10254
|
+
enableRowSelection: reactTableEnableRowSelection !== null && reactTableEnableRowSelection !== void 0 ? reactTableEnableRowSelection : false,
|
10255
|
+
enableMultiRowSelection: !options.enableRowSelectionSingle && reactTableEnableRowSelection,
|
10243
10256
|
enableSorting: (_options$enableSortin = options.enableSorting) !== null && _options$enableSortin !== void 0 ? _options$enableSortin : false,
|
10244
10257
|
// models for default features
|
10245
10258
|
getExpandedRowModel: reactTable.getExpandedRowModel(),
|
@@ -10439,8 +10452,8 @@ function getTableFeaturePreset(props) {
|
|
10439
10452
|
enableColumnHiding: (_props$enableColumnHi = props.enableColumnHiding) !== null && _props$enableColumnHi !== void 0 ? _props$enableColumnHi : presetOptions.enableColumnHiding,
|
10440
10453
|
enableColumnResizing: (_props$enableColumnRe = props.enableColumnResizing) !== null && _props$enableColumnRe !== void 0 ? _props$enableColumnRe : presetOptions.enableColumnResizing,
|
10441
10454
|
enableRowExpansion: enableRowExpansion && !!props.rowExpansionRenderer,
|
10442
|
-
enableRowSelection:
|
10443
|
-
enableRowSelectionSingle:
|
10455
|
+
enableRowSelection: !!props.onRowSelect && enableRowSelection,
|
10456
|
+
enableRowSelectionSingle: !!props.onRowSelect && enableRowSelectionSingle,
|
10444
10457
|
// custom -- common between all table types
|
10445
10458
|
enableColumnOrdering: (_props$enableColumnOr = props.enableColumnOrdering) !== null && _props$enableColumnOr !== void 0 ? _props$enableColumnOr : presetOptions.enableColumnOrdering,
|
10446
10459
|
enableFontSize: (_props$enableFontSize = props.enableFontSize) !== null && _props$enableFontSize !== void 0 ? _props$enableFontSize : presetOptions.enableFontSize,
|
@@ -10737,11 +10750,12 @@ function useTableRowSelection(isEnabled = false) {
|
|
10737
10750
|
const rows = table.getRowModel().rows;
|
10738
10751
|
const tableMeta = table.options.meta;
|
10739
10752
|
if (event.key === ' ') {
|
10753
|
+
var _rows$rowActiveIndex;
|
10740
10754
|
event.preventDefault();
|
10741
10755
|
const rowActiveIndex = tableMeta.rowActive.rowActiveIndex;
|
10742
|
-
if (rowActiveIndex !== undefined) {
|
10743
|
-
var _rows$
|
10744
|
-
(_rows$
|
10756
|
+
if (rowActiveIndex !== undefined && (_rows$rowActiveIndex = rows[rowActiveIndex]) !== null && _rows$rowActiveIndex !== void 0 && _rows$rowActiveIndex.getCanSelect()) {
|
10757
|
+
var _rows$rowActiveIndex2;
|
10758
|
+
(_rows$rowActiveIndex2 = rows[rowActiveIndex]) === null || _rows$rowActiveIndex2 === void 0 ? void 0 : _rows$rowActiveIndex2.toggleSelected();
|
10745
10759
|
}
|
10746
10760
|
return;
|
10747
10761
|
} else if ((event.ctrlKey || event.metaKey) && event.key === 'a') {
|
@@ -11357,22 +11371,22 @@ function useTableRowHeightListener(table) {
|
|
11357
11371
|
}
|
11358
11372
|
|
11359
11373
|
function useTableRowSelectionListener(table, onRowSelect) {
|
11360
|
-
const
|
11374
|
+
const rows = table.getSelectedRowModel().flatRows;
|
11375
|
+
const rowSelection = React__default.useMemo(() => rows.map(row => row.original), [rows]);
|
11361
11376
|
useLazyEffect(() => {
|
11362
|
-
const selectedRows = table.getSelectedRowModel().rows;
|
11363
11377
|
if (table.options.enableRowSelection && typeof onRowSelect === 'function') {
|
11364
11378
|
if (table.options.enableMultiRowSelection) {
|
11365
|
-
onRowSelect(
|
11379
|
+
onRowSelect(rowSelection);
|
11366
11380
|
} else {
|
11367
|
-
var _ref
|
11368
|
-
onRowSelect((_ref = [
|
11381
|
+
var _ref;
|
11382
|
+
onRowSelect((_ref = [rowSelection[0]]) !== null && _ref !== void 0 ? _ref : []);
|
11369
11383
|
}
|
11370
11384
|
}
|
11371
11385
|
// It is important to stringify either rowSelection state or selectedRows, because we don't
|
11372
11386
|
// know if the array or object that is returned by react-table has the same reference or not.
|
11373
11387
|
// rowSelection state is used here because it will be more expensive to strigify selectedRows
|
11374
11388
|
// than rowSelection state.
|
11375
|
-
}, [table.options.enableRowSelection, table.options.enableMultiRowSelection,
|
11389
|
+
}, [table.options.enableRowSelection, table.options.enableMultiRowSelection, rowSelection]);
|
11376
11390
|
}
|
11377
11391
|
|
11378
11392
|
function resetHighlightedColumnIndexes(value, table) {
|
@@ -11571,7 +11585,7 @@ function useTableManager(props, meta, internalColumns) {
|
|
11571
11585
|
const rowGoto = useTableRowGoto(options.enableRowGoto, props.onRowGoto);
|
11572
11586
|
const rowGroups = useTableRowGroups(props.rowActionsForGroup);
|
11573
11587
|
const rowHeight = useTableRowHeight(options.enableRowHeight, settings.rowHeight);
|
11574
|
-
const rowSelection = useTableRowSelection(options.enableRowSelection);
|
11588
|
+
const rowSelection = useTableRowSelection(!!options.enableRowSelection);
|
11575
11589
|
const search = useTableSearch(options.enableSearch, settings.excludeUnmatchedRecordsInSearch);
|
11576
11590
|
const server = useTableServerLoading(props.loadPage, props.loadAll, props.pageSize);
|
11577
11591
|
// TODO: memoise
|
@@ -11978,7 +11992,7 @@ function Row(props) {
|
|
11978
11992
|
}
|
11979
11993
|
|
11980
11994
|
function useTableRenderer(renderers, table, tableRef, defaultRowActiveIndex) {
|
11981
|
-
var _table$getState$group,
|
11995
|
+
var _table$getState$group, _virtualItems$padding, _virtualItems$padding2, _virtualItems$padding3, _ref, _virtualItems;
|
11982
11996
|
const tableMeta = table.options.meta;
|
11983
11997
|
const rows = table.getRowModel().rows;
|
11984
11998
|
const isTableRowGrouped = !!((_table$getState$group = table.getState().grouping) !== null && _table$getState$group !== void 0 && _table$getState$group.length);
|
@@ -12000,8 +12014,6 @@ function useTableRenderer(renderers, table, tableRef, defaultRowActiveIndex) {
|
|
12000
12014
|
getScrollElement: () => tableRef.current,
|
12001
12015
|
overscan: tableMeta.printing.isPrinting ? rows.length : undefined,
|
12002
12016
|
rangeExtractor,
|
12003
|
-
// correctly sets top and bottom spacing for the scroll container - very sensitive, don't change
|
12004
|
-
scrollMargin: isTableRowGrouped ? 0 : scrollPaddingStart,
|
12005
12017
|
// correctly sets the scroll padding offset, e.g. when keyboard navigating rows in the list
|
12006
12018
|
scrollPaddingStart,
|
12007
12019
|
scrollPaddingEnd: tableMeta.footer.isEnabled ? scrollPaddingEnd * 2 : scrollPaddingEnd
|
@@ -12029,8 +12041,9 @@ function useTableRenderer(renderers, table, tableRef, defaultRowActiveIndex) {
|
|
12029
12041
|
}, [virtualItems.length, tableRef.current, totalSize, rows.length]);
|
12030
12042
|
// use row 1 not 0, because 0 might be sticky in grouped tables and it's start value will always be 0
|
12031
12043
|
const paddingStartIndex = isTableRowGrouped && rows.length > 1 ? 1 : 0;
|
12044
|
+
const startValue = isTableRowGrouped ? ((_virtualItems$padding = virtualItems[paddingStartIndex]) === null || _virtualItems$padding === void 0 ? void 0 : _virtualItems$padding.start) - ((_virtualItems$padding2 = virtualItems[paddingStartIndex]) === null || _virtualItems$padding2 === void 0 ? void 0 : _virtualItems$padding2.size) : (_virtualItems$padding3 = virtualItems[paddingStartIndex]) === null || _virtualItems$padding3 === void 0 ? void 0 : _virtualItems$padding3.start;
|
12032
12045
|
// styling for offsetting rows - this "is" the virtualisation
|
12033
|
-
const [paddingTop, paddingBottom] = virtualItems.length > 0 ? [Math.max(0,
|
12046
|
+
const [paddingTop, paddingBottom] = virtualItems.length > 0 ? [Math.max(0, startValue !== null && startValue !== void 0 ? startValue : 0), Math.max(0, (_ref = totalSize - ((_virtualItems = virtualItems[virtualItems.length - 1]) === null || _virtualItems === void 0 ? void 0 : _virtualItems.end)) !== null && _ref !== void 0 ? _ref : 0)] : [0, 0];
|
12034
12047
|
// ensure default active rows are scrolled to
|
12035
12048
|
React__default.useEffect(() => {
|
12036
12049
|
if (defaultRowActiveIndex) {
|
@@ -12260,7 +12273,7 @@ function Cell$1(context) {
|
|
12260
12273
|
const onDragStart = event => {
|
12261
12274
|
var _tableMeta$rowDrag$se, _tableMeta$rowDrag, _tableMeta$rowDrag$ha, _tableMeta$rowDrag2;
|
12262
12275
|
let rows = [row];
|
12263
|
-
if (
|
12276
|
+
if (row.getCanSelect()) {
|
12264
12277
|
rows = row.getIsSelected() ? table.getSelectedRowModel().rows : [row, ...table.getSelectedRowModel().rows];
|
12265
12278
|
}
|
12266
12279
|
const data = rows.map(row => row.original);
|
@@ -12409,9 +12422,8 @@ function Header$4(context) {
|
|
12409
12422
|
}, /*#__PURE__*/React__default.createElement(Checkbox, {
|
12410
12423
|
"aria-label": title,
|
12411
12424
|
className: "hover:border-blue !-mt-px",
|
12412
|
-
key: String(`${isAllRowsSelected}_${isSomeRowsSelected}`),
|
12413
12425
|
checked: isAllRowsSelected,
|
12414
|
-
indeterminate: isSomeRowsSelected,
|
12426
|
+
indeterminate: isSomeRowsSelected && !isAllRowsSelected,
|
12415
12427
|
loading: tableMeta.server.loadAllStatus === exports.TableServerLoadAllState.Loading,
|
12416
12428
|
onChange: handleChange
|
12417
12429
|
}));
|
@@ -12440,6 +12452,7 @@ function Cell$3(context) {
|
|
12440
12452
|
return null;
|
12441
12453
|
}
|
12442
12454
|
const isSelected = row.getIsGrouped() ? row.getIsAllSubRowsSelected() : row.getIsSelected();
|
12455
|
+
const canSelect = row.getCanSelect();
|
12443
12456
|
const title = isSelected ? texts.table.columns.select.deselect : texts.table.columns.select.select;
|
12444
12457
|
if (table.options.enableMultiRowSelection) {
|
12445
12458
|
const handleClick = function (event) {
|
@@ -12458,7 +12471,7 @@ function Cell$3(context) {
|
|
12458
12471
|
function _temp4() {
|
12459
12472
|
table.setRowSelection(currentRowSelection => ({
|
12460
12473
|
...currentRowSelection,
|
12461
|
-
...selectedRows.reduce((state, row) => ({
|
12474
|
+
...selectedRows.filter(row => row.getCanSelect()).reduce((state, row) => ({
|
12462
12475
|
...state,
|
12463
12476
|
[row.id]: true
|
12464
12477
|
}), {})
|
@@ -12486,6 +12499,7 @@ function Cell$3(context) {
|
|
12486
12499
|
}
|
12487
12500
|
};
|
12488
12501
|
return /*#__PURE__*/React__default.createElement(Tooltip, {
|
12502
|
+
hidden: !canSelect,
|
12489
12503
|
title: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, title, /*#__PURE__*/React__default.createElement(Shortcut, {
|
12490
12504
|
className: "ml-2",
|
12491
12505
|
keys: "Space"
|
@@ -12495,11 +12509,12 @@ function Cell$3(context) {
|
|
12495
12509
|
className: "!mt-0",
|
12496
12510
|
checked: isSelected,
|
12497
12511
|
onClick: handleClick,
|
12512
|
+
disabled: !canSelect,
|
12498
12513
|
// this is necessary to remove console spam from eslint
|
12499
12514
|
onChange: () => false
|
12500
12515
|
}));
|
12501
12516
|
} else {
|
12502
|
-
const className = cn('!mt-0', getRadioClassnames());
|
12517
|
+
const className = cn('!mt-0', getRadioClassnames(!canSelect));
|
12503
12518
|
const handleClick = event => {
|
12504
12519
|
event.stopPropagation();
|
12505
12520
|
row.toggleSelected();
|
@@ -12507,7 +12522,8 @@ function Cell$3(context) {
|
|
12507
12522
|
};
|
12508
12523
|
return /*#__PURE__*/React__default.createElement("button", {
|
12509
12524
|
className: className,
|
12510
|
-
"aria-checked": isSelected,
|
12525
|
+
"aria-checked": canSelect && isSelected,
|
12526
|
+
disabled: !canSelect,
|
12511
12527
|
onClick: handleClick,
|
12512
12528
|
role: "radio",
|
12513
12529
|
type: "button"
|
@@ -12778,7 +12794,7 @@ const DisplayRow = /*#__PURE__*/React__default.memo(function DisplayRow(props) {
|
|
12778
12794
|
attributes['data-row-group'] = row.getIsGrouped() ? true : undefined;
|
12779
12795
|
}
|
12780
12796
|
// row selection
|
12781
|
-
if (
|
12797
|
+
if (row.getCanSelect()) {
|
12782
12798
|
attributes['data-row-selected'] = row.getIsSelected() || row.getIsAllSubRowsSelected() ? true : undefined;
|
12783
12799
|
}
|
12784
12800
|
// row expansion
|
@@ -12916,6 +12932,7 @@ function Resizer(props) {
|
|
12916
12932
|
headerRef,
|
12917
12933
|
id,
|
12918
12934
|
isResizing,
|
12935
|
+
onResetSize,
|
12919
12936
|
onResize,
|
12920
12937
|
setColumnSizing,
|
12921
12938
|
width
|
@@ -12930,16 +12947,21 @@ function Resizer(props) {
|
|
12930
12947
|
};
|
12931
12948
|
// columns set to "grow" don't set a width, so if resize is being triggered on a grow column make sure to set a size first
|
12932
12949
|
const handleResize = event => {
|
12933
|
-
|
12934
|
-
|
12935
|
-
|
12936
|
-
[id]: headerRef.getBoundingClientRect().width
|
12937
|
-
}));
|
12938
|
-
setTimeout(() => {
|
12939
|
-
onResize === null || onResize === void 0 ? void 0 : onResize(event);
|
12940
|
-
}, 1);
|
12950
|
+
// event.detail >= 2 means a user has clicked more than once quickly.
|
12951
|
+
if (event.detail >= 2) {
|
12952
|
+
onResetSize();
|
12941
12953
|
} else {
|
12942
|
-
|
12954
|
+
if (!Number.isInteger(width) && headerRef) {
|
12955
|
+
setColumnSizing(sizes => ({
|
12956
|
+
...sizes,
|
12957
|
+
[id]: headerRef.getBoundingClientRect().width
|
12958
|
+
}));
|
12959
|
+
setTimeout(() => {
|
12960
|
+
onResize === null || onResize === void 0 ? void 0 : onResize(event);
|
12961
|
+
}, 1);
|
12962
|
+
} else {
|
12963
|
+
onResize === null || onResize === void 0 ? void 0 : onResize(event);
|
12964
|
+
}
|
12943
12965
|
}
|
12944
12966
|
};
|
12945
12967
|
const handle = /*#__PURE__*/React__default.createElement("div", {
|
@@ -13315,6 +13337,7 @@ function Header$5(props) {
|
|
13315
13337
|
if (canResize) {
|
13316
13338
|
memoedProps.isResizing = header.column.getIsResizing();
|
13317
13339
|
memoedProps.onResize = header.getResizeHandler();
|
13340
|
+
memoedProps.resetSize = header.column.resetSize;
|
13318
13341
|
}
|
13319
13342
|
if (canSort) {
|
13320
13343
|
const handleSortToggle = sortDirection => {
|
@@ -13363,6 +13386,7 @@ const MemoedHeader = /*#__PURE__*/React__default.memo(function MemoedHeader(prop
|
|
13363
13386
|
onResize: handleResize,
|
13364
13387
|
onSort: handleSort,
|
13365
13388
|
onSortToggle: handleSortToggle,
|
13389
|
+
resetSize: handleResetSize,
|
13366
13390
|
scrollToIndex,
|
13367
13391
|
setRowActiveIndex,
|
13368
13392
|
setColumnSizing,
|
@@ -13424,6 +13448,7 @@ const MemoedHeader = /*#__PURE__*/React__default.memo(function MemoedHeader(prop
|
|
13424
13448
|
id: id,
|
13425
13449
|
isResizing: isResizing,
|
13426
13450
|
onResize: handleResize,
|
13451
|
+
onResetSize: handleResetSize,
|
13427
13452
|
setColumnSizing: setColumnSizing,
|
13428
13453
|
width: width
|
13429
13454
|
})) : null);
|
@@ -14607,7 +14632,7 @@ const Tag$1 = /*#__PURE__*/React__default.forwardRef((props, ref) => {
|
|
14607
14632
|
})) : null);
|
14608
14633
|
});
|
14609
14634
|
|
14610
|
-
const createOptionClassName = (shouldPauseHoverState = false) => cn('group mb-px flex w-full text-sm flex-shrink-0 font-normal cursor-pointer items-center rounded bg-white px-2 leading-8 text-black aria-hidden:hidden gap-1.5 bg-white aria-current:wcag-grey-200 aria-disabled:text-black/25 aria-disabled:pointer-events-none', {
|
14635
|
+
const createOptionClassName = (shouldPauseHoverState = false) => cn('group mb-px flex w-full text-sm flex-shrink-0 font-normal cursor-pointer items-center rounded bg-white px-2 leading-8 text-black aria-hidden:hidden gap-1.5 bg-white aria-current:wcag-grey-200 aria-disabled:text-black/25 aria-disabled:pointer-events-none !justify-normal', {
|
14611
14636
|
'hover:wcag-grey-200': !shouldPauseHoverState
|
14612
14637
|
});
|
14613
14638
|
const createCollectionClassName = () => 'flex flex-col gap-px';
|
@@ -15064,7 +15089,7 @@ const Single = /*#__PURE__*/React__default.forwardRef(function Select2TriggerSin
|
|
15064
15089
|
}, output));
|
15065
15090
|
});
|
15066
15091
|
const Multiple = /*#__PURE__*/React__default.forwardRef(function Select2TriggerMultiple(props, ref) {
|
15067
|
-
var _buttonRef$
|
15092
|
+
var _buttonRef$current2;
|
15068
15093
|
const {
|
15069
15094
|
children,
|
15070
15095
|
emptyValue: _,
|
@@ -15081,6 +15106,11 @@ const Multiple = /*#__PURE__*/React__default.forwardRef(function Select2TriggerM
|
|
15081
15106
|
} = useSelect2Context();
|
15082
15107
|
const buttonRef = useMergedRef(ref);
|
15083
15108
|
const valuesAsChildren = values.map(value => children.find(c => c.props.value === value)).filter(c => !!c);
|
15109
|
+
const forwardClick = event => {
|
15110
|
+
var _buttonRef$current;
|
15111
|
+
event.preventDefault();
|
15112
|
+
(_buttonRef$current = buttonRef.current) === null || _buttonRef$current === void 0 ? void 0 : _buttonRef$current.click();
|
15113
|
+
};
|
15084
15114
|
let content;
|
15085
15115
|
let {
|
15086
15116
|
className
|
@@ -15088,7 +15118,8 @@ const Multiple = /*#__PURE__*/React__default.forwardRef(function Select2TriggerM
|
|
15088
15118
|
if (open) {
|
15089
15119
|
className = cn('!absolute z-20 !h-fit', buttonProps.className);
|
15090
15120
|
content = /*#__PURE__*/React__default.createElement(ScrollArea, {
|
15091
|
-
className: "my-1 flex max-h-[5.5rem] flex-col"
|
15121
|
+
className: "my-1 flex max-h-[5.5rem] flex-col",
|
15122
|
+
onClick: forwardClick
|
15092
15123
|
}, /*#__PURE__*/React__default.createElement("div", {
|
15093
15124
|
className: "flex flex-wrap gap-1"
|
15094
15125
|
}, valuesAsChildren.length === 0 ? ( /*#__PURE__*/React__default.createElement(Placeholder, {
|
@@ -15111,7 +15142,7 @@ const Multiple = /*#__PURE__*/React__default.forwardRef(function Select2TriggerM
|
|
15111
15142
|
}, child.props.children)))));
|
15112
15143
|
} else {
|
15113
15144
|
content = /*#__PURE__*/React__default.createElement(MultipleValue, {
|
15114
|
-
|
15145
|
+
onClick: forwardClick,
|
15115
15146
|
valuesAsChildren: valuesAsChildren,
|
15116
15147
|
placeholder: placeholder
|
15117
15148
|
});
|
@@ -15120,7 +15151,7 @@ const Multiple = /*#__PURE__*/React__default.forwardRef(function Select2TriggerM
|
|
15120
15151
|
className: "relative inline-flex h-fit flex-grow",
|
15121
15152
|
"data-taco": "select2-container",
|
15122
15153
|
style: {
|
15123
|
-
width: open ? (_buttonRef$
|
15154
|
+
width: open ? (_buttonRef$current2 = buttonRef.current) === null || _buttonRef$current2 === void 0 ? void 0 : _buttonRef$current2.offsetWidth : undefined
|
15124
15155
|
}
|
15125
15156
|
}, /*#__PURE__*/React__default.createElement(Button$3, Object.assign({}, buttonProps, {
|
15126
15157
|
className: className,
|
@@ -15128,30 +15159,23 @@ const Multiple = /*#__PURE__*/React__default.forwardRef(function Select2TriggerM
|
|
15128
15159
|
}), content));
|
15129
15160
|
});
|
15130
15161
|
const MultipleValue = ({
|
15162
|
+
onClick,
|
15131
15163
|
valuesAsChildren,
|
15132
15164
|
placeholder
|
15133
15165
|
}) => {
|
15134
15166
|
const {
|
15135
15167
|
disabled,
|
15136
|
-
open,
|
15137
15168
|
readOnly,
|
15138
|
-
setValue,
|
15139
15169
|
tags
|
15140
15170
|
} = useSelect2Context();
|
15141
15171
|
const [contentRef, setContentRef] = React__default.useState(null);
|
15142
15172
|
const boundaryIndex = contentRef ? getIndexOfFirstChildOverflowingParent(contentRef, 30) : undefined;
|
15143
|
-
const createClickHandler = tagValue => event => {
|
15144
|
-
event === null || event === void 0 ? void 0 : event.stopPropagation();
|
15145
|
-
event === null || event === void 0 ? void 0 : event.preventDefault();
|
15146
|
-
if (!disabled && !readOnly) {
|
15147
|
-
setValue(tagValue);
|
15148
|
-
}
|
15149
|
-
};
|
15150
15173
|
return /*#__PURE__*/React__default.createElement("div", {
|
15151
|
-
className: "relative flex items-center gap-1 overflow-hidden"
|
15174
|
+
className: "relative flex w-full items-center gap-1 overflow-hidden",
|
15175
|
+
onClick: onClick
|
15152
15176
|
}, /*#__PURE__*/React__default.createElement("div", {
|
15153
|
-
className: "flex gap-1 truncate",
|
15154
|
-
ref:
|
15177
|
+
className: "flex flex-1 gap-1 truncate",
|
15178
|
+
ref: ref => setContentRef(ref)
|
15155
15179
|
}, valuesAsChildren.length === 0 ? ( /*#__PURE__*/React__default.createElement(Placeholder, {
|
15156
15180
|
disabled: disabled,
|
15157
15181
|
readOnly: readOnly
|
@@ -15165,7 +15189,6 @@ const MultipleValue = ({
|
|
15165
15189
|
color: tags ? child.props.color : undefined,
|
15166
15190
|
disabled: disabled,
|
15167
15191
|
icon: child.props.prefix,
|
15168
|
-
onDelete: open ? createClickHandler(child.props.value) : undefined,
|
15169
15192
|
readOnly: readOnly
|
15170
15193
|
}, child.props.children);
|
15171
15194
|
if (index === boundaryIndex) {
|
@@ -15420,20 +15443,25 @@ const Create = props => {
|
|
15420
15443
|
setOpen,
|
15421
15444
|
setSearchQuery,
|
15422
15445
|
setValidationError,
|
15423
|
-
setValue
|
15446
|
+
setValue,
|
15447
|
+
createDialog,
|
15448
|
+
createTriggerText
|
15424
15449
|
} = useSelect2Context();
|
15425
15450
|
const {
|
15426
15451
|
texts
|
15427
15452
|
} = useLocalization();
|
15428
15453
|
// determine what the next color tag should be based on color occurences
|
15429
15454
|
const nextColor = React__default.useMemo(() => getNextColor(options), [options]);
|
15430
|
-
|
15455
|
+
const onCreateDialogClose = React__default.useCallback(() => {
|
15456
|
+
setOpen(false);
|
15457
|
+
}, [setOpen]);
|
15458
|
+
if (!createDialog && !searchQuery) {
|
15431
15459
|
return null;
|
15432
15460
|
}
|
15433
|
-
const
|
15461
|
+
const create = function (value) {
|
15434
15462
|
try {
|
15435
15463
|
const _temp = _catch(function () {
|
15436
|
-
return Promise.resolve(handleCreate(
|
15464
|
+
return Promise.resolve(handleCreate(value, nextColor)).then(function (item) {
|
15437
15465
|
setValue(item.value);
|
15438
15466
|
if (multiple) {
|
15439
15467
|
setSearchQuery('');
|
@@ -15454,17 +15482,33 @@ const Create = props => {
|
|
15454
15482
|
event.currentTarget.click();
|
15455
15483
|
}
|
15456
15484
|
};
|
15457
|
-
const className = cn(
|
15458
|
-
|
15459
|
-
|
15460
|
-
|
15461
|
-
|
15462
|
-
|
15485
|
+
const className = cn(createOptionClassName(), {
|
15486
|
+
'!w-[calc(100%_-_theme(spacing.3))] ml-1.5': !createDialog,
|
15487
|
+
'leading-normal border-grey-300 h-9 border-t py-2.5 px-4 !-mb-1.5': !!createDialog
|
15488
|
+
});
|
15489
|
+
const creationOptions = createDialog ? {
|
15490
|
+
dialog: props => createDialog({
|
15491
|
+
...props,
|
15492
|
+
onClose: onCreateDialogClose
|
15493
|
+
}, searchQuery, create)
|
15494
|
+
} : {
|
15495
|
+
onClick: () => create(searchQuery)
|
15496
|
+
};
|
15497
|
+
const createText = createTriggerText || texts.select2.create;
|
15498
|
+
return /*#__PURE__*/React__default.createElement(Button$1, Object.assign({
|
15499
|
+
className: className
|
15500
|
+
}, creationOptions, {
|
15501
|
+
onKeyDown: handleKeyDown,
|
15502
|
+
appearance: createDialog ? 'discrete' : 'default'
|
15503
|
+
}), /*#__PURE__*/React__default.createElement("span", {
|
15463
15504
|
className: "flex items-center gap-1.5"
|
15464
|
-
},
|
15505
|
+
}, createDialog ? ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Icon, {
|
15506
|
+
className: "text-xs",
|
15507
|
+
name: "circle-plus"
|
15508
|
+
}), " ", createText)) : ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, createText, /*#__PURE__*/React__default.createElement(Tag$1, {
|
15465
15509
|
color: nextColor,
|
15466
15510
|
className: "cursor-pointer"
|
15467
|
-
}, searchQuery)));
|
15511
|
+
}, searchQuery)))));
|
15468
15512
|
};
|
15469
15513
|
|
15470
15514
|
const Collection$1 = props => {
|
@@ -15497,6 +15541,8 @@ const Select2 = /*#__PURE__*/React__default.forwardRef(function Select2(props, r
|
|
15497
15541
|
readOnly = false,
|
15498
15542
|
tags = false,
|
15499
15543
|
value: prop,
|
15544
|
+
createDialog,
|
15545
|
+
createTriggerText,
|
15500
15546
|
...otherProps
|
15501
15547
|
} = props;
|
15502
15548
|
const emptyOption = React__default.useMemo(() => {
|
@@ -15576,7 +15622,9 @@ const Select2 = /*#__PURE__*/React__default.forwardRef(function Select2(props, r
|
|
15576
15622
|
tags,
|
15577
15623
|
fontSize,
|
15578
15624
|
validationError,
|
15579
|
-
value
|
15625
|
+
value,
|
15626
|
+
createDialog,
|
15627
|
+
createTriggerText
|
15580
15628
|
};
|
15581
15629
|
const handleKeyDown = event => {
|
15582
15630
|
var _listboxRef$current;
|
@@ -15661,7 +15709,8 @@ const Select2 = /*#__PURE__*/React__default.forwardRef(function Select2(props, r
|
|
15661
15709
|
setValue(nextValue);
|
15662
15710
|
}
|
15663
15711
|
};
|
15664
|
-
const className = cn('border-grey-300 rounded border bg-white py-1.5 shadow-md outline-none
|
15712
|
+
const className = cn('border-grey-300 rounded border bg-white py-1.5 shadow-md outline-none', createCollectionClassName());
|
15713
|
+
const isInlineCreation = onCreate && !createDialog;
|
15665
15714
|
return /*#__PURE__*/React__default.createElement(Select2Context.Provider, {
|
15666
15715
|
value: context
|
15667
15716
|
}, /*#__PURE__*/React__default.createElement(PopoverPrimitive.Root, {
|
@@ -15692,8 +15741,8 @@ const Select2 = /*#__PURE__*/React__default.forwardRef(function Select2(props, r
|
|
15692
15741
|
style: {
|
15693
15742
|
minWidth: dimensions !== null && dimensions !== void 0 && dimensions.width ? `${dimensions.width}px` : undefined
|
15694
15743
|
}
|
15695
|
-
}, flattenedChildren.length > 0 ||
|
15696
|
-
placeholder:
|
15744
|
+
}, flattenedChildren.length > 0 || isInlineCreation ? ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Search$2, {
|
15745
|
+
placeholder: isInlineCreation ? texts.select2.searchOrCreate : texts.select2.search,
|
15697
15746
|
ref: searchRef,
|
15698
15747
|
onTabKeyPress: () => setTabTriggeredClose(true)
|
15699
15748
|
}), multiple && selectOptions.length > 1 && ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Button$1, {
|
@@ -15714,7 +15763,7 @@ const Select2 = /*#__PURE__*/React__default.forwardRef(function Select2(props, r
|
|
15714
15763
|
})), /*#__PURE__*/React__default.createElement("span", null, texts.listbox.loading))) : flattenedChildren.length <= 0 ? ( /*#__PURE__*/React__default.createElement("div", {
|
15715
15764
|
className: "text-grey-700 -mt-0.5 flex h-8 items-center px-2",
|
15716
15765
|
role: "presentation"
|
15717
|
-
},
|
15766
|
+
}, texts.listbox.empty)) : ( /*#__PURE__*/React__default.createElement(Root$1, {
|
15718
15767
|
className: "flex flex-col gap-0.5",
|
15719
15768
|
customSelector: ":scope > button",
|
15720
15769
|
disabled: disabled,
|
@@ -16632,7 +16681,7 @@ function TableGrid(props) {
|
|
16632
16681
|
scrollToIndex: table.renderer.scrollToIndex,
|
16633
16682
|
style: props.children ? {
|
16634
16683
|
...table.renderer.style,
|
16635
|
-
height: table.renderer.style.height +
|
16684
|
+
height: table.renderer.style.height + ROW_HEIGHT_ESTIMATES[table.meta.rowHeight.height]
|
16636
16685
|
} : table.renderer.style
|
16637
16686
|
}, table.renderer.rows, props.children), table.meta.footer.isEnabled ? /*#__PURE__*/React__default.createElement(Foot, {
|
16638
16687
|
table: table.instance
|
@@ -18275,8 +18324,12 @@ function willRowMoveAfterSorting(cell, change, rowIndex) {
|
|
18275
18324
|
function animateCreateRow(id) {
|
18276
18325
|
const templateRow = document.querySelector(`[data-row-id="${id}"]`);
|
18277
18326
|
if (templateRow) {
|
18278
|
-
|
18279
|
-
|
18327
|
+
const firstCell = templateRow.querySelector(':first-child');
|
18328
|
+
const checkbox = firstCell === null || firstCell === void 0 ? void 0 : firstCell.querySelector('[data-taco="checkbox"]');
|
18329
|
+
firstCell === null || firstCell === void 0 ? void 0 : firstCell.focus();
|
18330
|
+
if (checkbox) {
|
18331
|
+
setDataFocusAttribute(checkbox);
|
18332
|
+
}
|
18280
18333
|
templateRow.scrollIntoView();
|
18281
18334
|
const keyframes = [{
|
18282
18335
|
background: '#b2c7ef'
|
@@ -19300,7 +19353,7 @@ function Row$2(props) {
|
|
19300
19353
|
const isActiveRow = tableMeta.rowActive.rowActiveIndex === index;
|
19301
19354
|
React__default.useEffect(() => {
|
19302
19355
|
if (tableMeta.editing.isEditing && isActiveRow && tableMeta.editing.lastFocusedCellIndex === undefined) {
|
19303
|
-
focusManager.focusFirst();
|
19356
|
+
setDataFocusAttribute(focusManager.focusFirst());
|
19304
19357
|
}
|
19305
19358
|
}, [tableMeta.editing.isEditing, tableMeta.rowActive.rowActiveIndex, tableMeta.editing.lastFocusedCellIndex]);
|
19306
19359
|
const handleFocus = React__default.useCallback(event => {
|
@@ -19682,11 +19735,18 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(props, ref) {
|
|
19682
19735
|
}), children);
|
19683
19736
|
});
|
19684
19737
|
const TabList = /*#__PURE__*/React.forwardRef(function Tab(props, ref) {
|
19685
|
-
const
|
19738
|
+
const {
|
19739
|
+
children
|
19740
|
+
} = props;
|
19741
|
+
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);
|
19686
19742
|
return /*#__PURE__*/React.createElement(TabsPrimitive.List, Object.assign({}, props, {
|
19687
19743
|
className: className,
|
19688
19744
|
ref: ref
|
19689
|
-
})
|
19745
|
+
}), /*#__PURE__*/React.createElement(OverflowGroup, {
|
19746
|
+
wrapChild: true,
|
19747
|
+
className: "w-full",
|
19748
|
+
moreButton: text => /*#__PURE__*/React.createElement(Button$1, null, text)
|
19749
|
+
}, children));
|
19690
19750
|
});
|
19691
19751
|
const TabTrigger = /*#__PURE__*/React.forwardRef(function Tab(props, ref) {
|
19692
19752
|
const {
|
@@ -19696,7 +19756,7 @@ const TabTrigger = /*#__PURE__*/React.forwardRef(function Tab(props, ref) {
|
|
19696
19756
|
tooltip,
|
19697
19757
|
...otherProps
|
19698
19758
|
} = props;
|
19699
|
-
const triggerClassName = cn('group relative p-0.5 outline-none disabled:cursor-not-allowed disabled:text-black/50',
|
19759
|
+
const triggerClassName = cn(props.className, 'group relative p-0.5 outline-none disabled:cursor-not-allowed disabled:text-black/50',
|
19700
19760
|
// horizontal
|
19701
19761
|
'[[aria-orientation="horizontal"]_&]:pb-1',
|
19702
19762
|
// horizontal
|