@economic/taco 2.11.1 → 2.12.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/Icon/components/EditSimple.d.ts +3 -0
- package/dist/components/Icon/components/index.d.ts +1 -1
- package/dist/components/Input/Input.d.ts +1 -1
- package/dist/components/Menu/Menu.d.ts +1 -2
- package/dist/components/Menu/components/Content.d.ts +1 -1
- package/dist/components/Menu/components/Item.d.ts +1 -1
- package/dist/components/Menu/components/Link.d.ts +1 -1
- package/dist/components/Menu/components/Separator.d.ts +2 -4
- package/dist/components/Menu/components/SubMenu.d.ts +1 -1
- package/dist/components/ModeSwitch/ModeSwitch.d.ts +17 -0
- package/dist/components/Navigation2/components/Link.d.ts +1 -1
- package/dist/components/Provider/Localization.d.ts +0 -1
- package/dist/components/Select2/components/Option.d.ts +1 -1
- package/dist/components/Select2/components/Search.d.ts +1 -1
- package/dist/components/Table3/hooks/features/useCurrentRow.d.ts +1 -0
- package/dist/components/Table3/hooks/useCssGrid.d.ts +1 -1
- package/dist/components/Table3/types.d.ts +0 -1
- package/dist/components/Tag/Tag.d.ts +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/EditSimple.js +19 -0
- package/dist/esm/packages/taco/src/components/Icon/components/EditSimple.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Icon/components/index.js +2 -0
- package/dist/esm/packages/taco/src/components/Icon/components/index.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/Menu.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/Separator.js +6 -7
- package/dist/esm/packages/taco/src/components/Menu/components/Separator.js.map +1 -1
- package/dist/esm/packages/taco/src/components/ModeSwitch/ModeSwitch.js +30 -0
- package/dist/esm/packages/taco/src/components/ModeSwitch/ModeSwitch.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Provider/Localization.js +1 -2
- package/dist/esm/packages/taco/src/components/Provider/Localization.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/Table3.js +10 -5
- package/dist/esm/packages/taco/src/components/Table3/Table3.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Menu.js +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Menu.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/EditButton.js +9 -16
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/EditButton.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/PrintIFrame.js +1 -0
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/PrintIFrame.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useCurrentRow.js +18 -3
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useCurrentRow.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/useCssGrid.js +3 -2
- package/dist/esm/packages/taco/src/components/Table3/hooks/useCssGrid.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/types.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Tooltip/Tooltip.js +12 -10
- package/dist/esm/packages/taco/src/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/esm/packages/taco/src/index.js +1 -0
- package/dist/esm/packages/taco/src/index.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/taco.cjs.development.js +97 -42
- 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 +14 -14
- package/types.json +13363 -11176
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Tooltip.js","sources":["../../../../../../../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as TooltipPrimitive from '@radix-ui/react-tooltip';\nimport cn from 'classnames';\n\nexport type TooltipProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> & {\n /** The element which activates the tooltip when hovered. Should be a single React/HTML element */\n children: React.ReactElement | any;\n /** Text displayed in the tooltip */\n title: string | JSX.Element;\n /**\n * Placement of the tooltip relative to the reference element. Placement will be reversed if a collision occurs\n * @defaultValue bottom\n */\n placement?: 'top' | 'right' | 'bottom' | 'left';\n};\n\nexport const Tooltip = React.forwardRef(function Tooltip(props: TooltipProps, ref: React.Ref<HTMLElement>) {\n const { children, placement,
|
1
|
+
{"version":3,"file":"Tooltip.js","sources":["../../../../../../../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as TooltipPrimitive from '@radix-ui/react-tooltip';\nimport cn from 'classnames';\n\nexport type TooltipProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> & {\n /** The element which activates the tooltip when hovered. Should be a single React/HTML element */\n children: React.ReactElement | any;\n /** Text displayed in the tooltip */\n title: string | JSX.Element;\n /**\n * Placement of the tooltip relative to the reference element. Placement will be reversed if a collision occurs\n * @defaultValue bottom\n */\n placement?: 'top' | 'right' | 'bottom' | 'left';\n};\n\nexport const Tooltip = React.forwardRef(function Tooltip(props: TooltipProps, ref: React.Ref<HTMLElement>) {\n const { title, children, placement, ...otherProps } = props;\n const className = cn(otherProps.className);\n\n return (\n <TooltipPrimitive.Root delayDuration={250}>\n <TooltipPrimitive.Trigger asChild ref={ref as any}>\n {children}\n </TooltipPrimitive.Trigger>\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content {...otherProps} asChild className={className} side={placement} sideOffset={3}>\n <div\n className=\"xs:max-w-[theme(spacing.56)] max-w-[theme(spacing.32)] animate-[fade-in_150ms] rounded-sm bg-blue-900 px-2 py-1 text-xs font-bold text-white\"\n data-taco=\"tooltip\"\n style={{\n transformOrigin: 'var(--radix-tooltip-content-transform-origin)',\n }}>\n <TooltipPrimitive.Arrow className=\"-mt-px fill-blue-900/90 stroke-blue-900/90\" />\n {title}\n </div>\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n </TooltipPrimitive.Root>\n );\n});\n"],"names":["Tooltip","React","props","ref","title","children","placement","otherProps","className","cn","TooltipPrimitive","delayDuration","asChild","side","sideOffset","style","transformOrigin"],"mappings":";;;;MAgBaA,OAAO,gBAAGC,UAAgB,CAAC,SAASD,OAAOA,CAACE,KAAmB,EAAEC,GAA2B;EACrG,MAAM;IAAEC,KAAK;IAAEC,QAAQ;IAAEC,SAAS;IAAE,GAAGC;GAAY,GAAGL,KAAK;EAC3D,MAAMM,SAAS,GAAGC,EAAE,CAACF,UAAU,CAACC,SAAS,CAAC;EAE1C,oBACIP,cAACS,IAAqB;IAACC,aAAa,EAAE;kBAClCV,cAACS,OAAwB;IAACE,OAAO;IAACT,GAAG,EAAEA;KAClCE,QAAQ,CACc,eAC3BJ,cAACS,MAAuB,qBACpBT,cAACS,OAAwB,oBAAKH,UAAU;IAAEK,OAAO;IAACJ,SAAS,EAAEA,SAAS;IAAEK,IAAI,EAAEP,SAAS;IAAEQ,UAAU,EAAE;mBACjGb;IACIO,SAAS,EAAC,8IAA8I;iBAC9I,SAAS;IACnBO,KAAK,EAAE;MACHC,eAAe,EAAE;;kBAErBf,cAACS,KAAsB;IAACF,SAAS,EAAC;IAA+C,EAChFJ,KAAK,CACJ,CACiB,CACL,CACN;AAEhC,CAAC;;;;"}
|
@@ -38,6 +38,7 @@ export { Listbox, MultiListbox } from './components/Listbox/Listbox.js';
|
|
38
38
|
export { Shortcut } from './components/Shortcut/Shortcut.js';
|
39
39
|
export { RadioGroup, findByValue, getRadioGroupItemValueAsString, useRadioGroup } from './components/RadioGroup/RadioGroup.js';
|
40
40
|
export { Menu } from './components/Menu/Menu.js';
|
41
|
+
export { ModeSwitch } from './components/ModeSwitch/ModeSwitch.js';
|
41
42
|
export { Treeview } from './components/Treeview/Treeview.js';
|
42
43
|
export { useDropTarget } from './utils/hooks/useDropTarget.js';
|
43
44
|
export { Navigation } from './components/Navigation/Navigation.js';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.d.ts
CHANGED
@@ -24,6 +24,7 @@ export * from './components/IconButton/IconButton';
|
|
24
24
|
export * from './components/Input/Input';
|
25
25
|
export * from './components/Listbox/Listbox';
|
26
26
|
export * from './components/Menu/Menu';
|
27
|
+
export * from './components/ModeSwitch/ModeSwitch';
|
27
28
|
export * from './components/Navigation/Navigation';
|
28
29
|
export * from './components/OverflowGroup/OverflowGroup';
|
29
30
|
export * from './components/Pagination/Pagination';
|
@@ -1287,6 +1287,21 @@ function IconESignature(props, svgRef) {
|
|
1287
1287
|
}
|
1288
1288
|
var ESignature = /*#__PURE__*/React.forwardRef(IconESignature);
|
1289
1289
|
|
1290
|
+
function IconEditSimple(props, svgRef) {
|
1291
|
+
return /*#__PURE__*/React.createElement("svg", Object.assign({
|
1292
|
+
fill: "none",
|
1293
|
+
xmlns: "http://www.w3.org/2000/svg",
|
1294
|
+
viewBox: "0 0 24 24",
|
1295
|
+
ref: svgRef
|
1296
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
1297
|
+
fillRule: "evenodd",
|
1298
|
+
clipRule: "evenodd",
|
1299
|
+
d: "M16.013 4.513a1.75 1.75 0 012.35-.114l.124.114 1.586 1.585a1.75 1.75 0 01.114 2.35l-.114.125L8.061 20.586H4v-4.06L16.013 4.512zm-1.514 3.633l-8.999 9v1.94h1.938l9-9.001-1.939-1.939zm2.928-2.573a.25.25 0 00-.3-.04l-.054.04-1.513 1.512 1.939 1.939 1.514-1.511a.25.25 0 00.065-.24l-.025-.06-.04-.054-1.586-1.586z",
|
1300
|
+
fill: "currentColor"
|
1301
|
+
}));
|
1302
|
+
}
|
1303
|
+
var EditSimple = /*#__PURE__*/React.forwardRef(IconEditSimple);
|
1304
|
+
|
1290
1305
|
function IconEdit(props, svgRef) {
|
1291
1306
|
return /*#__PURE__*/React.createElement("svg", Object.assign({
|
1292
1307
|
xmlns: "http://www.w3.org/2000/svg",
|
@@ -3349,6 +3364,7 @@ const icons = {
|
|
3349
3364
|
drag: Drag,
|
3350
3365
|
'e-copedia': ECopedia,
|
3351
3366
|
'e-signature': ESignature,
|
3367
|
+
'edit-simple': EditSimple,
|
3352
3368
|
edit: Edit,
|
3353
3369
|
'ellipsis-horizontal': EllipsisHorizontal,
|
3354
3370
|
'ellipsis-vertical': EllipsisVertical,
|
@@ -3983,29 +3999,31 @@ const Button = /*#__PURE__*/React.forwardRef(function Button(props, ref) {
|
|
3983
3999
|
|
3984
4000
|
const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(props, ref) {
|
3985
4001
|
const {
|
4002
|
+
title,
|
3986
4003
|
children,
|
3987
4004
|
placement,
|
3988
|
-
title,
|
3989
4005
|
...otherProps
|
3990
4006
|
} = props;
|
3991
|
-
const className = cn(
|
3992
|
-
const style = {
|
3993
|
-
transformOrigin: 'var(--radix-tooltip-content-transform-origin)'
|
3994
|
-
};
|
4007
|
+
const className = cn(otherProps.className);
|
3995
4008
|
return /*#__PURE__*/React.createElement(TooltipPrimitive.Root, {
|
3996
4009
|
delayDuration: 250
|
3997
4010
|
}, /*#__PURE__*/React.createElement(TooltipPrimitive.Trigger, {
|
3998
4011
|
asChild: true,
|
3999
4012
|
ref: ref
|
4000
4013
|
}, children), /*#__PURE__*/React.createElement(TooltipPrimitive.Portal, null, /*#__PURE__*/React.createElement(TooltipPrimitive.Content, Object.assign({}, otherProps, {
|
4014
|
+
asChild: true,
|
4001
4015
|
className: className,
|
4002
|
-
"data-taco": "tooltip",
|
4003
4016
|
side: placement,
|
4004
|
-
sideOffset: 3
|
4005
|
-
|
4006
|
-
|
4017
|
+
sideOffset: 3
|
4018
|
+
}), /*#__PURE__*/React.createElement("div", {
|
4019
|
+
className: "xs:max-w-[theme(spacing.56)] max-w-[theme(spacing.32)] animate-[fade-in_150ms] rounded-sm bg-blue-900 px-2 py-1 text-xs font-bold text-white",
|
4020
|
+
"data-taco": "tooltip",
|
4021
|
+
style: {
|
4022
|
+
transformOrigin: 'var(--radix-tooltip-content-transform-origin)'
|
4023
|
+
}
|
4024
|
+
}, /*#__PURE__*/React.createElement(TooltipPrimitive.Arrow, {
|
4007
4025
|
className: "-mt-px fill-blue-900/90 stroke-blue-900/90"
|
4008
|
-
}), title)));
|
4026
|
+
}), title))));
|
4009
4027
|
});
|
4010
4028
|
|
4011
4029
|
const getButtonClasses = () => {
|
@@ -4356,8 +4374,7 @@ const defaultLocalisationTexts = {
|
|
4356
4374
|
},
|
4357
4375
|
buttons: {
|
4358
4376
|
edit: {
|
4359
|
-
|
4360
|
-
tooltip: 'Edit'
|
4377
|
+
tooltip: 'Edit table'
|
4361
4378
|
}
|
4362
4379
|
},
|
4363
4380
|
rowIndicator: {
|
@@ -7862,12 +7879,11 @@ const RadioGroup$1 = /*#__PURE__*/React.forwardRef(function MenuRadioItem(props,
|
|
7862
7879
|
});
|
7863
7880
|
RadioGroup$1.Item = RadioItem;
|
7864
7881
|
|
7865
|
-
const Separator =
|
7866
|
-
return /*#__PURE__*/React.createElement(DropdownMenuPrimitive.Separator,
|
7867
|
-
className: "bg-grey-300 my-1 h-px"
|
7868
|
-
|
7869
|
-
|
7870
|
-
});
|
7882
|
+
const Separator = () => {
|
7883
|
+
return /*#__PURE__*/React.createElement(DropdownMenuPrimitive.Separator, {
|
7884
|
+
className: "bg-grey-300 my-1 h-px"
|
7885
|
+
});
|
7886
|
+
};
|
7871
7887
|
|
7872
7888
|
const Header = /*#__PURE__*/React.forwardRef(function MenuHeader(props, ref) {
|
7873
7889
|
const menu = useCurrentMenu();
|
@@ -7942,6 +7958,29 @@ Menu$1.Header = Header;
|
|
7942
7958
|
Menu$1.RadioGroup = RadioGroup$1;
|
7943
7959
|
Menu$1.SubMenu = SubMenu;
|
7944
7960
|
|
7961
|
+
const ModeSwitch = /*#__PURE__*/React.forwardRef(function ModeSwitch(props, ref) {
|
7962
|
+
const {
|
7963
|
+
onChange,
|
7964
|
+
...otherProps
|
7965
|
+
} = props;
|
7966
|
+
const className = cn('group w-14 h-8 flex flex-shrink-0 rounded-full inline-flex focus-visible:yt-focus p-1', {
|
7967
|
+
'bg-grey-500 hover:bg-grey-700 aria-checked:bg-blue-500 aria-checked:hover:bg-blue-700': !props.disabled,
|
7968
|
+
'bg-grey-500 aria-checked:bg-blue-500 cursor-not-allowed opacity-50': props.disabled
|
7969
|
+
}, props.className);
|
7970
|
+
return /*#__PURE__*/React.createElement(PrimitiveSwitch.Root, Object.assign({}, otherProps, {
|
7971
|
+
className: className,
|
7972
|
+
"data-taco": "mode",
|
7973
|
+
onCheckedChange: onChange,
|
7974
|
+
ref: ref
|
7975
|
+
}), /*#__PURE__*/React.createElement(PrimitiveSwitch.Thumb, {
|
7976
|
+
className: "'will-change-transform flex h-6 w-6 items-center justify-center rounded-full bg-white transition-transform group-disabled:opacity-50 group-aria-checked:translate-x-[100%]"
|
7977
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
7978
|
+
name: "edit-simple",
|
7979
|
+
className: "!h-5 !w-5"
|
7980
|
+
})));
|
7981
|
+
});
|
7982
|
+
ModeSwitch.displayName = 'ModeSwitch';
|
7983
|
+
|
7945
7984
|
const TreeviewItem = /*#__PURE__*/React__default.forwardRef(function TreeviewItem(props, ref) {
|
7946
7985
|
return /*#__PURE__*/React__default.createElement("a", Object.assign({}, props, {
|
7947
7986
|
ref: ref
|
@@ -16008,7 +16047,7 @@ function Menu$3(props) {
|
|
16008
16047
|
// we do this in the next tick, otherwise the menu closes and react throws a "state update on unmounted component" error
|
16009
16048
|
const handleClick = event => setTimeout(() => handleHide(event), 1);
|
16010
16049
|
menuItems.push( /*#__PURE__*/React__default.createElement(Menu$1.Item, {
|
16011
|
-
icon: "
|
16050
|
+
icon: "eye-off",
|
16012
16051
|
onClick: handleClick
|
16013
16052
|
}, texts.table3.columns.menu.hideColumn));
|
16014
16053
|
}
|
@@ -16655,7 +16694,7 @@ const getInputAppearanceClassnames = () => {
|
|
16655
16694
|
return cn('[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none');
|
16656
16695
|
};
|
16657
16696
|
|
16658
|
-
const useCssGrid = (table, isPrintTable = false) => {
|
16697
|
+
const useCssGrid = (table, isPrintTable = false, actionsForRowLength = 0) => {
|
16659
16698
|
const allVisibleColumns = table.getVisibleLeafColumns();
|
16660
16699
|
const columnSizing = table.getState().columnSizing;
|
16661
16700
|
const rowsLength = table.getRowModel().rows.length;
|
@@ -16674,7 +16713,8 @@ const useCssGrid = (table, isPrintTable = false) => {
|
|
16674
16713
|
size = `minmax(${PRINT_MIN_COLUMN_SIZE}px, ${maxWidth})`;
|
16675
16714
|
} else if (isColumnInternal) {
|
16676
16715
|
if (column.id === COLUMN_ID) {
|
16677
|
-
|
16716
|
+
const minWidth = actionsForRowLength * 32 + 8 /* button margins l+r */ + 8; /* cell padding l+r */
|
16717
|
+
size = `minmax(${minWidth}px, auto)`;
|
16678
16718
|
} else {
|
16679
16719
|
// getSize method is used instead of columnSizing state because columnSizing state doesn't have
|
16680
16720
|
// sizes of internal columns.
|
@@ -16767,16 +16807,31 @@ function useCurrentRow(defaultCurrentRowIndex) {
|
|
16767
16807
|
// do it in the next tick, otherwise it prevents internal focus from working
|
16768
16808
|
// meaning you have to tab twice to get to the first focusable element
|
16769
16809
|
setTimeout(() => {
|
16770
|
-
setCurrentRowIndex(
|
16771
|
-
|
16810
|
+
setCurrentRowIndex(index => {
|
16811
|
+
if (index === undefined) {
|
16812
|
+
scrollToIndex(0);
|
16813
|
+
return 0;
|
16814
|
+
}
|
16815
|
+
return index;
|
16816
|
+
});
|
16772
16817
|
}, 1);
|
16773
16818
|
}
|
16774
16819
|
}, [currentRowIndex, length]);
|
16820
|
+
const onMouseCapture = React__default.useCallback((event, length) => {
|
16821
|
+
if (event.isDefaultPrevented()) {
|
16822
|
+
return;
|
16823
|
+
}
|
16824
|
+
if (currentRowIndex === undefined && length > 0) {
|
16825
|
+
event.preventDefault();
|
16826
|
+
event.stopPropagation();
|
16827
|
+
}
|
16828
|
+
}, [currentRowIndex, length]);
|
16775
16829
|
return {
|
16776
16830
|
currentRowIndex,
|
16777
16831
|
setCurrentRowIndex,
|
16778
16832
|
handleFocus: onFocus,
|
16779
|
-
handleKeyDown: onKeyDown
|
16833
|
+
handleKeyDown: onKeyDown,
|
16834
|
+
handleMouseCapture: onMouseCapture
|
16780
16835
|
};
|
16781
16836
|
}
|
16782
16837
|
const getNextIndex$2 = (direction, currentIndex, length) => {
|
@@ -20144,15 +20199,8 @@ function EditButton(props) {
|
|
20144
20199
|
texts
|
20145
20200
|
} = useLocalization();
|
20146
20201
|
const tableMeta = props.table.options.meta;
|
20147
|
-
|
20148
|
-
|
20149
|
-
});
|
20150
|
-
const handleClick = () => tableMeta.editing.toggleEditing(!tableMeta.editing.isEditing);
|
20151
|
-
return /*#__PURE__*/React__default.createElement(Button$1, {
|
20152
|
-
"aria-pressed": tableMeta.editing.isEditing,
|
20153
|
-
className: className,
|
20154
|
-
onClick: handleClick,
|
20155
|
-
tooltip: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, texts.table3.editing.buttons.edit.tooltip, /*#__PURE__*/React__default.createElement(Shortcut, {
|
20202
|
+
return /*#__PURE__*/React__default.createElement(Tooltip, {
|
20203
|
+
title: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, texts.table3.editing.buttons.edit.tooltip, /*#__PURE__*/React__default.createElement(Shortcut, {
|
20156
20204
|
className: "ml-2",
|
20157
20205
|
keys: {
|
20158
20206
|
key: 'e',
|
@@ -20160,10 +20208,11 @@ function EditButton(props) {
|
|
20160
20208
|
shift: false
|
20161
20209
|
}
|
20162
20210
|
}))
|
20163
|
-
}, /*#__PURE__*/React__default.createElement(
|
20164
|
-
"aria-
|
20165
|
-
|
20166
|
-
|
20211
|
+
}, /*#__PURE__*/React__default.createElement(ModeSwitch, {
|
20212
|
+
"aria-pressed": tableMeta.editing.isEditing,
|
20213
|
+
checked: tableMeta.editing.isEditing,
|
20214
|
+
onChange: tableMeta.editing.toggleEditing
|
20215
|
+
}));
|
20167
20216
|
}
|
20168
20217
|
|
20169
20218
|
const PRINT_STYLES = `
|
@@ -21184,12 +21233,16 @@ const Table$1 = /*#__PURE__*/fixedForwardRef(function Table3(props, ref) {
|
|
21184
21233
|
// scrollToIndex function changes when row count changes, so it is important to update handlers with new
|
21185
21234
|
// scrollToIndex function.
|
21186
21235
|
[scrollToIndex, tableMeta.editing.isEditing, internalRef.current]);
|
21187
|
-
const handleBlur = event => {
|
21236
|
+
const handleBlur = tableMeta.editing.isEnabled ? event => {
|
21188
21237
|
tableMeta.editing.handleBlur(event);
|
21189
|
-
};
|
21190
|
-
const handleFocus = event => {
|
21238
|
+
} : undefined;
|
21239
|
+
const handleFocus = tableMeta.currentRow.currentRowIndex === undefined ? event => {
|
21191
21240
|
tableMeta.currentRow.handleFocus(event, table.getRowModel().rows.length, scrollToIndex);
|
21192
|
-
};
|
21241
|
+
} : undefined;
|
21242
|
+
// mouse capture fires before focus, so we can prevent propagation and stop double setting of the active row
|
21243
|
+
const handleMouseCapture = tableMeta.currentRow.currentRowIndex === undefined ? event => {
|
21244
|
+
tableMeta.currentRow.handleMouseCapture(event, table.getRowModel().rows.length);
|
21245
|
+
} : undefined;
|
21193
21246
|
const handleScroll = function (event) {
|
21194
21247
|
try {
|
21195
21248
|
tableMeta.columnFreezing.handleScroll(event);
|
@@ -21207,7 +21260,7 @@ const Table$1 = /*#__PURE__*/fixedForwardRef(function Table3(props, ref) {
|
|
21207
21260
|
// if the table is a print table or not.
|
21208
21261
|
const {
|
21209
21262
|
style: cssGridStyle
|
21210
|
-
} = useCssGrid(table, tableMeta.isPrinting);
|
21263
|
+
} = useCssGrid(table, tableMeta.isPrinting, tableMeta.rowActions.actionsForRowLength);
|
21211
21264
|
const {
|
21212
21265
|
style: cssVars
|
21213
21266
|
} = useCssVars(tableMeta.rowHeight.height, tableMeta.fontSize.size);
|
@@ -21241,6 +21294,7 @@ const Table$1 = /*#__PURE__*/fixedForwardRef(function Table3(props, ref) {
|
|
21241
21294
|
"data-taco": "table2",
|
21242
21295
|
onBlur: handleBlur,
|
21243
21296
|
onFocus: handleFocus,
|
21297
|
+
onMouseDownCapture: handleMouseCapture,
|
21244
21298
|
onScroll: handleScroll,
|
21245
21299
|
ref: internalRef,
|
21246
21300
|
role: "table",
|
@@ -22267,6 +22321,7 @@ exports.Listbox = Listbox;
|
|
22267
22321
|
exports.LocalizationContext = LocalizationContext;
|
22268
22322
|
exports.LocalizationProvider = LocalizationProvider;
|
22269
22323
|
exports.Menu = Menu$1;
|
22324
|
+
exports.ModeSwitch = ModeSwitch;
|
22270
22325
|
exports.MultiListbox = MultiListbox;
|
22271
22326
|
exports.Navigation = Navigation;
|
22272
22327
|
exports.Navigation2 = Navigation2;
|