@economic/taco 2.12.1 → 2.13.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/Provider/Localization.d.ts +1 -0
- package/dist/components/Select2/components/Option.d.ts +7 -5
- package/dist/components/Table3/Table3.d.ts +9 -1
- package/dist/components/Table3/components/columns/header/Group.d.ts +15 -0
- package/dist/components/Table3/components/columns/header/Header.d.ts +5 -0
- package/dist/components/Table3/components/columns/internal/EditingActions.d.ts +1 -1
- package/dist/components/Table3/hooks/features/useHeaderOffsetStyle.d.ts +3 -0
- package/dist/components/Table3/types.d.ts +7 -0
- package/dist/esm/index.css +24 -6
- package/dist/esm/packages/taco/src/components/Combobox/useCombobox.js +1 -1
- package/dist/esm/packages/taco/src/components/Combobox/useCombobox.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Provider/Localization.js +1 -0
- package/dist/esm/packages/taco/src/components/Provider/Localization.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Option.js +13 -6
- 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 +7 -6
- package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/Table3.js +24 -7
- package/dist/esm/packages/taco/src/components/Table3/Table3.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Group.js +70 -0
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Group.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Header.js +26 -8
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Header.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/EditingActions.js +13 -9
- package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/EditingActions.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/ColumnSettings.js +8 -5
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/ColumnSettings.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterColumn.js +14 -2
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterColumn.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useHeaderOffsetStyle.js +24 -0
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useHeaderOffsetStyle.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Table3/hooks/useConvertChildrenToColumns.js +30 -7
- package/dist/esm/packages/taco/src/components/Table3/hooks/useConvertChildrenToColumns.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/types.js.map +1 -1
- package/dist/index.css +24 -6
- package/dist/taco.cjs.development.js +216 -52
- 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
- package/types.json +7273 -6481
@@ -4426,6 +4426,7 @@ const defaultLocalisationTexts = {
|
|
4426
4426
|
condition: 'Condition',
|
4427
4427
|
value: 'Value'
|
4428
4428
|
},
|
4429
|
+
hiddenColumn: 'Hidden column',
|
4429
4430
|
tooltip: 'Apply filters',
|
4430
4431
|
total: 'Viewing [CURRENT] of [TOTAL]'
|
4431
4432
|
},
|
@@ -5558,7 +5559,7 @@ const useCombobox = ({
|
|
5558
5559
|
// event handlers
|
5559
5560
|
const handleInputBlur = event => {
|
5560
5561
|
event.persist();
|
5561
|
-
if (event.relatedTarget === listRef.current) {
|
5562
|
+
if (listRef.current && event.relatedTarget === listRef.current) {
|
5562
5563
|
event.preventDefault();
|
5563
5564
|
return;
|
5564
5565
|
}
|
@@ -9854,7 +9855,8 @@ const Option$1 = /*#__PURE__*/React__default.forwardRef(function Select2Option(p
|
|
9854
9855
|
children,
|
9855
9856
|
color,
|
9856
9857
|
description,
|
9857
|
-
|
9858
|
+
prefix,
|
9859
|
+
postfix,
|
9858
9860
|
className: cName,
|
9859
9861
|
...otherProps
|
9860
9862
|
} = props;
|
@@ -9908,14 +9910,20 @@ const Option$1 = /*#__PURE__*/React__default.forwardRef(function Select2Option(p
|
|
9908
9910
|
}) : null, isTag ? /*#__PURE__*/React__default.createElement(Tag$1, {
|
9909
9911
|
className: "pointer-events-none my-1",
|
9910
9912
|
color: color,
|
9911
|
-
icon:
|
9912
|
-
}, children) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null,
|
9913
|
-
name:
|
9914
|
-
}) :
|
9913
|
+
icon: prefix
|
9914
|
+
}, children) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, prefix ? typeof prefix === 'string' ? /*#__PURE__*/React__default.createElement(Icon, {
|
9915
|
+
name: prefix
|
9916
|
+
}) : prefix : null, /*#__PURE__*/React__default.createElement("span", {
|
9917
|
+
className: "flex w-full justify-between"
|
9918
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
9915
9919
|
className: "flex flex-col"
|
9916
9920
|
}, /*#__PURE__*/React__default.createElement("span", null, children), description ? /*#__PURE__*/React__default.createElement("span", {
|
9917
9921
|
className: "text-grey-700 -mt-1.5 mb-1.5 text-xs"
|
9918
|
-
}, description) : null)
|
9922
|
+
}, description) : null), /*#__PURE__*/React__default.createElement("span", {
|
9923
|
+
className: "mt-1 flex flex-col"
|
9924
|
+
}, postfix ? typeof postfix === 'string' ? /*#__PURE__*/React__default.createElement(Icon, {
|
9925
|
+
name: postfix
|
9926
|
+
}) : postfix : null))), popover ? /*#__PURE__*/React__default.createElement(IconButton, {
|
9919
9927
|
icon: "ellipsis-vertical",
|
9920
9928
|
appearance: "discrete",
|
9921
9929
|
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', {
|
@@ -10065,13 +10073,14 @@ const Single = /*#__PURE__*/React__default.forwardRef(function Select2TriggerSin
|
|
10065
10073
|
className: "truncate",
|
10066
10074
|
color: currentValue.props.color,
|
10067
10075
|
disabled: disabled,
|
10068
|
-
icon: currentValue.props.
|
10076
|
+
icon: currentValue.props.prefix,
|
10069
10077
|
readOnly: readOnly
|
10070
10078
|
}, currentValue.props.children);
|
10071
10079
|
} else {
|
10072
|
-
output = /*#__PURE__*/React__default.createElement(React__default.Fragment, null, currentValue.props.
|
10073
|
-
name: currentValue.props.
|
10074
|
-
|
10080
|
+
output = /*#__PURE__*/React__default.createElement(React__default.Fragment, null, currentValue.props.prefix ? typeof currentValue.props.prefix === 'string' ? /*#__PURE__*/React__default.createElement(Icon, {
|
10081
|
+
name: currentValue.props.prefix,
|
10082
|
+
className: "mr-1 !h-5 !w-5"
|
10083
|
+
}) : currentValue.props.prefix : null, currentValue.props.children);
|
10075
10084
|
}
|
10076
10085
|
}
|
10077
10086
|
return /*#__PURE__*/React__default.createElement(Button$2, Object.assign({}, buttonProps, {
|
@@ -10118,7 +10127,7 @@ const Multiple = /*#__PURE__*/React__default.forwardRef(function Select2TriggerM
|
|
10118
10127
|
className: "truncate",
|
10119
10128
|
color: tags ? child.props.color : undefined,
|
10120
10129
|
disabled: disabled,
|
10121
|
-
icon: child.props.
|
10130
|
+
icon: child.props.prefix,
|
10122
10131
|
onDelete: event => {
|
10123
10132
|
event === null || event === void 0 ? void 0 : event.stopPropagation();
|
10124
10133
|
event === null || event === void 0 ? void 0 : event.preventDefault();
|
@@ -10186,7 +10195,7 @@ const MultipleValue = ({
|
|
10186
10195
|
}),
|
10187
10196
|
color: tags ? child.props.color : undefined,
|
10188
10197
|
disabled: disabled,
|
10189
|
-
icon: child.props.
|
10198
|
+
icon: child.props.prefix,
|
10190
10199
|
onDelete: open ? createClickHandler(child.props.value) : undefined,
|
10191
10200
|
readOnly: readOnly
|
10192
10201
|
}, child.props.children);
|
@@ -16197,6 +16206,7 @@ function Header$2(props) {
|
|
16197
16206
|
children,
|
16198
16207
|
column,
|
16199
16208
|
header,
|
16209
|
+
hasSeparator,
|
16200
16210
|
scrollToIndex,
|
16201
16211
|
table
|
16202
16212
|
} = props;
|
@@ -16232,10 +16242,13 @@ function Header$2(props) {
|
|
16232
16242
|
canResize: column.getCanResize(),
|
16233
16243
|
canSort,
|
16234
16244
|
children: children !== null && children !== void 0 ? children : columnMeta.header,
|
16245
|
+
colSpan: header.colSpan,
|
16235
16246
|
hasMenu: isMenuAvailable(table, header),
|
16247
|
+
hasSeparator,
|
16236
16248
|
id: header.id,
|
16237
16249
|
index: header.index,
|
16238
16250
|
isFrozen: isFrozenColumn(header, table),
|
16251
|
+
isPlaceholder: header.isPlaceholder,
|
16239
16252
|
isPrinting: tableMeta.isPrinting,
|
16240
16253
|
isResizing: column.getIsResizing(),
|
16241
16254
|
length: table.getRowModel().rows.length,
|
@@ -16260,10 +16273,13 @@ const MemoedHeader = /*#__PURE__*/React__default.memo(function MemoedHeader(prop
|
|
16260
16273
|
canHide,
|
16261
16274
|
canResize,
|
16262
16275
|
canSort,
|
16276
|
+
colSpan,
|
16263
16277
|
hasMenu,
|
16278
|
+
hasSeparator,
|
16264
16279
|
id,
|
16265
16280
|
index,
|
16266
16281
|
isFrozen,
|
16282
|
+
isPlaceholder,
|
16267
16283
|
isPrinting,
|
16268
16284
|
isResizing,
|
16269
16285
|
length,
|
@@ -16277,19 +16293,22 @@ const MemoedHeader = /*#__PURE__*/React__default.memo(function MemoedHeader(prop
|
|
16277
16293
|
sortDirection,
|
16278
16294
|
table
|
16279
16295
|
} = props;
|
16280
|
-
const className = cn('sticky
|
16296
|
+
const className = cn('sticky font-bold border-b-2 box-content group/column relative', '[[role="table"][data-resizing="true"]_&]:pointer-events-none', 'px-[var(--table3-cell-padding-x)]', {
|
16297
|
+
'!border-white': isPlaceholder,
|
16281
16298
|
'h-10 items-center': !isPrinting,
|
16282
16299
|
'pb-2': isPrinting,
|
16283
16300
|
'cursor-pointer select-none': canSort,
|
16284
|
-
'hover:bg-grey-100': canSort || canResize || hasMenu,
|
16301
|
+
'hover:bg-grey-100': !isPlaceholder && (canSort || canResize || hasMenu),
|
16285
16302
|
'focus-within:bg-grey-100': hasMenu,
|
16286
|
-
'!pointer-events-all !bg-grey-100': isResizing,
|
16303
|
+
'!pointer-events-all !bg-grey-100': !isPlaceholder && isResizing,
|
16287
16304
|
// z-indexes
|
16288
16305
|
'z-10 hover:z-20': !isFrozen && !isResizing,
|
16289
16306
|
'z-20': !isFrozen && isResizing,
|
16290
|
-
'
|
16307
|
+
// when column is frozen, we need to increase it's z-index when it's hovered,
|
16308
|
+
// so that resize handler appears on top of next frozen cell, and didn't get cut by it.
|
16309
|
+
'!z-30 hover:!z-40': isFrozen,
|
16291
16310
|
'!z-40': isFrozen && isResizing
|
16292
|
-
}, meta.headerClassName);
|
16311
|
+
}, colSpan > 1 ? `col-span-${colSpan}` : '', meta.headerClassName);
|
16293
16312
|
const [internalRef, setInternalRef] = React__default.useState(null);
|
16294
16313
|
React__default.useLayoutEffect(() => {
|
16295
16314
|
if (internalRef && length) {
|
@@ -16312,7 +16331,7 @@ const MemoedHeader = /*#__PURE__*/React__default.memo(function MemoedHeader(prop
|
|
16312
16331
|
"data-column-index": index,
|
16313
16332
|
role: "columnheader",
|
16314
16333
|
ref: setInternalRef
|
16315
|
-
}), isInternalColumn$1(id) ? children : /*#__PURE__*/React__default.createElement(Tooltip, {
|
16334
|
+
}), isPlaceholder ? null : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, isInternalColumn$1(id) ? children : /*#__PURE__*/React__default.createElement(Tooltip, {
|
16316
16335
|
title: String((_meta$tooltip = meta === null || meta === void 0 ? void 0 : meta.tooltip) !== null && _meta$tooltip !== void 0 ? _meta$tooltip : children),
|
16317
16336
|
placement: "top"
|
16318
16337
|
}, /*#__PURE__*/React__default.createElement("span", {
|
@@ -16337,11 +16356,19 @@ const MemoedHeader = /*#__PURE__*/React__default.memo(function MemoedHeader(prop
|
|
16337
16356
|
scrollToIndex: scrollToIndex,
|
16338
16357
|
sortDirection: sortDirection,
|
16339
16358
|
table: table
|
16340
|
-
}) : null, canResize ? /*#__PURE__*/React__default.createElement(Resizer, {
|
16359
|
+
}) : null), hasSeparator ? /*#__PURE__*/React__default.createElement(HeaderSeparator, null) : null, !isPlaceholder && canResize ? /*#__PURE__*/React__default.createElement(Resizer, {
|
16341
16360
|
isResizing: isResizing,
|
16342
16361
|
onResize: handleResize
|
16343
16362
|
}) : null);
|
16344
16363
|
});
|
16364
|
+
function HeaderSeparator() {
|
16365
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
16366
|
+
"data-taco": "header-separator",
|
16367
|
+
className: cn('invisible absolute right-[0.5px] top-0 flex h-full w-2 touch-none select-none justify-center py-2 group-hover/header:visible')
|
16368
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
16369
|
+
className: cn('bg-grey-300 h-full w-[1px]')
|
16370
|
+
}));
|
16371
|
+
}
|
16345
16372
|
|
16346
16373
|
const RowContext$1 = /*#__PURE__*/React__default.createContext({
|
16347
16374
|
isHovered: false,
|
@@ -17555,6 +17582,7 @@ const savingIndicatorHideDelay = 3000;
|
|
17555
17582
|
const COLUMN_ID$1 = '__editing_actions';
|
17556
17583
|
const MemoedCell$1 = /*#__PURE__*/React__default.memo(function MemoedCell(props) {
|
17557
17584
|
const {
|
17585
|
+
hasChanges,
|
17558
17586
|
isCurrentRow,
|
17559
17587
|
isEditing,
|
17560
17588
|
row,
|
@@ -17563,8 +17591,6 @@ const MemoedCell$1 = /*#__PURE__*/React__default.memo(function MemoedCell(props)
|
|
17563
17591
|
const tableMeta = table.options.meta;
|
17564
17592
|
const savingState = tableMeta.editing.savingStates && tableMeta.editing.savingStates[row.id];
|
17565
17593
|
const [isSavedIndicatorVisible, setIsSavingIndicatorVisible] = React__default.useState(false);
|
17566
|
-
const changeset = tableMeta.editing.changes ? Object.keys(tableMeta.editing.changes) : [];
|
17567
|
-
const isRowInEditingState = changeset.indexOf(row.id) >= 0;
|
17568
17594
|
const {
|
17569
17595
|
texts
|
17570
17596
|
} = useLocalization();
|
@@ -17586,14 +17612,14 @@ const MemoedCell$1 = /*#__PURE__*/React__default.memo(function MemoedCell(props)
|
|
17586
17612
|
title: texts.table3.editing.saving.progress
|
17587
17613
|
}, /*#__PURE__*/React__default.createElement(Spinner, {
|
17588
17614
|
delay: 0,
|
17589
|
-
className: "!text-grey-700 mr-1
|
17615
|
+
className: "!text-grey-700 mr-1 !h-5 !w-5"
|
17590
17616
|
}));
|
17591
17617
|
} else if (isSavedIndicatorVisible) {
|
17592
17618
|
content = /*#__PURE__*/React__default.createElement(Tooltip, {
|
17593
17619
|
title: texts.table3.editing.saving.complete
|
17594
17620
|
}, /*#__PURE__*/React__default.createElement(Icon, {
|
17595
17621
|
name: "tick",
|
17596
|
-
className: "!text-grey-700 mr-1"
|
17622
|
+
className: "!text-grey-700 mr-1 !h-5 !w-5"
|
17597
17623
|
}));
|
17598
17624
|
}
|
17599
17625
|
}
|
@@ -17604,11 +17630,11 @@ const MemoedCell$1 = /*#__PURE__*/React__default.memo(function MemoedCell(props)
|
|
17604
17630
|
icon: "more",
|
17605
17631
|
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, {
|
17606
17632
|
icon: "tick",
|
17607
|
-
disabled: !
|
17633
|
+
disabled: !hasChanges,
|
17608
17634
|
onClick: () => tableMeta.editing.saveChangesIfNeeded()
|
17609
17635
|
}, texts.table3.editing.actions.save), /*#__PURE__*/React__default.createElement(Menu$1.Item, {
|
17610
17636
|
icon: "close",
|
17611
|
-
disabled: !
|
17637
|
+
disabled: !hasChanges,
|
17612
17638
|
onClick: () => tableMeta.editing.resetChange(row.id)
|
17613
17639
|
}, texts.table3.editing.actions.clear), /*#__PURE__*/React__default.createElement(Menu$1.Item, {
|
17614
17640
|
icon: "undo",
|
@@ -17617,12 +17643,15 @@ const MemoedCell$1 = /*#__PURE__*/React__default.memo(function MemoedCell(props)
|
|
17617
17643
|
tabIndex: isCurrentRow ? 0 : -1
|
17618
17644
|
}));
|
17619
17645
|
}
|
17646
|
+
const contentClassName = cn('flex items-center justify-end text-right', {
|
17647
|
+
'-mb-2 -mt-2': isCurrentRow
|
17648
|
+
});
|
17620
17649
|
return /*#__PURE__*/React__default.createElement(DisplayCell, Object.assign({}, props, {
|
17621
17650
|
className: cn({
|
17622
17651
|
'!sticky': !!content
|
17623
17652
|
})
|
17624
17653
|
}), content ? /*#__PURE__*/React__default.createElement("span", {
|
17625
|
-
className:
|
17654
|
+
className: contentClassName
|
17626
17655
|
}, content) : undefined);
|
17627
17656
|
});
|
17628
17657
|
function Cell$2(props) {
|
@@ -17630,12 +17659,14 @@ function Cell$2(props) {
|
|
17630
17659
|
rowIndex
|
17631
17660
|
} = React__default.useContext(RowContext$1);
|
17632
17661
|
const tableMeta = props.table.options.meta;
|
17662
|
+
const changeset = tableMeta.editing.changes ? Object.keys(tableMeta.editing.changes) : [];
|
17633
17663
|
return /*#__PURE__*/React__default.createElement(MemoedCell$1, Object.assign({}, props, {
|
17664
|
+
hasChanges: changeset.indexOf(props.row.id) >= 0,
|
17634
17665
|
isCurrentRow: tableMeta.currentRow.currentRowIndex === rowIndex,
|
17635
17666
|
isEditing: tableMeta.editing.isEditing
|
17636
17667
|
}));
|
17637
17668
|
}
|
17638
|
-
const EDITING_ACTIONS_WIDTH =
|
17669
|
+
const EDITING_ACTIONS_WIDTH = 60;
|
17639
17670
|
function createRowEditingActionsColumn() {
|
17640
17671
|
return {
|
17641
17672
|
id: COLUMN_ID$1,
|
@@ -17644,7 +17675,7 @@ function createRowEditingActionsColumn() {
|
|
17644
17675
|
footer: Footer$4,
|
17645
17676
|
meta: {
|
17646
17677
|
align: 'right',
|
17647
|
-
className: cn('items-center print:opacity-0 [[role="table"][data-editing="true"]_&]:group-[[data-current="true"]]/row:sticky right-0 !pl-0 !pr-1', '[[role="table"][data-editing="true"]_&]:group-[[data-current="true"]]/row:shadow-[-
|
17678
|
+
className: cn('items-center print:opacity-0 [[role="table"][data-editing="true"]_&]:group-[[data-current="true"]]/row:sticky right-0 !pl-0 !pr-1', '[[role="table"][data-editing="true"]_&]:group-[[data-current="true"]]/row:shadow-[-6px_0px_6px_var(--table3-row-actions-shadow)]', 'group-[[data-current="true"][data-selected="false"]]/row:text-grey-200', 'group-[[data-selected="true"]]/row:text-blue-100', 'group-[[data-selected="false"]:hover]/row:text-grey-100'),
|
17648
17679
|
enableOrdering: false,
|
17649
17680
|
enableSearch: false,
|
17650
17681
|
enableTruncate: false,
|
@@ -18578,6 +18609,69 @@ function createRowDragColumn(onRowDrag) {
|
|
18578
18609
|
};
|
18579
18610
|
}
|
18580
18611
|
|
18612
|
+
function Group$3(props) {
|
18613
|
+
const {
|
18614
|
+
children,
|
18615
|
+
column,
|
18616
|
+
header,
|
18617
|
+
table,
|
18618
|
+
hasSeparator
|
18619
|
+
} = props;
|
18620
|
+
const columnMeta = React__default.useMemo(() => column.columnDef.meta, []);
|
18621
|
+
const tableMeta = table.options.meta;
|
18622
|
+
const memoedProps = {
|
18623
|
+
align: 'center',
|
18624
|
+
children: children !== null && children !== void 0 ? children : columnMeta.header,
|
18625
|
+
colSpan: header.colSpan,
|
18626
|
+
hasSeparator,
|
18627
|
+
id: header.id,
|
18628
|
+
index: header.index,
|
18629
|
+
isPrinting: tableMeta.isPrinting,
|
18630
|
+
length: table.getRowModel().rows.length,
|
18631
|
+
meta: columnMeta,
|
18632
|
+
table
|
18633
|
+
};
|
18634
|
+
return /*#__PURE__*/React__default.createElement(MemoedGroup, Object.assign({}, memoedProps));
|
18635
|
+
}
|
18636
|
+
const MemoedGroup = /*#__PURE__*/React__default.memo(function MemoedGroup(props) {
|
18637
|
+
var _meta$tooltip;
|
18638
|
+
const {
|
18639
|
+
align,
|
18640
|
+
children,
|
18641
|
+
colSpan,
|
18642
|
+
hasSeparator,
|
18643
|
+
id,
|
18644
|
+
isPrinting,
|
18645
|
+
meta,
|
18646
|
+
table
|
18647
|
+
} = props;
|
18648
|
+
const containerClassName = cn('sticky px-2 mb-[2px]', {
|
18649
|
+
'h-10': !isPrinting
|
18650
|
+
}, colSpan > 1 ? `col-span-${colSpan}` : '');
|
18651
|
+
const innerClassName = cn('font-bold box-content group/column relative', 'px-[var(--table3-cell-padding-x)]', {
|
18652
|
+
'h-full items-center': !isPrinting,
|
18653
|
+
'pb-2': isPrinting,
|
18654
|
+
'border-b-2': !!children
|
18655
|
+
}, meta.headerClassName);
|
18656
|
+
if (table.options.debugAll) {
|
18657
|
+
console.log('header group render', id);
|
18658
|
+
}
|
18659
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
18660
|
+
className: containerClassName,
|
18661
|
+
"data-taco": "table3-column-group",
|
18662
|
+
"data-align": align
|
18663
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
18664
|
+
className: innerClassName
|
18665
|
+
}, /*#__PURE__*/React__default.createElement(Tooltip, {
|
18666
|
+
title: String((_meta$tooltip = meta === null || meta === void 0 ? void 0 : meta.tooltip) !== null && _meta$tooltip !== void 0 ? _meta$tooltip : children),
|
18667
|
+
placement: "top"
|
18668
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
18669
|
+
className: cn({
|
18670
|
+
truncate: !isPrinting
|
18671
|
+
})
|
18672
|
+
}, children)), hasSeparator ? /*#__PURE__*/React__default.createElement(HeaderSeparator, null) : null));
|
18673
|
+
});
|
18674
|
+
|
18581
18675
|
function getSortingFn$1(dataType, customFnOrBuiltIn) {
|
18582
18676
|
if (typeof customFnOrBuiltIn === 'function') {
|
18583
18677
|
return (rowA, rowB, columnId) => customFnOrBuiltIn(rowA.original, rowB.original, columnId);
|
@@ -18599,13 +18693,12 @@ function useConvertChildrenToColumns(props, options, editing) {
|
|
18599
18693
|
return React__default.useMemo(() => {
|
18600
18694
|
var _props$actionsForRow;
|
18601
18695
|
const columnHelper = reactTable$1.createColumnHelper();
|
18602
|
-
const columns = [];
|
18603
18696
|
const defaultColumnSizing = {};
|
18604
18697
|
const defaultColumnVisibility = {};
|
18605
18698
|
const defaultSorting = [];
|
18606
|
-
|
18607
|
-
|
18608
|
-
if ( /*#__PURE__*/React__default.isValidElement(child) && child.props.accessor) {
|
18699
|
+
function processChild(child) {
|
18700
|
+
var _child$type, _child$type2;
|
18701
|
+
if ( /*#__PURE__*/React__default.isValidElement(child) && ((_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.displayName) === 'Table3Column' && child.props.accessor) {
|
18609
18702
|
var _child$props$enableRe, _child$props$enableFi, _child$props$enableSo, _child$props$enableHi, _child$props$enableOr, _child$props$enablePr, _child$props$enableSe, _child$props$enableTr;
|
18610
18703
|
if (child.props.defaultWidth) {
|
18611
18704
|
defaultColumnSizing[child.props.accessor] = child.props.defaultWidth === 'grow' ? '1fr' : child.props.defaultWidth;
|
@@ -18619,7 +18712,8 @@ function useConvertChildrenToColumns(props, options, editing) {
|
|
18619
18712
|
desc: child.props.sort === 'desc'
|
18620
18713
|
});
|
18621
18714
|
}
|
18622
|
-
|
18715
|
+
// return regular column definition
|
18716
|
+
return {
|
18623
18717
|
accessorKey: child.props.accessor,
|
18624
18718
|
id: child.props.accessor,
|
18625
18719
|
header: Header$2,
|
@@ -18656,9 +18750,31 @@ function useConvertChildrenToColumns(props, options, editing) {
|
|
18656
18750
|
renderer: child.props.renderer,
|
18657
18751
|
tooltip: child.props.tooltip
|
18658
18752
|
}
|
18753
|
+
};
|
18754
|
+
} else if ( /*#__PURE__*/React__default.isValidElement(child) && ((_child$type2 = child.type) === null || _child$type2 === void 0 ? void 0 : _child$type2.displayName) === 'Table3Group' && child.props.children) {
|
18755
|
+
// return column group definition
|
18756
|
+
return columnHelper.group({
|
18757
|
+
id: child.props.id,
|
18758
|
+
header: Group$3,
|
18759
|
+
columns: processChildren(child.props.children),
|
18760
|
+
meta: {
|
18761
|
+
align: 'center',
|
18762
|
+
enableOrdering: false,
|
18763
|
+
enableSearch: false,
|
18764
|
+
enableTruncate: false,
|
18765
|
+
header: child.props.header
|
18766
|
+
}
|
18659
18767
|
});
|
18660
18768
|
}
|
18661
|
-
|
18769
|
+
return;
|
18770
|
+
}
|
18771
|
+
function processChildren(children) {
|
18772
|
+
return React__default.Children.toArray(children).map(processChild)
|
18773
|
+
// compiler cannot get filtering out undefined items, so using the type casting here
|
18774
|
+
.filter(child => !!child); // need to remove undefined array items after processing the children
|
18775
|
+
}
|
18776
|
+
|
18777
|
+
const columns = processChildren(props.children);
|
18662
18778
|
if (options.enableRowExpansion && props.expandedRowRenderer) {
|
18663
18779
|
columns.unshift(columnHelper.display(createRowExpansionColumn$1(props.expandedRowRenderer)));
|
18664
18780
|
}
|
@@ -18680,7 +18796,7 @@ function useConvertChildrenToColumns(props, options, editing) {
|
|
18680
18796
|
defaultColumnVisibility,
|
18681
18797
|
defaultSorting
|
18682
18798
|
};
|
18683
|
-
}, []);
|
18799
|
+
}, [editing.isEditing]);
|
18684
18800
|
}
|
18685
18801
|
|
18686
18802
|
function usePrinting(isEnabled, loadAll, showWarningWhenPrintingLargeDataset = true) {
|
@@ -19703,18 +19819,27 @@ function FilterColumn(props) {
|
|
19703
19819
|
value = null,
|
19704
19820
|
...attributes
|
19705
19821
|
} = props;
|
19822
|
+
const {
|
19823
|
+
texts
|
19824
|
+
} = useLocalization();
|
19706
19825
|
return /*#__PURE__*/React__default.createElement(Select2, Object.assign({}, attributes, {
|
19707
19826
|
className: "!w-32 flex-shrink-0",
|
19708
19827
|
emptyValue: null,
|
19709
19828
|
onChange: handleChange,
|
19710
19829
|
value: value
|
19711
19830
|
}), allColumns.map(column => {
|
19712
|
-
var _column$columnDef$met;
|
19831
|
+
var _column$columnDef$met, _column$parent, _column$parent$column;
|
19713
19832
|
return /*#__PURE__*/React__default.createElement(Select2.Option, {
|
19714
19833
|
key: column.id,
|
19715
19834
|
value: column.id,
|
19835
|
+
postfix: !column.getIsVisible() ? /*#__PURE__*/React__default.createElement(Tooltip, {
|
19836
|
+
title: texts.table3.filters.hiddenColumn
|
19837
|
+
}, /*#__PURE__*/React__default.createElement(Icon, {
|
19838
|
+
name: "eye-off",
|
19839
|
+
className: "text-grey-500"
|
19840
|
+
})) : undefined,
|
19716
19841
|
disabled: column.id !== value && (!column.getCanFilter() || !!filters.find(f => f.id === column.id))
|
19717
|
-
}, (_column$columnDef$met = column.columnDef.meta) === null || _column$columnDef$met === void 0 ? void 0 : _column$columnDef$met.header);
|
19842
|
+
}, ((_column$columnDef$met = column.columnDef.meta) === null || _column$columnDef$met === void 0 ? void 0 : _column$columnDef$met.header) + (column.parent ? ` (${(_column$parent = column.parent) === null || _column$parent === void 0 ? void 0 : (_column$parent$column = _column$parent.columnDef.meta) === null || _column$parent$column === void 0 ? void 0 : _column$parent$column.header})` : ''));
|
19718
19843
|
}));
|
19719
19844
|
}
|
19720
19845
|
|
@@ -20718,7 +20843,7 @@ function RowHeight(props) {
|
|
20718
20843
|
}
|
20719
20844
|
|
20720
20845
|
const Column$4 = /*#__PURE__*/React__default.forwardRef(function Column(props, ref) {
|
20721
|
-
var _column$columnDef$met;
|
20846
|
+
var _column$parent, _column$parent$column, _column$columnDef$met;
|
20722
20847
|
const {
|
20723
20848
|
column,
|
20724
20849
|
draggable = false,
|
@@ -20732,6 +20857,7 @@ const Column$4 = /*#__PURE__*/React__default.forwardRef(function Column(props, r
|
|
20732
20857
|
});
|
20733
20858
|
const attributes = draggable ? dragAttributes : undefined;
|
20734
20859
|
const isVisible = column.getIsVisible();
|
20860
|
+
const parentText = column.parent ? (_column$parent = column.parent) === null || _column$parent === void 0 ? void 0 : (_column$parent$column = _column$parent.columnDef.meta) === null || _column$parent$column === void 0 ? void 0 : _column$parent$column.header : null;
|
20735
20861
|
return /*#__PURE__*/React__default.createElement("div", Object.assign({}, attributes, {
|
20736
20862
|
key: column.id,
|
20737
20863
|
className: className,
|
@@ -20742,7 +20868,9 @@ const Column$4 = /*#__PURE__*/React__default.forwardRef(function Column(props, r
|
|
20742
20868
|
className: "text-grey-500 group-hover/column:text-grey-700 -mx-2 !h-5"
|
20743
20869
|
}) : null, /*#__PURE__*/React__default.createElement("span", {
|
20744
20870
|
className: "flex-grow truncate"
|
20745
|
-
}, (_column$columnDef$met = column.columnDef.meta) === null || _column$columnDef$met === void 0 ? void 0 : _column$columnDef$met.header
|
20871
|
+
}, (_column$columnDef$met = column.columnDef.meta) === null || _column$columnDef$met === void 0 ? void 0 : _column$columnDef$met.header, parentText ? /*#__PURE__*/React__default.createElement("span", {
|
20872
|
+
className: "italic"
|
20873
|
+
}, " (", parentText, ")") : null), canHide ? /*#__PURE__*/React__default.createElement(Checkbox, {
|
20746
20874
|
checked: isVisible,
|
20747
20875
|
onChange: () => column.toggleVisibility(!isVisible)
|
20748
20876
|
}) : null);
|
@@ -20760,8 +20888,8 @@ function ColumnSettingsPopover(props) {
|
|
20760
20888
|
const allColumns = table.getAllLeafColumns();
|
20761
20889
|
const tableMeta = table.options.meta;
|
20762
20890
|
const columns = React__default.useMemo(() => allColumns.filter(column => !isInternalColumn$1(column.id)).filter(column => {
|
20763
|
-
var _column$columnDef$met2;
|
20764
|
-
return query !== null && query !== void 0 && query.length ? (_column$columnDef$met2 = column.columnDef.meta) === null || _column$columnDef$met2 === void 0 ? void 0 : _column$columnDef$met2.header.toLowerCase().includes(query.toLowerCase()) : true;
|
20891
|
+
var _column$columnDef$met2, _column$parent2, _column$parent2$colum;
|
20892
|
+
return query !== null && query !== void 0 && query.length ? ((_column$columnDef$met2 = column.columnDef.meta) === null || _column$columnDef$met2 === void 0 ? void 0 : _column$columnDef$met2.header.toLowerCase().includes(query.toLowerCase())) || ((_column$parent2 = column.parent) === null || _column$parent2 === void 0 ? void 0 : (_column$parent2$colum = _column$parent2.columnDef.meta) === null || _column$parent2$colum === void 0 ? void 0 : _column$parent2$colum.header.toLowerCase().includes(query.toLowerCase())) : true;
|
20765
20893
|
}), [allColumns, query]);
|
20766
20894
|
const listClassName = 'flex max-h-64 flex-col gap-y-px overflow-auto';
|
20767
20895
|
const handleReorder = (activeId, overId) => {
|
@@ -20776,7 +20904,7 @@ function ColumnSettingsPopover(props) {
|
|
20776
20904
|
return /*#__PURE__*/React__default.createElement(Popover, Object.assign({}, popoverProps, {
|
20777
20905
|
anchor: trigger
|
20778
20906
|
}), /*#__PURE__*/React__default.createElement(Popover.Content, null, /*#__PURE__*/React__default.createElement("div", {
|
20779
|
-
className: "flex w-
|
20907
|
+
className: "flex max-w-sm flex-col gap-2"
|
20780
20908
|
}, table.options.enableHiding ? /*#__PURE__*/React__default.createElement(Input, {
|
20781
20909
|
onChange: event => setQuery(event.target.value),
|
20782
20910
|
placeholder: texts.table3.columnSettings.search,
|
@@ -21055,6 +21183,26 @@ const useCssVars = (height, fontSize) => {
|
|
21055
21183
|
};
|
21056
21184
|
};
|
21057
21185
|
|
21186
|
+
// header height: 40px, border bottom height: 2px;
|
21187
|
+
const HEADER_COLUMN_HEIGHT = 42;
|
21188
|
+
function getHeaderTopOffset(depth) {
|
21189
|
+
return HEADER_COLUMN_HEIGHT * (depth - 1);
|
21190
|
+
}
|
21191
|
+
function useHeaderOffsetStyle(tableId, table) {
|
21192
|
+
const headers = table.getFlatHeaders();
|
21193
|
+
const style = React__default.useMemo(() => {
|
21194
|
+
// 'new Set' will remove all duplicates and leave only unique values,
|
21195
|
+
// in the end we should get only one depht value per array item, example: [1, 2, 3], which we will iterate through later.
|
21196
|
+
const headerDepths = [...new Set(headers.map(header => header.depth))];
|
21197
|
+
return headerDepths.map(depth => {
|
21198
|
+
return `#${tableId} [data-taco="table2-header"] [role="row"]:nth-child(${depth}) [role="columnheader"],
|
21199
|
+
#${tableId} [data-taco="table2-header"] [role="row"]:nth-child(${depth}) [data-taco="table3-column-group"]
|
21200
|
+
{ top: ${getHeaderTopOffset(depth)}px }`;
|
21201
|
+
}).join('\r\n');
|
21202
|
+
}, [headers, tableId]);
|
21203
|
+
return style;
|
21204
|
+
}
|
21205
|
+
|
21058
21206
|
function useTable3DataLoader(fetch, fetchAll, options = {
|
21059
21207
|
pageSize: 100
|
21060
21208
|
}) {
|
@@ -21183,6 +21331,11 @@ function useTable3DataLoader(fetch, fetchAll, options = {
|
|
21183
21331
|
function Column$5(_) {
|
21184
21332
|
return null;
|
21185
21333
|
}
|
21334
|
+
Column$5.displayName = 'Table3Column';
|
21335
|
+
function Group$4(_) {
|
21336
|
+
return null;
|
21337
|
+
}
|
21338
|
+
Group$4.displayName = 'Table3Group';
|
21186
21339
|
// Cast the old forwardRef to the new one
|
21187
21340
|
const fixedForwardRef = React__default.forwardRef;
|
21188
21341
|
const Table$1 = /*#__PURE__*/fixedForwardRef(function Table3(props, ref) {
|
@@ -21275,10 +21428,13 @@ const Table$1 = /*#__PURE__*/fixedForwardRef(function Table3(props, ref) {
|
|
21275
21428
|
opacity: 0.999
|
21276
21429
|
};
|
21277
21430
|
const columnFreezingStyle = useColumnFreezingStyle(props.id, table);
|
21431
|
+
const headerOffsetStyle = useHeaderOffsetStyle(props.id, table);
|
21278
21432
|
const isServerLoadingAndNotReady = tableMeta.isUsingServer && props.length === undefined;
|
21279
21433
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, columnFreezingStyle ? /*#__PURE__*/React__default.createElement("style", {
|
21280
21434
|
"data-taco": "table3-column-freezing-styles"
|
21281
|
-
}, columnFreezingStyle) : null, /*#__PURE__*/React__default.createElement(
|
21435
|
+
}, columnFreezingStyle) : null, headerOffsetStyle ? /*#__PURE__*/React__default.createElement("style", {
|
21436
|
+
"data-taco": "table3-column-header-offset-styles"
|
21437
|
+
}, headerOffsetStyle) : null, /*#__PURE__*/React__default.createElement(Toolbar, {
|
21282
21438
|
table: table,
|
21283
21439
|
tableProps: props,
|
21284
21440
|
total: length,
|
@@ -21310,12 +21466,19 @@ const Table$1 = /*#__PURE__*/fixedForwardRef(function Table3(props, ref) {
|
|
21310
21466
|
className: "contents",
|
21311
21467
|
key: headerGroup.id,
|
21312
21468
|
role: "row"
|
21313
|
-
}, headerGroup.headers.map(header =>
|
21314
|
-
|
21315
|
-
|
21316
|
-
|
21317
|
-
|
21318
|
-
|
21469
|
+
}, headerGroup.headers.map((header, index) => {
|
21470
|
+
var _headerGroup$headers;
|
21471
|
+
// We need to render separator if column is not the last in array, if index is not equal to freeze column index,
|
21472
|
+
// if next element is not placeholder and if column itself is not placeholder.
|
21473
|
+
const hasSeparator = index !== tableMeta.columnFreezing.frozenColumnIndex && index !== headerGroup.headers.length - 1 && (!((_headerGroup$headers = headerGroup.headers[index + 1]) !== null && _headerGroup$headers !== void 0 && _headerGroup$headers.isPlaceholder) || !header.isPlaceholder);
|
21474
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, {
|
21475
|
+
key: header.id
|
21476
|
+
}, reactTable$1.flexRender(header.column.columnDef.header, {
|
21477
|
+
...header.getContext(),
|
21478
|
+
scrollToIndex,
|
21479
|
+
hasSeparator
|
21480
|
+
}));
|
21481
|
+
})))), table.getRowModel().rows.length ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(focus.FocusScope, {
|
21319
21482
|
autoFocus: tableMeta.editing.isEditing
|
21320
21483
|
}, /*#__PURE__*/React__default.createElement("div", {
|
21321
21484
|
onMouseDownCapture: handleMouseCapture,
|
@@ -21354,6 +21517,7 @@ const Table3 = /*#__PURE__*/fixedForwardRef(function Table3(props, ref) {
|
|
21354
21517
|
}));
|
21355
21518
|
});
|
21356
21519
|
Table3.Column = Column$5;
|
21520
|
+
Table3.Group = Group$4;
|
21357
21521
|
|
21358
21522
|
const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(props, ref) {
|
21359
21523
|
const {
|
@@ -22111,7 +22275,7 @@ Layout$1.Page = Page;
|
|
22111
22275
|
Layout$1.Sidebar = Sidebar;
|
22112
22276
|
Layout$1.Content = Content$9;
|
22113
22277
|
|
22114
|
-
const Group$
|
22278
|
+
const Group$5 = /*#__PURE__*/React__default.forwardRef(function Group(props, ref) {
|
22115
22279
|
const {
|
22116
22280
|
children,
|
22117
22281
|
defaultExpanded = false,
|
@@ -22270,7 +22434,7 @@ const Navigation2 = /*#__PURE__*/React__default.forwardRef(function Navigation2(
|
|
22270
22434
|
}
|
22271
22435
|
}), children);
|
22272
22436
|
});
|
22273
|
-
Navigation2.Group = Group$
|
22437
|
+
Navigation2.Group = Group$5;
|
22274
22438
|
Navigation2.Link = Link$2;
|
22275
22439
|
Navigation2.Section = Section;
|
22276
22440
|
Navigation2.Content = Content$a;
|