@economic/taco 2.34.0 → 2.35.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/Drawer/Context.d.ts +1 -0
- package/dist/components/Drawer/Drawer.d.ts +6 -0
- 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/Provider/Localization.d.ts +1 -0
- package/dist/components/Select2/Select2.d.ts +25 -4
- 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 -0
- package/dist/esm/packages/taco/src/components/Datepicker/Datepicker.js +13 -3
- package/dist/esm/packages/taco/src/components/Datepicker/Datepicker.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Drawer/Context.js +1 -0
- package/dist/esm/packages/taco/src/components/Drawer/Context.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Drawer/Drawer.js +3 -1
- package/dist/esm/packages/taco/src/components/Drawer/Drawer.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Drawer/components/Content.js +41 -8
- package/dist/esm/packages/taco/src/components/Drawer/components/Content.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Drawer/util.js +1 -1
- package/dist/esm/packages/taco/src/components/Drawer/util.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/List/components/Toggle.js +26 -15
- package/dist/esm/packages/taco/src/components/List/components/Toggle.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Provider/Localization.js +2 -1
- package/dist/esm/packages/taco/src/components/Provider/Localization.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/Select2.js +48 -10
- 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 +1 -0
- 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/Cell/util.js +2 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/util.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 -12
- 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 +1 -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 +2 -2
- 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/Body/util.js +12 -5
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Body/util.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Menu.js +9 -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/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/FilterColumn.js +3 -4
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterColumn.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterComparator.js +3 -4
- 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/useTableDataLoader.js +0 -4
- package/dist/esm/packages/taco/src/primitives/Table/useTableDataLoader.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/search.js +3 -2
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/search.js.map +1 -1
- package/dist/index.css +4 -0
- package/dist/primitives/Table/Core/components/Body/util.d.ts +2 -2
- package/dist/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterColumn.d.ts +1 -1
- package/dist/taco.cjs.development.js +287 -87
- 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
@@ -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,
|
@@ -4662,7 +4747,8 @@ const defaultLocalisationTexts = {
|
|
4662
4747
|
open: 'Open'
|
4663
4748
|
},
|
4664
4749
|
drawer: {
|
4665
|
-
close: 'Close'
|
4750
|
+
close: 'Close',
|
4751
|
+
back: 'Back'
|
4666
4752
|
}
|
4667
4753
|
};
|
4668
4754
|
const defaultLocalizationContext = {
|
@@ -5217,6 +5303,11 @@ const InputWithoutDeprecatedFeatures = /*#__PURE__*/React.forwardRef(function In
|
|
5217
5303
|
event.preventDefault();
|
5218
5304
|
const position = event.key === 'End' ? event.currentTarget.value.length : 0;
|
5219
5305
|
event.currentTarget.setSelectionRange(position, position);
|
5306
|
+
// Necessary for ensuring the cursor is scrolled into view when using Home/End keys on Windows
|
5307
|
+
if (internalRef.current) {
|
5308
|
+
const scrollPosition = event.key === 'End' ? internalRef.current.scrollWidth : 0;
|
5309
|
+
internalRef.current.scrollLeft = scrollPosition;
|
5310
|
+
}
|
5220
5311
|
}
|
5221
5312
|
}
|
5222
5313
|
if (typeof onKeyDown === 'function') {
|
@@ -6312,6 +6403,13 @@ const Datepicker = /*#__PURE__*/React.forwardRef(function Datepicker(props, ref)
|
|
6312
6403
|
texts
|
6313
6404
|
} = useLocalization();
|
6314
6405
|
const className = cn('inline-flex w-full text-black font-normal', externalClassName);
|
6406
|
+
const popoverContentRef = React.useRef(null);
|
6407
|
+
const handleOpenAutofocus = React.useCallback(e => {
|
6408
|
+
var _popoverContentRef$cu, _popoverContentRef$cu2;
|
6409
|
+
e.preventDefault();
|
6410
|
+
const currentDay = (_popoverContentRef$cu = popoverContentRef === null || popoverContentRef === void 0 ? void 0 : (_popoverContentRef$cu2 = popoverContentRef.current) === null || _popoverContentRef$cu2 === void 0 ? void 0 : _popoverContentRef$cu2.querySelector('table button[name="day"][aria-selected="true"]')) !== null && _popoverContentRef$cu !== void 0 ? _popoverContentRef$cu : null;
|
6411
|
+
currentDay === null || currentDay === void 0 ? void 0 : currentDay.focus();
|
6412
|
+
}, [popoverContentRef]);
|
6315
6413
|
return /*#__PURE__*/React.createElement("span", {
|
6316
6414
|
className: className,
|
6317
6415
|
"data-taco": "datepicker",
|
@@ -6322,10 +6420,13 @@ const Datepicker = /*#__PURE__*/React.forwardRef(function Datepicker(props, ref)
|
|
6322
6420
|
disabled: input.disabled || input.readOnly,
|
6323
6421
|
icon: "calendar",
|
6324
6422
|
tabIndex: -1,
|
6325
|
-
popover: props => ( /*#__PURE__*/React.createElement(Popover, Object.assign({}, props), /*#__PURE__*/React.createElement(Popover.Content,
|
6423
|
+
popover: props => ( /*#__PURE__*/React.createElement(Popover, Object.assign({}, props), /*#__PURE__*/React.createElement(Popover.Content, {
|
6424
|
+
onOpenAutoFocus: handleOpenAutofocus
|
6425
|
+
}, ({
|
6326
6426
|
close
|
6327
6427
|
}) => ( /*#__PURE__*/React.createElement("div", {
|
6328
|
-
className: "-m-3 flex
|
6428
|
+
className: '[&_button[name="day"]:focus]:yt-focus -m-3 flex',
|
6429
|
+
ref: popoverContentRef
|
6329
6430
|
}, /*#__PURE__*/React.createElement(Calendar$1, Object.assign({}, calendar, {
|
6330
6431
|
onChange: (date, event) => {
|
6331
6432
|
calendar.onChange(date, event);
|
@@ -6682,6 +6783,7 @@ const useCurrentMenu = () => {
|
|
6682
6783
|
const DrawerContext = /*#__PURE__*/React.createContext({
|
6683
6784
|
closeOnEscape: true,
|
6684
6785
|
showCloseButton: true,
|
6786
|
+
onClickBack: () => {},
|
6685
6787
|
onClose: () => {},
|
6686
6788
|
onResize: () => {},
|
6687
6789
|
props: {},
|
@@ -6713,7 +6815,7 @@ const getDrawerContentClassNames = (size, variant, open) => {
|
|
6713
6815
|
const getDrawerContainerClassNames = variant => {
|
6714
6816
|
return cn('bg-white mx-auto absolute h-full w-full flex flex-col ', {
|
6715
6817
|
'shadow-[0_6px_9px_0_rgba(89,85,98,0.3),0_0_1px_0_rgba(89,85,98,0.2)]': variant === 'overlay',
|
6716
|
-
'border-l border-grey h-full': variant === 'embedded'
|
6818
|
+
'border-l border-grey-300 h-full': variant === 'embedded'
|
6717
6819
|
});
|
6718
6820
|
};
|
6719
6821
|
const getDrawerDragHandlerClassNames = () => {
|
@@ -6779,24 +6881,55 @@ const RenderPropWrapper$2 = /*#__PURE__*/React__default.forwardRef(function Rend
|
|
6779
6881
|
...renderProps
|
6780
6882
|
});
|
6781
6883
|
});
|
6782
|
-
const Title$2 = /*#__PURE__*/React__default.forwardRef(function DrawerTitle(props,
|
6884
|
+
const Title$2 = /*#__PURE__*/React__default.forwardRef(function DrawerTitle(props, externalRef) {
|
6783
6885
|
const {
|
6784
6886
|
className,
|
6785
6887
|
children,
|
6786
6888
|
...otherProps
|
6787
6889
|
} = props;
|
6890
|
+
const ref = useMergedRef(externalRef);
|
6891
|
+
const [style, setStyle] = React__default.useState({});
|
6892
|
+
const {
|
6893
|
+
texts
|
6894
|
+
} = useLocalization();
|
6895
|
+
const {
|
6896
|
+
onClickBack
|
6897
|
+
} = useCurrentDrawer();
|
6788
6898
|
/**
|
6789
6899
|
* By design in default drawer version Title has grey separator, but we might have exceptions like Drawer + Tabs scenario,
|
6790
|
-
* where we might want to hide the grey separator. For this reason separator was
|
6791
|
-
* so it can be easily overriden in exceptional
|
6900
|
+
* where we might want to hide the grey separator. For this reason separator was rendered with using of classNames,
|
6901
|
+
* so it can be easily overriden in exceptional scenarios.
|
6792
6902
|
* */
|
6793
|
-
const cName = cn('grow-0 py-4
|
6903
|
+
const cName = cn('grow-0 py-4 px-4 justify-self-start mb-0 border-b-[1px] border-grey-300 flex items-start', className);
|
6904
|
+
React__default.useEffect(() => {
|
6905
|
+
var _ref$current, _drawer$querySelector, _closeButton$offsetWi, _drawer$querySelector2, _actionsWrapper$offse;
|
6906
|
+
const drawer = ref === null || ref === void 0 ? void 0 : (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.closest('[data-taco="drawer"]');
|
6907
|
+
// This is the margin amount that we need to deduct from the margins to align with the design
|
6908
|
+
const marginAdjust = 4;
|
6909
|
+
const closeButton = (_drawer$querySelector = drawer === null || drawer === void 0 ? void 0 : drawer.querySelector(`[aria-label="${texts.drawer.close}"]`)) !== null && _drawer$querySelector !== void 0 ? _drawer$querySelector : null;
|
6910
|
+
const closeButtonWidth = (_closeButton$offsetWi = closeButton === null || closeButton === void 0 ? void 0 : closeButton.offsetWidth) !== null && _closeButton$offsetWi !== void 0 ? _closeButton$offsetWi : 0;
|
6911
|
+
const closeButtonRightMargin = 8;
|
6912
|
+
const actionsWrapper = (_drawer$querySelector2 = drawer === null || drawer === void 0 ? void 0 : drawer.querySelector(`#taco-drawer-actions[data-taco="group"]`)) !== null && _drawer$querySelector2 !== void 0 ? _drawer$querySelector2 : null;
|
6913
|
+
const actionsWrapperWidth = (_actionsWrapper$offse = actionsWrapper === null || actionsWrapper === void 0 ? void 0 : actionsWrapper.offsetWidth) !== null && _actionsWrapper$offse !== void 0 ? _actionsWrapper$offse : 0;
|
6914
|
+
const actionsWrapperRightMargin = 8;
|
6915
|
+
const marginRight = closeButtonWidth + actionsWrapperWidth + closeButtonRightMargin + actionsWrapperRightMargin - marginAdjust;
|
6916
|
+
setStyle({
|
6917
|
+
marginRight
|
6918
|
+
});
|
6919
|
+
}, [ref, texts.drawer.close]);
|
6794
6920
|
return /*#__PURE__*/React__default.createElement(DialogPrimitive.Title, Object.assign({
|
6795
6921
|
className: cName
|
6796
6922
|
}, otherProps, {
|
6797
6923
|
ref: ref
|
6798
|
-
}), /*#__PURE__*/React__default.createElement(
|
6799
|
-
|
6924
|
+
}), onClickBack ? ( /*#__PURE__*/React__default.createElement(IconButton, {
|
6925
|
+
appearance: "discrete",
|
6926
|
+
"aria-label": texts.drawer.back,
|
6927
|
+
className: "mr-3 text-base",
|
6928
|
+
icon: "chevron-left",
|
6929
|
+
onClick: onClickBack
|
6930
|
+
})) : null, /*#__PURE__*/React__default.createElement("span", {
|
6931
|
+
className: "line-clamp-2 inline-block overflow-y-hidden",
|
6932
|
+
style: style
|
6800
6933
|
}, children));
|
6801
6934
|
});
|
6802
6935
|
const Footer$2 = /*#__PURE__*/React__default.forwardRef(function DrawerFooter(props, ref) {
|
@@ -6819,8 +6952,10 @@ const Actions = /*#__PURE__*/React__default.forwardRef(function Actions(props, r
|
|
6819
6952
|
...otherProps
|
6820
6953
|
} = props;
|
6821
6954
|
const cName = cn('absolute top-0 right-10 mr-[8px] mt-4', className);
|
6955
|
+
// Id is added to identify the actions wrapper inside a useEffect in Dialog.Title
|
6822
6956
|
return /*#__PURE__*/React__default.createElement(Group, Object.assign({}, otherProps, {
|
6823
6957
|
className: cName,
|
6958
|
+
id: "taco-drawer-actions",
|
6824
6959
|
ref: ref
|
6825
6960
|
}));
|
6826
6961
|
});
|
@@ -6934,8 +7069,8 @@ const DrawerContent = /*#__PURE__*/React__default.forwardRef(function Content(pr
|
|
6934
7069
|
};
|
6935
7070
|
}, [size, variant, open]);
|
6936
7071
|
const handleEscapeKeyDown = event => {
|
6937
|
-
var _ref$
|
6938
|
-
const isTargetInsideDrawerContent = (_ref$
|
7072
|
+
var _ref$current2;
|
7073
|
+
const isTargetInsideDrawerContent = (_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : _ref$current2.contains(event.target);
|
6939
7074
|
if (isTargetInsideDrawerContent) {
|
6940
7075
|
if (!closeOnEscape) {
|
6941
7076
|
event.preventDefault();
|
@@ -7065,6 +7200,7 @@ const Drawer = /*#__PURE__*/React.forwardRef(function Drawer(props, ref) {
|
|
7065
7200
|
closeOnEscape = true,
|
7066
7201
|
onResize,
|
7067
7202
|
onClose,
|
7203
|
+
onClickBack,
|
7068
7204
|
size = 'md',
|
7069
7205
|
trigger,
|
7070
7206
|
children,
|
@@ -7081,6 +7217,7 @@ const Drawer = /*#__PURE__*/React.forwardRef(function Drawer(props, ref) {
|
|
7081
7217
|
const [outlet, setOutlet] = React.useState();
|
7082
7218
|
const context = React.useMemo(() => ({
|
7083
7219
|
closeOnEscape,
|
7220
|
+
onClickBack,
|
7084
7221
|
onClose,
|
7085
7222
|
onResize,
|
7086
7223
|
props: otherProps,
|
@@ -7092,7 +7229,7 @@ const Drawer = /*#__PURE__*/React.forwardRef(function Drawer(props, ref) {
|
|
7092
7229
|
focusTrap,
|
7093
7230
|
showCloseButton,
|
7094
7231
|
outlet
|
7095
|
-
}), [closeOnEscape, open, setOpen, otherProps, variant, onResize, onClose, size, focusTrap, showCloseButton, outlet]);
|
7232
|
+
}), [closeOnEscape, open, setOpen, otherProps, variant, onResize, onClose, size, focusTrap, showCloseButton, outlet, onClickBack]);
|
7096
7233
|
// this prevents two drawers being open at once and used when one drawer getting opened before another one got closed.
|
7097
7234
|
const close = React.useCallback(() => {
|
7098
7235
|
setOpen(false);
|
@@ -7456,6 +7593,7 @@ Switch.displayName = 'Switch';
|
|
7456
7593
|
const ToggleItem = /*#__PURE__*/React__default.forwardRef(function Toggle(props, ref) {
|
7457
7594
|
const {
|
7458
7595
|
controlRef,
|
7596
|
+
onToggle,
|
7459
7597
|
...attributes
|
7460
7598
|
} = props;
|
7461
7599
|
function handleClick(event) {
|
@@ -7466,25 +7604,23 @@ const ToggleItem = /*#__PURE__*/React__default.forwardRef(function Toggle(props,
|
|
7466
7604
|
if (event.isDefaultPrevented()) {
|
7467
7605
|
return;
|
7468
7606
|
}
|
7469
|
-
// If event target is not a control
|
7470
|
-
if (event.target !== controlRef.current
|
7471
|
-
|
7472
|
-
(_controlRef$current2 = controlRef.current) === null || _controlRef$current2 === void 0 ? void 0 : _controlRef$current2.click();
|
7607
|
+
// If event target is not a control and not an element inside the control, then trigger click of the control
|
7608
|
+
if (event.target !== controlRef.current && !((_controlRef$current = controlRef.current) !== null && _controlRef$current !== void 0 && _controlRef$current.contains(event.target))) {
|
7609
|
+
onToggle();
|
7473
7610
|
return;
|
7474
7611
|
}
|
7475
7612
|
}
|
7476
7613
|
function handleKeyDown(event) {
|
7477
|
-
var _controlRef$
|
7614
|
+
var _controlRef$current2;
|
7478
7615
|
if (typeof props.onKeyDown === 'function') {
|
7479
7616
|
props.onKeyDown(event);
|
7480
7617
|
}
|
7481
7618
|
if (event.isDefaultPrevented()) {
|
7482
7619
|
return;
|
7483
7620
|
}
|
7484
|
-
// If event target is not a control
|
7485
|
-
if ((event.key === 'Enter' || event.key === ' ') &&
|
7486
|
-
|
7487
|
-
(_controlRef$current4 = controlRef.current) === null || _controlRef$current4 === void 0 ? void 0 : _controlRef$current4.click();
|
7621
|
+
// If event target is not a control and not an element inside the control, then send appropriate "activate" keyboard shortcuts to the control as a click
|
7622
|
+
if ((event.key === 'Enter' || event.key === ' ') && event.target !== controlRef.current && !((_controlRef$current2 = controlRef.current) !== null && _controlRef$current2 !== void 0 && _controlRef$current2.contains(event.target))) {
|
7623
|
+
onToggle();
|
7488
7624
|
return;
|
7489
7625
|
}
|
7490
7626
|
}
|
@@ -7498,44 +7634,56 @@ const ToggleItem = /*#__PURE__*/React__default.forwardRef(function Toggle(props,
|
|
7498
7634
|
});
|
7499
7635
|
const Switch$1 = /*#__PURE__*/React__default.forwardRef(function Switch$1(props, ref) {
|
7500
7636
|
const {
|
7501
|
-
checked,
|
7637
|
+
checked: externalChecked,
|
7502
7638
|
onChange,
|
7503
7639
|
...attributes
|
7504
7640
|
} = props;
|
7641
|
+
const [checked, setChecked] = React__default.useState(externalChecked);
|
7505
7642
|
const switchRef = React__default.useRef(null);
|
7643
|
+
const toggle = React__default.useCallback(() => {
|
7644
|
+
setChecked(!checked);
|
7645
|
+
onChange(!checked);
|
7646
|
+
}, [checked, onChange]);
|
7506
7647
|
const control = /*#__PURE__*/React__default.createElement(Switch, {
|
7507
7648
|
checked: checked,
|
7508
7649
|
className: "group-hover/toggle:[&[aria-checked=false]]:bg-grey-700 group-hover/toggle:[&[aria-checked=true]]:bg-blue-700",
|
7509
7650
|
disabled: props.disabled,
|
7510
|
-
onChange:
|
7651
|
+
onChange: toggle,
|
7511
7652
|
ref: switchRef,
|
7512
7653
|
tabIndex: -1
|
7513
7654
|
});
|
7514
7655
|
return /*#__PURE__*/React__default.createElement(ToggleItem, Object.assign({}, attributes, {
|
7515
7656
|
control: control,
|
7516
7657
|
controlRef: switchRef,
|
7517
|
-
ref: ref
|
7658
|
+
ref: ref,
|
7659
|
+
onToggle: toggle
|
7518
7660
|
}));
|
7519
7661
|
});
|
7520
7662
|
const Checkbox$1 = /*#__PURE__*/React__default.forwardRef(function Switch(props, ref) {
|
7521
7663
|
const {
|
7522
|
-
checked,
|
7664
|
+
checked: externalChecked,
|
7523
7665
|
onChange,
|
7524
7666
|
...attributes
|
7525
7667
|
} = props;
|
7668
|
+
const [checked, setChecked] = React__default.useState(externalChecked);
|
7526
7669
|
const checkboxRef = React__default.useRef(null);
|
7670
|
+
const toggle = React__default.useCallback(() => {
|
7671
|
+
setChecked(!checked);
|
7672
|
+
onChange(!checked);
|
7673
|
+
}, [checked, onChange]);
|
7527
7674
|
const control = /*#__PURE__*/React__default.createElement(Checkbox, {
|
7528
7675
|
checked: checked,
|
7529
7676
|
className: "group-hover/toggle:[&[aria-checked=false]]:border-grey-700 group-hover/toggle:[&[aria-checked=true]]:border-blue-700 group-hover/checkbox:[&[aria-checked=true]]:bg-blue-700",
|
7530
7677
|
disabled: props.disabled,
|
7531
|
-
onChange:
|
7678
|
+
onChange: toggle,
|
7532
7679
|
ref: checkboxRef,
|
7533
7680
|
tabIndex: -1
|
7534
7681
|
});
|
7535
7682
|
return /*#__PURE__*/React__default.createElement(ToggleItem, Object.assign({}, attributes, {
|
7536
7683
|
control: control,
|
7537
7684
|
controlRef: checkboxRef,
|
7538
|
-
ref: ref
|
7685
|
+
ref: ref,
|
7686
|
+
onToggle: toggle
|
7539
7687
|
}));
|
7540
7688
|
});
|
7541
7689
|
|
@@ -10764,8 +10912,6 @@ function useTableDataLoader(fetchPage, fetchAll, options = {
|
|
10764
10912
|
// if a search is currently "active", we need to re load all because
|
10765
10913
|
const handleSort = function (sorting) {
|
10766
10914
|
try {
|
10767
|
-
// set the sorting so we can track if it changed between loads
|
10768
|
-
_lastUsedSorting.current = sorting;
|
10769
10915
|
if (_lastUsedSearch.current) {
|
10770
10916
|
// we're searching, which means we need to refetch all with the correct sorting applied
|
10771
10917
|
loadAll(sorting, _lastUsedFilters.current);
|
@@ -10780,8 +10926,6 @@ function useTableDataLoader(fetchPage, fetchAll, options = {
|
|
10780
10926
|
};
|
10781
10927
|
const handleFilter = function (filters) {
|
10782
10928
|
try {
|
10783
|
-
// set the filters so we can track if it changed between loads
|
10784
|
-
_lastUsedFilters.current = filters;
|
10785
10929
|
if (_lastUsedSearch.current) {
|
10786
10930
|
// we're searching, which means we need to refetch all with the correct sorting applied
|
10787
10931
|
loadAll(_lastUsedSorting.current, filters);
|
@@ -11073,8 +11217,8 @@ function resetHighlightedColumnIndexes(value, table) {
|
|
11073
11217
|
}
|
11074
11218
|
}
|
11075
11219
|
if (column.getIsVisible() && column.columnDef.enableGlobalFilter && allowSearch) {
|
11076
|
-
var
|
11077
|
-
const cellValue = getCellValueAsString((
|
11220
|
+
var _column$columnDef$met;
|
11221
|
+
const cellValue = getCellValueAsString(get(row.original, column.id), (_column$columnDef$met = column.columnDef.meta) === null || _column$columnDef$met === void 0 ? void 0 : _column$columnDef$met.dataType);
|
11078
11222
|
// indexes don't map to sorted data
|
11079
11223
|
if (cellValue !== undefined && isWeakContains(cellValue, value)) {
|
11080
11224
|
indexes.push([rowIndex, columnIndex]);
|
@@ -12423,7 +12567,7 @@ const DisplayRow = /*#__PURE__*/React__default.memo(function DisplayRow(props) {
|
|
12423
12567
|
const handleClickCapture = React__default.useCallback(() => {
|
12424
12568
|
// do this in the next frame, otherwise it remounts the row and prevents row actions on hover from being clickable
|
12425
12569
|
requestAnimationFrame(() => tableMeta.rowActive.setRowActiveIndex(index));
|
12426
|
-
}, []);
|
12570
|
+
}, [index]);
|
12427
12571
|
// row active
|
12428
12572
|
if (tableMeta.rowActive.isEnabled) {
|
12429
12573
|
attributes['data-row-active'] = tableMeta.rowActive.rowActiveIndex === index ? true : undefined;
|
@@ -12436,7 +12580,6 @@ const DisplayRow = /*#__PURE__*/React__default.memo(function DisplayRow(props) {
|
|
12436
12580
|
}
|
12437
12581
|
// row drag
|
12438
12582
|
if (tableMeta.rowDrag.isEnabled) {
|
12439
|
-
attributes.draggable = true;
|
12440
12583
|
attributes['aria-grabbed'] = !!tableMeta.rowDrag.dragging[row.id];
|
12441
12584
|
}
|
12442
12585
|
// row drop
|
@@ -12866,7 +13009,15 @@ function HeaderMenu(props) {
|
|
12866
13009
|
icon: "more",
|
12867
13010
|
menu: popoverElement ? undefined : menuProps => ( /*#__PURE__*/React__default.createElement(Menu$1, Object.assign({}, menuProps), /*#__PURE__*/React__default.createElement(Menu$1.Content, null, memoedMenuItems))),
|
12868
13011
|
popover: popoverElement,
|
12869
|
-
onClickCapture: event => event.preventDefault()
|
13012
|
+
onClickCapture: event => event.preventDefault(),
|
13013
|
+
onKeyDown: event => {
|
13014
|
+
// Removes focus from the column header menu button so that active row shortcuts execute when Tab,
|
13015
|
+
// Shift+Tab, or any other keydown event occurs.
|
13016
|
+
if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {
|
13017
|
+
var _event$currentTarget;
|
13018
|
+
(_event$currentTarget = event.currentTarget) === null || _event$currentTarget === void 0 ? void 0 : _event$currentTarget.blur();
|
13019
|
+
}
|
13020
|
+
}
|
12870
13021
|
});
|
12871
13022
|
}
|
12872
13023
|
|
@@ -13100,16 +13251,22 @@ const MemoedHeader = /*#__PURE__*/React__default.memo(function MemoedHeader(prop
|
|
13100
13251
|
})) : null);
|
13101
13252
|
});
|
13102
13253
|
|
13103
|
-
const
|
13254
|
+
const FOCUS_MANAGER_OPTIONS_TAB = {
|
13104
13255
|
accept: element => !!element.closest('tr[data-row-active="true"]'),
|
13105
13256
|
tabbable: true
|
13106
13257
|
};
|
13258
|
+
const FOCUS_MANAGER_OPTIONS_ARROW_KEYS = {
|
13259
|
+
accept: element => {
|
13260
|
+
const acceptTabbable = isElementInteractive(element) ? element.getAttribute('tabindex') !== '-1' : true;
|
13261
|
+
return !!element.closest('tr[data-row-active="true"]') && !hasFocusableElement(element) && acceptTabbable;
|
13262
|
+
}
|
13263
|
+
};
|
13107
13264
|
function useAugmentedFocusManager() {
|
13108
13265
|
const focusManager = focus.useFocusManager();
|
13109
|
-
const focusPrevious = () => focusManager.focusPrevious(
|
13110
|
-
const focusNext = () => focusManager.focusNext(
|
13111
|
-
const focusFirst = () => focusManager.focusFirst(
|
13112
|
-
const focusLast = () => focusManager.focusLast(
|
13266
|
+
const focusPrevious = (arrowNavigation = false) => focusManager.focusPrevious(arrowNavigation ? FOCUS_MANAGER_OPTIONS_ARROW_KEYS : FOCUS_MANAGER_OPTIONS_TAB);
|
13267
|
+
const focusNext = (arrowNavigation = false) => focusManager.focusNext(arrowNavigation ? FOCUS_MANAGER_OPTIONS_ARROW_KEYS : FOCUS_MANAGER_OPTIONS_TAB);
|
13268
|
+
const focusFirst = () => focusManager.focusFirst(FOCUS_MANAGER_OPTIONS_TAB);
|
13269
|
+
const focusLast = () => focusManager.focusLast(FOCUS_MANAGER_OPTIONS_TAB);
|
13113
13270
|
return {
|
13114
13271
|
focusPrevious,
|
13115
13272
|
focusNext,
|
@@ -13145,10 +13302,10 @@ function Body(props) {
|
|
13145
13302
|
let focusedElement;
|
13146
13303
|
switch (event.key) {
|
13147
13304
|
case 'ArrowLeft':
|
13148
|
-
focusedElement = isMetaKeyPressed ? focusManager.focusFirst() : focusManager.focusPrevious();
|
13305
|
+
focusedElement = isMetaKeyPressed ? focusManager.focusFirst() : focusManager.focusPrevious(true);
|
13149
13306
|
break;
|
13150
13307
|
case 'ArrowRight':
|
13151
|
-
focusedElement = isMetaKeyPressed ? focusManager.focusLast() : focusManager.focusNext();
|
13308
|
+
focusedElement = isMetaKeyPressed ? focusManager.focusLast() : focusManager.focusNext(true);
|
13152
13309
|
// Scrolls table all the way to the right
|
13153
13310
|
if (isMetaKeyPressed && tableElement) {
|
13154
13311
|
tableElement.scrollLeft = tableElement.scrollWidth;
|
@@ -15153,6 +15310,9 @@ const Select2 = /*#__PURE__*/React__default.forwardRef(function Select2(props, r
|
|
15153
15310
|
name,
|
15154
15311
|
onChange,
|
15155
15312
|
onCreate,
|
15313
|
+
dialogTriggerTitle,
|
15314
|
+
dialogTriggerDisabled,
|
15315
|
+
dialog,
|
15156
15316
|
onDelete,
|
15157
15317
|
onEdit,
|
15158
15318
|
placeholder,
|
@@ -15222,6 +15382,9 @@ const Select2 = /*#__PURE__*/React__default.forwardRef(function Select2(props, r
|
|
15222
15382
|
listboxRef,
|
15223
15383
|
multiple,
|
15224
15384
|
onCreate,
|
15385
|
+
dialogTriggerTitle,
|
15386
|
+
dialogTriggerDisabled,
|
15387
|
+
dialog,
|
15225
15388
|
onDelete,
|
15226
15389
|
onEdit,
|
15227
15390
|
open,
|
@@ -15323,21 +15486,34 @@ const Select2 = /*#__PURE__*/React__default.forwardRef(function Select2(props, r
|
|
15323
15486
|
setValue(nextValue);
|
15324
15487
|
}
|
15325
15488
|
};
|
15489
|
+
const handleCreateInDialog = function (name, color) {
|
15490
|
+
try {
|
15491
|
+
const _temp2 = function () {
|
15492
|
+
if (onCreate && dialog) {
|
15493
|
+
const _temp = _catch(function () {
|
15494
|
+
return Promise.resolve(onCreate(name, color)).then(function (option) {
|
15495
|
+
setValue(option.value);
|
15496
|
+
// To avoid memory leak we should bind onClose of dialog with setOpen(false)
|
15497
|
+
setOpen(false);
|
15498
|
+
});
|
15499
|
+
}, function (err) {
|
15500
|
+
console.log(err);
|
15501
|
+
});
|
15502
|
+
if (_temp && _temp.then) return _temp.then(function () {});
|
15503
|
+
}
|
15504
|
+
}();
|
15505
|
+
return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
|
15506
|
+
} catch (e) {
|
15507
|
+
return Promise.reject(e);
|
15508
|
+
}
|
15509
|
+
};
|
15326
15510
|
const className = cn('border-grey-300 rounded border bg-white py-1.5 shadow-md outline-none"', createCollectionClassName());
|
15327
15511
|
return /*#__PURE__*/React__default.createElement(Select2Context.Provider, {
|
15328
15512
|
value: context
|
15329
15513
|
}, /*#__PURE__*/React__default.createElement(PopoverPrimitive.Root, {
|
15330
15514
|
open: open,
|
15331
15515
|
onOpenChange: setOpen
|
15332
|
-
}, /*#__PURE__*/React__default.createElement(
|
15333
|
-
emptyValue: emptyValue,
|
15334
|
-
multiple: multiple || tags,
|
15335
|
-
name: name,
|
15336
|
-
options: flattenedChildren.map(child => child.props.value),
|
15337
|
-
parentRef: internalRef,
|
15338
|
-
setValue: setValue,
|
15339
|
-
value: value
|
15340
|
-
}), /*#__PURE__*/React__default.createElement(PopoverPrimitive.Trigger, {
|
15516
|
+
}, /*#__PURE__*/React__default.createElement(PopoverPrimitive.Trigger, {
|
15341
15517
|
asChild: true,
|
15342
15518
|
"data-taco": "Select2"
|
15343
15519
|
}, /*#__PURE__*/React__default.createElement(Trigger$7, Object.assign({}, otherProps, {
|
@@ -15398,7 +15574,24 @@ const Select2 = /*#__PURE__*/React__default.forwardRef(function Select2(props, r
|
|
15398
15574
|
}, searchQuery === '' ? ( /*#__PURE__*/React__default.createElement(Collection$1, null, initialChildren)) : ( /*#__PURE__*/React__default.createElement(Collection$1, null, filteredChildren)), onCreate ? /*#__PURE__*/React__default.createElement(Create, {
|
15399
15575
|
onCreate: onCreate,
|
15400
15576
|
options: flattenedChildren
|
15401
|
-
}) : null))
|
15577
|
+
}) : null)), dialog && dialogTriggerTitle && ( /*#__PURE__*/React__default.createElement("span", {
|
15578
|
+
className: "border-grey-300 h-9 border-t p-1.5"
|
15579
|
+
}, /*#__PURE__*/React__default.createElement(Button$1, {
|
15580
|
+
appearance: "discrete",
|
15581
|
+
disabled: dialogTriggerDisabled,
|
15582
|
+
dialog: dialog(handleCreateInDialog)
|
15583
|
+
}, /*#__PURE__*/React__default.createElement(Icon, {
|
15584
|
+
className: "text-xs",
|
15585
|
+
name: "circle-plus"
|
15586
|
+
}), " ", dialogTriggerTitle)))))), /*#__PURE__*/React__default.createElement(ControlledHiddenField, {
|
15587
|
+
emptyValue: emptyValue,
|
15588
|
+
multiple: multiple || tags,
|
15589
|
+
name: name,
|
15590
|
+
options: flattenedChildren.map(child => child.props.value),
|
15591
|
+
parentRef: internalRef,
|
15592
|
+
setValue: setValue,
|
15593
|
+
value: value
|
15594
|
+
})));
|
15402
15595
|
});
|
15403
15596
|
Select2.Option = Option$1;
|
15404
15597
|
Select2.Group = Group$3;
|
@@ -15708,8 +15901,7 @@ const FilterColumn = /*#__PURE__*/React__default.forwardRef((props, ref) => {
|
|
15708
15901
|
allColumns,
|
15709
15902
|
filters,
|
15710
15903
|
onChange: handleChange,
|
15711
|
-
value = null
|
15712
|
-
...attributes
|
15904
|
+
value = null
|
15713
15905
|
} = props;
|
15714
15906
|
const {
|
15715
15907
|
texts
|
@@ -15722,13 +15914,13 @@ const FilterColumn = /*#__PURE__*/React__default.forwardRef((props, ref) => {
|
|
15722
15914
|
message: warning ? texts.table.filters.hiddenColumn : undefined,
|
15723
15915
|
warning: warning,
|
15724
15916
|
className: "min-h-[theme(spacing.8)]"
|
15725
|
-
}, /*#__PURE__*/React__default.createElement(Select2,
|
15917
|
+
}, /*#__PURE__*/React__default.createElement(Select2, {
|
15726
15918
|
ref: ref,
|
15727
15919
|
className: "focus:yt-focus !w-32 flex-shrink-0 ",
|
15728
15920
|
emptyValue: null,
|
15729
15921
|
onChange: handleChange,
|
15730
15922
|
value: value
|
15731
|
-
}
|
15923
|
+
}, allColumns.map(column => {
|
15732
15924
|
var _column$columnDef$met, _column$parent, _column$parent$column;
|
15733
15925
|
return /*#__PURE__*/React__default.createElement(Select2.Option, {
|
15734
15926
|
key: column.id,
|
@@ -15748,19 +15940,18 @@ function FilterComparator(props) {
|
|
15748
15940
|
const {
|
15749
15941
|
column,
|
15750
15942
|
onChange: handleChange,
|
15751
|
-
value
|
15752
|
-
...attributes
|
15943
|
+
value
|
15753
15944
|
} = props;
|
15754
15945
|
const {
|
15755
15946
|
texts
|
15756
15947
|
} = useLocalization();
|
15757
15948
|
const validComparators = guessComparatorsBasedOnControl(column);
|
15758
|
-
return /*#__PURE__*/React__default.createElement(Select2,
|
15949
|
+
return /*#__PURE__*/React__default.createElement(Select2, {
|
15759
15950
|
className: "!w-32 flex-shrink-0",
|
15760
15951
|
disabled: !column,
|
15761
15952
|
onChange: handleChange,
|
15762
15953
|
value: value
|
15763
|
-
}
|
15954
|
+
}, validComparators.map(comparator => ( /*#__PURE__*/React__default.createElement(Select2.Option, {
|
15764
15955
|
key: comparator,
|
15765
15956
|
value: comparator
|
15766
15957
|
}, getComparatorText(comparator, texts, column)))));
|
@@ -16268,7 +16459,7 @@ function TableGrid(props) {
|
|
16268
16459
|
key: props.id,
|
16269
16460
|
header: props,
|
16270
16461
|
scrollToIndex: table.renderer.scrollToIndex
|
16271
|
-
}))))))), table.instance.
|
16462
|
+
}))))))), table.instance.getCoreRowModel().rows.length ? ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Body, {
|
16272
16463
|
enableHorizontalArrowKeyNavigation: enableHorizontalArrowKeyNavigation,
|
16273
16464
|
table: table.instance,
|
16274
16465
|
tableElement: table.ref.current,
|
@@ -17779,7 +17970,7 @@ const useTableRowCreation = (data, tableRef) => {
|
|
17779
17970
|
};
|
17780
17971
|
};
|
17781
17972
|
|
17782
|
-
function useTableEditingListener(table) {
|
17973
|
+
function useTableEditingListener(table, tableRef) {
|
17783
17974
|
const tableMeta = table.options.meta;
|
17784
17975
|
const saveChanges = () => {
|
17785
17976
|
requestAnimationFrame(() => {
|
@@ -17821,6 +18012,20 @@ function useTableEditingListener(table) {
|
|
17821
18012
|
window.removeEventListener('beforeunload', showUnsavedChangesWarning);
|
17822
18013
|
};
|
17823
18014
|
}, [tableMeta.editing.isEditing, hasChanges]);
|
18015
|
+
React__default.useEffect(() => {
|
18016
|
+
const onClickOutside = event => {
|
18017
|
+
if (tableMeta.editing.isEditing) {
|
18018
|
+
var _event$target$getAttr, _event$target;
|
18019
|
+
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 : '';
|
18020
|
+
const insideTable = isElementInsideOrTriggeredFromContainer(event.target, tableRef.current) || element === 'backdrop';
|
18021
|
+
if (!insideTable) {
|
18022
|
+
saveChanges();
|
18023
|
+
}
|
18024
|
+
}
|
18025
|
+
};
|
18026
|
+
document.addEventListener('click', onClickOutside);
|
18027
|
+
return () => document.removeEventListener('click', onClickOutside);
|
18028
|
+
}, [saveChanges, tableMeta.editing.isEditing]);
|
17824
18029
|
}
|
17825
18030
|
|
17826
18031
|
function willRowMove(cell, change, rowIndex) {
|
@@ -17899,14 +18104,6 @@ function useTableEditing(isEnabled = false, handleSave, validator) {
|
|
17899
18104
|
// changes are saved as soon as the active row changes, so in most cases this will only contain the active row's changes
|
17900
18105
|
// but not always - if validation or server requests fail when saving, those rows remain until the failure is resolved
|
17901
18106
|
const pendingChangesFns = usePendingChanges(isEnabled, handleSave, validator);
|
17902
|
-
// if focus leaves the table in any way, trigger a save
|
17903
|
-
const handleBlur = React__default.useCallback(event => {
|
17904
|
-
// custom event from datepicker, and it doesn't have the relatedTarget property set.
|
17905
|
-
const isClosingDatepicker = dateFns.isDate(event.detail);
|
17906
|
-
if (event.relatedTarget !== event.currentTarget && !isElementInsideOrTriggeredFromContainer(event.relatedTarget, event.currentTarget) && !isClosingDatepicker) {
|
17907
|
-
pendingChangesFns.saveChanges();
|
17908
|
-
}
|
17909
|
-
}, [pendingChangesFns.saveChanges]);
|
17910
18107
|
useGlobalKeyDown(isEnabled && isEditing ? {
|
17911
18108
|
key: 's',
|
17912
18109
|
meta: true,
|
@@ -17923,8 +18120,7 @@ function useTableEditing(isEnabled = false, handleSave, validator) {
|
|
17923
18120
|
toggleEditing: isEnabled ? toggleEditing : () => undefined,
|
17924
18121
|
lastFocusedCellIndex,
|
17925
18122
|
setLastFocusedCellIndex,
|
17926
|
-
...pendingChangesFns
|
17927
|
-
handleBlur: isEnabled && isEditing ? handleBlur : () => undefined
|
18123
|
+
...pendingChangesFns
|
17928
18124
|
};
|
17929
18125
|
}
|
17930
18126
|
function usePendingChanges(isEnabled, handleSave, validator) {
|
@@ -18248,7 +18444,7 @@ function RowMoveIndicator(props) {
|
|
18248
18444
|
if (cellRef.current) {
|
18249
18445
|
if (isActiveRow && !!moveReason) {
|
18250
18446
|
var _cellRef$current$pare;
|
18251
|
-
const firstChild = (_cellRef$current$pare = cellRef.current.parentElement) === null || _cellRef$current$pare === void 0 ? void 0 : _cellRef$current$pare.querySelector(
|
18447
|
+
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"]`);
|
18252
18448
|
if (cellRef.current === firstChild) {
|
18253
18449
|
var _cellRef$current$pare2;
|
18254
18450
|
setShow(true);
|
@@ -18448,7 +18644,7 @@ function useEditingCellAutofocus(props) {
|
|
18448
18644
|
tableElement.scrollTo(props.cell.column.getStart() - columnFreezingOffset, tableElement.scrollTop);
|
18449
18645
|
}
|
18450
18646
|
}
|
18451
|
-
if (event.target === event.currentTarget) {
|
18647
|
+
if (event.target === event.currentTarget && hasFocusableElement(event.currentTarget)) {
|
18452
18648
|
focusManager.focusNext();
|
18453
18649
|
}
|
18454
18650
|
};
|
@@ -18503,6 +18699,7 @@ function EditingControlCell(props) {
|
|
18503
18699
|
const cellAttributes = {
|
18504
18700
|
...getCellAttributes(cell, index, isHighlighted),
|
18505
18701
|
'data-cell-editing-invalid': error ? true : undefined,
|
18702
|
+
'data-taco': 'cell-control',
|
18506
18703
|
onFocus: handleFocus,
|
18507
18704
|
ref: cellRef,
|
18508
18705
|
tabIndex: -1
|
@@ -18700,16 +18897,24 @@ function EditingActionMenu(props) {
|
|
18700
18897
|
hasErrors,
|
18701
18898
|
onClear: handleClear,
|
18702
18899
|
onExit: handleExit,
|
18703
|
-
onSave: handleSave
|
18900
|
+
onSave: handleSave,
|
18901
|
+
isLastRow
|
18704
18902
|
} = props;
|
18705
18903
|
const {
|
18706
18904
|
texts
|
18707
18905
|
} = useLocalization();
|
18906
|
+
const handleKeyDown = event => {
|
18907
|
+
// 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.
|
18908
|
+
if (isLastRow && hasChanges && event.key === 'Tab') {
|
18909
|
+
handleSave();
|
18910
|
+
}
|
18911
|
+
};
|
18708
18912
|
return /*#__PURE__*/React__default.createElement(IconButton, {
|
18709
18913
|
appearance: "transparent",
|
18710
18914
|
"aria-label": texts.table3.editing.actions.tooltip,
|
18711
18915
|
className: "group-[[data-row-editing-status]]/row:hidden",
|
18712
18916
|
icon: "more",
|
18917
|
+
onKeyDown: handleKeyDown,
|
18713
18918
|
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, {
|
18714
18919
|
icon: "tick",
|
18715
18920
|
disabled: !hasChanges || hasErrors,
|
@@ -18806,7 +19011,7 @@ function Row$2(props) {
|
|
18806
19011
|
}
|
18807
19012
|
}, [tableMeta.editing.isEditing, tableMeta.rowActive.rowActiveIndex, tableMeta.editing.lastFocusedCellIndex]);
|
18808
19013
|
const handleFocus = React__default.useCallback(event => {
|
18809
|
-
if (tableMeta.editing.isEditing
|
19014
|
+
if (tableMeta.editing.isEditing) {
|
18810
19015
|
var _event$target$closest, _event$target$closest2;
|
18811
19016
|
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);
|
18812
19017
|
if (!isNaN(cellIndex)) {
|
@@ -18839,7 +19044,8 @@ function useTable3(props, ref) {
|
|
18839
19044
|
hasErrors: editing.hasRowErrors(rowId),
|
18840
19045
|
onClear: () => editing.resetChanges(rowId),
|
18841
19046
|
onSave: () => editing.saveChanges(rowId),
|
18842
|
-
onExit: () => editing.toggleEditing(false)
|
19047
|
+
onExit: () => editing.toggleEditing(false),
|
19048
|
+
isLastRow: table.meta.rowActive.rowActiveIndex === table.meta.length - 1
|
18843
19049
|
}))] : props.rowActions
|
18844
19050
|
};
|
18845
19051
|
const meta = {
|
@@ -18847,7 +19053,7 @@ function useTable3(props, ref) {
|
|
18847
19053
|
};
|
18848
19054
|
const table = useTable(extendedProps, ref, RENDERERS$1, meta);
|
18849
19055
|
// listeners
|
18850
|
-
useTableEditingListener(table.instance);
|
19056
|
+
useTableEditingListener(table.instance, table.ref);
|
18851
19057
|
React__default.useEffect(() => {
|
18852
19058
|
if (table.ref.current) {
|
18853
19059
|
table.ref.current.instance.toggleEditing = enabled => table.meta.editing.toggleEditing(enabled !== null && enabled !== void 0 ? enabled : editing => !editing);
|
@@ -19036,15 +19242,9 @@ Group$5.displayName = 'Table3Group';
|
|
19036
19242
|
const BaseTable3 = /*#__PURE__*/fixedForwardRef(function BaseTable3(props, ref) {
|
19037
19243
|
var _table3$meta$editing, _table3$meta$editing2;
|
19038
19244
|
const table3 = useTable3(props, ref);
|
19039
|
-
const handleBlur = event => {
|
19040
|
-
if (table3.meta.editing.isEditing) {
|
19041
|
-
table3.meta.editing.handleBlur(event);
|
19042
|
-
}
|
19043
|
-
};
|
19044
19245
|
const gridAttributes = {
|
19045
19246
|
'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,
|
19046
|
-
enableHorizontalArrowKeyNavigation: table3.meta.editing.isEditing
|
19047
|
-
onBlur: handleBlur
|
19247
|
+
enableHorizontalArrowKeyNavigation: table3.meta.editing.isEditing
|
19048
19248
|
};
|
19049
19249
|
const hasValidationErrors = table3.meta.editing.hasErrors(table3.instance, table3.ref);
|
19050
19250
|
return /*#__PURE__*/React__default.createElement(Table, null, /*#__PURE__*/React__default.createElement(Table.Toolbar, {
|