@economic/taco 2.33.1 → 2.34.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/Icon/components/DocumentSigned.d.ts +3 -0
- package/dist/components/Icon/components/Home2.d.ts +3 -0
- package/dist/components/Icon/components/Id.d.ts +3 -0
- package/dist/components/Icon/components/MastercardOs.d.ts +3 -0
- package/dist/components/Icon/components/NovemberFirst.d.ts +3 -0
- package/dist/components/Icon/components/index.d.ts +1 -1
- package/dist/components/Input/Input.d.ts +1 -1
- package/dist/components/Menu/components/Item.d.ts +1 -1
- package/dist/components/Menu/components/Link.d.ts +1 -1
- package/dist/components/Navigation2/components/Link.d.ts +1 -1
- package/dist/components/Select2/components/Option.d.ts +2 -2
- package/dist/components/Select2/components/Search.d.ts +1 -1
- package/dist/components/Table3/components/Columns/Internal/EditingActionsMenu.d.ts +1 -0
- package/dist/components/Table3/features/useTableEditing.d.ts +0 -1
- package/dist/components/Table3/listeners/useTableEditingListener.d.ts +3 -1
- package/dist/components/Tag/Tag.d.ts +1 -1
- package/dist/esm/index.css +4 -4
- package/dist/esm/packages/taco/src/components/Combobox/useCombobox.js +4 -5
- package/dist/esm/packages/taco/src/components/Combobox/useCombobox.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/DocumentSigned.js +19 -0
- package/dist/esm/packages/taco/src/components/Icon/components/DocumentSigned.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Icon/components/Home2.js +19 -0
- package/dist/esm/packages/taco/src/components/Icon/components/Home2.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Icon/components/Id.js +19 -0
- package/dist/esm/packages/taco/src/components/Icon/components/Id.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Icon/components/MastercardOs.js +23 -0
- package/dist/esm/packages/taco/src/components/Icon/components/MastercardOs.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Icon/components/NovemberFirst.js +20 -0
- package/dist/esm/packages/taco/src/components/Icon/components/NovemberFirst.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Icon/components/index.js +10 -0
- package/dist/esm/packages/taco/src/components/Icon/components/index.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Input/Input.js +5 -0
- package/dist/esm/packages/taco/src/components/Input/Input.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/Trigger.js +9 -7
- package/dist/esm/packages/taco/src/components/Menu/components/Trigger.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/Select2.js +3 -1
- package/dist/esm/packages/taco/src/components/Select2/Select2.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/Table3.js +1 -7
- package/dist/esm/packages/taco/src/components/Table3/Table3.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/Editing/RowMoveIndicator.js +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/Editing/RowMoveIndicator.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/EditingControlCell.js +3 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/EditingControlCell.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Internal/EditingActionsMenu.js +9 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Internal/EditingActionsMenu.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Row.js +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Row.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/features/useTableEditing.js +1 -13
- package/dist/esm/packages/taco/src/components/Table3/features/useTableEditing.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/listeners/useTableEditingListener.js +16 -1
- package/dist/esm/packages/taco/src/components/Table3/listeners/useTableEditingListener.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/useTable3.js +3 -2
- package/dist/esm/packages/taco/src/components/Table3/useTable3.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/Body/Body.js +21 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Body/Body.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/BuiltIns/DisplayRow.js +1 -2
- 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/components/Toolbar/components/Filters/components/Filter.js +12 -3
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/Filter.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterComparator.js +3 -47
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterComparator.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/util.js +44 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/util.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableRenderer.js +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableRenderer.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowActive.js +5 -5
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowActive.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/dom.js +4 -1
- package/dist/esm/packages/taco/src/utils/dom.js.map +1 -1
- package/dist/index.css +4 -4
- package/dist/primitives/Table/Core/components/Body/Body.d.ts +2 -0
- package/dist/primitives/Table/Core/components/Toolbar/components/Filters/util.d.ts +2 -1
- package/dist/taco.cjs.development.js +221 -97
- 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
|
@@ -1239,6 +1239,21 @@ function IconDocumentRejectedRequest(props, svgRef) {
|
|
|
1239
1239
|
}
|
|
1240
1240
|
var DocumentRejectedRequest = /*#__PURE__*/React.forwardRef(IconDocumentRejectedRequest);
|
|
1241
1241
|
|
|
1242
|
+
function IconDocumentSigned(props, svgRef) {
|
|
1243
|
+
return /*#__PURE__*/React.createElement("svg", Object.assign({
|
|
1244
|
+
fill: "none",
|
|
1245
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1246
|
+
viewBox: "0 0 24 24",
|
|
1247
|
+
ref: svgRef
|
|
1248
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
1249
|
+
fillRule: "evenodd",
|
|
1250
|
+
clipRule: "evenodd",
|
|
1251
|
+
d: "M14.293 2.293A1 1 0 0013.586 2H5.75A1.75 1.75 0 004 3.75v16.5c0 .966.784 1.75 1.75 1.75h12.5A1.75 1.75 0 0020 20.25V8.414a1 1 0 00-.293-.707l-5.414-5.414zM5.75 3.5H13v3.75l.006.144A1.75 1.75 0 0014.75 9h3.75v11.25l-.007.057a.25.25 0 01-.243.193H5.75l-.057-.007a.25.25 0 01-.193-.243V3.75l.007-.057A.25.25 0 015.75 3.5zm8.75 1.121V7.25a.25.25 0 00.193.243l.057.007h2.63L14.5 4.621zm-6.693 9.425C8.183 12.37 9.194 11 10.43 11c1.547 0 1.796 1.624 1 3.337a6.972 6.972 0 01-1.424 2.009l-.156.148.138-.007.17-.017c1.058-.13 1.702-.687 2.014-1.725l.044-.16.026-.08c.239-.613 1.208-.407 1.13.292a10.03 10.03 0 00-.074 1.205l.006.168.084-.093.202-.245c.451-.532.863-.748 1.332-.404.185.135.278.313.343.543l.019.072.033.156.064.387.087-.088.147-.16.172-.202.197-.242.22-.284.23-.312.057-.067a.59.59 0 01.898.758l-.133.182-.252.334-.127.162c-.665.834-1.147 1.225-1.605 1.266-.419.037-.725-.198-.889-.556a1.83 1.83 0 01-.128-.403l-.016-.081-.08.09-.093.096c-.583.591-1.13.773-1.585.251l-.068-.084-.054-.08a1.31 1.31 0 01-.128-.29l-.011-.04-.098.082-.152.112c-.568.398-1.28.616-2.126.645l-.2.003-.167-.005a1.862 1.862 0 01-.843-.253l-.016-.01-.077.046-.256.137a6.378 6.378 0 01-.8.342l-.222.072-.078.018a.59.59 0 01-.267-1.145 5.16 5.16 0 00.806-.324l.15-.08-.043-.116-.056-.188c-.133-.511-.144-1.121-.036-1.775l.031-.17.038-.181zm2.617-.347c.422-.975.323-1.52.004-1.52-.545 0-1.255 1.006-1.502 2.273-.09.462-.108.86-.061 1.178l.025.14.082-.07.197-.186a5.84 5.84 0 001.1-1.488l.091-.185.064-.142z",
|
|
1252
|
+
fill: "currentColor"
|
|
1253
|
+
}));
|
|
1254
|
+
}
|
|
1255
|
+
var DocumentSigned = /*#__PURE__*/React.forwardRef(IconDocumentSigned);
|
|
1256
|
+
|
|
1242
1257
|
function IconDocumentSplit(props, svgRef) {
|
|
1243
1258
|
return /*#__PURE__*/React.createElement("svg", Object.assign({
|
|
1244
1259
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1763,6 +1778,21 @@ function IconHeightTall(props, svgRef) {
|
|
|
1763
1778
|
}
|
|
1764
1779
|
var HeightTall = /*#__PURE__*/React.forwardRef(IconHeightTall);
|
|
1765
1780
|
|
|
1781
|
+
function IconHome2(props, svgRef) {
|
|
1782
|
+
return /*#__PURE__*/React.createElement("svg", Object.assign({
|
|
1783
|
+
fill: "none",
|
|
1784
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1785
|
+
viewBox: "0 0 24 24",
|
|
1786
|
+
ref: svgRef
|
|
1787
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
1788
|
+
fillRule: "evenodd",
|
|
1789
|
+
clipRule: "evenodd",
|
|
1790
|
+
d: "M11.116 2.823a1.25 1.25 0 011.768 0L17.25 7.19V6a.75.75 0 011.5 0v2.69l2.78 2.78a.75.75 0 01-1.06 1.06l-2.994-2.993-.013-.013L12 4.061l-8.47 8.47a.75.75 0 01-1.06-1.061l8.646-8.647zm1.768 3.25l7 7c.234.235.366.553.366.884v6.293c0 .69-.56 1.25-1.25 1.25h-4c-.69 0-1.25-.56-1.25-1.25V16.5h-3.5v3.75c0 .69-.56 1.25-1.25 1.25H5c-.69 0-1.25-.56-1.25-1.25v-6.293c0-.332.132-.65.366-.884l7-7a1.25 1.25 0 011.768 0zM12 7.311l-6.75 6.75V20h3.5v-3.75c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25V20h3.5v-5.94L12 7.31z",
|
|
1791
|
+
fill: "currentColor"
|
|
1792
|
+
}));
|
|
1793
|
+
}
|
|
1794
|
+
var Home2 = /*#__PURE__*/React.forwardRef(IconHome2);
|
|
1795
|
+
|
|
1766
1796
|
function IconHome(props, svgRef) {
|
|
1767
1797
|
return /*#__PURE__*/React.createElement("svg", Object.assign({
|
|
1768
1798
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1776,6 +1806,21 @@ function IconHome(props, svgRef) {
|
|
|
1776
1806
|
}
|
|
1777
1807
|
var Home = /*#__PURE__*/React.forwardRef(IconHome);
|
|
1778
1808
|
|
|
1809
|
+
function IconId(props, svgRef) {
|
|
1810
|
+
return /*#__PURE__*/React.createElement("svg", Object.assign({
|
|
1811
|
+
fill: "none",
|
|
1812
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1813
|
+
viewBox: "0 0 24 24",
|
|
1814
|
+
ref: svgRef
|
|
1815
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
1816
|
+
fillRule: "evenodd",
|
|
1817
|
+
clipRule: "evenodd",
|
|
1818
|
+
d: "M20.25 5c.966 0 1.75.784 1.75 1.75v10.5A1.75 1.75 0 0120.25 19H3.75A1.75 1.75 0 012 17.25V6.75C2 5.784 2.784 5 3.75 5h16.5zm0 1.5H3.75a.25.25 0 00-.243.193L3.5 6.75v10.5a.25.25 0 00.193.243l.057.007h16.5a.25.25 0 00.243-.193l.007-.057V6.75a.25.25 0 00-.193-.243L20.25 6.5zm-9.268 7.993c-.316-1.81-1.31-2.714-2.982-2.714-1.673 0-2.667.905-2.982 2.714a1.204 1.204 0 001.184 1.41h3.595a1.204 1.204 0 001.185-1.41zM8 8c.76 0 1.374.77 1.374 1.718 0 .949-.615 1.718-1.374 1.718-.759 0-1.374-.77-1.374-1.718C6.626 8.769 7.24 8 8 8zm11 .75a.75.75 0 00-.75-.75h-6a.75.75 0 000 1.5h6a.75.75 0 00.75-.75zM18.25 14a.75.75 0 010 1.5h-4.5a.75.75 0 010-1.5h4.5zm.75-2.25a.75.75 0 00-.75-.75h-4.5a.75.75 0 000 1.5h4.5a.75.75 0 00.75-.75z",
|
|
1819
|
+
fill: "currentColor"
|
|
1820
|
+
}));
|
|
1821
|
+
}
|
|
1822
|
+
var Id = /*#__PURE__*/React.forwardRef(IconId);
|
|
1823
|
+
|
|
1779
1824
|
function IconImages(props, svgRef) {
|
|
1780
1825
|
return /*#__PURE__*/React.createElement("svg", Object.assign({
|
|
1781
1826
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2266,6 +2311,25 @@ function IconMarket(props, svgRef) {
|
|
|
2266
2311
|
}
|
|
2267
2312
|
var Market = /*#__PURE__*/React.forwardRef(IconMarket);
|
|
2268
2313
|
|
|
2314
|
+
function IconMastercardOs(props, svgRef) {
|
|
2315
|
+
return /*#__PURE__*/React.createElement("svg", Object.assign({
|
|
2316
|
+
fill: "none",
|
|
2317
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2318
|
+
viewBox: "0 0 24 24",
|
|
2319
|
+
ref: svgRef
|
|
2320
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
2321
|
+
d: "M14.698 7.314H9.286v9.66h5.412v-9.66z",
|
|
2322
|
+
fill: "#FF5A00"
|
|
2323
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
2324
|
+
d: "M9.646 12.144c0-1.963.929-3.704 2.354-4.83A6.178 6.178 0 008.185 6C4.766 6 2 8.748 2 12.144s2.766 6.143 6.185 6.143A6.178 6.178 0 0012 16.973a6.117 6.117 0 01-2.354-4.83z",
|
|
2325
|
+
fill: "#EB001B"
|
|
2326
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
2327
|
+
d: "M22 12.144c0 3.396-2.766 6.143-6.185 6.143A6.178 6.178 0 0112 16.973a6.095 6.095 0 002.354-4.83A6.146 6.146 0 0012 7.315 6.168 6.168 0 0115.813 6C19.233 6 22 8.766 22 12.144z",
|
|
2328
|
+
fill: "#F79E1B"
|
|
2329
|
+
}));
|
|
2330
|
+
}
|
|
2331
|
+
var MastercardOs = /*#__PURE__*/React.forwardRef(IconMastercardOs);
|
|
2332
|
+
|
|
2269
2333
|
function IconMatchAmount(props, svgRef) {
|
|
2270
2334
|
return /*#__PURE__*/React.createElement("svg", Object.assign({
|
|
2271
2335
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2435,6 +2499,22 @@ function IconNote(props, svgRef) {
|
|
|
2435
2499
|
}
|
|
2436
2500
|
var Note = /*#__PURE__*/React.forwardRef(IconNote);
|
|
2437
2501
|
|
|
2502
|
+
function IconNovemberFirst(props, svgRef) {
|
|
2503
|
+
return /*#__PURE__*/React.createElement("svg", Object.assign({
|
|
2504
|
+
fill: "none",
|
|
2505
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2506
|
+
viewBox: "0 0 24 24",
|
|
2507
|
+
ref: svgRef
|
|
2508
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
2509
|
+
d: "M21.484 8.828C19.73 3.592 14.065.768 8.829 2.519 3.592 4.271.767 9.936 2.519 15.172c1.752 5.237 7.418 8.06 12.655 6.308a9.997 9.997 0 006.31-12.653z",
|
|
2510
|
+
fill: "#0D2840"
|
|
2511
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
2512
|
+
d: "M13.977 7.263v5.445l-4.14-5.445H7.264l.78 1.156v7.686h1.919v-5.619l4.28 5.62H15.9V7.262h-1.922z",
|
|
2513
|
+
fill: "#2CD7B3"
|
|
2514
|
+
}));
|
|
2515
|
+
}
|
|
2516
|
+
var NovemberFirst = /*#__PURE__*/React.forwardRef(IconNovemberFirst);
|
|
2517
|
+
|
|
2438
2518
|
function IconNumbers(props, svgRef) {
|
|
2439
2519
|
return /*#__PURE__*/React.createElement("svg", Object.assign({
|
|
2440
2520
|
fill: "none",
|
|
@@ -3486,6 +3566,7 @@ const icons = {
|
|
|
3486
3566
|
'document-preview': DocumentPreview,
|
|
3487
3567
|
'document-received': DocumentReceived,
|
|
3488
3568
|
'document-rejected-request': DocumentRejectedRequest,
|
|
3569
|
+
'document-signed': DocumentSigned,
|
|
3489
3570
|
'document-split': DocumentSplit,
|
|
3490
3571
|
'document-time': DocumentTime,
|
|
3491
3572
|
document: Document,
|
|
@@ -3525,7 +3606,9 @@ const icons = {
|
|
|
3525
3606
|
'height-medium': HeightMedium,
|
|
3526
3607
|
'height-short': HeightShort,
|
|
3527
3608
|
'height-tall': HeightTall,
|
|
3609
|
+
home2: Home2,
|
|
3528
3610
|
home: Home,
|
|
3611
|
+
id: Id,
|
|
3529
3612
|
images: Images,
|
|
3530
3613
|
import: Import,
|
|
3531
3614
|
'inbox-einvoicing': InboxEinvoicing,
|
|
@@ -3562,6 +3645,7 @@ const icons = {
|
|
|
3562
3645
|
'log-out': LogOut,
|
|
3563
3646
|
log: Log,
|
|
3564
3647
|
market: Market,
|
|
3648
|
+
'mastercard-os': MastercardOs,
|
|
3565
3649
|
'match-amount': MatchAmount,
|
|
3566
3650
|
'match-entries': MatchEntries,
|
|
3567
3651
|
menu: Menu,
|
|
@@ -3575,6 +3659,7 @@ const icons = {
|
|
|
3575
3659
|
'note-follow-up': NoteFollowUp,
|
|
3576
3660
|
'note-read': NoteRead,
|
|
3577
3661
|
note: Note,
|
|
3662
|
+
'november-first': NovemberFirst,
|
|
3578
3663
|
numbers: Numbers,
|
|
3579
3664
|
'partner-api': PartnerApi,
|
|
3580
3665
|
'payment-paid': PaymentPaid,
|
|
@@ -4122,6 +4207,9 @@ function isElementInteractive(element) {
|
|
|
4122
4207
|
}
|
|
4123
4208
|
return ['A', 'BUTTON', 'INPUT', 'TEXTAREA', 'SELECT', 'LABEL', 'OPTION'].includes(element.tagName) && !element.hidden && !element.disabled && !element.readOnly;
|
|
4124
4209
|
}
|
|
4210
|
+
function isElementInsideTable3OrReport(element) {
|
|
4211
|
+
return !!(element !== null && element !== void 0 && element.closest('[data-taco^=table]'));
|
|
4212
|
+
}
|
|
4125
4213
|
|
|
4126
4214
|
function isPressingMetaKey(event) {
|
|
4127
4215
|
return isMacOs() ? event.metaKey : event.ctrlKey;
|
|
@@ -5214,6 +5302,11 @@ const InputWithoutDeprecatedFeatures = /*#__PURE__*/React.forwardRef(function In
|
|
|
5214
5302
|
event.preventDefault();
|
|
5215
5303
|
const position = event.key === 'End' ? event.currentTarget.value.length : 0;
|
|
5216
5304
|
event.currentTarget.setSelectionRange(position, position);
|
|
5305
|
+
// Necessary for ensuring the cursor is scrolled into view when using Home/End keys on Windows
|
|
5306
|
+
if (internalRef.current) {
|
|
5307
|
+
const scrollPosition = event.key === 'End' ? internalRef.current.scrollWidth : 0;
|
|
5308
|
+
internalRef.current.scrollLeft = scrollPosition;
|
|
5309
|
+
}
|
|
5217
5310
|
}
|
|
5218
5311
|
}
|
|
5219
5312
|
if (typeof onKeyDown === 'function') {
|
|
@@ -5823,9 +5916,7 @@ const useCombobox = ({
|
|
|
5823
5916
|
}
|
|
5824
5917
|
};
|
|
5825
5918
|
const handleInputKeyDown = event => {
|
|
5826
|
-
var _inputRef$current;
|
|
5827
5919
|
event.persist();
|
|
5828
|
-
const insideTheTable = !!((_inputRef$current = inputRef.current) !== null && _inputRef$current !== void 0 && _inputRef$current.closest('table, [role="rowgroup"]'));
|
|
5829
5920
|
if (!event.ctrlKey && !event.metaKey) {
|
|
5830
5921
|
switch (event.key) {
|
|
5831
5922
|
case 'Backspace':
|
|
@@ -5847,7 +5938,7 @@ const useCombobox = ({
|
|
|
5847
5938
|
}
|
|
5848
5939
|
case 'Enter':
|
|
5849
5940
|
{
|
|
5850
|
-
if (
|
|
5941
|
+
if (isElementInsideTable3OrReport(event.currentTarget)) {
|
|
5851
5942
|
event.preventDefault();
|
|
5852
5943
|
if (inline && !open) {
|
|
5853
5944
|
setOpen(true);
|
|
@@ -5865,7 +5956,7 @@ const useCombobox = ({
|
|
|
5865
5956
|
if (open) {
|
|
5866
5957
|
event.preventDefault();
|
|
5867
5958
|
} else {
|
|
5868
|
-
if (!inline && buttonRef.current && !
|
|
5959
|
+
if (!inline && buttonRef.current && !isElementInsideTable3OrReport(event.currentTarget)) {
|
|
5869
5960
|
buttonRef.current.click();
|
|
5870
5961
|
}
|
|
5871
5962
|
}
|
|
@@ -5885,7 +5976,7 @@ const useCombobox = ({
|
|
|
5885
5976
|
listRef.current.dispatchEvent(createCustomKeyboardEvent(event));
|
|
5886
5977
|
}
|
|
5887
5978
|
if (inline && !open) {
|
|
5888
|
-
if ((event.key === 'ArrowUp' || event.key === 'ArrowDown') && !
|
|
5979
|
+
if ((event.key === 'ArrowUp' || event.key === 'ArrowDown') && !isElementInsideTable3OrReport(event.currentTarget)) {
|
|
5889
5980
|
event.preventDefault();
|
|
5890
5981
|
const initialIndex = event.key === 'ArrowUp' ? data.length - 1 : 0;
|
|
5891
5982
|
setCurrentIndex(currentIndex !== undefined ? currentIndex : initialIndex);
|
|
@@ -8194,12 +8285,13 @@ const Link$1 = /*#__PURE__*/React.forwardRef(function MenuLink(props, ref) {
|
|
|
8194
8285
|
const Trigger$6 = /*#__PURE__*/React.forwardRef(function MenuTrigger(props, ref) {
|
|
8195
8286
|
const menu = useCurrentMenu();
|
|
8196
8287
|
const internalRef = useMergedRef(ref);
|
|
8197
|
-
const
|
|
8198
|
-
|
|
8199
|
-
|
|
8200
|
-
|
|
8201
|
-
|
|
8202
|
-
|
|
8288
|
+
const handleKeyDown = event => {
|
|
8289
|
+
if (event.key === 'ArrowDown') {
|
|
8290
|
+
if (isElementInsideTable3OrReport(event.currentTarget)) {
|
|
8291
|
+
var _event$currentTarget$;
|
|
8292
|
+
event.preventDefault();
|
|
8293
|
+
(_event$currentTarget$ = event.currentTarget.parentNode) === null || _event$currentTarget$ === void 0 ? void 0 : _event$currentTarget$.dispatchEvent(createCustomKeyboardEvent(event));
|
|
8294
|
+
}
|
|
8203
8295
|
}
|
|
8204
8296
|
};
|
|
8205
8297
|
React.useEffect(() => {
|
|
@@ -8210,7 +8302,7 @@ const Trigger$6 = /*#__PURE__*/React.forwardRef(function MenuTrigger(props, ref)
|
|
|
8210
8302
|
return /*#__PURE__*/React.createElement(DropdownMenuPrimitive.Trigger, Object.assign({}, props, {
|
|
8211
8303
|
asChild: true,
|
|
8212
8304
|
ref: internalRef,
|
|
8213
|
-
onKeyDown:
|
|
8305
|
+
onKeyDown: handleKeyDown
|
|
8214
8306
|
}));
|
|
8215
8307
|
});
|
|
8216
8308
|
|
|
@@ -10437,11 +10529,11 @@ function useTableRowActive(isEnabled = false, initialRowActiveIndex) {
|
|
|
10437
10529
|
const [rowActiveIndex, setRowActiveIndex] = React__default.useState(initialRowActiveIndex);
|
|
10438
10530
|
const [rowHoverIndex, setRowHoverIndex] = React__default.useState(undefined);
|
|
10439
10531
|
const [isHoverStatePaused, setHoverStatePaused] = useIsHoverStatePaused();
|
|
10440
|
-
const move = (direction, length, scrollToIndex) =>
|
|
10441
|
-
const nextIndex =
|
|
10442
|
-
|
|
10443
|
-
|
|
10444
|
-
}
|
|
10532
|
+
const move = (direction, length, scrollToIndex) => {
|
|
10533
|
+
const nextIndex = rowActiveIndex !== undefined ? getNextIndex(direction, rowActiveIndex, length) : 0;
|
|
10534
|
+
scrollToIndex(nextIndex);
|
|
10535
|
+
setTimeout(() => setRowActiveIndex(nextIndex), 50);
|
|
10536
|
+
};
|
|
10445
10537
|
const onKeyDown = React__default.useCallback((event, length, scrollToIndex) => {
|
|
10446
10538
|
if (!isEnabled || event.defaultPrevented) {
|
|
10447
10539
|
return;
|
|
@@ -11663,7 +11755,7 @@ function useTableRenderer(renderers, table, tableRef, defaultRowActiveIndex) {
|
|
|
11663
11755
|
} = useRowHeightVirtualisation(table);
|
|
11664
11756
|
// row groups
|
|
11665
11757
|
const rangeExtractor = useRowGroupVirtualisation(table);
|
|
11666
|
-
// account for thead and tfoot in the scroll area
|
|
11758
|
+
// account for thead and tfoot in the scroll area - both are always medium row height
|
|
11667
11759
|
const scrollPaddingStart = ROW_HEIGHT_ESTIMATES.medium;
|
|
11668
11760
|
// column groups offset the bottom padding :shrug:, multiplying by 1.5 ensures the bottom padding remains
|
|
11669
11761
|
// consistent when there are groups and when there aren't. 1.5 is relatively arbitrary, but it gives alignment
|
|
@@ -12421,7 +12513,7 @@ const DisplayRow = /*#__PURE__*/React__default.memo(function DisplayRow(props) {
|
|
|
12421
12513
|
const handleClickCapture = React__default.useCallback(() => {
|
|
12422
12514
|
// do this in the next frame, otherwise it remounts the row and prevents row actions on hover from being clickable
|
|
12423
12515
|
requestAnimationFrame(() => tableMeta.rowActive.setRowActiveIndex(index));
|
|
12424
|
-
}, []);
|
|
12516
|
+
}, [index]);
|
|
12425
12517
|
// row active
|
|
12426
12518
|
if (tableMeta.rowActive.isEnabled) {
|
|
12427
12519
|
attributes['data-row-active'] = tableMeta.rowActive.rowActiveIndex === index ? true : undefined;
|
|
@@ -12434,7 +12526,6 @@ const DisplayRow = /*#__PURE__*/React__default.memo(function DisplayRow(props) {
|
|
|
12434
12526
|
}
|
|
12435
12527
|
// row drag
|
|
12436
12528
|
if (tableMeta.rowDrag.isEnabled) {
|
|
12437
|
-
attributes.draggable = true;
|
|
12438
12529
|
attributes['aria-grabbed'] = !!tableMeta.rowDrag.dragging[row.id];
|
|
12439
12530
|
}
|
|
12440
12531
|
// row drop
|
|
@@ -13121,6 +13212,7 @@ function Body(props) {
|
|
|
13121
13212
|
enableHorizontalArrowKeyNavigation = false,
|
|
13122
13213
|
scrollToIndex,
|
|
13123
13214
|
table,
|
|
13215
|
+
tableElement,
|
|
13124
13216
|
...attributes
|
|
13125
13217
|
} = props;
|
|
13126
13218
|
const ref = React__default.useRef(null);
|
|
@@ -13138,12 +13230,30 @@ function Body(props) {
|
|
|
13138
13230
|
return;
|
|
13139
13231
|
}
|
|
13140
13232
|
tableMeta.rowActive.setHoverStatePaused(true);
|
|
13141
|
-
const
|
|
13233
|
+
const isMetaKeyPressed = isPressingMetaKey(event);
|
|
13234
|
+
let focusedElement;
|
|
13235
|
+
switch (event.key) {
|
|
13236
|
+
case 'ArrowLeft':
|
|
13237
|
+
focusedElement = isMetaKeyPressed ? focusManager.focusFirst() : focusManager.focusPrevious();
|
|
13238
|
+
break;
|
|
13239
|
+
case 'ArrowRight':
|
|
13240
|
+
focusedElement = isMetaKeyPressed ? focusManager.focusLast() : focusManager.focusNext();
|
|
13241
|
+
// Scrolls table all the way to the right
|
|
13242
|
+
if (isMetaKeyPressed && tableElement) {
|
|
13243
|
+
tableElement.scrollLeft = tableElement.scrollWidth;
|
|
13244
|
+
}
|
|
13245
|
+
break;
|
|
13246
|
+
default:
|
|
13247
|
+
focusedElement = event.shiftKey ? focusManager.focusPrevious() : focusManager.focusNext();
|
|
13248
|
+
break;
|
|
13249
|
+
}
|
|
13142
13250
|
if (focusedElement) {
|
|
13143
13251
|
// override default behaviour, since we're handling focus internally now
|
|
13144
13252
|
event.preventDefault();
|
|
13145
13253
|
return;
|
|
13146
13254
|
}
|
|
13255
|
+
// The code below only executes when focusedElement was undefined/null. This happens only when arrow-left/shift+tab
|
|
13256
|
+
// is pressed on the first cell or arrow-right/tab is pressed on the last cell.
|
|
13147
13257
|
if (event.shiftKey || event.key === 'ArrowLeft') {
|
|
13148
13258
|
if (!isFirstRow) {
|
|
13149
13259
|
// there are no previous elements to focus, go up a row or go outside the table
|
|
@@ -15223,6 +15333,8 @@ const Select2 = /*#__PURE__*/React__default.forwardRef(function Select2(props, r
|
|
|
15223
15333
|
var _listboxRef$current;
|
|
15224
15334
|
if (open) {
|
|
15225
15335
|
event.preventDefault();
|
|
15336
|
+
} else if (isElementInsideTable3OrReport(event.currentTarget)) {
|
|
15337
|
+
return;
|
|
15226
15338
|
} else if (!event.ctrlKey && !event.metaKey && (event.key === 'ArrowDown' || /^[a-z0-9]$/i.test(event.key))) {
|
|
15227
15339
|
setOpen(true);
|
|
15228
15340
|
}
|
|
@@ -15639,6 +15751,46 @@ function sortByHeader(a, b) {
|
|
|
15639
15751
|
function isEmptyFilter(filter) {
|
|
15640
15752
|
return !filter.value.hasOwnProperty('value'); // eslint-disable-line no-prototype-builtins
|
|
15641
15753
|
}
|
|
15754
|
+
function guessComparatorsBasedOnControl(column) {
|
|
15755
|
+
var _column$columnDef$met;
|
|
15756
|
+
const columnMeta = (_column$columnDef$met = column === null || column === void 0 ? void 0 : column.columnDef.meta) !== null && _column$columnDef$met !== void 0 ? _column$columnDef$met : {};
|
|
15757
|
+
if (Array.isArray(columnMeta.filters)) {
|
|
15758
|
+
return columnMeta.filters;
|
|
15759
|
+
}
|
|
15760
|
+
if (typeof columnMeta.control === 'function') {
|
|
15761
|
+
const renderedControl = columnMeta.control({
|
|
15762
|
+
onBlur: () => undefined,
|
|
15763
|
+
onFocus: () => undefined,
|
|
15764
|
+
setValue: () => undefined,
|
|
15765
|
+
value: undefined,
|
|
15766
|
+
disabled: false,
|
|
15767
|
+
readOnly: false,
|
|
15768
|
+
ref: undefined
|
|
15769
|
+
});
|
|
15770
|
+
if ( /*#__PURE__*/React__default.isValidElement(renderedControl)) {
|
|
15771
|
+
const {
|
|
15772
|
+
props,
|
|
15773
|
+
type
|
|
15774
|
+
} = renderedControl;
|
|
15775
|
+
if (type.displayName === 'Select2') {
|
|
15776
|
+
if (props.multiple) {
|
|
15777
|
+
return [exports.TableFilterComparator.HasAnyOf, exports.TableFilterComparator.HasAllOf, exports.TableFilterComparator.IsEqualTo, exports.TableFilterComparator.HasNoneOf, exports.TableFilterComparator.IsEmpty, exports.TableFilterComparator.IsNotEmpty];
|
|
15778
|
+
}
|
|
15779
|
+
return [exports.TableFilterComparator.IsEqualTo, exports.TableFilterComparator.IsNotEqualTo, exports.TableFilterComparator.IsEmpty, exports.TableFilterComparator.IsNotEmpty];
|
|
15780
|
+
}
|
|
15781
|
+
}
|
|
15782
|
+
}
|
|
15783
|
+
if (columnMeta.dataType === 'number') {
|
|
15784
|
+
return [exports.TableFilterComparator.IsEqualTo, exports.TableFilterComparator.IsNotEqualTo, exports.TableFilterComparator.IsGreaterThan, exports.TableFilterComparator.IsLessThan, exports.TableFilterComparator.IsBetween, exports.TableFilterComparator.IsEmpty, exports.TableFilterComparator.IsNotEmpty];
|
|
15785
|
+
}
|
|
15786
|
+
if (columnMeta.control === 'datepicker' || columnMeta.dataType === 'datetime') {
|
|
15787
|
+
return [exports.TableFilterComparator.IsEqualTo, exports.TableFilterComparator.IsNotEqualTo, exports.TableFilterComparator.IsBetween, exports.TableFilterComparator.IsLessThan, exports.TableFilterComparator.IsGreaterThan, exports.TableFilterComparator.IsEmpty, exports.TableFilterComparator.IsNotEmpty, exports.TableFilterComparator.IsLessThanOrEqualTo, exports.TableFilterComparator.IsGreaterThanOrEqualTo];
|
|
15788
|
+
}
|
|
15789
|
+
if (columnMeta.control === 'switch') {
|
|
15790
|
+
return [exports.TableFilterComparator.IsEqualTo];
|
|
15791
|
+
}
|
|
15792
|
+
return [exports.TableFilterComparator.Contains, exports.TableFilterComparator.DoesNotContain, exports.TableFilterComparator.IsEqualTo, exports.TableFilterComparator.IsNotEqualTo, exports.TableFilterComparator.IsEmpty, exports.TableFilterComparator.IsNotEmpty];
|
|
15793
|
+
}
|
|
15642
15794
|
|
|
15643
15795
|
const FilterColumn = /*#__PURE__*/React__default.forwardRef((props, ref) => {
|
|
15644
15796
|
const {
|
|
@@ -15692,11 +15844,6 @@ function FilterComparator(props) {
|
|
|
15692
15844
|
texts
|
|
15693
15845
|
} = useLocalization();
|
|
15694
15846
|
const validComparators = guessComparatorsBasedOnControl(column);
|
|
15695
|
-
React__default.useEffect(() => {
|
|
15696
|
-
if (value === undefined || !validComparators.includes(value)) {
|
|
15697
|
-
handleChange === null || handleChange === void 0 ? void 0 : handleChange(validComparators[0]);
|
|
15698
|
-
}
|
|
15699
|
-
}, [validComparators]);
|
|
15700
15847
|
return /*#__PURE__*/React__default.createElement(Select2, Object.assign({}, attributes, {
|
|
15701
15848
|
className: "!w-32 flex-shrink-0",
|
|
15702
15849
|
disabled: !column,
|
|
@@ -15707,49 +15854,9 @@ function FilterComparator(props) {
|
|
|
15707
15854
|
value: comparator
|
|
15708
15855
|
}, getComparatorText(comparator, texts, column)))));
|
|
15709
15856
|
}
|
|
15710
|
-
function guessComparatorsBasedOnControl(column) {
|
|
15711
|
-
var _column$columnDef$met;
|
|
15712
|
-
const columnMeta = (_column$columnDef$met = column === null || column === void 0 ? void 0 : column.columnDef.meta) !== null && _column$columnDef$met !== void 0 ? _column$columnDef$met : {};
|
|
15713
|
-
if (Array.isArray(columnMeta.filters)) {
|
|
15714
|
-
return columnMeta.filters;
|
|
15715
|
-
}
|
|
15716
|
-
if (typeof columnMeta.control === 'function') {
|
|
15717
|
-
const renderedControl = columnMeta.control({
|
|
15718
|
-
onBlur: () => undefined,
|
|
15719
|
-
onFocus: () => undefined,
|
|
15720
|
-
setValue: () => undefined,
|
|
15721
|
-
value: undefined,
|
|
15722
|
-
disabled: false,
|
|
15723
|
-
readOnly: false,
|
|
15724
|
-
ref: undefined
|
|
15725
|
-
});
|
|
15726
|
-
if ( /*#__PURE__*/React__default.isValidElement(renderedControl)) {
|
|
15727
|
-
const {
|
|
15728
|
-
props,
|
|
15729
|
-
type
|
|
15730
|
-
} = renderedControl;
|
|
15731
|
-
if (type.displayName === 'Select2') {
|
|
15732
|
-
if (props.multiple) {
|
|
15733
|
-
return [exports.TableFilterComparator.HasAnyOf, exports.TableFilterComparator.HasAllOf, exports.TableFilterComparator.IsEqualTo, exports.TableFilterComparator.HasNoneOf, exports.TableFilterComparator.IsEmpty, exports.TableFilterComparator.IsNotEmpty];
|
|
15734
|
-
}
|
|
15735
|
-
return [exports.TableFilterComparator.IsEqualTo, exports.TableFilterComparator.IsNotEqualTo, exports.TableFilterComparator.IsEmpty, exports.TableFilterComparator.IsNotEmpty];
|
|
15736
|
-
}
|
|
15737
|
-
}
|
|
15738
|
-
}
|
|
15739
|
-
if (columnMeta.dataType === 'number') {
|
|
15740
|
-
return [exports.TableFilterComparator.IsEqualTo, exports.TableFilterComparator.IsNotEqualTo, exports.TableFilterComparator.IsGreaterThan, exports.TableFilterComparator.IsLessThan, exports.TableFilterComparator.IsBetween, exports.TableFilterComparator.IsEmpty, exports.TableFilterComparator.IsNotEmpty];
|
|
15741
|
-
}
|
|
15742
|
-
if (columnMeta.control === 'datepicker' || columnMeta.dataType === 'datetime') {
|
|
15743
|
-
return [exports.TableFilterComparator.IsEqualTo, exports.TableFilterComparator.IsNotEqualTo, exports.TableFilterComparator.IsBetween, exports.TableFilterComparator.IsLessThan, exports.TableFilterComparator.IsGreaterThan, exports.TableFilterComparator.IsEmpty, exports.TableFilterComparator.IsNotEmpty, exports.TableFilterComparator.IsLessThanOrEqualTo, exports.TableFilterComparator.IsGreaterThanOrEqualTo];
|
|
15744
|
-
}
|
|
15745
|
-
if (columnMeta.control === 'switch') {
|
|
15746
|
-
return [exports.TableFilterComparator.IsEqualTo];
|
|
15747
|
-
}
|
|
15748
|
-
return [exports.TableFilterComparator.Contains, exports.TableFilterComparator.DoesNotContain, exports.TableFilterComparator.IsEqualTo, exports.TableFilterComparator.IsNotEqualTo, exports.TableFilterComparator.IsEmpty, exports.TableFilterComparator.IsNotEmpty];
|
|
15749
|
-
}
|
|
15750
15857
|
function getComparatorText(comparator, texts, column) {
|
|
15751
|
-
var _column$columnDef, _column$columnDef$
|
|
15752
|
-
const isDate = (column === null || column === void 0 ? void 0 : (_column$columnDef = column.columnDef) === null || _column$columnDef === void 0 ? void 0 : (_column$columnDef$
|
|
15858
|
+
var _column$columnDef, _column$columnDef$met;
|
|
15859
|
+
const isDate = (column === null || column === void 0 ? void 0 : (_column$columnDef = column.columnDef) === null || _column$columnDef === void 0 ? void 0 : (_column$columnDef$met = _column$columnDef.meta) === null || _column$columnDef$met === void 0 ? void 0 : _column$columnDef$met.control) === 'datepicker';
|
|
15753
15860
|
switch (comparator) {
|
|
15754
15861
|
case exports.TableFilterComparator.Contains:
|
|
15755
15862
|
return texts.table.filters.comparators.contains;
|
|
@@ -15925,14 +16032,22 @@ function Filter$1(props) {
|
|
|
15925
16032
|
}
|
|
15926
16033
|
} = filter;
|
|
15927
16034
|
const handleChangeColumn = columnId => {
|
|
15928
|
-
var _previousColumn$colum, _nextColumn$columnDef;
|
|
16035
|
+
var _previousColumn$colum, _previousColumn$colum2, _nextColumn$columnDef;
|
|
15929
16036
|
const previousColumn = allColumns.find(column => column.id === id);
|
|
15930
16037
|
const nextColumn = allColumns.find(column => column.id === columnId);
|
|
15931
16038
|
// UX requirement: if old column data type is the same as next column data type,
|
|
15932
16039
|
// then we applying the same filter value for the next column,
|
|
15933
16040
|
// but when data types are different, we're reseting comparator ans value for the next column
|
|
15934
|
-
|
|
15935
|
-
|
|
16041
|
+
if (previousColumn !== null && previousColumn !== void 0 && (_previousColumn$colum = previousColumn.columnDef.meta) !== null && _previousColumn$colum !== void 0 && _previousColumn$colum.dataType && (previousColumn === null || previousColumn === void 0 ? void 0 : (_previousColumn$colum2 = previousColumn.columnDef.meta) === null || _previousColumn$colum2 === void 0 ? void 0 : _previousColumn$colum2.dataType) === (nextColumn === null || nextColumn === void 0 ? void 0 : (_nextColumn$columnDef = nextColumn.columnDef.meta) === null || _nextColumn$columnDef === void 0 ? void 0 : _nextColumn$columnDef.dataType)) {
|
|
16042
|
+
handleChange(position, {
|
|
16043
|
+
id: columnId,
|
|
16044
|
+
value: filter.value
|
|
16045
|
+
});
|
|
16046
|
+
return;
|
|
16047
|
+
}
|
|
16048
|
+
const validComparators = guessComparatorsBasedOnControl(nextColumn);
|
|
16049
|
+
const value = {
|
|
16050
|
+
comparator: validComparators[0],
|
|
15936
16051
|
value: undefined
|
|
15937
16052
|
};
|
|
15938
16053
|
handleChange(position, {
|
|
@@ -16242,9 +16357,10 @@ function TableGrid(props) {
|
|
|
16242
16357
|
key: props.id,
|
|
16243
16358
|
header: props,
|
|
16244
16359
|
scrollToIndex: table.renderer.scrollToIndex
|
|
16245
|
-
}))))))), table.instance.
|
|
16360
|
+
}))))))), table.instance.getCoreRowModel().rows.length ? ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Body, {
|
|
16246
16361
|
enableHorizontalArrowKeyNavigation: enableHorizontalArrowKeyNavigation,
|
|
16247
16362
|
table: table.instance,
|
|
16363
|
+
tableElement: table.ref.current,
|
|
16248
16364
|
scrollToIndex: table.renderer.scrollToIndex,
|
|
16249
16365
|
style: table.renderer.style
|
|
16250
16366
|
}, table.renderer.rows), table.meta.footer.isEnabled ? /*#__PURE__*/React__default.createElement(Foot, {
|
|
@@ -17752,7 +17868,7 @@ const useTableRowCreation = (data, tableRef) => {
|
|
|
17752
17868
|
};
|
|
17753
17869
|
};
|
|
17754
17870
|
|
|
17755
|
-
function useTableEditingListener(table) {
|
|
17871
|
+
function useTableEditingListener(table, tableRef) {
|
|
17756
17872
|
const tableMeta = table.options.meta;
|
|
17757
17873
|
const saveChanges = () => {
|
|
17758
17874
|
requestAnimationFrame(() => {
|
|
@@ -17794,6 +17910,20 @@ function useTableEditingListener(table) {
|
|
|
17794
17910
|
window.removeEventListener('beforeunload', showUnsavedChangesWarning);
|
|
17795
17911
|
};
|
|
17796
17912
|
}, [tableMeta.editing.isEditing, hasChanges]);
|
|
17913
|
+
React__default.useEffect(() => {
|
|
17914
|
+
const onClickOutside = event => {
|
|
17915
|
+
if (tableMeta.editing.isEditing) {
|
|
17916
|
+
var _event$target$getAttr, _event$target;
|
|
17917
|
+
const element = (_event$target$getAttr = (_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.getAttribute('data-taco')) !== null && _event$target$getAttr !== void 0 ? _event$target$getAttr : '';
|
|
17918
|
+
const insideTable = isElementInsideOrTriggeredFromContainer(event.target, tableRef.current) || element === 'backdrop';
|
|
17919
|
+
if (!insideTable) {
|
|
17920
|
+
saveChanges();
|
|
17921
|
+
}
|
|
17922
|
+
}
|
|
17923
|
+
};
|
|
17924
|
+
document.addEventListener('click', onClickOutside);
|
|
17925
|
+
return () => document.removeEventListener('click', onClickOutside);
|
|
17926
|
+
}, [saveChanges, tableMeta.editing.isEditing]);
|
|
17797
17927
|
}
|
|
17798
17928
|
|
|
17799
17929
|
function willRowMove(cell, change, rowIndex) {
|
|
@@ -17872,15 +18002,6 @@ function useTableEditing(isEnabled = false, handleSave, validator) {
|
|
|
17872
18002
|
// changes are saved as soon as the active row changes, so in most cases this will only contain the active row's changes
|
|
17873
18003
|
// but not always - if validation or server requests fail when saving, those rows remain until the failure is resolved
|
|
17874
18004
|
const pendingChangesFns = usePendingChanges(isEnabled, handleSave, validator);
|
|
17875
|
-
// if focus leaves the table in any way, trigger a save
|
|
17876
|
-
const handleBlur = React__default.useCallback(event => {
|
|
17877
|
-
// custom event from datepicker, and it doesn't have the relatedTarget property set.
|
|
17878
|
-
const isClosingDatepicker = dateFns.isDate(event.detail);
|
|
17879
|
-
if (event.relatedTarget !== event.currentTarget && !isElementInsideOrTriggeredFromContainer(event.relatedTarget, event.currentTarget) && !isClosingDatepicker) {
|
|
17880
|
-
pendingChangesFns.saveChanges();
|
|
17881
|
-
}
|
|
17882
|
-
}, [pendingChangesFns.saveChanges]);
|
|
17883
|
-
// TODO: using useGlobalKeyDown prevents trigger when focused on inputs, but it's more "proper"
|
|
17884
18005
|
useGlobalKeyDown(isEnabled && isEditing ? {
|
|
17885
18006
|
key: 's',
|
|
17886
18007
|
meta: true,
|
|
@@ -17897,8 +18018,7 @@ function useTableEditing(isEnabled = false, handleSave, validator) {
|
|
|
17897
18018
|
toggleEditing: isEnabled ? toggleEditing : () => undefined,
|
|
17898
18019
|
lastFocusedCellIndex,
|
|
17899
18020
|
setLastFocusedCellIndex,
|
|
17900
|
-
...pendingChangesFns
|
|
17901
|
-
handleBlur: isEnabled && isEditing ? handleBlur : () => undefined
|
|
18021
|
+
...pendingChangesFns
|
|
17902
18022
|
};
|
|
17903
18023
|
}
|
|
17904
18024
|
function usePendingChanges(isEnabled, handleSave, validator) {
|
|
@@ -18222,7 +18342,7 @@ function RowMoveIndicator(props) {
|
|
|
18222
18342
|
if (cellRef.current) {
|
|
18223
18343
|
if (isActiveRow && !!moveReason) {
|
|
18224
18344
|
var _cellRef$current$pare;
|
|
18225
|
-
const firstChild = (_cellRef$current$pare = cellRef.current.parentElement) === null || _cellRef$current$pare === void 0 ? void 0 : _cellRef$current$pare.querySelector(
|
|
18345
|
+
const firstChild = (_cellRef$current$pare = cellRef.current.parentElement) === null || _cellRef$current$pare === void 0 ? void 0 : _cellRef$current$pare.querySelector(`td[data-taco="cell-control"]`);
|
|
18226
18346
|
if (cellRef.current === firstChild) {
|
|
18227
18347
|
var _cellRef$current$pare2;
|
|
18228
18348
|
setShow(true);
|
|
@@ -18477,6 +18597,7 @@ function EditingControlCell(props) {
|
|
|
18477
18597
|
const cellAttributes = {
|
|
18478
18598
|
...getCellAttributes(cell, index, isHighlighted),
|
|
18479
18599
|
'data-cell-editing-invalid': error ? true : undefined,
|
|
18600
|
+
'data-taco': 'cell-control',
|
|
18480
18601
|
onFocus: handleFocus,
|
|
18481
18602
|
ref: cellRef,
|
|
18482
18603
|
tabIndex: -1
|
|
@@ -18575,7 +18696,7 @@ const MemoedEditingCell = /*#__PURE__*/React__default.memo(function MemoedEditin
|
|
|
18575
18696
|
return;
|
|
18576
18697
|
}
|
|
18577
18698
|
// toggle into detailed mode when actually inputting something
|
|
18578
|
-
if (/^[a-z0-9]$/i.test(event.key) || event.key === 'Backspace') {
|
|
18699
|
+
if (!isPressingMetaKey(event) && (/^[a-z0-9]$/i.test(event.key) || event.key === 'Backspace')) {
|
|
18579
18700
|
toggleDetailedMode(true);
|
|
18580
18701
|
}
|
|
18581
18702
|
};
|
|
@@ -18674,16 +18795,24 @@ function EditingActionMenu(props) {
|
|
|
18674
18795
|
hasErrors,
|
|
18675
18796
|
onClear: handleClear,
|
|
18676
18797
|
onExit: handleExit,
|
|
18677
|
-
onSave: handleSave
|
|
18798
|
+
onSave: handleSave,
|
|
18799
|
+
isLastRow
|
|
18678
18800
|
} = props;
|
|
18679
18801
|
const {
|
|
18680
18802
|
texts
|
|
18681
18803
|
} = useLocalization();
|
|
18804
|
+
const handleKeyDown = event => {
|
|
18805
|
+
// normally we handle this on change of active row, but when tabbing out of the last row the active row state stays on the last one.
|
|
18806
|
+
if (isLastRow && hasChanges && event.key === 'Tab') {
|
|
18807
|
+
handleSave();
|
|
18808
|
+
}
|
|
18809
|
+
};
|
|
18682
18810
|
return /*#__PURE__*/React__default.createElement(IconButton, {
|
|
18683
18811
|
appearance: "transparent",
|
|
18684
18812
|
"aria-label": texts.table3.editing.actions.tooltip,
|
|
18685
18813
|
className: "group-[[data-row-editing-status]]/row:hidden",
|
|
18686
18814
|
icon: "more",
|
|
18815
|
+
onKeyDown: handleKeyDown,
|
|
18687
18816
|
menu: menuProps => ( /*#__PURE__*/React__default.createElement(Menu$1, Object.assign({}, menuProps), /*#__PURE__*/React__default.createElement(Menu$1.Content, null, /*#__PURE__*/React__default.createElement(Menu$1.Item, {
|
|
18688
18817
|
icon: "tick",
|
|
18689
18818
|
disabled: !hasChanges || hasErrors,
|
|
@@ -18783,7 +18912,7 @@ function Row$2(props) {
|
|
|
18783
18912
|
if (tableMeta.editing.isEditing && isActiveRow) {
|
|
18784
18913
|
var _event$target$closest, _event$target$closest2;
|
|
18785
18914
|
const cellIndex = Number((_event$target$closest = (_event$target$closest2 = event.target.closest('td')) === null || _event$target$closest2 === void 0 ? void 0 : _event$target$closest2.getAttribute('data-cell-index')) !== null && _event$target$closest !== void 0 ? _event$target$closest : undefined);
|
|
18786
|
-
if (!isNaN(cellIndex)
|
|
18915
|
+
if (!isNaN(cellIndex)) {
|
|
18787
18916
|
tableMeta.editing.setLastFocusedCellIndex(Number(cellIndex));
|
|
18788
18917
|
}
|
|
18789
18918
|
}
|
|
@@ -18813,7 +18942,8 @@ function useTable3(props, ref) {
|
|
|
18813
18942
|
hasErrors: editing.hasRowErrors(rowId),
|
|
18814
18943
|
onClear: () => editing.resetChanges(rowId),
|
|
18815
18944
|
onSave: () => editing.saveChanges(rowId),
|
|
18816
|
-
onExit: () => editing.toggleEditing(false)
|
|
18945
|
+
onExit: () => editing.toggleEditing(false),
|
|
18946
|
+
isLastRow: table.meta.rowActive.rowActiveIndex === table.meta.length - 1
|
|
18817
18947
|
}))] : props.rowActions
|
|
18818
18948
|
};
|
|
18819
18949
|
const meta = {
|
|
@@ -18821,7 +18951,7 @@ function useTable3(props, ref) {
|
|
|
18821
18951
|
};
|
|
18822
18952
|
const table = useTable(extendedProps, ref, RENDERERS$1, meta);
|
|
18823
18953
|
// listeners
|
|
18824
|
-
useTableEditingListener(table.instance);
|
|
18954
|
+
useTableEditingListener(table.instance, table.ref);
|
|
18825
18955
|
React__default.useEffect(() => {
|
|
18826
18956
|
if (table.ref.current) {
|
|
18827
18957
|
table.ref.current.instance.toggleEditing = enabled => table.meta.editing.toggleEditing(enabled !== null && enabled !== void 0 ? enabled : editing => !editing);
|
|
@@ -19010,15 +19140,9 @@ Group$5.displayName = 'Table3Group';
|
|
|
19010
19140
|
const BaseTable3 = /*#__PURE__*/fixedForwardRef(function BaseTable3(props, ref) {
|
|
19011
19141
|
var _table3$meta$editing, _table3$meta$editing2;
|
|
19012
19142
|
const table3 = useTable3(props, ref);
|
|
19013
|
-
const handleBlur = event => {
|
|
19014
|
-
if (table3.meta.editing.isEditing) {
|
|
19015
|
-
table3.meta.editing.handleBlur(event);
|
|
19016
|
-
}
|
|
19017
|
-
};
|
|
19018
19143
|
const gridAttributes = {
|
|
19019
19144
|
'data-table-editing-mode': (_table3$meta$editing = table3.meta.editing) !== null && _table3$meta$editing !== void 0 && _table3$meta$editing.isEditing ? (_table3$meta$editing2 = table3.meta.editing) !== null && _table3$meta$editing2 !== void 0 && _table3$meta$editing2.isDetailedMode ? 'detailed' : 'normal' : undefined,
|
|
19020
|
-
enableHorizontalArrowKeyNavigation: table3.meta.editing.isEditing
|
|
19021
|
-
onBlur: handleBlur
|
|
19145
|
+
enableHorizontalArrowKeyNavigation: table3.meta.editing.isEditing
|
|
19022
19146
|
};
|
|
19023
19147
|
const hasValidationErrors = table3.meta.editing.hasErrors(table3.instance, table3.ref);
|
|
19024
19148
|
return /*#__PURE__*/React__default.createElement(Table, null, /*#__PURE__*/React__default.createElement(Table.Toolbar, {
|