@economic/taco 2.46.10-alpha.0 → 2.47.0-alpha.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/Report/Report.d.ts +1 -1
- package/dist/components/Select2/components/Option.d.ts +4 -4
- package/dist/components/Table3/components/Row/Editing/CreateNewRow.d.ts +1 -2
- package/dist/components/Table3/components/Row/Editing/TemporaryRow.d.ts +1 -0
- package/dist/components/Table3/util/editing.d.ts +3 -0
- package/dist/esm/index.css +13 -4
- 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 +15 -7
- package/dist/esm/packages/taco/src/components/Table3/Table3.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/CreateNewRow.js +2 -4
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/CreateNewRow.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/TemporaryRow.js +3 -3
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/TemporaryRow.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/util/editing.js +9 -1
- package/dist/esm/packages/taco/src/components/Table3/util/editing.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/Table.js +2 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/Table.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Expansion.js +4 -0
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Expansion.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Footer/Footer.js +7 -2
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Footer/Footer.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/useTableRowExpansion.js +2 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowExpansion.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/useTableManager.js +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/useTableManager.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/presets.js +7 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/presets.js.map +1 -1
- package/dist/index.css +13 -4
- package/dist/primitives/Table/Core/Table.d.ts +1 -0
- 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 +2 -1
- package/dist/primitives/Table/useTableManager/features/useTableRowExpansion.d.ts +2 -1
- package/dist/taco.cjs.development.js +137 -61
- 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 -3
package/dist/index.css
CHANGED
@@ -650,13 +650,22 @@ table[data-taco^='table'] tr[data-row-group]:first-child {
|
|
650
650
|
@apply pt-0;
|
651
651
|
}
|
652
652
|
|
653
|
+
/* Only apply -mt-px when the row group header is sticked to the top of the table.
|
654
|
+
margin-top -1px is needed to hide a little gap between the group header and table and the edge of the table.
|
655
|
+
If we'll not do this, then it will be slightly visible how rows are moving behind it when scrolled.
|
656
|
+
*/
|
657
|
+
|
658
|
+
table[data-taco^='table'] tr[data-row-group]:first-child td {
|
659
|
+
@apply -mt-px;
|
660
|
+
}
|
661
|
+
|
653
662
|
table[data-taco^='table'] tr[data-row-group]:not(:first-child):before {
|
654
663
|
content: '';
|
655
|
-
@apply bg-grey-100 border-grey-300 absolute left-0 right-0
|
664
|
+
@apply bg-grey-100 border-grey-300 absolute -top-1 left-0 right-0 h-10 border-t print:top-0 print:h-[2px] print:border-t-2;
|
656
665
|
}
|
657
666
|
|
658
667
|
table[data-taco^='table'] tr[data-row-group] td {
|
659
|
-
@apply
|
668
|
+
@apply border-b-2 border-t-0 font-bold;
|
660
669
|
}
|
661
670
|
|
662
671
|
table[data-taco^='table'] tr:first-child td {
|
@@ -752,14 +761,14 @@ table[data-taco^='table'] td:not([data-cell-truncate='true']) {
|
|
752
761
|
}
|
753
762
|
|
754
763
|
/* FOOTER */
|
755
|
-
table[data-taco^='table'] tfoot td {
|
764
|
+
table[data-taco^='table'] tfoot tr:not([data-row-index]) td {
|
756
765
|
/*
|
757
766
|
* Since footer has sticky position, the top and bottom padding ensures that the inner content doesn't come over
|
758
767
|
* the border of the footer row.
|
759
768
|
*/
|
760
769
|
@apply border-b-0 !py-1 font-bold;
|
761
770
|
}
|
762
|
-
table[data-taco^='table'] tfoot td:first-child {
|
771
|
+
table[data-taco^='table'] tfoot tr:not([data-row-index]) td:first-child {
|
763
772
|
@apply z-30 !pb-0 !pt-[2px];
|
764
773
|
}
|
765
774
|
|
@@ -13,6 +13,7 @@ export declare namespace Table {
|
|
13
13
|
export declare type TableGridProps<TType = unknown> = React.TableHTMLAttributes<HTMLTableElement> & {
|
14
14
|
'data-taco': string;
|
15
15
|
enableHorizontalArrowKeyNavigation?: boolean;
|
16
|
+
footerRows?: null | JSX.Element | JSX.Element[];
|
16
17
|
table: useTableReturnValue<TType>;
|
17
18
|
};
|
18
19
|
export declare function TableGrid<TType = unknown>(props: TableGridProps<TType>): JSX.Element;
|
package/dist/primitives/Table/Core/components/Toolbar/components/Filters/components/Filter.d.ts
CHANGED
@@ -4,7 +4,6 @@ import { TableFilter } from '../../../../../../types';
|
|
4
4
|
export declare type FilterProps<TType = unknown> = {
|
5
5
|
allColumns: ReactTableColumn<TType, unknown>[];
|
6
6
|
filter: TableFilter;
|
7
|
-
filters: TableFilter[];
|
8
7
|
position: number;
|
9
8
|
onChange: (position: number, value: TableFilter) => void;
|
10
9
|
onRemove?: (position: number) => void;
|
@@ -1,12 +1,9 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { Column as ReactTableColumn } from '@tanstack/react-table';
|
3
3
|
import { Select2Props } from '../../../../../../../../components/Select2/Select2';
|
4
|
-
import { TableFilter } from '../../../../../../types';
|
5
4
|
export declare type FilterColumnProps<TType = unknown> = Omit<Select2Props, 'children'> & {
|
6
5
|
allColumns: ReactTableColumn<TType, unknown>[];
|
7
|
-
filters: TableFilter[];
|
8
6
|
};
|
9
7
|
export declare const FilterColumn: React.ForwardRefExoticComponent<Pick<Select2Props, "defaultValue" | "onChange" | "value" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "autoFocus" | "emptyValue" | "disabled" | "fontSize" | "highlighted" | "invalid" | "loading" | "multiple" | "name" | "onCreate" | "onDelete" | "onEdit" | "readOnly" | "required" | "tags" | "createDialog" | "createTriggerText"> & {
|
10
8
|
allColumns: ReactTableColumn<unknown, unknown>[];
|
11
|
-
filters: TableFilter[];
|
12
9
|
} & React.RefAttributes<HTMLButtonElement>>;
|
@@ -41,7 +41,7 @@ export declare type TableColumnFilter = ReactTableColumnFilter;
|
|
41
41
|
export declare type TableColumnMenu = ((columnId: string) => React.ReactNode | null)[];
|
42
42
|
export declare type TableColumnRenderer<TType, TValue> = (value: TValue, row: TType) => JSX.Element | string | number | null;
|
43
43
|
export declare type TableColumnRendererAggregate<TType, TValue> = (value: TValue, row: TType) => JSX.Element | string | number | null;
|
44
|
-
export declare type TableColumnRendererControl<TType = unknown> = ((props: TableColumnRendererControlProps, row?: TType) => JSX.Element) | 'datepicker' | 'input' | 'switch' | 'checkbox' | 'textarea';
|
44
|
+
export declare type TableColumnRendererControl<TType = unknown> = ((props: TableColumnRendererControlProps, row?: TType, filterState?: TableFilter[]) => JSX.Element) | 'datepicker' | 'input' | 'switch' | 'checkbox' | 'textarea';
|
45
45
|
export declare type TableColumnRendererControlProps = {
|
46
46
|
className?: string;
|
47
47
|
disabled?: boolean;
|
@@ -134,6 +134,7 @@ export declare type TableFeatureProps<TType = unknown> = {
|
|
134
134
|
enableColumnHiding?: boolean;
|
135
135
|
enableColumnResizing?: boolean;
|
136
136
|
enableRowExpansion?: boolean;
|
137
|
+
enableRowExpansionAll?: boolean;
|
137
138
|
enableRowSelection?: TableConditionalRowProp<TType>;
|
138
139
|
enableColumnOrdering?: boolean;
|
139
140
|
enableFontSize?: boolean;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { TableRowExpansionRenderer } from '../../types';
|
2
|
-
export declare function useTableRowExpansion<TType = unknown>(isEnabled?: boolean, rowExpansionRenderer?: TableRowExpansionRenderer<TType>): {
|
2
|
+
export declare function useTableRowExpansion<TType = unknown>(isEnabled?: boolean, canExpandAll?: boolean, rowExpansionRenderer?: TableRowExpansionRenderer<TType>): {
|
3
3
|
isEnabled: boolean;
|
4
|
+
canExpandAll: boolean;
|
4
5
|
rowExpansionRenderer: TableRowExpansionRenderer<TType> | undefined;
|
5
6
|
};
|
@@ -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",
|
@@ -10525,6 +10528,7 @@ const DEFAULT_PRESET = {
|
|
10525
10528
|
enableColumnHiding: false,
|
10526
10529
|
enableColumnResizing: false,
|
10527
10530
|
enableRowExpansion: false,
|
10531
|
+
enableRowExpansionAll: true,
|
10528
10532
|
enableRowSelection: false,
|
10529
10533
|
// custom -- common between all table types
|
10530
10534
|
enableColumnOrdering: false,
|
@@ -10551,6 +10555,7 @@ const presets = {
|
|
10551
10555
|
enableColumnHiding: true,
|
10552
10556
|
enableColumnResizing: true,
|
10553
10557
|
enableRowExpansion: true,
|
10558
|
+
enableRowExpansionAll: true,
|
10554
10559
|
enableRowSelection: true,
|
10555
10560
|
// custom -- common between all table types
|
10556
10561
|
enableColumnOrdering: true,
|
@@ -10576,6 +10581,7 @@ const presets = {
|
|
10576
10581
|
enableColumnHiding: false,
|
10577
10582
|
enableColumnResizing: false,
|
10578
10583
|
enableRowExpansion: true,
|
10584
|
+
enableRowExpansionAll: true,
|
10579
10585
|
enableRowSelection: true,
|
10580
10586
|
// custom -- common between all table types
|
10581
10587
|
enableColumnOrdering: false,
|
@@ -10601,6 +10607,7 @@ const presets = {
|
|
10601
10607
|
enableColumnHiding: false,
|
10602
10608
|
enableColumnResizing: false,
|
10603
10609
|
enableRowExpansion: true,
|
10610
|
+
enableRowExpansionAll: true,
|
10604
10611
|
enableRowSelection: false,
|
10605
10612
|
// custom -- common between all table types
|
10606
10613
|
enableColumnOrdering: false,
|
@@ -10618,7 +10625,7 @@ const presets = {
|
|
10618
10625
|
}
|
10619
10626
|
};
|
10620
10627
|
function getTableFeaturePreset(props) {
|
10621
|
-
var _props$enableRowActio, _props$enableRowClick, _props$enableRowDrag, _props$enableRowDrop, _props$enableRowGoto, _props$enableRowExpan, _props$enableRowSelec, _props$enableFilterin, _props$enableSearch, _props$enableSorting, _props$enableColumnFr, _props$enableColumnHi, _props$enableColumnRe, _props$enableColumnOr, _props$enableFontSize, _props$enableFooter, _props$enablePrinting, _props$enableRowActiv, _props$rowActions, _props$enableRowHeigh, _props$enableSaveSett;
|
10628
|
+
var _props$enableRowActio, _props$enableRowClick, _props$enableRowDrag, _props$enableRowDrop, _props$enableRowGoto, _props$enableRowExpan, _props$enableRowExpan2, _props$enableRowSelec, _props$enableFilterin, _props$enableSearch, _props$enableSorting, _props$enableColumnFr, _props$enableColumnHi, _props$enableColumnRe, _props$enableColumnOr, _props$enableFontSize, _props$enableFooter, _props$enablePrinting, _props$enableRowActiv, _props$rowActions, _props$enableRowHeigh, _props$enableSaveSett;
|
10622
10629
|
const presetOptions = props.preset ? presets[props.preset] : DEFAULT_PRESET;
|
10623
10630
|
const enableRowActions = (_props$enableRowActio = props.enableRowActions) !== null && _props$enableRowActio !== void 0 ? _props$enableRowActio : presetOptions.enableRowActions;
|
10624
10631
|
const enableRowClick = (_props$enableRowClick = props.enableRowClick) !== null && _props$enableRowClick !== void 0 ? _props$enableRowClick : presetOptions.enableRowClick;
|
@@ -10626,6 +10633,7 @@ function getTableFeaturePreset(props) {
|
|
10626
10633
|
const enableRowDrop = (_props$enableRowDrop = props.enableRowDrop) !== null && _props$enableRowDrop !== void 0 ? _props$enableRowDrop : presetOptions.enableRowDrop;
|
10627
10634
|
const enableRowGoto = (_props$enableRowGoto = props.enableRowGoto) !== null && _props$enableRowGoto !== void 0 ? _props$enableRowGoto : presetOptions.enableRowGoto;
|
10628
10635
|
const enableRowExpansion = (_props$enableRowExpan = props.enableRowExpansion) !== null && _props$enableRowExpan !== void 0 ? _props$enableRowExpan : presetOptions.enableRowExpansion;
|
10636
|
+
const enableRowExpansionAll = (_props$enableRowExpan2 = props.enableRowExpansionAll) !== null && _props$enableRowExpan2 !== void 0 ? _props$enableRowExpan2 : presetOptions.enableRowExpansionAll;
|
10629
10637
|
const enableRowSelection = (_props$enableRowSelec = props.enableRowSelection) !== null && _props$enableRowSelec !== void 0 ? _props$enableRowSelec : presetOptions.enableRowSelection;
|
10630
10638
|
return {
|
10631
10639
|
// react-table built-in
|
@@ -10650,6 +10658,7 @@ function getTableFeaturePreset(props) {
|
|
10650
10658
|
enableRowDrag: enableRowDrag && !!props.onRowDrag,
|
10651
10659
|
enableRowDrop: enableRowDrop && !!props.onRowDrop,
|
10652
10660
|
enableRowGoto: enableRowGoto && !!props.onRowGoto,
|
10661
|
+
enableRowExpansionAll: enableRowExpansion && enableRowExpansionAll && !!props.rowExpansionRenderer,
|
10653
10662
|
enableRowHeight: (_props$enableRowHeigh = props.enableRowHeight) !== null && _props$enableRowHeigh !== void 0 ? _props$enableRowHeigh : presetOptions.enableRowHeight,
|
10654
10663
|
enableSaveSettings: (_props$enableSaveSett = props.enableSaveSettings) !== null && _props$enableSaveSett !== void 0 ? _props$enableSaveSett : presetOptions.enableSaveSettings
|
10655
10664
|
};
|
@@ -10894,9 +10903,10 @@ function useTableRowClick(isEnabled = false, onRowClick) {
|
|
10894
10903
|
};
|
10895
10904
|
}
|
10896
10905
|
|
10897
|
-
function useTableRowExpansion(isEnabled = false, rowExpansionRenderer) {
|
10906
|
+
function useTableRowExpansion(isEnabled = false, canExpandAll = true, rowExpansionRenderer) {
|
10898
10907
|
return {
|
10899
10908
|
isEnabled,
|
10909
|
+
canExpandAll,
|
10900
10910
|
rowExpansionRenderer: isEnabled ? rowExpansionRenderer : undefined
|
10901
10911
|
};
|
10902
10912
|
}
|
@@ -11737,7 +11747,7 @@ function useTableManager(props, meta, internalColumns) {
|
|
11737
11747
|
const rowClick = useTableRowClick(options.enableRowClick, props.onRowClick);
|
11738
11748
|
const rowDrag = useTableRowDrag(options.enableRowDrag && !(meta !== null && meta !== void 0 && (_meta$editing = meta.editing) !== null && _meta$editing !== void 0 && _meta$editing.isEditing), props.onRowDrag);
|
11739
11749
|
const rowDrop = useTableRowDrop(options.enableRowDrop, props.onRowDrop);
|
11740
|
-
const rowExpansion = useTableRowExpansion(options.enableRowExpansion, props.rowExpansionRenderer);
|
11750
|
+
const rowExpansion = useTableRowExpansion(options.enableRowExpansion, options.enableRowExpansionAll, props.rowExpansionRenderer);
|
11741
11751
|
const rowGoto = useTableRowGoto(options.enableRowGoto, props.onRowGoto);
|
11742
11752
|
const rowGroups = useTableRowGroups(props.rowActionsForGroup);
|
11743
11753
|
const rowHeight = useTableRowHeight(options.enableRowHeight, settings.rowHeight);
|
@@ -12479,6 +12489,10 @@ function Header$3(context) {
|
|
12479
12489
|
const {
|
12480
12490
|
table
|
12481
12491
|
} = context;
|
12492
|
+
const tableMeta = table.options.meta;
|
12493
|
+
if (!tableMeta.rowExpansion.canExpandAll) {
|
12494
|
+
return null;
|
12495
|
+
}
|
12482
12496
|
const isSomeRowsExpanded = table.getIsSomeRowsExpanded();
|
12483
12497
|
const handleClick = event => {
|
12484
12498
|
event.stopPropagation();
|
@@ -13785,8 +13799,13 @@ function Summary(props) {
|
|
13785
13799
|
}
|
13786
13800
|
|
13787
13801
|
function Foot(props) {
|
13788
|
-
const
|
13789
|
-
|
13802
|
+
const {
|
13803
|
+
children,
|
13804
|
+
table,
|
13805
|
+
...attributes
|
13806
|
+
} = props;
|
13807
|
+
const nonGroupedHeaders = table.getFooterGroups()[0].headers.filter(header => !header.column.getIsGrouped());
|
13808
|
+
return /*#__PURE__*/React__default.createElement("tfoot", Object.assign({}, attributes), children, /*#__PURE__*/React__default.createElement("tr", null, nonGroupedHeaders.map((header, index) => (/*#__PURE__*/React__default.createElement(Footer$3, {
|
13790
13809
|
key: header.id,
|
13791
13810
|
header: header,
|
13792
13811
|
index: index
|
@@ -14816,14 +14835,16 @@ const Tag$1 = /*#__PURE__*/React__default.forwardRef((props, ref) => {
|
|
14816
14835
|
ref: ref,
|
14817
14836
|
"data-taco": "tag"
|
14818
14837
|
}), /*#__PURE__*/React__default.createElement("span", {
|
14819
|
-
className: "truncate px-2",
|
14838
|
+
className: "flex items-center truncate px-2",
|
14820
14839
|
ref: textRef
|
14821
14840
|
}, icon ? typeof icon === 'string' ? (/*#__PURE__*/React__default.createElement(Icon, {
|
14822
14841
|
name: icon,
|
14823
|
-
className: "-ml-1
|
14842
|
+
className: "-ml-1 mr-1 !h-5 !w-5"
|
14824
14843
|
})) : (/*#__PURE__*/React__default.cloneElement(icon, {
|
14825
|
-
className: 'mr-1 -ml-1
|
14826
|
-
})) : null,
|
14844
|
+
className: 'mr-1 -ml-1 !h-5 !w-5'
|
14845
|
+
})) : null, /*#__PURE__*/React__default.createElement("span", {
|
14846
|
+
className: "truncate"
|
14847
|
+
}, children)), onDelete ? (/*#__PURE__*/React__default.createElement(Icon, {
|
14827
14848
|
name: "close",
|
14828
14849
|
onClick: onDelete,
|
14829
14850
|
className: "-ml-1.5 !h-6 !w-5 flex-shrink-0 cursor-pointer rounded-r p-0.5 hover:bg-black/5"
|
@@ -15102,12 +15123,13 @@ const Option$1 = /*#__PURE__*/React__default.forwardRef(function Select2Option(p
|
|
15102
15123
|
}), hasValue ? (/*#__PURE__*/React__default.createElement(Icon, {
|
15103
15124
|
name: "tick",
|
15104
15125
|
className: "pointer-events-none invisible -mx-0.5 !h-4 !w-4 group-aria-selected:visible"
|
15105
|
-
})) : null, isTag ? (/*#__PURE__*/React__default.createElement(Tag$1, {
|
15126
|
+
})) : null, typeof children !== 'string' ? (/*#__PURE__*/React__default.createElement("span", null, children)) : isTag ? (/*#__PURE__*/React__default.createElement(Tag$1, {
|
15106
15127
|
className: "pointer-events-none my-1",
|
15107
15128
|
color: color,
|
15108
15129
|
icon: prefix
|
15109
15130
|
}, children)) : (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, prefix ? typeof prefix === 'string' ? /*#__PURE__*/React__default.createElement(Icon, {
|
15110
|
-
name: prefix
|
15131
|
+
name: prefix,
|
15132
|
+
className: "!h-5 !w-5"
|
15111
15133
|
}) : prefix : null, /*#__PURE__*/React__default.createElement("span", {
|
15112
15134
|
className: "flex w-full justify-between"
|
15113
15135
|
}, /*#__PURE__*/React__default.createElement("span", {
|
@@ -15116,9 +15138,10 @@ const Option$1 = /*#__PURE__*/React__default.forwardRef(function Select2Option(p
|
|
15116
15138
|
className: "text-grey-700 -mt-1.5 mb-1.5 text-xs"
|
15117
15139
|
}, description) : null), /*#__PURE__*/React__default.createElement("span", {
|
15118
15140
|
className: "flex flex-col self-center"
|
15119
|
-
}, postfix ? typeof postfix === 'string' ? /*#__PURE__*/React__default.createElement(Icon, {
|
15120
|
-
name: postfix
|
15121
|
-
|
15141
|
+
}, postfix ? typeof postfix === 'string' ? (/*#__PURE__*/React__default.createElement(Icon, {
|
15142
|
+
name: postfix,
|
15143
|
+
className: "!h-5 !w-5"
|
15144
|
+
})) : postfix : null)))), popover ? (/*#__PURE__*/React__default.createElement(IconButton, {
|
15122
15145
|
icon: "ellipsis-vertical",
|
15123
15146
|
appearance: "discrete",
|
15124
15147
|
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', {
|
@@ -15284,7 +15307,7 @@ const Single = /*#__PURE__*/React__default.forwardRef(function Select2TriggerSin
|
|
15284
15307
|
readOnly,
|
15285
15308
|
tags
|
15286
15309
|
} = useSelect2Context();
|
15287
|
-
const contentClassName = cn('truncate items-center gap-1');
|
15310
|
+
const contentClassName = cn('truncate flex items-center gap-1');
|
15288
15311
|
const currentValue = children.find(matchesValue(value));
|
15289
15312
|
let output;
|
15290
15313
|
if (placeholder && currentValue === undefined) {
|
@@ -15294,13 +15317,13 @@ const Single = /*#__PURE__*/React__default.forwardRef(function Select2TriggerSin
|
|
15294
15317
|
}, placeholder);
|
15295
15318
|
} else if (currentValue) {
|
15296
15319
|
if (tags && emptyValue !== value) {
|
15297
|
-
output = /*#__PURE__*/React__default.createElement(Tag$1, {
|
15320
|
+
if (typeof currentValue.props.children === 'string') output = /*#__PURE__*/React__default.createElement(Tag$1, {
|
15298
15321
|
className: "truncate",
|
15299
15322
|
color: currentValue.props.color,
|
15300
15323
|
disabled: disabled,
|
15301
15324
|
icon: currentValue.props.prefix,
|
15302
15325
|
readOnly: readOnly
|
15303
|
-
}, currentValue.props.children);
|
15326
|
+
}, currentValue.props.children);else output = currentValue.props.children;
|
15304
15327
|
} else {
|
15305
15328
|
output = /*#__PURE__*/React__default.createElement(React__default.Fragment, null, currentValue.props.prefix ? typeof currentValue.props.prefix === 'string' ? (/*#__PURE__*/React__default.createElement(Icon, {
|
15306
15329
|
name: currentValue.props.prefix,
|
@@ -15351,7 +15374,7 @@ const Multiple = /*#__PURE__*/React__default.forwardRef(function Select2TriggerM
|
|
15351
15374
|
}, valuesAsChildren.length === 0 ? (/*#__PURE__*/React__default.createElement(Placeholder, {
|
15352
15375
|
disabled: disabled,
|
15353
15376
|
readOnly: readOnly
|
15354
|
-
}, placeholder)) : valuesAsChildren.map(child => (/*#__PURE__*/React__default.createElement(Tag$1, {
|
15377
|
+
}, placeholder)) : valuesAsChildren.map(child => typeof child.props.children === 'string' ? (/*#__PURE__*/React__default.createElement(Tag$1, {
|
15355
15378
|
key: String(child.props.value),
|
15356
15379
|
className: "truncate",
|
15357
15380
|
color: tags ? child.props.color : undefined,
|
@@ -15365,7 +15388,23 @@ const Multiple = /*#__PURE__*/React__default.forwardRef(function Select2TriggerM
|
|
15365
15388
|
}
|
15366
15389
|
},
|
15367
15390
|
readOnly: readOnly
|
15368
|
-
}, child.props.children))
|
15391
|
+
}, child.props.children)) : (/*#__PURE__*/React__default.cloneElement(child.props.children, {
|
15392
|
+
key: String(child.props.value),
|
15393
|
+
className: '!pr-0 !pl-1.5',
|
15394
|
+
children: (/*#__PURE__*/React__default.createElement("span", {
|
15395
|
+
className: "flex items-center"
|
15396
|
+
}, child.props.children.props.children, /*#__PURE__*/React__default.createElement(Icon, {
|
15397
|
+
name: "close",
|
15398
|
+
onClick: event => {
|
15399
|
+
event === null || event === void 0 ? void 0 : event.stopPropagation();
|
15400
|
+
event === null || event === void 0 ? void 0 : event.preventDefault();
|
15401
|
+
if (!disabled && !readOnly) {
|
15402
|
+
setValue(child.props.value);
|
15403
|
+
}
|
15404
|
+
},
|
15405
|
+
className: "ml-0.5 !h-5 !w-5 shrink-0 cursor-pointer rounded-r p-0.5 hover:bg-black/5"
|
15406
|
+
})))
|
15407
|
+
})))));
|
15369
15408
|
} else {
|
15370
15409
|
content = /*#__PURE__*/React__default.createElement(MultipleValue, {
|
15371
15410
|
onClick: forwardClick,
|
@@ -15396,6 +15435,18 @@ const MultipleValue = ({
|
|
15396
15435
|
} = useSelect2Context();
|
15397
15436
|
const [contentRef, setContentRef] = React__default.useState(null);
|
15398
15437
|
const boundaryIndex = contentRef ? getIndexOfFirstChildOverflowingParent(contentRef, 30) : undefined;
|
15438
|
+
// Retrieves the relevant text content from any JSX.Element passed as a select option, handling nested elements, arrays, and direct text
|
15439
|
+
const getTooltipTitle = child => {
|
15440
|
+
const children = child.props.children;
|
15441
|
+
if (typeof children === 'string') return children;
|
15442
|
+
if (typeof children.props.children === 'string') {
|
15443
|
+
return children.props.children;
|
15444
|
+
}
|
15445
|
+
if (Array.isArray(children.props.children)) {
|
15446
|
+
return children.props.children.filter(item => typeof item === 'string');
|
15447
|
+
}
|
15448
|
+
return '';
|
15449
|
+
};
|
15399
15450
|
return /*#__PURE__*/React__default.createElement("div", {
|
15400
15451
|
className: "relative flex w-full items-center gap-1 overflow-hidden",
|
15401
15452
|
onClick: onClick
|
@@ -15406,26 +15457,35 @@ const MultipleValue = ({
|
|
15406
15457
|
disabled: disabled,
|
15407
15458
|
readOnly: readOnly
|
15408
15459
|
}, placeholder)) : valuesAsChildren.map((child, index) => {
|
15409
|
-
const
|
15410
|
-
|
15460
|
+
const classNames = {
|
15461
|
+
truncate: index === boundaryIndex,
|
15462
|
+
hidden: boundaryIndex !== undefined && boundaryIndex !== null ? index > boundaryIndex : false
|
15463
|
+
};
|
15464
|
+
let output;
|
15465
|
+
if (typeof child.props.children === 'string') {
|
15466
|
+
output = /*#__PURE__*/React__default.createElement(Tag$1, {
|
15467
|
+
key: String(child.props.value),
|
15468
|
+
className: cn('cursor-pointer', classNames),
|
15469
|
+
color: tags ? child.props.color : undefined,
|
15470
|
+
disabled: disabled,
|
15471
|
+
icon: child.props.prefix,
|
15472
|
+
readOnly: readOnly
|
15473
|
+
}, child.props.children);
|
15474
|
+
} else output = /*#__PURE__*/React__default.cloneElement(child.props.children, {
|
15411
15475
|
className: cn('cursor-pointer', {
|
15412
|
-
|
15413
|
-
|
15414
|
-
|
15415
|
-
|
15416
|
-
disabled: disabled,
|
15417
|
-
icon: child.props.prefix,
|
15418
|
-
readOnly: readOnly
|
15419
|
-
}, child.props.children);
|
15476
|
+
'shrink-0': index !== boundaryIndex
|
15477
|
+
}, classNames),
|
15478
|
+
key: String(child.props.value)
|
15479
|
+
});
|
15420
15480
|
if (index === boundaryIndex) {
|
15421
15481
|
return /*#__PURE__*/React__default.createElement(Tooltip, {
|
15422
15482
|
key: String(child.props.value),
|
15423
|
-
title: String(child
|
15424
|
-
},
|
15483
|
+
title: String(getTooltipTitle(child))
|
15484
|
+
}, output);
|
15425
15485
|
}
|
15426
|
-
return
|
15486
|
+
return output;
|
15427
15487
|
})), boundaryIndex !== undefined && boundaryIndex !== null && boundaryIndex < valuesAsChildren.length - 1 ? (/*#__PURE__*/React__default.createElement(Tooltip, {
|
15428
|
-
title: valuesAsChildren.slice(boundaryIndex + 1).map(child => child ? String(child
|
15488
|
+
title: valuesAsChildren.slice(boundaryIndex + 1).map(child => child ? String(getTooltipTitle(child)) : '').join(', ')
|
15429
15489
|
}, /*#__PURE__*/React__default.createElement(Badge, {
|
15430
15490
|
className: "flex-shrink-0"
|
15431
15491
|
}, "+", valuesAsChildren.length - (boundaryIndex + 1)))) : null);
|
@@ -16299,10 +16359,11 @@ function guessComparatorsBasedOnControl(column) {
|
|
16299
16359
|
return getDataTypeProperties(columnMeta.dataType).filterComparators;
|
16300
16360
|
}
|
16301
16361
|
|
16362
|
+
const FilterContext = /*#__PURE__*/React__default.createContext([]);
|
16363
|
+
|
16302
16364
|
const FilterColumn = /*#__PURE__*/React__default.forwardRef((props, ref) => {
|
16303
16365
|
const {
|
16304
16366
|
allColumns,
|
16305
|
-
filters,
|
16306
16367
|
onChange: handleChange,
|
16307
16368
|
value = null,
|
16308
16369
|
...attributes
|
@@ -16310,6 +16371,7 @@ const FilterColumn = /*#__PURE__*/React__default.forwardRef((props, ref) => {
|
|
16310
16371
|
const {
|
16311
16372
|
texts
|
16312
16373
|
} = useLocalization();
|
16374
|
+
const filters = React__default.useContext(FilterContext);
|
16313
16375
|
const selectedColumn = allColumns.find(column => column.id === value);
|
16314
16376
|
const warning = selectedColumn && !selectedColumn.getIsVisible();
|
16315
16377
|
return /*#__PURE__*/React__default.createElement("div", {
|
@@ -16475,6 +16537,7 @@ function Control(props) {
|
|
16475
16537
|
} = props;
|
16476
16538
|
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;
|
16477
16539
|
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;
|
16540
|
+
const filters = React__default.useContext(FilterContext);
|
16478
16541
|
React.useEffect(() => {
|
16479
16542
|
// 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
|
16480
16543
|
if ((controlRenderer === 'switch' || controlRenderer === 'checkbox') && value === undefined) {
|
@@ -16486,7 +16549,7 @@ function Control(props) {
|
|
16486
16549
|
...attributes,
|
16487
16550
|
setValue: value => onChange(value),
|
16488
16551
|
value
|
16489
|
-
}), {
|
16552
|
+
}, undefined, filters), {
|
16490
16553
|
['data-query-selector']: querySelector,
|
16491
16554
|
className: 'focus:yt-focus'
|
16492
16555
|
});
|
@@ -16528,7 +16591,6 @@ function Filter$1(props) {
|
|
16528
16591
|
const {
|
16529
16592
|
allColumns,
|
16530
16593
|
filter,
|
16531
|
-
filters,
|
16532
16594
|
onChange: handleChange,
|
16533
16595
|
onRemove,
|
16534
16596
|
position
|
@@ -16603,7 +16665,6 @@ function Filter$1(props) {
|
|
16603
16665
|
className: "flex min-h-[theme(spacing.8)] w-14 flex-shrink-0 items-center justify-end pr-2 text-right"
|
16604
16666
|
}, position > 0 ? texts.table.filters.conditions.and : texts.table.filters.conditions.where), /*#__PURE__*/React__default.createElement(FilterColumn, {
|
16605
16667
|
allColumns: allColumns,
|
16606
|
-
filters: filters,
|
16607
16668
|
onChange: handleChangeColumn,
|
16608
16669
|
value: id,
|
16609
16670
|
ref: ref
|
@@ -16707,7 +16768,9 @@ function ManageFiltersPopover(props) {
|
|
16707
16768
|
};
|
16708
16769
|
return /*#__PURE__*/React__default.createElement(Popover, Object.assign({}, popoverProps, {
|
16709
16770
|
onChange: handleClose
|
16710
|
-
}), /*#__PURE__*/React__default.createElement(Popover.Content, null, /*#__PURE__*/React__default.createElement(
|
16771
|
+
}), /*#__PURE__*/React__default.createElement(Popover.Content, null, /*#__PURE__*/React__default.createElement(FilterContext.Provider, {
|
16772
|
+
value: filters
|
16773
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
16711
16774
|
className: "flex w-[40rem] flex-col gap-4"
|
16712
16775
|
}, /*#__PURE__*/React__default.createElement("div", {
|
16713
16776
|
className: "flex h-8"
|
@@ -16723,7 +16786,6 @@ function ManageFiltersPopover(props) {
|
|
16723
16786
|
key: `filter_${index}`,
|
16724
16787
|
allColumns: allColumns,
|
16725
16788
|
filter: filter,
|
16726
|
-
filters: filters,
|
16727
16789
|
position: index,
|
16728
16790
|
onChange: handleChangeFilter,
|
16729
16791
|
onRemove: filters.length > 0 && filters.some(f => f.id) || filters.length > 1 ? handleRemoveFilter : undefined
|
@@ -16739,7 +16801,7 @@ function ManageFiltersPopover(props) {
|
|
16739
16801
|
}, texts.table.filters.buttons.clear), /*#__PURE__*/React__default.createElement(Button$1, {
|
16740
16802
|
appearance: "primary",
|
16741
16803
|
onClick: handleApply
|
16742
|
-
}, texts.table.filters.buttons.apply)))));
|
16804
|
+
}, texts.table.filters.buttons.apply))))));
|
16743
16805
|
}
|
16744
16806
|
|
16745
16807
|
function Filters(props) {
|
@@ -16859,6 +16921,7 @@ function TableGrid(props) {
|
|
16859
16921
|
var _table$state$grouping;
|
16860
16922
|
const {
|
16861
16923
|
enableHorizontalArrowKeyNavigation,
|
16924
|
+
footerRows,
|
16862
16925
|
table,
|
16863
16926
|
...attributes
|
16864
16927
|
} = props;
|
@@ -16901,7 +16964,7 @@ function TableGrid(props) {
|
|
16901
16964
|
} : table.renderer.style
|
16902
16965
|
}, table.renderer.rows, props.children), table.meta.footer.isEnabled ? /*#__PURE__*/React__default.createElement(Foot, {
|
16903
16966
|
table: table.instance
|
16904
|
-
}) : null)))));
|
16967
|
+
}, footerRows) : null)))));
|
16905
16968
|
}
|
16906
16969
|
|
16907
16970
|
function Column$1(_) {
|
@@ -18493,6 +18556,14 @@ const shortcut = {
|
|
18493
18556
|
meta: true,
|
18494
18557
|
shift: false
|
18495
18558
|
};
|
18559
|
+
function isTableScrolled(ref) {
|
18560
|
+
if (ref.current) {
|
18561
|
+
var _ref$current, _ref$current$querySel, _ref$current2, _ref$current2$querySe;
|
18562
|
+
const height = parseFloat(((_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : (_ref$current$querySel = _ref$current.querySelector('tbody')) === null || _ref$current$querySel === void 0 ? void 0 : _ref$current$querySel.style.height) || '0') + parseFloat(((_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : (_ref$current2$querySe = _ref$current2.querySelector('tbody')) === null || _ref$current2$querySe === void 0 ? void 0 : _ref$current2$querySe.style.paddingBottom) || '0');
|
18563
|
+
return height > ref.current.scrollHeight;
|
18564
|
+
}
|
18565
|
+
return false;
|
18566
|
+
}
|
18496
18567
|
|
18497
18568
|
function useTableEditingListener(table, tableRef, scrollToIndex) {
|
18498
18569
|
const tableMeta = table.options.meta;
|
@@ -20037,10 +20108,10 @@ function CreateNewRow(props) {
|
|
20037
20108
|
var _temporaryRows$0$tabl, _temporaryRows$, _table$getState$colum;
|
20038
20109
|
const {
|
20039
20110
|
buttonRef,
|
20111
|
+
isScrolled,
|
20040
20112
|
scrollToIndex,
|
20041
20113
|
table,
|
20042
|
-
tableMeta
|
20043
|
-
tableRef
|
20114
|
+
tableMeta
|
20044
20115
|
} = props;
|
20045
20116
|
const {
|
20046
20117
|
texts
|
@@ -20073,11 +20144,9 @@ function CreateNewRow(props) {
|
|
20073
20144
|
keys: shortcut
|
20074
20145
|
});
|
20075
20146
|
}
|
20076
|
-
const isScrolled = tableRef.current ? tableRef.current.scrollHeight > tableRef.current.clientHeight : false;
|
20077
20147
|
const className = cn('group/row border-grey-300 !sticky z-[21]', {
|
20078
20148
|
'bottom-10': tableMeta.footer.isEnabled,
|
20079
20149
|
'bottom-0': !tableMeta.footer.isEnabled,
|
20080
|
-
'border-t-2': isScrolled,
|
20081
20150
|
'border-b': !isScrolled
|
20082
20151
|
});
|
20083
20152
|
return /*#__PURE__*/React__default.createElement("tr", {
|
@@ -20102,6 +20171,7 @@ function CreateNewRow(props) {
|
|
20102
20171
|
function TemporaryRow(props) {
|
20103
20172
|
const {
|
20104
20173
|
createRowButtonRef,
|
20174
|
+
isScrolled,
|
20105
20175
|
table,
|
20106
20176
|
tableMeta,
|
20107
20177
|
tableRef
|
@@ -20164,10 +20234,9 @@ function TemporaryRow(props) {
|
|
20164
20234
|
}
|
20165
20235
|
}
|
20166
20236
|
};
|
20167
|
-
const isScrolled = tableRef.current ? tableRef.current.scrollHeight > tableRef.current.clientHeight : false;
|
20168
20237
|
const className = cn('group/row border-grey-300 !sticky z-[22]', {
|
20169
|
-
'bottom-[calc(5rem_+
|
20170
|
-
'bottom-[calc(2.5rem_+
|
20238
|
+
'bottom-[calc(5rem_+_2px)] data-[row-editing-move]:bottom-[calc(5rem_+_2px)]': tableMeta.footer.isEnabled,
|
20239
|
+
'bottom-[calc(2.5rem_+_2px)] data-[row-editing-move]:bottom-[calc(2.5rem_+_2px)]': !tableMeta.footer.isEnabled,
|
20171
20240
|
'border-t-2 shadow-[0px_-5px_20px_0px_rgba(0,0,0,0.1)] [&>td]:!border-b-0': isScrolled
|
20172
20241
|
});
|
20173
20242
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, table.getBottomRows().map(row => (/*#__PURE__*/React__default.createElement(Row, {
|
@@ -20203,6 +20272,17 @@ const BaseTable3 = /*#__PURE__*/fixedForwardRef(function BaseTable3(props, ref)
|
|
20203
20272
|
};
|
20204
20273
|
const hasAlertErrors = table3.meta.editing.getErrorsShownInAlert().length;
|
20205
20274
|
const hasCreateWorkflow = table3.meta.editing.isEnabled && props.onEditingCreate;
|
20275
|
+
const isScrolled = isTableScrolled(table3.ref);
|
20276
|
+
let createWorkflow;
|
20277
|
+
if (hasCreateWorkflow) {
|
20278
|
+
createWorkflow = /*#__PURE__*/React__default.createElement(CreateNewRow, {
|
20279
|
+
buttonRef: table3.meta.editing.createRowButtonRef,
|
20280
|
+
isScrolled: isScrolled,
|
20281
|
+
scrollToIndex: table3.renderer.scrollToIndex,
|
20282
|
+
table: table3.instance,
|
20283
|
+
tableMeta: table3.meta
|
20284
|
+
});
|
20285
|
+
}
|
20206
20286
|
return /*#__PURE__*/React__default.createElement(Table, null, /*#__PURE__*/React__default.createElement(Table.Toolbar, {
|
20207
20287
|
table: table3
|
20208
20288
|
}, table3.meta.editing.isEnabled ? (/*#__PURE__*/React__default.createElement(Editing, {
|
@@ -20215,19 +20295,15 @@ const BaseTable3 = /*#__PURE__*/fixedForwardRef(function BaseTable3(props, ref)
|
|
20215
20295
|
tableRef: table3.ref
|
20216
20296
|
})) : null, /*#__PURE__*/React__default.createElement(Table.Grid, Object.assign({}, gridAttributes, {
|
20217
20297
|
"data-taco": "table3",
|
20298
|
+
footerRows: hasCreateWorkflow && isScrolled ? createWorkflow : undefined,
|
20218
20299
|
table: table3
|
20219
20300
|
}), hasCreateWorkflow ? (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(TemporaryRow, {
|
20220
20301
|
createRowButtonRef: table3.meta.editing.createRowButtonRef,
|
20302
|
+
isScrolled: isScrolled,
|
20221
20303
|
table: table3.instance,
|
20222
20304
|
tableMeta: table3.meta,
|
20223
20305
|
tableRef: table3.ref
|
20224
|
-
}),
|
20225
|
-
buttonRef: table3.meta.editing.createRowButtonRef,
|
20226
|
-
scrollToIndex: table3.renderer.scrollToIndex,
|
20227
|
-
table: table3.instance,
|
20228
|
-
tableMeta: table3.meta,
|
20229
|
-
tableRef: table3.ref
|
20230
|
-
}))) : null));
|
20306
|
+
}), !isScrolled ? createWorkflow : null)) : null));
|
20231
20307
|
});
|
20232
20308
|
const Table3 = /*#__PURE__*/fixedForwardRef(function Table3(props, ref) {
|
20233
20309
|
const stringifiedChildren = String(props.children);
|