@economic/taco 2.47.0-server.3 → 2.47.0-server.4
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/Select2/components/Option.d.ts +4 -4
- package/dist/esm/index.css +11 -2
- package/dist/esm/packages/taco/src/charts/utils/color.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Badge/Badge.js +9 -6
- package/dist/esm/packages/taco/src/components/Badge/Badge.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Option.js +7 -5
- package/dist/esm/packages/taco/src/components/Select2/components/Option.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js +56 -19
- package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/Table3.js +12 -14
- package/dist/esm/packages/taco/src/components/Table3/Table3.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Tag/Tag.js +6 -4
- package/dist/esm/packages/taco/src/components/Tag/Tag.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/Row.js +12 -10
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/Row.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/FilterContext.js +6 -0
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/FilterContext.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/ManageFiltersPopover.js +5 -3
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/ManageFiltersPopover.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/Filter.js +0 -2
- 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/FilterColumn.js +2 -1
- 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/FilterValue.js +3 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterValue.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/types.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableServerLoading.js +3 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableServerLoading.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/useTableManager.js +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/useTableManager.js.map +1 -1
- package/dist/index.css +11 -2
- package/dist/primitives/Table/Core/components/Toolbar/components/Filters/FilterContext.d.ts +3 -0
- package/dist/primitives/Table/Core/components/Toolbar/components/Filters/components/Filter.d.ts +0 -1
- package/dist/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterColumn.d.ts +0 -3
- package/dist/primitives/Table/types.d.ts +1 -1
- package/dist/primitives/Table/useTableManager/features/useTableServerLoading.d.ts +2 -1
- package/dist/taco.cjs.development.js +115 -67
- 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 +1 -2
@@ -4083,10 +4083,10 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(props, ref) {
|
|
4083
4083
|
...otherProps
|
4084
4084
|
} = props;
|
4085
4085
|
const isTransparent = color === 'transparent';
|
4086
|
-
const className = cn('rounded-full border overflow-hidden whitespace-nowrap inline-flex items-center justify-center', {
|
4086
|
+
const className = cn('rounded-full border box-border overflow-hidden whitespace-nowrap inline-flex items-center justify-center', {
|
4087
4087
|
[`border ${getOutlineColorShadeClasses(color)}`]: outline,
|
4088
|
-
[`border-
|
4089
|
-
[`border-
|
4088
|
+
[`border-none font-normal ${getSubtleColorShadeClasses(color)}`]: subtle,
|
4089
|
+
[`border-none ${getColorShadeClasses(color)}`]: !outline && !subtle,
|
4090
4090
|
'h-4 min-w-0 py-0 px-1 text-xs': small,
|
4091
4091
|
'h-2 w-2 min-w-0': compact,
|
4092
4092
|
'font-bold': outline || !subtle,
|
@@ -4098,12 +4098,15 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(props, ref) {
|
|
4098
4098
|
if (compact) {
|
4099
4099
|
return /*#__PURE__*/React.createElement(VisuallyHidden, null, children);
|
4100
4100
|
}
|
4101
|
+
const contentToRender = typeof children === 'string' ? /*#__PURE__*/React.createElement("span", {
|
4102
|
+
className: "items-center truncate"
|
4103
|
+
}, children) : children;
|
4101
4104
|
if (status) {
|
4102
4105
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
4103
|
-
className: cn('mr-1 h-2 w-2 rounded-full', getColorShadeClasses(color))
|
4104
|
-
}),
|
4106
|
+
className: cn('mr-1 h-2 w-2 shrink-0 rounded-full', getColorShadeClasses(color))
|
4107
|
+
}), contentToRender);
|
4105
4108
|
}
|
4106
|
-
return
|
4109
|
+
return contentToRender;
|
4107
4110
|
};
|
4108
4111
|
return /*#__PURE__*/React.createElement("span", Object.assign({}, otherProps, {
|
4109
4112
|
"aria-atomic": "true",
|
@@ -11362,7 +11365,7 @@ function useTableDataLoader(fetchPage, fetchAll, options = {
|
|
11362
11365
|
}, invalidate];
|
11363
11366
|
}
|
11364
11367
|
|
11365
|
-
function useTableServerLoading(loadPage, loadAll, pages, pageSize = DEFAULT_PAGE_SIZE, _experimentalDataLoader2 = false) {
|
11368
|
+
function useTableServerLoading(length, loadPage, loadAll, pages, pageSize = DEFAULT_PAGE_SIZE, _experimentalDataLoader2 = false) {
|
11366
11369
|
const isEnabled = !!loadPage && !!loadAll;
|
11367
11370
|
const [isReady, setReady] = React__default.useState(false);
|
11368
11371
|
const [loadAllStatus, setLoadedStatus] = React__default.useState(exports.TableServerLoadAllState.Incomplete);
|
@@ -11416,6 +11419,7 @@ function useTableServerLoading(loadPage, loadAll, pages, pageSize = DEFAULT_PAGE
|
|
11416
11419
|
}
|
11417
11420
|
};
|
11418
11421
|
}
|
11422
|
+
const pageCount = Math.ceil(length / pageSize);
|
11419
11423
|
return {
|
11420
11424
|
pages,
|
11421
11425
|
isEnabled,
|
@@ -11425,6 +11429,7 @@ function useTableServerLoading(loadPage, loadAll, pages, pageSize = DEFAULT_PAGE
|
|
11425
11429
|
loadAllIfNeeded: _loadAllIfNeeded,
|
11426
11430
|
loadAllStatus,
|
11427
11431
|
pageSize,
|
11432
|
+
pageCount,
|
11428
11433
|
_experimentalDataLoader2
|
11429
11434
|
};
|
11430
11435
|
}
|
@@ -11765,7 +11770,7 @@ function useTableManager(props, meta, internalColumns) {
|
|
11765
11770
|
const rowHeight = useTableRowHeight(options.enableRowHeight, settings.rowHeight);
|
11766
11771
|
const rowSelection = useTableRowSelection(!!options.enableRowSelection);
|
11767
11772
|
const search = useTableSearch(options.enableSearch, props.onChangeSearch, settings.excludeUnmatchedRecordsInSearch);
|
11768
|
-
const server = useTableServerLoading(props.loadPage, props.loadAll, props.pages, props.pageSize, props._experimentalDataLoader2);
|
11773
|
+
const server = useTableServerLoading(length, props.loadPage, props.loadAll, props.pages, props.pageSize, props._experimentalDataLoader2);
|
11769
11774
|
// TODO: memoise
|
11770
11775
|
// convert jsx column components into valid table columns
|
11771
11776
|
const {
|
@@ -12126,18 +12131,20 @@ function Row(props) {
|
|
12126
12131
|
}
|
12127
12132
|
*/
|
12128
12133
|
// always load the next page
|
12129
|
-
if (scrollDirection === 'forward' || !scrollDirection) {
|
12134
|
+
if ((scrollDirection === 'forward' || !scrollDirection) && pageIndex + 2 < tableMeta.server.pageCount) {
|
12130
12135
|
pageIndexesToFetch.push(pageIndex + 1);
|
12131
12136
|
}
|
12132
|
-
|
12133
|
-
|
12134
|
-
|
12135
|
-
|
12136
|
-
|
12137
|
-
|
12138
|
-
|
12139
|
-
|
12140
|
-
|
12137
|
+
if (pageIndexesToFetch.length) {
|
12138
|
+
// the virtualiser fetches a page ahead, so this won't get called in most cases
|
12139
|
+
// but it provides a fallback for some edge cases
|
12140
|
+
timeout = setTimeout(() => {
|
12141
|
+
pageIndexesToFetch.forEach(index => {
|
12142
|
+
var _tableMeta$server$loa, _tableMeta$server;
|
12143
|
+
// this can be called by every row within the current page, but loadPage returns early if a pending request exists
|
12144
|
+
(_tableMeta$server$loa = (_tableMeta$server = tableMeta.server).loadPage) === null || _tableMeta$server$loa === void 0 ? void 0 : _tableMeta$server$loa.call(_tableMeta$server, index, sorting, filters, tableMeta.search.enableGlobalFilter ? search : undefined, hiddenColumns);
|
12145
|
+
});
|
12146
|
+
}, DELAY_BEFORE_LOAD_MS);
|
12147
|
+
}
|
12141
12148
|
}
|
12142
12149
|
return () => {
|
12143
12150
|
clearTimeout(timeout);
|
@@ -14941,14 +14948,16 @@ const Tag$1 = /*#__PURE__*/React__default.forwardRef((props, ref) => {
|
|
14941
14948
|
ref: ref,
|
14942
14949
|
"data-taco": "tag"
|
14943
14950
|
}), /*#__PURE__*/React__default.createElement("span", {
|
14944
|
-
className: "truncate px-2",
|
14951
|
+
className: "flex items-center truncate px-2",
|
14945
14952
|
ref: textRef
|
14946
14953
|
}, icon ? typeof icon === 'string' ? (/*#__PURE__*/React__default.createElement(Icon, {
|
14947
14954
|
name: icon,
|
14948
|
-
className: "-ml-1
|
14955
|
+
className: "-ml-1 mr-1 !h-5 !w-5"
|
14949
14956
|
})) : (/*#__PURE__*/React__default.cloneElement(icon, {
|
14950
|
-
className: 'mr-1 -ml-1
|
14951
|
-
})) : null,
|
14957
|
+
className: 'mr-1 -ml-1 !h-5 !w-5'
|
14958
|
+
})) : null, /*#__PURE__*/React__default.createElement("span", {
|
14959
|
+
className: "truncate"
|
14960
|
+
}, children)), onDelete ? (/*#__PURE__*/React__default.createElement(Icon, {
|
14952
14961
|
name: "close",
|
14953
14962
|
onClick: onDelete,
|
14954
14963
|
className: "-ml-1.5 !h-6 !w-5 flex-shrink-0 cursor-pointer rounded-r p-0.5 hover:bg-black/5"
|
@@ -15227,12 +15236,13 @@ const Option$1 = /*#__PURE__*/React__default.forwardRef(function Select2Option(p
|
|
15227
15236
|
}), hasValue ? (/*#__PURE__*/React__default.createElement(Icon, {
|
15228
15237
|
name: "tick",
|
15229
15238
|
className: "pointer-events-none invisible -mx-0.5 !h-4 !w-4 group-aria-selected:visible"
|
15230
|
-
})) : null, isTag ? (/*#__PURE__*/React__default.createElement(Tag$1, {
|
15239
|
+
})) : null, typeof children !== 'string' ? (/*#__PURE__*/React__default.createElement("span", null, children)) : isTag ? (/*#__PURE__*/React__default.createElement(Tag$1, {
|
15231
15240
|
className: "pointer-events-none my-1",
|
15232
15241
|
color: color,
|
15233
15242
|
icon: prefix
|
15234
15243
|
}, children)) : (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, prefix ? typeof prefix === 'string' ? /*#__PURE__*/React__default.createElement(Icon, {
|
15235
|
-
name: prefix
|
15244
|
+
name: prefix,
|
15245
|
+
className: "!h-5 !w-5"
|
15236
15246
|
}) : prefix : null, /*#__PURE__*/React__default.createElement("span", {
|
15237
15247
|
className: "flex w-full justify-between"
|
15238
15248
|
}, /*#__PURE__*/React__default.createElement("span", {
|
@@ -15241,9 +15251,10 @@ const Option$1 = /*#__PURE__*/React__default.forwardRef(function Select2Option(p
|
|
15241
15251
|
className: "text-grey-700 -mt-1.5 mb-1.5 text-xs"
|
15242
15252
|
}, description) : null), /*#__PURE__*/React__default.createElement("span", {
|
15243
15253
|
className: "flex flex-col self-center"
|
15244
|
-
}, postfix ? typeof postfix === 'string' ? /*#__PURE__*/React__default.createElement(Icon, {
|
15245
|
-
name: postfix
|
15246
|
-
|
15254
|
+
}, postfix ? typeof postfix === 'string' ? (/*#__PURE__*/React__default.createElement(Icon, {
|
15255
|
+
name: postfix,
|
15256
|
+
className: "!h-5 !w-5"
|
15257
|
+
})) : postfix : null)))), popover ? (/*#__PURE__*/React__default.createElement(IconButton, {
|
15247
15258
|
icon: "ellipsis-vertical",
|
15248
15259
|
appearance: "discrete",
|
15249
15260
|
className: cn('group-aria-current:visible invisible -mr-1 ml-auto !h-5 min-h-[theme(spacing.6)] !w-5 min-w-[theme(spacing.6)] hover:!bg-black/[.08] focus:!shadow-none group-hover:visible', {
|
@@ -15409,7 +15420,7 @@ const Single = /*#__PURE__*/React__default.forwardRef(function Select2TriggerSin
|
|
15409
15420
|
readOnly,
|
15410
15421
|
tags
|
15411
15422
|
} = useSelect2Context();
|
15412
|
-
const contentClassName = cn('truncate items-center gap-1');
|
15423
|
+
const contentClassName = cn('truncate flex items-center gap-1');
|
15413
15424
|
const currentValue = children.find(matchesValue(value));
|
15414
15425
|
let output;
|
15415
15426
|
if (placeholder && currentValue === undefined) {
|
@@ -15419,13 +15430,13 @@ const Single = /*#__PURE__*/React__default.forwardRef(function Select2TriggerSin
|
|
15419
15430
|
}, placeholder);
|
15420
15431
|
} else if (currentValue) {
|
15421
15432
|
if (tags && emptyValue !== value) {
|
15422
|
-
output = /*#__PURE__*/React__default.createElement(Tag$1, {
|
15433
|
+
if (typeof currentValue.props.children === 'string') output = /*#__PURE__*/React__default.createElement(Tag$1, {
|
15423
15434
|
className: "truncate",
|
15424
15435
|
color: currentValue.props.color,
|
15425
15436
|
disabled: disabled,
|
15426
15437
|
icon: currentValue.props.prefix,
|
15427
15438
|
readOnly: readOnly
|
15428
|
-
}, currentValue.props.children);
|
15439
|
+
}, currentValue.props.children);else output = currentValue.props.children;
|
15429
15440
|
} else {
|
15430
15441
|
output = /*#__PURE__*/React__default.createElement(React__default.Fragment, null, currentValue.props.prefix ? typeof currentValue.props.prefix === 'string' ? (/*#__PURE__*/React__default.createElement(Icon, {
|
15431
15442
|
name: currentValue.props.prefix,
|
@@ -15476,7 +15487,7 @@ const Multiple = /*#__PURE__*/React__default.forwardRef(function Select2TriggerM
|
|
15476
15487
|
}, valuesAsChildren.length === 0 ? (/*#__PURE__*/React__default.createElement(Placeholder, {
|
15477
15488
|
disabled: disabled,
|
15478
15489
|
readOnly: readOnly
|
15479
|
-
}, placeholder)) : valuesAsChildren.map(child => (/*#__PURE__*/React__default.createElement(Tag$1, {
|
15490
|
+
}, placeholder)) : valuesAsChildren.map(child => typeof child.props.children === 'string' ? (/*#__PURE__*/React__default.createElement(Tag$1, {
|
15480
15491
|
key: String(child.props.value),
|
15481
15492
|
className: "truncate",
|
15482
15493
|
color: tags ? child.props.color : undefined,
|
@@ -15490,7 +15501,23 @@ const Multiple = /*#__PURE__*/React__default.forwardRef(function Select2TriggerM
|
|
15490
15501
|
}
|
15491
15502
|
},
|
15492
15503
|
readOnly: readOnly
|
15493
|
-
}, child.props.children))
|
15504
|
+
}, child.props.children)) : (/*#__PURE__*/React__default.cloneElement(child.props.children, {
|
15505
|
+
key: String(child.props.value),
|
15506
|
+
className: '!pr-0 !pl-1.5',
|
15507
|
+
children: (/*#__PURE__*/React__default.createElement("span", {
|
15508
|
+
className: "flex items-center"
|
15509
|
+
}, child.props.children.props.children, /*#__PURE__*/React__default.createElement(Icon, {
|
15510
|
+
name: "close",
|
15511
|
+
onClick: event => {
|
15512
|
+
event === null || event === void 0 ? void 0 : event.stopPropagation();
|
15513
|
+
event === null || event === void 0 ? void 0 : event.preventDefault();
|
15514
|
+
if (!disabled && !readOnly) {
|
15515
|
+
setValue(child.props.value);
|
15516
|
+
}
|
15517
|
+
},
|
15518
|
+
className: "ml-0.5 !h-5 !w-5 shrink-0 cursor-pointer rounded-r p-0.5 hover:bg-black/5"
|
15519
|
+
})))
|
15520
|
+
})))));
|
15494
15521
|
} else {
|
15495
15522
|
content = /*#__PURE__*/React__default.createElement(MultipleValue, {
|
15496
15523
|
onClick: forwardClick,
|
@@ -15521,6 +15548,18 @@ const MultipleValue = ({
|
|
15521
15548
|
} = useSelect2Context();
|
15522
15549
|
const [contentRef, setContentRef] = React__default.useState(null);
|
15523
15550
|
const boundaryIndex = contentRef ? getIndexOfFirstChildOverflowingParent(contentRef, 30) : undefined;
|
15551
|
+
// Retrieves the relevant text content from any JSX.Element passed as a select option, handling nested elements, arrays, and direct text
|
15552
|
+
const getTooltipTitle = child => {
|
15553
|
+
const children = child.props.children;
|
15554
|
+
if (typeof children === 'string') return children;
|
15555
|
+
if (typeof children.props.children === 'string') {
|
15556
|
+
return children.props.children;
|
15557
|
+
}
|
15558
|
+
if (Array.isArray(children.props.children)) {
|
15559
|
+
return children.props.children.filter(item => typeof item === 'string');
|
15560
|
+
}
|
15561
|
+
return '';
|
15562
|
+
};
|
15524
15563
|
return /*#__PURE__*/React__default.createElement("div", {
|
15525
15564
|
className: "relative flex w-full items-center gap-1 overflow-hidden",
|
15526
15565
|
onClick: onClick
|
@@ -15531,26 +15570,35 @@ const MultipleValue = ({
|
|
15531
15570
|
disabled: disabled,
|
15532
15571
|
readOnly: readOnly
|
15533
15572
|
}, placeholder)) : valuesAsChildren.map((child, index) => {
|
15534
|
-
const
|
15535
|
-
|
15573
|
+
const classNames = {
|
15574
|
+
truncate: index === boundaryIndex,
|
15575
|
+
hidden: boundaryIndex !== undefined && boundaryIndex !== null ? index > boundaryIndex : false
|
15576
|
+
};
|
15577
|
+
let output;
|
15578
|
+
if (typeof child.props.children === 'string') {
|
15579
|
+
output = /*#__PURE__*/React__default.createElement(Tag$1, {
|
15580
|
+
key: String(child.props.value),
|
15581
|
+
className: cn('cursor-pointer', classNames),
|
15582
|
+
color: tags ? child.props.color : undefined,
|
15583
|
+
disabled: disabled,
|
15584
|
+
icon: child.props.prefix,
|
15585
|
+
readOnly: readOnly
|
15586
|
+
}, child.props.children);
|
15587
|
+
} else output = /*#__PURE__*/React__default.cloneElement(child.props.children, {
|
15536
15588
|
className: cn('cursor-pointer', {
|
15537
|
-
|
15538
|
-
|
15539
|
-
|
15540
|
-
|
15541
|
-
disabled: disabled,
|
15542
|
-
icon: child.props.prefix,
|
15543
|
-
readOnly: readOnly
|
15544
|
-
}, child.props.children);
|
15589
|
+
'shrink-0': index !== boundaryIndex
|
15590
|
+
}, classNames),
|
15591
|
+
key: String(child.props.value)
|
15592
|
+
});
|
15545
15593
|
if (index === boundaryIndex) {
|
15546
15594
|
return /*#__PURE__*/React__default.createElement(Tooltip, {
|
15547
15595
|
key: String(child.props.value),
|
15548
|
-
title: String(child
|
15549
|
-
},
|
15596
|
+
title: String(getTooltipTitle(child))
|
15597
|
+
}, output);
|
15550
15598
|
}
|
15551
|
-
return
|
15599
|
+
return output;
|
15552
15600
|
})), boundaryIndex !== undefined && boundaryIndex !== null && boundaryIndex < valuesAsChildren.length - 1 ? (/*#__PURE__*/React__default.createElement(Tooltip, {
|
15553
|
-
title: valuesAsChildren.slice(boundaryIndex + 1).map(child => child ? String(child
|
15601
|
+
title: valuesAsChildren.slice(boundaryIndex + 1).map(child => child ? String(getTooltipTitle(child)) : '').join(', ')
|
15554
15602
|
}, /*#__PURE__*/React__default.createElement(Badge, {
|
15555
15603
|
className: "flex-shrink-0"
|
15556
15604
|
}, "+", valuesAsChildren.length - (boundaryIndex + 1)))) : null);
|
@@ -16425,10 +16473,11 @@ function guessComparatorsBasedOnControl(column) {
|
|
16425
16473
|
return getDataTypeProperties(columnMeta.dataType).filterComparators;
|
16426
16474
|
}
|
16427
16475
|
|
16476
|
+
const FilterContext = /*#__PURE__*/React__default.createContext([]);
|
16477
|
+
|
16428
16478
|
const FilterColumn = /*#__PURE__*/React__default.forwardRef((props, ref) => {
|
16429
16479
|
const {
|
16430
16480
|
allColumns,
|
16431
|
-
filters,
|
16432
16481
|
onChange: handleChange,
|
16433
16482
|
value = null,
|
16434
16483
|
...attributes
|
@@ -16436,6 +16485,7 @@ const FilterColumn = /*#__PURE__*/React__default.forwardRef((props, ref) => {
|
|
16436
16485
|
const {
|
16437
16486
|
texts
|
16438
16487
|
} = useLocalization();
|
16488
|
+
const filters = React__default.useContext(FilterContext);
|
16439
16489
|
const selectedColumn = allColumns.find(column => column.id === value);
|
16440
16490
|
const warning = selectedColumn && !selectedColumn.getIsVisible();
|
16441
16491
|
return /*#__PURE__*/React__default.createElement("div", {
|
@@ -16601,6 +16651,7 @@ function Control(props) {
|
|
16601
16651
|
} = props;
|
16602
16652
|
const controlRenderer = column === null || column === void 0 ? void 0 : (_column$columnDef$met2 = column.columnDef.meta) === null || _column$columnDef$met2 === void 0 ? void 0 : _column$columnDef$met2.control;
|
16603
16653
|
const dataType = column === null || column === void 0 ? void 0 : (_column$columnDef$met3 = column.columnDef.meta) === null || _column$columnDef$met3 === void 0 ? void 0 : _column$columnDef$met3.dataType;
|
16654
|
+
const filters = React__default.useContext(FilterContext);
|
16604
16655
|
React.useEffect(() => {
|
16605
16656
|
// Set value to false only after first render of the control (when it's undefined) after setting the FilterColumn value, because we don't want to change then the value every time filter is opened
|
16606
16657
|
if ((controlRenderer === 'switch' || controlRenderer === 'checkbox') && value === undefined) {
|
@@ -16612,7 +16663,7 @@ function Control(props) {
|
|
16612
16663
|
...attributes,
|
16613
16664
|
setValue: value => onChange(value),
|
16614
16665
|
value
|
16615
|
-
}), {
|
16666
|
+
}, undefined, filters), {
|
16616
16667
|
['data-query-selector']: querySelector,
|
16617
16668
|
className: 'focus:yt-focus'
|
16618
16669
|
});
|
@@ -16654,7 +16705,6 @@ function Filter$1(props) {
|
|
16654
16705
|
const {
|
16655
16706
|
allColumns,
|
16656
16707
|
filter,
|
16657
|
-
filters,
|
16658
16708
|
onChange: handleChange,
|
16659
16709
|
onRemove,
|
16660
16710
|
position
|
@@ -16729,7 +16779,6 @@ function Filter$1(props) {
|
|
16729
16779
|
className: "flex min-h-[theme(spacing.8)] w-14 flex-shrink-0 items-center justify-end pr-2 text-right"
|
16730
16780
|
}, position > 0 ? texts.table.filters.conditions.and : texts.table.filters.conditions.where), /*#__PURE__*/React__default.createElement(FilterColumn, {
|
16731
16781
|
allColumns: allColumns,
|
16732
|
-
filters: filters,
|
16733
16782
|
onChange: handleChangeColumn,
|
16734
16783
|
value: id,
|
16735
16784
|
ref: ref
|
@@ -16833,7 +16882,9 @@ function ManageFiltersPopover(props) {
|
|
16833
16882
|
};
|
16834
16883
|
return /*#__PURE__*/React__default.createElement(Popover, Object.assign({}, popoverProps, {
|
16835
16884
|
onChange: handleClose
|
16836
|
-
}), /*#__PURE__*/React__default.createElement(Popover.Content, null, /*#__PURE__*/React__default.createElement(
|
16885
|
+
}), /*#__PURE__*/React__default.createElement(Popover.Content, null, /*#__PURE__*/React__default.createElement(FilterContext.Provider, {
|
16886
|
+
value: filters
|
16887
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
16837
16888
|
className: "flex w-[40rem] flex-col gap-4"
|
16838
16889
|
}, /*#__PURE__*/React__default.createElement("div", {
|
16839
16890
|
className: "flex h-8"
|
@@ -16849,7 +16900,6 @@ function ManageFiltersPopover(props) {
|
|
16849
16900
|
key: `filter_${index}`,
|
16850
16901
|
allColumns: allColumns,
|
16851
16902
|
filter: filter,
|
16852
|
-
filters: filters,
|
16853
16903
|
position: index,
|
16854
16904
|
onChange: handleChangeFilter,
|
16855
16905
|
onRemove: filters.length > 0 && filters.some(f => f.id) || filters.length > 1 ? handleRemoveFilter : undefined
|
@@ -16865,7 +16915,7 @@ function ManageFiltersPopover(props) {
|
|
16865
16915
|
}, texts.table.filters.buttons.clear), /*#__PURE__*/React__default.createElement(Button$1, {
|
16866
16916
|
appearance: "primary",
|
16867
16917
|
onClick: handleApply
|
16868
|
-
}, texts.table.filters.buttons.apply)))));
|
16918
|
+
}, texts.table.filters.buttons.apply))))));
|
16869
16919
|
}
|
16870
16920
|
|
16871
16921
|
function Filters(props) {
|
@@ -20329,6 +20379,16 @@ const BaseTable3 = /*#__PURE__*/fixedForwardRef(function BaseTable3(props, ref)
|
|
20329
20379
|
const hasAlertErrors = table3.meta.editing.getErrorsShownInAlert().length;
|
20330
20380
|
const hasCreateWorkflow = table3.meta.editing.isEnabled && props.onEditingCreate;
|
20331
20381
|
const isScrolled = isTableScrolled(table3.ref);
|
20382
|
+
let createWorkflow;
|
20383
|
+
if (hasCreateWorkflow) {
|
20384
|
+
createWorkflow = /*#__PURE__*/React__default.createElement(CreateNewRow, {
|
20385
|
+
buttonRef: table3.meta.editing.createRowButtonRef,
|
20386
|
+
isScrolled: isScrolled,
|
20387
|
+
scrollToIndex: table3.renderer.scrollToIndex,
|
20388
|
+
table: table3.instance,
|
20389
|
+
tableMeta: table3.meta
|
20390
|
+
});
|
20391
|
+
}
|
20332
20392
|
return /*#__PURE__*/React__default.createElement(Table, null, /*#__PURE__*/React__default.createElement(Table.Toolbar, {
|
20333
20393
|
table: table3
|
20334
20394
|
}, table3.meta.editing.isEnabled ? (/*#__PURE__*/React__default.createElement(Editing, {
|
@@ -20341,13 +20401,7 @@ const BaseTable3 = /*#__PURE__*/fixedForwardRef(function BaseTable3(props, ref)
|
|
20341
20401
|
tableRef: table3.ref
|
20342
20402
|
})) : null, /*#__PURE__*/React__default.createElement(Table.Grid, Object.assign({}, gridAttributes, {
|
20343
20403
|
"data-taco": "table3",
|
20344
|
-
footerRows: hasCreateWorkflow && isScrolled ?
|
20345
|
-
buttonRef: table3.meta.editing.createRowButtonRef,
|
20346
|
-
isScrolled: isScrolled,
|
20347
|
-
scrollToIndex: table3.renderer.scrollToIndex,
|
20348
|
-
table: table3.instance,
|
20349
|
-
tableMeta: table3.meta
|
20350
|
-
})) : undefined,
|
20404
|
+
footerRows: hasCreateWorkflow && isScrolled ? createWorkflow : undefined,
|
20351
20405
|
table: table3
|
20352
20406
|
}), hasCreateWorkflow ? (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(TemporaryRow, {
|
20353
20407
|
createRowButtonRef: table3.meta.editing.createRowButtonRef,
|
@@ -20355,13 +20409,7 @@ const BaseTable3 = /*#__PURE__*/fixedForwardRef(function BaseTable3(props, ref)
|
|
20355
20409
|
table: table3.instance,
|
20356
20410
|
tableMeta: table3.meta,
|
20357
20411
|
tableRef: table3.ref
|
20358
|
-
}), !isScrolled ?
|
20359
|
-
buttonRef: table3.meta.editing.createRowButtonRef,
|
20360
|
-
isScrolled: isScrolled,
|
20361
|
-
scrollToIndex: table3.renderer.scrollToIndex,
|
20362
|
-
table: table3.instance,
|
20363
|
-
tableMeta: table3.meta
|
20364
|
-
})) : null)) : null));
|
20412
|
+
}), !isScrolled ? createWorkflow : null)) : null));
|
20365
20413
|
});
|
20366
20414
|
const Table3 = /*#__PURE__*/fixedForwardRef(function Table3(props, ref) {
|
20367
20415
|
const stringifiedChildren = String(props.children);
|