@economic/taco 2.7.5 → 2.8.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/Icon/components/CircleInformation.d.ts +3 -0
- package/dist/components/Icon/components/CircleQuestionmark.d.ts +3 -0
- package/dist/components/Icon/components/CircleWarning.d.ts +3 -0
- package/dist/components/Icon/components/index.d.ts +1 -1
- package/dist/components/Input/Input.d.ts +1 -1
- package/dist/components/Menu/components/Item.d.ts +1 -1
- package/dist/components/Menu/components/Link.d.ts +1 -1
- package/dist/components/Navigation2/components/Link.d.ts +1 -1
- package/dist/components/Select2/Select2.d.ts +1 -0
- package/dist/components/Select2/components/Option.d.ts +1 -1
- package/dist/components/Select2/components/Search.d.ts +1 -1
- package/dist/components/Select2/components/Trigger.d.ts +1 -0
- package/dist/components/Table3/components/columns/footer/Summary.d.ts +1 -0
- package/dist/components/Tag/Tag.d.ts +1 -1
- package/dist/esm/index.css +14 -1
- package/dist/esm/packages/taco/src/components/Combobox/Combobox.js +8 -1
- package/dist/esm/packages/taco/src/components/Combobox/Combobox.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Dialog/components/Content.js +0 -9
- package/dist/esm/packages/taco/src/components/Dialog/components/Content.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/CircleInformation.js +19 -0
- package/dist/esm/packages/taco/src/components/Icon/components/CircleInformation.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Icon/components/CircleQuestionmark.js +19 -0
- package/dist/esm/packages/taco/src/components/Icon/components/CircleQuestionmark.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Icon/components/CircleWarning.js +19 -0
- package/dist/esm/packages/taco/src/components/Icon/components/CircleWarning.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Icon/components/index.js +6 -0
- package/dist/esm/packages/taco/src/components/Icon/components/index.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Provider/Localization.js +1 -1
- package/dist/esm/packages/taco/src/components/Provider/Localization.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/Select2.js +3 -1
- package/dist/esm/packages/taco/src/components/Select2/Select2.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js +28 -7
- package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/Table3.js +8 -2
- package/dist/esm/packages/taco/src/components/Table3/Table3.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingControl.js +13 -3
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingControl.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/footer/Summary.js +12 -2
- package/dist/esm/packages/taco/src/components/Table3/components/columns/footer/Summary.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Header.js +4 -1
- 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/toolbar/EditButton.js +0 -9
- 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/Filter/filters/Filters.js +2 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/Filters.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useEditing.js +15 -8
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useEditing.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useGlobalKeyDown.js +2 -2
- package/dist/esm/packages/taco/src/hooks/useGlobalKeyDown.js.map +1 -1
- package/dist/esm/packages/taco/src/index.js +1 -1
- package/dist/esm/packages/taco/src/primitives/Button.js +5 -0
- package/dist/esm/packages/taco/src/primitives/Button.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/keyboard.js +24 -19
- package/dist/esm/packages/taco/src/utils/keyboard.js.map +1 -1
- package/dist/index.css +14 -1
- package/dist/taco.cjs.development.js +171 -64
- 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/dist/utils/keyboard.d.ts +2 -1
- package/package.json +2 -2
- package/types.json +17770 -11838
@@ -761,6 +761,21 @@ function IconCircleClose(props, svgRef) {
|
|
761
761
|
}
|
762
762
|
var CircleClose = /*#__PURE__*/React.forwardRef(IconCircleClose);
|
763
763
|
|
764
|
+
function IconCircleInformation(props, svgRef) {
|
765
|
+
return /*#__PURE__*/React.createElement("svg", Object.assign({
|
766
|
+
fill: "none",
|
767
|
+
xmlns: "http://www.w3.org/2000/svg",
|
768
|
+
viewBox: "0 0 24 24",
|
769
|
+
ref: svgRef
|
770
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
771
|
+
fillRule: "evenodd",
|
772
|
+
clipRule: "evenodd",
|
773
|
+
d: "M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2zm0 1.5a8.5 8.5 0 100 17 8.5 8.5 0 000-17zm-.267 5.753a1 1 0 10-.001-2.001 1 1 0 00.001 2.001zM14 16.754a.75.75 0 000-1.502h-1.267V11.5a.752.752 0 00-.75-.751H10a.75.75 0 000 1.502h1.233v3H10a.75.75 0 000 1.503h4z",
|
774
|
+
fill: "currentColor"
|
775
|
+
}));
|
776
|
+
}
|
777
|
+
var CircleInformation = /*#__PURE__*/React.forwardRef(IconCircleInformation);
|
778
|
+
|
764
779
|
function IconCircleMinus(props, svgRef) {
|
765
780
|
return /*#__PURE__*/React.createElement("svg", Object.assign({
|
766
781
|
xmlns: "http://www.w3.org/2000/svg",
|
@@ -787,6 +802,21 @@ function IconCirclePlus(props, svgRef) {
|
|
787
802
|
}
|
788
803
|
var CirclePlus = /*#__PURE__*/React.forwardRef(IconCirclePlus);
|
789
804
|
|
805
|
+
function IconCircleQuestionmark(props, svgRef) {
|
806
|
+
return /*#__PURE__*/React.createElement("svg", Object.assign({
|
807
|
+
fill: "none",
|
808
|
+
xmlns: "http://www.w3.org/2000/svg",
|
809
|
+
viewBox: "0 0 24 24",
|
810
|
+
ref: svgRef
|
811
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
812
|
+
fillRule: "evenodd",
|
813
|
+
clipRule: "evenodd",
|
814
|
+
d: "M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2zm0 1.5a8.5 8.5 0 100 17 8.5 8.5 0 000-17zm.58 10.15a.71.71 0 00.226-.543v-1.272a.306.306 0 01.045-.143.522.522 0 01.136-.133 3.91 3.91 0 01.285-.18l.028-.016c.112-.066.242-.143.387-.237.706-.454 1.156-1.012 1.156-1.838 0-.673-.37-1.19-.887-1.53-.513-.336-1.183-.508-1.845-.508-.552 0-1.234.096-1.79.317a2.441 2.441 0 00-.574.315c-.09.069-.174.146-.245.232a1.15 1.15 0 00-.154.238 1.474 1.474 0 00-.148.625c0 .075.01.118.02.167.036.159.12.3.254.401a.77.77 0 00.47.147.768.768 0 00.745-.517l.004-.013c.053-.17.226-.306.517-.4.282-.09.611-.116.852-.116.267 0 .575.078.809.213.241.139.345.298.345.44 0 .188-.051.32-.152.444-.11.136-.285.27-.55.444h-.002l-.136.091h-.001c-.232.153-.49.322-.695.513-.252.234-.467.537-.467.938v1.38c0 .226.087.421.248.556.155.13.357.185.56.185.21 0 .41-.064.558-.2zm-.559 3.1c.504 0 .924-.4.924-.904 0-.512-.423-.9-.924-.9a.908.908 0 00-.92.9c0 .504.42.904.92.904z",
|
815
|
+
fill: "currentColor"
|
816
|
+
}));
|
817
|
+
}
|
818
|
+
var CircleQuestionmark = /*#__PURE__*/React.forwardRef(IconCircleQuestionmark);
|
819
|
+
|
790
820
|
function IconCircleTick(props, svgRef) {
|
791
821
|
return /*#__PURE__*/React.createElement("svg", Object.assign({
|
792
822
|
xmlns: "http://www.w3.org/2000/svg",
|
@@ -800,6 +830,21 @@ function IconCircleTick(props, svgRef) {
|
|
800
830
|
}
|
801
831
|
var CircleTick = /*#__PURE__*/React.forwardRef(IconCircleTick);
|
802
832
|
|
833
|
+
function IconCircleWarning(props, svgRef) {
|
834
|
+
return /*#__PURE__*/React.createElement("svg", Object.assign({
|
835
|
+
fill: "none",
|
836
|
+
xmlns: "http://www.w3.org/2000/svg",
|
837
|
+
viewBox: "0 0 24 24",
|
838
|
+
ref: svgRef
|
839
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
840
|
+
fillRule: "evenodd",
|
841
|
+
clipRule: "evenodd",
|
842
|
+
d: "M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2zm0 1.5a8.5 8.5 0 100 17 8.5 8.5 0 000-17zm0 3.75a.97.97 0 00-.974.989L11.2 12.5c.01.417.352.749.771.749a.768.768 0 00.77-.74l.23-4.26a.97.97 0 00-.97-1zm0 9.5a1 1 0 100-2 1 1 0 000 2z",
|
843
|
+
fill: "currentColor"
|
844
|
+
}));
|
845
|
+
}
|
846
|
+
var CircleWarning = /*#__PURE__*/React.forwardRef(IconCircleWarning);
|
847
|
+
|
803
848
|
function IconClampOpen(props, svgRef) {
|
804
849
|
return /*#__PURE__*/React.createElement("svg", Object.assign({
|
805
850
|
xmlns: "http://www.w3.org/2000/svg",
|
@@ -3249,9 +3294,12 @@ const icons = {
|
|
3249
3294
|
'chevron-up-solid': ChevronUpSolid,
|
3250
3295
|
'chevron-up': ChevronUp,
|
3251
3296
|
'circle-close': CircleClose,
|
3297
|
+
'circle-information': CircleInformation,
|
3252
3298
|
'circle-minus': CircleMinus,
|
3253
3299
|
'circle-plus': CirclePlus,
|
3300
|
+
'circle-questionmark': CircleQuestionmark,
|
3254
3301
|
'circle-tick': CircleTick,
|
3302
|
+
'circle-warning': CircleWarning,
|
3255
3303
|
'clamp-open': ClampOpen,
|
3256
3304
|
clamp: Clamp,
|
3257
3305
|
close: Close,
|
@@ -3837,29 +3885,34 @@ function isEventTriggeredOnInteractiveElement(eventTarget) {
|
|
3837
3885
|
const element = eventTarget;
|
3838
3886
|
return ['A', 'BUTTON', 'INPUT', 'TEXTAREA', 'SELECT'].includes(element.tagName) && !element.hidden && !element.disabled && !element.readOnly;
|
3839
3887
|
}
|
3840
|
-
function
|
3888
|
+
function shouldTriggerShortcut(event, key) {
|
3889
|
+
const keyOptions = typeof key === 'string' ? {
|
3890
|
+
key,
|
3891
|
+
meta: false,
|
3892
|
+
shift: false
|
3893
|
+
} : key;
|
3894
|
+
if (keyOptions.meta && (isMacOs() ? !event.metaKey : !event.ctrlKey) || !keyOptions.meta && (isMacOs() ? event.metaKey : event.ctrlKey)) {
|
3895
|
+
return false;
|
3896
|
+
}
|
3897
|
+
if (keyOptions.shift && !event.shiftKey || keyOptions.shift === false && event.shiftKey) {
|
3898
|
+
return false;
|
3899
|
+
}
|
3900
|
+
return event.key.toLowerCase() === keyOptions.key.toLowerCase();
|
3901
|
+
}
|
3902
|
+
function createShortcutKeyDownHandler(key, handler, stopPropagation = true) {
|
3841
3903
|
return function (event) {
|
3842
|
-
const keyOptions = typeof key === 'string' ? {
|
3843
|
-
key,
|
3844
|
-
meta: false,
|
3845
|
-
shift: false
|
3846
|
-
} : key;
|
3847
3904
|
if (event.target !== event.currentTarget && isEventTriggeredOnInteractiveElement(event.target)) {
|
3848
3905
|
return;
|
3849
3906
|
}
|
3850
|
-
|
3851
|
-
return;
|
3852
|
-
}
|
3853
|
-
if (keyOptions.shift && !event.shiftKey || keyOptions.shift === false && event.shiftKey) {
|
3854
|
-
return;
|
3855
|
-
}
|
3856
|
-
const condition = event.key.toLowerCase() === keyOptions.key.toLowerCase();
|
3907
|
+
const condition = shouldTriggerShortcut(event, key);
|
3857
3908
|
if (condition) {
|
3858
|
-
|
3859
|
-
|
3860
|
-
|
3861
|
-
|
3862
|
-
|
3909
|
+
if (stopPropagation) {
|
3910
|
+
var _event$stopImmediateP;
|
3911
|
+
// stops react handlers bubbling up to global
|
3912
|
+
event.stopPropagation();
|
3913
|
+
// stops global handlers bubbling up to other global
|
3914
|
+
(_event$stopImmediateP = event.stopImmediatePropagation) === null || _event$stopImmediateP === void 0 ? void 0 : _event$stopImmediateP.call(event);
|
3915
|
+
}
|
3863
3916
|
handler(event);
|
3864
3917
|
}
|
3865
3918
|
};
|
@@ -3873,7 +3926,7 @@ const useGlobalKeyDown = (shortcut, handler) => {
|
|
3873
3926
|
React__default.useEffect(() => {
|
3874
3927
|
let handleKeyDown;
|
3875
3928
|
if (shortcut) {
|
3876
|
-
handleKeyDown = createShortcutKeyDownHandler(shortcut, handler);
|
3929
|
+
handleKeyDown = createShortcutKeyDownHandler(shortcut, handler, false);
|
3877
3930
|
document.addEventListener('keydown', handleKeyDown);
|
3878
3931
|
}
|
3879
3932
|
return () => {
|
@@ -3881,7 +3934,7 @@ const useGlobalKeyDown = (shortcut, handler) => {
|
|
3881
3934
|
document.removeEventListener('keydown', handleKeyDown);
|
3882
3935
|
}
|
3883
3936
|
};
|
3884
|
-
}, [shortcut]);
|
3937
|
+
}, [shortcut, handler]);
|
3885
3938
|
};
|
3886
3939
|
|
3887
3940
|
const Button = /*#__PURE__*/React.forwardRef(function Button(props, ref) {
|
@@ -3895,6 +3948,11 @@ const Button = /*#__PURE__*/React.forwardRef(function Button(props, ref) {
|
|
3895
3948
|
const internalRef = useMergedRef(ref);
|
3896
3949
|
useGlobalKeyDown(shortcut, () => {
|
3897
3950
|
var _internalRef$current;
|
3951
|
+
const dialog = document.querySelector('[role="dialog"]');
|
3952
|
+
// Don't trigger the click on the button if it is outside of the dialog
|
3953
|
+
if (dialog && !(dialog !== null && dialog !== void 0 && dialog.contains(internalRef.current))) {
|
3954
|
+
return;
|
3955
|
+
}
|
3898
3956
|
(_internalRef$current = internalRef.current) === null || _internalRef$current === void 0 ? void 0 : _internalRef$current.click();
|
3899
3957
|
});
|
3900
3958
|
const Tag = props.href ? 'a' : 'button';
|
@@ -4367,7 +4425,7 @@ const defaultLocalisationTexts = {
|
|
4367
4425
|
}
|
4368
4426
|
},
|
4369
4427
|
search: {
|
4370
|
-
excludeUnmatchedResults: '
|
4428
|
+
excludeUnmatchedResults: 'Show only search results',
|
4371
4429
|
placeholder: 'Search...'
|
4372
4430
|
},
|
4373
4431
|
shortcuts: {
|
@@ -5630,6 +5688,12 @@ const Combobox = /*#__PURE__*/React.forwardRef(function Combobox(props, ref) {
|
|
5630
5688
|
const className = cn('inline-flex relative', {
|
5631
5689
|
'yt-combobox--inline': props.inline
|
5632
5690
|
}, externalClassName);
|
5691
|
+
const handleKeydown = event => {
|
5692
|
+
const isInsideEditingCell = !!event.target.closest('[role="cell"]');
|
5693
|
+
if (!isInsideEditingCell && (event.key === 'ArrowUp' || event.key === 'ArrowDown')) {
|
5694
|
+
event.stopPropagation();
|
5695
|
+
}
|
5696
|
+
};
|
5633
5697
|
return /*#__PURE__*/React.createElement("span", {
|
5634
5698
|
className: className,
|
5635
5699
|
"data-taco": "combobox",
|
@@ -5639,7 +5703,8 @@ const Combobox = /*#__PURE__*/React.forwardRef(function Combobox(props, ref) {
|
|
5639
5703
|
ref: internalRef
|
5640
5704
|
}, /*#__PURE__*/React.createElement("div", Object.assign({}, combobox, {
|
5641
5705
|
className: "inline w-full",
|
5642
|
-
ref: ref
|
5706
|
+
ref: ref,
|
5707
|
+
onKeyDown: handleKeydown
|
5643
5708
|
}), /*#__PURE__*/React.createElement(Input, Object.assign({}, input, {
|
5644
5709
|
autoComplete: "off",
|
5645
5710
|
button: props.inline ? /*#__PURE__*/React.createElement(IconButton
|
@@ -6151,8 +6216,6 @@ const Content$4 = /*#__PURE__*/React.forwardRef(function DialogContent(props, re
|
|
6151
6216
|
} else if (dialog.onClose) {
|
6152
6217
|
dialog.onClose();
|
6153
6218
|
}
|
6154
|
-
// Stops event from propogating outside the dialog.
|
6155
|
-
event.stopPropagation();
|
6156
6219
|
};
|
6157
6220
|
// the chosen behaviour in taco is that outside clicks do not close the dialog
|
6158
6221
|
const handleInteractOutside = event => event.preventDefault();
|
@@ -6166,19 +6229,12 @@ const Content$4 = /*#__PURE__*/React.forwardRef(function DialogContent(props, re
|
|
6166
6229
|
} else {
|
6167
6230
|
output = props.children;
|
6168
6231
|
}
|
6169
|
-
const onKeyDown = event => {
|
6170
|
-
if (event.key !== 'Escape') {
|
6171
|
-
// Stops event from propogating outside the dialog.
|
6172
|
-
event.stopPropagation();
|
6173
|
-
}
|
6174
|
-
};
|
6175
6232
|
return /*#__PURE__*/React.createElement(DialogPrimitive.Portal, null, /*#__PURE__*/React.createElement(DialogPrimitive.Overlay, {
|
6176
6233
|
asChild: true
|
6177
6234
|
}, /*#__PURE__*/React.createElement(Backdrop, null, /*#__PURE__*/React.createElement(DialogPrimitive.Content, Object.assign({}, props, {
|
6178
6235
|
className: className,
|
6179
6236
|
onEscapeKeyDown: handleEscapeKeyDown,
|
6180
6237
|
onInteractOutside: handleInteractOutside,
|
6181
|
-
onKeyDown: onKeyDown,
|
6182
6238
|
ref: internalRef,
|
6183
6239
|
style: {
|
6184
6240
|
...props.style,
|
@@ -9925,6 +9981,7 @@ const Single = /*#__PURE__*/React__default.forwardRef(function Select2TriggerSin
|
|
9925
9981
|
children,
|
9926
9982
|
emptyValue,
|
9927
9983
|
value,
|
9984
|
+
placeholder,
|
9928
9985
|
...buttonProps
|
9929
9986
|
} = props;
|
9930
9987
|
const {
|
@@ -9935,7 +9992,14 @@ const Single = /*#__PURE__*/React__default.forwardRef(function Select2TriggerSin
|
|
9935
9992
|
const contentClassName = cn('truncate items-center gap-1');
|
9936
9993
|
const currentValue = children.find(matchesValue(value));
|
9937
9994
|
let output;
|
9938
|
-
if (currentValue) {
|
9995
|
+
if (placeholder && currentValue === undefined) {
|
9996
|
+
output = /*#__PURE__*/React__default.createElement("div", {
|
9997
|
+
className: cn({
|
9998
|
+
'text-grey-700': disabled,
|
9999
|
+
'text-grey-500': !disabled
|
10000
|
+
})
|
10001
|
+
}, placeholder);
|
10002
|
+
} else if (currentValue) {
|
9939
10003
|
if (tags && emptyValue !== undefined && emptyValue !== value) {
|
9940
10004
|
output = /*#__PURE__*/React__default.createElement(Tag$1, {
|
9941
10005
|
className: "truncate",
|
@@ -9962,6 +10026,7 @@ const Multiple = /*#__PURE__*/React__default.forwardRef(function Select2TriggerM
|
|
9962
10026
|
children,
|
9963
10027
|
emptyValue: _,
|
9964
10028
|
values = [],
|
10029
|
+
placeholder,
|
9965
10030
|
...buttonProps
|
9966
10031
|
} = props;
|
9967
10032
|
const {
|
@@ -9983,7 +10048,12 @@ const Multiple = /*#__PURE__*/React__default.forwardRef(function Select2TriggerM
|
|
9983
10048
|
className: "my-1 flex max-h-[5.5rem] flex-col"
|
9984
10049
|
}, /*#__PURE__*/React__default.createElement("div", {
|
9985
10050
|
className: "flex flex-wrap gap-1"
|
9986
|
-
}, valuesAsChildren.
|
10051
|
+
}, valuesAsChildren.length === 0 ? /*#__PURE__*/React__default.createElement("div", {
|
10052
|
+
className: cn({
|
10053
|
+
'text-grey-700': disabled,
|
10054
|
+
'text-grey-500': !disabled
|
10055
|
+
})
|
10056
|
+
}, placeholder) : valuesAsChildren.map(child => /*#__PURE__*/React__default.createElement(Tag$1, {
|
9987
10057
|
key: String(child.props.value),
|
9988
10058
|
className: "truncate",
|
9989
10059
|
color: tags ? child.props.color : undefined,
|
@@ -10001,7 +10071,8 @@ const Multiple = /*#__PURE__*/React__default.forwardRef(function Select2TriggerM
|
|
10001
10071
|
} else {
|
10002
10072
|
content = /*#__PURE__*/React__default.createElement(MultipleValue, {
|
10003
10073
|
key: String(open),
|
10004
|
-
valuesAsChildren: valuesAsChildren
|
10074
|
+
valuesAsChildren: valuesAsChildren,
|
10075
|
+
placeholder: placeholder
|
10005
10076
|
});
|
10006
10077
|
}
|
10007
10078
|
return /*#__PURE__*/React__default.createElement("div", {
|
@@ -10017,7 +10088,8 @@ const Multiple = /*#__PURE__*/React__default.forwardRef(function Select2TriggerM
|
|
10017
10088
|
}), content));
|
10018
10089
|
});
|
10019
10090
|
const MultipleValue = ({
|
10020
|
-
valuesAsChildren
|
10091
|
+
valuesAsChildren,
|
10092
|
+
placeholder
|
10021
10093
|
}) => {
|
10022
10094
|
const {
|
10023
10095
|
disabled,
|
@@ -10040,9 +10112,14 @@ const MultipleValue = ({
|
|
10040
10112
|
}, /*#__PURE__*/React__default.createElement("div", {
|
10041
10113
|
className: "flex gap-1 truncate",
|
10042
10114
|
ref: el => setContentRef(el)
|
10043
|
-
}, valuesAsChildren.
|
10115
|
+
}, valuesAsChildren.length === 0 ? /*#__PURE__*/React__default.createElement("div", {
|
10116
|
+
className: cn({
|
10117
|
+
'text-grey-700': disabled,
|
10118
|
+
'text-grey-500': !disabled
|
10119
|
+
})
|
10120
|
+
}, placeholder) : valuesAsChildren.map((child, index) => {
|
10044
10121
|
const tag = /*#__PURE__*/React__default.createElement(Tag$1, {
|
10045
|
-
key: child.props.value,
|
10122
|
+
key: String(child.props.value),
|
10046
10123
|
className: cn('cursor-pointer', {
|
10047
10124
|
truncate: index === boundaryIndex,
|
10048
10125
|
hidden: boundaryIndex !== undefined && boundaryIndex !== null ? index > boundaryIndex : false
|
@@ -10055,7 +10132,7 @@ const MultipleValue = ({
|
|
10055
10132
|
}, child.props.children);
|
10056
10133
|
if (index === boundaryIndex) {
|
10057
10134
|
return /*#__PURE__*/React__default.createElement(Tooltip, {
|
10058
|
-
key: child.props.value,
|
10135
|
+
key: String(child.props.value),
|
10059
10136
|
title: String(child.props.children)
|
10060
10137
|
}, tag);
|
10061
10138
|
}
|
@@ -10382,6 +10459,7 @@ const Select2 = /*#__PURE__*/React__default.forwardRef(function Select2(props, r
|
|
10382
10459
|
defaultValue: defaultProp,
|
10383
10460
|
disabled = false,
|
10384
10461
|
emptyValue = undefined,
|
10462
|
+
placeholder,
|
10385
10463
|
highlighted = false,
|
10386
10464
|
invalid = false,
|
10387
10465
|
multiple = false,
|
@@ -10527,7 +10605,8 @@ const Select2 = /*#__PURE__*/React__default.forwardRef(function Select2(props, r
|
|
10527
10605
|
emptyValue: emptyValue,
|
10528
10606
|
onBlur: handleBlur,
|
10529
10607
|
onKeyDown: handleKeyDown,
|
10530
|
-
ref: internalRef
|
10608
|
+
ref: internalRef,
|
10609
|
+
placeholder: placeholder
|
10531
10610
|
}), flattenedChildren)), /*#__PURE__*/React__default.createElement(PopoverPrimitive.Portal, null, /*#__PURE__*/React__default.createElement(PopoverPrimitive.Content, {
|
10532
10611
|
asChild: true,
|
10533
10612
|
align: "start",
|
@@ -16139,7 +16218,10 @@ const MemoedHeader = /*#__PURE__*/React__default.memo(function MemoedHeader(prop
|
|
16139
16218
|
}) : null, hasMenu ? /*#__PURE__*/React__default.createElement(Menu$3, {
|
16140
16219
|
canFreeze: canFreeze,
|
16141
16220
|
canHide: canHide,
|
16142
|
-
className:
|
16221
|
+
className: cn('hidden group-hover/column:flex aria-expanded:!flex', {
|
16222
|
+
'ml-auto': align !== 'right',
|
16223
|
+
'ml-2': align === 'right'
|
16224
|
+
}),
|
16143
16225
|
index: index,
|
16144
16226
|
menu: meta.menu,
|
16145
16227
|
onGoto: handleGoto,
|
@@ -17178,14 +17260,20 @@ function useEditing(isEnabled, onSave) {
|
|
17178
17260
|
if (event.defaultPrevented) {
|
17179
17261
|
return;
|
17180
17262
|
}
|
17181
|
-
if (event
|
17182
|
-
|
17183
|
-
|
17184
|
-
|
17185
|
-
|
17186
|
-
|
17187
|
-
|
17188
|
-
|
17263
|
+
if (shouldTriggerShortcut(event, {
|
17264
|
+
key: 'e',
|
17265
|
+
meta: true,
|
17266
|
+
shift: false
|
17267
|
+
})) {
|
17268
|
+
setIsEditing(editing => !editing);
|
17269
|
+
} else if (shouldTriggerShortcut(event, {
|
17270
|
+
key: 's',
|
17271
|
+
meta: true,
|
17272
|
+
shift: false
|
17273
|
+
})) {
|
17274
|
+
// Prevent default browser save
|
17275
|
+
event.preventDefault();
|
17276
|
+
saveChangesIfNeeded();
|
17189
17277
|
}
|
17190
17278
|
}, [isEditing]);
|
17191
17279
|
const handleBlur = React__default.useCallback(event => {
|
@@ -17739,16 +17827,26 @@ const EditingControl = /*#__PURE__*/React__default.forwardRef(function Control(p
|
|
17739
17827
|
const columnMeta = column.columnDef.meta;
|
17740
17828
|
const controlRenderer = columnMeta === null || columnMeta === void 0 ? void 0 : columnMeta.control;
|
17741
17829
|
const isCellInDetailMode = tableMeta.editing.detailModeEditing && (ref === null || ref === void 0 ? void 0 : (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.contains(document.activeElement));
|
17742
|
-
// Revert to initial value if escape was pressed
|
17743
17830
|
const handleKeyDown = event => {
|
17831
|
+
// For some reason keydown event handler is not propogated to the table when input or other control element is
|
17832
|
+
// in focus so we need to check for shortcut that toggles the editing.
|
17833
|
+
if (shouldTriggerShortcut(event, {
|
17834
|
+
key: 'e',
|
17835
|
+
meta: true,
|
17836
|
+
shift: false
|
17837
|
+
})) {
|
17838
|
+
tableMeta.editing.toggleEditing(false);
|
17839
|
+
return;
|
17840
|
+
}
|
17744
17841
|
const target = event.target;
|
17745
17842
|
if (target.readOnly) {
|
17746
17843
|
return;
|
17747
17844
|
}
|
17748
|
-
//
|
17845
|
+
// Prevent row arrow shortcuts triggering when in detail mode
|
17749
17846
|
if (tableMeta.editing.detailModeEditing && (event.key === 'ArrowUp' || event.key === 'ArrowDown')) {
|
17750
17847
|
event.stopPropagation();
|
17751
17848
|
}
|
17849
|
+
// Revert to initial value if escape was pressed
|
17752
17850
|
if (event.key === 'Escape') {
|
17753
17851
|
event.preventDefault();
|
17754
17852
|
if (tableMeta.editing.detailModeEditing) {
|
@@ -17794,7 +17892,6 @@ const EditingControl = /*#__PURE__*/React__default.forwardRef(function Control(p
|
|
17794
17892
|
// Switching to editing mode, when key pressed any alphabetical character or number
|
17795
17893
|
if (/^[a-z0-9]$/i.test(event.key)) {
|
17796
17894
|
tableMeta.editing.setDetailModeEditing(true);
|
17797
|
-
return;
|
17798
17895
|
}
|
17799
17896
|
};
|
17800
17897
|
const handleDatepickerChange = event => {
|
@@ -19748,6 +19845,7 @@ function Filters(props) {
|
|
19748
19845
|
table
|
19749
19846
|
} = props;
|
19750
19847
|
const {
|
19848
|
+
locale,
|
19751
19849
|
texts
|
19752
19850
|
} = useLocalization();
|
19753
19851
|
const ref = React__default.useRef(null);
|
@@ -19828,7 +19926,7 @@ function Filters(props) {
|
|
19828
19926
|
className: "mb-0 inline-flex"
|
19829
19927
|
}, texts.table3.filters.button), /*#__PURE__*/React__default.createElement("p", {
|
19830
19928
|
className: "text-grey-700 mb-0 mr-auto mt-px inline-flex"
|
19831
|
-
}, texts.table3.filters.total.replace('[CURRENT]',
|
19929
|
+
}, texts.table3.filters.total.replace('[CURRENT]', new Intl.NumberFormat(locale).format(table.getFilteredRowModel().rows.length)).replace('[TOTAL]', new Intl.NumberFormat(locale).format(total))))), /*#__PURE__*/React__default.createElement("div", {
|
19832
19930
|
className: "flex flex-col gap-2"
|
19833
19931
|
}, filters.map((filter, index) => /*#__PURE__*/React__default.createElement(Filter$1, {
|
19834
19932
|
key: `filter_${index}`,
|
@@ -19969,14 +20067,6 @@ function EditButton(props) {
|
|
19969
20067
|
'!wcag-blue-100': tableMeta.editing.isEditing
|
19970
20068
|
});
|
19971
20069
|
const handleClick = () => tableMeta.editing.toggleEditing(!tableMeta.editing.isEditing);
|
19972
|
-
useGlobalKeyDown({
|
19973
|
-
key: 'e',
|
19974
|
-
meta: true,
|
19975
|
-
shift: false
|
19976
|
-
}, event => {
|
19977
|
-
event.preventDefault();
|
19978
|
-
tableMeta.editing.toggleEditing(!tableMeta.editing.isEditing);
|
19979
|
-
});
|
19980
20070
|
return /*#__PURE__*/React__default.createElement(Button$1, {
|
19981
20071
|
"aria-pressed": tableMeta.editing.isEditing,
|
19982
20072
|
className: className,
|
@@ -20510,10 +20600,13 @@ function useTableRefInstanceSetup(table, ref) {
|
|
20510
20600
|
}
|
20511
20601
|
|
20512
20602
|
function Summary$1(props) {
|
20603
|
+
var _table$getState$colum;
|
20513
20604
|
const {
|
20605
|
+
currentLength,
|
20514
20606
|
length,
|
20515
20607
|
table
|
20516
20608
|
} = props;
|
20609
|
+
const tableMeta = table.options.meta;
|
20517
20610
|
const {
|
20518
20611
|
locale,
|
20519
20612
|
texts
|
@@ -20524,13 +20617,20 @@ function Summary$1(props) {
|
|
20524
20617
|
const rowsSelectedLength = table.getIsAllRowsSelected() ? length : table.getSelectedRowModel().rows.length;
|
20525
20618
|
if (rowsSelectedLength > 0) {
|
20526
20619
|
label = texts.table3.footer.summary.selected;
|
20527
|
-
count = /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("strong", null, new Intl.NumberFormat(locale).format(rowsSelectedLength)), "\u00A0", texts.table3.footer.summary.count, "\u00A0", /*#__PURE__*/React__default.createElement("strong", null, length));
|
20620
|
+
count = /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("strong", null, new Intl.NumberFormat(locale).format(rowsSelectedLength)), "\u00A0", texts.table3.footer.summary.count, "\u00A0", /*#__PURE__*/React__default.createElement("strong", null, new Intl.NumberFormat(locale).format(length)));
|
20621
|
+
} else if ((_table$getState$colum = table.getState().columnFilters) !== null && _table$getState$colum !== void 0 && _table$getState$colum.length ||
|
20622
|
+
// filtered data
|
20623
|
+
!!table.getState().globalFilter && tableMeta.search.excludeUnmatchedResults // search with hide enabled
|
20624
|
+
) {
|
20625
|
+
label = texts.table3.footer.summary.records;
|
20626
|
+
count = /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("strong", null, currentLength), "\u00A0", texts.table3.footer.summary.count, "\u00A0", /*#__PURE__*/React__default.createElement("strong", null, new Intl.NumberFormat(locale).format(length)));
|
20528
20627
|
} else {
|
20529
20628
|
label = texts.table3.footer.summary.records;
|
20530
20629
|
count = /*#__PURE__*/React__default.createElement("strong", null, new Intl.NumberFormat(locale).format(length));
|
20531
20630
|
}
|
20532
20631
|
return /*#__PURE__*/React__default.createElement("div", {
|
20533
|
-
className: "sticky bottom-0 left-0 z-40 -mt-10 flex h-10 w-fit items-center whitespace-nowrap bg-white px-4 !pr-3 shadow-[6px_0px_6px_theme(colors.white)]"
|
20632
|
+
className: "sticky bottom-0 left-0 z-40 -mt-10 flex h-10 w-fit items-center whitespace-nowrap bg-white px-4 !pr-3 shadow-[6px_0px_6px_theme(colors.white)]",
|
20633
|
+
"data-taco": "table2-footer-summary"
|
20534
20634
|
}, label, "\u00A0", count);
|
20535
20635
|
}
|
20536
20636
|
|
@@ -20750,6 +20850,11 @@ const Table$1 = /*#__PURE__*/fixedForwardRef(function Table3(props, ref) {
|
|
20750
20850
|
const bodyRef = React__default.useRef(null);
|
20751
20851
|
React__default.useEffect(() => {
|
20752
20852
|
const handleKeyDown = event => {
|
20853
|
+
const dialog = document.querySelector('[role="dialog"]');
|
20854
|
+
// Don't trigger global shortcuts on the table if it is outside of the dialog
|
20855
|
+
if (dialog && !(dialog !== null && dialog !== void 0 && dialog.contains(internalRef.current))) {
|
20856
|
+
return;
|
20857
|
+
}
|
20753
20858
|
tableMeta.hoverState.handleKeyDown(event);
|
20754
20859
|
tableMeta.currentRow.handleKeyDown(event, table.getRowModel().rows.length, scrollToIndex);
|
20755
20860
|
tableMeta.rowClick.handleKeyDown(event, table);
|
@@ -20764,7 +20869,7 @@ const Table$1 = /*#__PURE__*/fixedForwardRef(function Table3(props, ref) {
|
|
20764
20869
|
// See https://github.com/e-conomic/taco/blob/dev/packages/taco/src/components/Table3/strategies/virtualised.tsx#L143
|
20765
20870
|
// scrollToIndex function changes when row count changes, so it is important to update handlers with new
|
20766
20871
|
// scrollToIndex function.
|
20767
|
-
[scrollToIndex]);
|
20872
|
+
[scrollToIndex, internalRef.current]);
|
20768
20873
|
const handleBlur = event => {
|
20769
20874
|
tableMeta.editing.handleBlur(event);
|
20770
20875
|
};
|
@@ -20838,7 +20943,7 @@ const Table$1 = /*#__PURE__*/fixedForwardRef(function Table3(props, ref) {
|
|
20838
20943
|
role: "rowgroup",
|
20839
20944
|
ref: bodyRef
|
20840
20945
|
}, renderBody())), /*#__PURE__*/React__default.createElement("div", {
|
20841
|
-
className: "border-grey-300 col-span-full -
|
20946
|
+
className: "border-grey-300 col-span-full translate-y-px border-t"
|
20842
20947
|
}), tableMeta.enableFooter ? /*#__PURE__*/React__default.createElement("div", {
|
20843
20948
|
className: "group/footer contents",
|
20844
20949
|
"data-taco": "table2-footer",
|
@@ -20850,6 +20955,7 @@ const Table$1 = /*#__PURE__*/fixedForwardRef(function Table3(props, ref) {
|
|
20850
20955
|
}, footerGroup.headers.map(footer => /*#__PURE__*/React__default.createElement(React__default.Fragment, {
|
20851
20956
|
key: footer.id
|
20852
20957
|
}, reactTable$1.flexRender(footer.column.columnDef.footer, footer.getContext()))))), length ? /*#__PURE__*/React__default.createElement(Summary$1, {
|
20958
|
+
currentLength: table.getRowModel().rows.length,
|
20853
20959
|
length: length,
|
20854
20960
|
table: table
|
20855
20961
|
}) : null) : null) : /*#__PURE__*/React__default.createElement("div", {
|
@@ -21907,6 +22013,7 @@ exports.parseFromCustomString = parseFromCustomString;
|
|
21907
22013
|
exports.parseFromISOString = parseFromISOString;
|
21908
22014
|
exports.removeChildTableRow = removeChildTableRow;
|
21909
22015
|
exports.setByRowIndexPath = setByRowIndexPath;
|
22016
|
+
exports.shouldTriggerShortcut = shouldTriggerShortcut;
|
21910
22017
|
exports.useBoundaryOverflowDetection = useBoundaryOverflowDetection;
|
21911
22018
|
exports.useBoundingClientRectListener = useBoundingClientRectListener;
|
21912
22019
|
exports.useDropTarget = useDropTarget;
|