@economic/taco 2.54.0 → 2.55.0-EC-64018.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Checkbox/Checkbox.d.ts +7 -2
- package/dist/components/List/List.d.ts +2 -2
- package/dist/components/List/components/Toggle.d.ts +2 -2
- package/dist/components/ModeSwitch/ModeSwitch.d.ts +6 -3
- package/dist/components/Switch/Switch.d.ts +6 -4
- package/dist/esm/index.css +76 -5
- package/dist/esm/packages/taco/src/components/Checkbox/Checkbox.js +41 -63
- package/dist/esm/packages/taco/src/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/esm/packages/taco/src/components/List/components/Toggle.js +14 -4
- package/dist/esm/packages/taco/src/components/List/components/Toggle.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Listbox/ScrollableList.js +6 -3
- package/dist/esm/packages/taco/src/components/Listbox/ScrollableList.js.map +1 -1
- package/dist/esm/packages/taco/src/components/ModeSwitch/ModeSwitch.js +34 -12
- package/dist/esm/packages/taco/src/components/ModeSwitch/ModeSwitch.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Switch/Switch.js +37 -35
- package/dist/esm/packages/taco/src/components/Switch/Switch.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/EditingControlCell.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Toolbar/Editing/Editing.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/Header.js +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/Header.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableDataLoader2.js +2 -2
- package/dist/esm/packages/taco/src/primitives/Table/useTableDataLoader2.js.map +1 -1
- package/dist/index.css +76 -5
- package/dist/taco.cjs.development.js +135 -121
- 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 +3 -3
@@ -11,9 +11,9 @@ var AlertDialogPrimitive = require('@radix-ui/react-alert-dialog');
|
|
11
11
|
var AccordionPrimitive = require('@radix-ui/react-accordion');
|
12
12
|
var TooltipPrimitive = require('@radix-ui/react-tooltip');
|
13
13
|
var reactDayPicker = require('react-day-picker');
|
14
|
-
var
|
15
|
-
var uuid = require('uuid');
|
14
|
+
var reactAriaComponents = require('react-aria-components');
|
16
15
|
var PopoverPrimitive = require('@radix-ui/react-popover');
|
16
|
+
var uuid = require('uuid');
|
17
17
|
var debounce$1 = _interopDefault(require('lodash/debounce'));
|
18
18
|
var dateFns = require('date-fns');
|
19
19
|
var DialogPrimitive = require('@radix-ui/react-dialog');
|
@@ -24,7 +24,6 @@ var ScrollAreaPrimitive = require('@radix-ui/react-scroll-area');
|
|
24
24
|
var reactUseControllableState = require('@radix-ui/react-use-controllable-state');
|
25
25
|
var HoverCardPrimitive = require('@radix-ui/react-hover-card');
|
26
26
|
var CollapsiblePrimitive = require('@radix-ui/react-collapsible');
|
27
|
-
var PrimitiveSwitch = require('@radix-ui/react-switch');
|
28
27
|
var DropdownMenuPrimitive = require('@radix-ui/react-dropdown-menu');
|
29
28
|
var RadioGroupPrimitive = require('@radix-ui/react-radio-group');
|
30
29
|
var ReactDOM = _interopDefault(require('react-dom'));
|
@@ -5246,11 +5245,6 @@ const Card = /*#__PURE__*/React.forwardRef(function Card(props, ref) {
|
|
5246
5245
|
});
|
5247
5246
|
Card.Content = Content$2;
|
5248
5247
|
|
5249
|
-
// React 18 has this built-in, when we upgrade this hook should be removed and the uuid dependency should be removed
|
5250
|
-
const useId = nativeId => {
|
5251
|
-
return React__default.useMemo(() => nativeId !== null && nativeId !== void 0 ? nativeId : uuid.v4(), []);
|
5252
|
-
};
|
5253
|
-
|
5254
5248
|
const Spinner = /*#__PURE__*/React__default.forwardRef(function Spinner(props, ref) {
|
5255
5249
|
const {
|
5256
5250
|
delay = 350,
|
@@ -5293,75 +5287,53 @@ const Spinner = /*#__PURE__*/React__default.forwardRef(function Spinner(props, r
|
|
5293
5287
|
const Checkbox = /*#__PURE__*/React.forwardRef(function Checkbox(props, ref) {
|
5294
5288
|
const {
|
5295
5289
|
checked,
|
5290
|
+
className,
|
5291
|
+
defaultChecked,
|
5296
5292
|
indeterminate,
|
5293
|
+
readOnly,
|
5297
5294
|
invalid,
|
5298
|
-
|
5299
|
-
|
5295
|
+
disabled,
|
5296
|
+
required,
|
5300
5297
|
onChange,
|
5298
|
+
loading,
|
5299
|
+
label,
|
5300
|
+
onClick,
|
5301
5301
|
...otherProps
|
5302
5302
|
} = props;
|
5303
|
-
|
5304
|
-
const
|
5303
|
+
// Converts the forwarded ref to an object ref, as required by RAC Checkbox.
|
5304
|
+
const inputRef = useMergedRef(ref);
|
5305
|
+
const checkboxContainerClassName = cn('group flex justify-center gap-2 data-[disabled]:text-grey-300 data-[disabled]:cursor-not-allowed');
|
5306
|
+
// Styling for other complex, state-driven scenarios is managed directly within the styles.css file.
|
5307
|
+
const checkboxClassName = cn('bg-white h-5 w-5 border rounded text-sm flex flex-shrink-0 text-white cursor-pointer', {
|
5305
5308
|
'self-start': !!label,
|
5306
5309
|
'mt-[0.1rem]': !label
|
5307
|
-
},
|
5308
|
-
|
5309
|
-
|
5310
|
-
|
5311
|
-
|
5312
|
-
|
5313
|
-
|
5314
|
-
|
5315
|
-
|
5316
|
-
|
5317
|
-
|
5318
|
-
|
5319
|
-
|
5320
|
-
|
5321
|
-
|
5322
|
-
|
5323
|
-
|
5324
|
-
|
5325
|
-
// the enter keyboard shortcut isn't supported by default, but we want it
|
5326
|
-
const handleKeyDown = event => {
|
5327
|
-
if (event.key === 'Enter') {
|
5328
|
-
event.currentTarget.click();
|
5329
|
-
}
|
5330
|
-
};
|
5331
|
-
const spinnerClassname = cn(
|
5332
|
-
//Spinner is slightly bigger then 'line' and 'tick' icons, so making it 2px smaller from each side
|
5333
|
-
"m-0.5 !h-[calc(100%-theme('spacing.1'))] !w-[calc(100%-theme('spacing.1'))]", {
|
5334
|
-
'text-blue-500': !checked && !indeterminate
|
5335
|
-
});
|
5336
|
-
const element = /*#__PURE__*/React.createElement(CheckboxPrimitive.Root, Object.assign({}, otherProps, labelledByProps, {
|
5337
|
-
"aria-invalid": invalid ? 'true' : undefined,
|
5310
|
+
}, className);
|
5311
|
+
return /*#__PURE__*/React.createElement(reactAriaComponents.Checkbox, Object.assign({}, otherProps, {
|
5312
|
+
className: checkboxContainerClassName,
|
5313
|
+
"data-taco": "checkbox-container",
|
5314
|
+
defaultSelected: defaultChecked,
|
5315
|
+
isDisabled: disabled,
|
5316
|
+
isIndeterminate: indeterminate,
|
5317
|
+
isInvalid: invalid,
|
5318
|
+
isRequired: required,
|
5319
|
+
isReadOnly: readOnly,
|
5320
|
+
isSelected: checked,
|
5321
|
+
inputRef: inputRef,
|
5322
|
+
onChange: onChange
|
5323
|
+
}), ({
|
5324
|
+
isIndeterminate,
|
5325
|
+
isSelected
|
5326
|
+
}) => (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
5327
|
+
className: checkboxClassName,
|
5338
5328
|
"data-taco": "checkbox",
|
5339
|
-
|
5340
|
-
|
5341
|
-
|
5342
|
-
|
5343
|
-
|
5344
|
-
|
5345
|
-
className: spinnerClassname
|
5346
|
-
})) : (/*#__PURE__*/React.createElement(CheckboxPrimitive.Indicator, {
|
5347
|
-
className: "flex h-full w-full"
|
5348
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
5349
|
-
name: indeterminate ? 'line' : 'tick',
|
5329
|
+
onClick: onClick
|
5330
|
+
}, loading ? (/*#__PURE__*/React.createElement(Spinner, {
|
5331
|
+
className: "m-0.5 !h-[calc(100%-theme('spacing.1'))] !w-[calc(100%-theme('spacing.1'))] text-blue-500 group-data-[indeterminate]:text-white group-data-[selected]:text-white"
|
5332
|
+
})) : (isIndeterminate || isSelected) && (/*#__PURE__*/React.createElement(Icon, {
|
5333
|
+
"aria-hidden": true,
|
5334
|
+
name: isIndeterminate ? 'line' : 'tick',
|
5350
5335
|
className: "!h-full !w-full"
|
5351
|
-
}))));
|
5352
|
-
if (label) {
|
5353
|
-
const labelContainerClassName = cn('flex items-center cursor-pointer gap-2', {
|
5354
|
-
'cursor-not-allowed text-grey-300': props.disabled
|
5355
|
-
});
|
5356
|
-
return /*#__PURE__*/React.createElement("span", {
|
5357
|
-
className: labelContainerClassName,
|
5358
|
-
"data-taco": "checkbox-container"
|
5359
|
-
}, element, /*#__PURE__*/React.createElement("label", {
|
5360
|
-
htmlFor: id,
|
5361
|
-
id: `${id}-label`
|
5362
|
-
}, label));
|
5363
|
-
}
|
5364
|
-
return element;
|
5336
|
+
}))), label)));
|
5365
5337
|
});
|
5366
5338
|
Checkbox.displayName = 'Checkbox';
|
5367
5339
|
|
@@ -5799,10 +5771,13 @@ const ScrollableList = /*#__PURE__*/React.forwardRef(function ScrollableList(pro
|
|
5799
5771
|
// so need to be taken out of screen reader scope.
|
5800
5772
|
, {
|
5801
5773
|
"aria-hidden": true,
|
5802
|
-
|
5774
|
+
excludeFromTabOrder: true,
|
5803
5775
|
checked: optionProps['aria-selected'],
|
5804
|
-
onChange: () =>
|
5805
|
-
|
5776
|
+
onChange: () => {
|
5777
|
+
var _optionProps$ref, _optionProps$ref$curr;
|
5778
|
+
(_optionProps$ref = optionProps.ref) === null || _optionProps$ref === void 0 ? void 0 : (_optionProps$ref$curr = _optionProps$ref.current) === null || _optionProps$ref$curr === void 0 ? void 0 : _optionProps$ref$curr.click();
|
5779
|
+
},
|
5780
|
+
className: "ml-2 self-center p-px"
|
5806
5781
|
}))))) : (/*#__PURE__*/React.createElement("li", {
|
5807
5782
|
className: "yt-list__empty"
|
5808
5783
|
}, /*#__PURE__*/React.createElement("span", null, texts.listbox.empty))));
|
@@ -7773,44 +7748,46 @@ const Collapsible = /*#__PURE__*/React__default.forwardRef(function Accordion(pr
|
|
7773
7748
|
|
7774
7749
|
const Switch = /*#__PURE__*/React.forwardRef(function Switch(props, ref) {
|
7775
7750
|
const {
|
7751
|
+
checked,
|
7752
|
+
defaultChecked,
|
7753
|
+
readOnly,
|
7776
7754
|
label,
|
7777
7755
|
onChange,
|
7756
|
+
disabled,
|
7757
|
+
onClick,
|
7758
|
+
className,
|
7778
7759
|
...otherProps
|
7779
7760
|
} = props;
|
7780
|
-
const
|
7781
|
-
const
|
7782
|
-
|
7783
|
-
'
|
7784
|
-
|
7785
|
-
|
7786
|
-
|
7787
|
-
|
7788
|
-
|
7789
|
-
|
7790
|
-
|
7791
|
-
|
7792
|
-
|
7793
|
-
const
|
7794
|
-
|
7761
|
+
const inputRef = useMergedRef(ref);
|
7762
|
+
const switchContainerClassName = cn('group flex self-start', 'data-[disabled]:text-grey-300 data-[disabled]:cursor-not-allowed');
|
7763
|
+
const switchClassName = cn('h-5 w-9 flex flex-shrink-0 rounded-full inline-flex cursor-pointer bg-grey-500', 'group-data-[focus-visible]:yt-focus', {
|
7764
|
+
'mr-2': !!label
|
7765
|
+
}, 'group-hover:bg-grey-700',
|
7766
|
+
// When switch is selected
|
7767
|
+
'group-data-[selected]:bg-blue-500',
|
7768
|
+
// When switch is selected and hovered
|
7769
|
+
'group-hover:group-data-[selected]:bg-blue-700',
|
7770
|
+
// When switch is disabled
|
7771
|
+
'group-data-[disabled]:!bg-grey-500/50 group-data-[disabled]:cursor-not-allowed',
|
7772
|
+
// When switch is disabled and selected
|
7773
|
+
'group-data-[disabled]:group-data-[selected]:!bg-blue-500/50', className);
|
7774
|
+
const switchThumbClassName = cn('pointer-events-none mt-0.5 h-4 w-4 translate-x-[0.15rem] rounded-full bg-white transition-transform will-change-transform', 'group-data-[disabled]:opacity-50', 'group-data-[selected]:translate-x-[1.1rem]');
|
7775
|
+
return /*#__PURE__*/React.createElement(reactAriaComponents.Switch, Object.assign({}, otherProps, {
|
7776
|
+
className: switchContainerClassName,
|
7777
|
+
"data-taco": "switch-container",
|
7778
|
+
inputRef: inputRef,
|
7779
|
+
isDisabled: disabled,
|
7780
|
+
isReadOnly: readOnly,
|
7781
|
+
isSelected: checked,
|
7782
|
+
defaultSelected: defaultChecked,
|
7783
|
+
onChange: onChange
|
7784
|
+
}), /*#__PURE__*/React.createElement("span", {
|
7785
|
+
className: switchClassName,
|
7795
7786
|
"data-taco": "switch",
|
7796
|
-
|
7797
|
-
|
7798
|
-
|
7799
|
-
|
7800
|
-
}));
|
7801
|
-
if (label) {
|
7802
|
-
const labelContainerClassName = cn('flex self-start cursor-pointer', {
|
7803
|
-
'cursor-not-allowed text-grey-300': props.disabled
|
7804
|
-
});
|
7805
|
-
return /*#__PURE__*/React.createElement("span", {
|
7806
|
-
className: labelContainerClassName,
|
7807
|
-
"data-taco": "switch-container"
|
7808
|
-
}, element, /*#__PURE__*/React.createElement("label", {
|
7809
|
-
htmlFor: id,
|
7810
|
-
id: `${id}-label`
|
7811
|
-
}, label));
|
7812
|
-
}
|
7813
|
-
return element;
|
7787
|
+
onClick: onClick
|
7788
|
+
}, /*#__PURE__*/React.createElement("span", {
|
7789
|
+
className: switchThumbClassName
|
7790
|
+
})), label);
|
7814
7791
|
});
|
7815
7792
|
Switch.displayName = 'Switch';
|
7816
7793
|
|
@@ -7868,13 +7845,18 @@ const Switch$1 = /*#__PURE__*/React__default.forwardRef(function Switch$1(props,
|
|
7868
7845
|
setChecked(!checked);
|
7869
7846
|
onChange(!checked);
|
7870
7847
|
}, [checked, onChange]);
|
7848
|
+
const controlClassName = cn(
|
7849
|
+
// When ToggleItem is hovered
|
7850
|
+
'group-hover/toggle:bg-grey-700',
|
7851
|
+
// When ToggleItem is hovered and switch inside it is selected
|
7852
|
+
'group-hover/toggle:group-data-[selected]:bg-blue-700');
|
7871
7853
|
const control = /*#__PURE__*/React__default.createElement(Switch, {
|
7872
7854
|
checked: checked,
|
7873
|
-
className:
|
7855
|
+
className: controlClassName,
|
7874
7856
|
disabled: props.disabled,
|
7875
7857
|
onChange: toggle,
|
7876
7858
|
ref: switchRef,
|
7877
|
-
|
7859
|
+
excludeFromTabOrder: true
|
7878
7860
|
});
|
7879
7861
|
return /*#__PURE__*/React__default.createElement(ToggleItem, Object.assign({}, attributes, {
|
7880
7862
|
control: control,
|
@@ -7895,13 +7877,18 @@ const Checkbox$1 = /*#__PURE__*/React__default.forwardRef(function Switch(props,
|
|
7895
7877
|
setChecked(!checked);
|
7896
7878
|
onChange(!checked);
|
7897
7879
|
}, [checked, onChange]);
|
7880
|
+
const controlClassName = cn(
|
7881
|
+
// When ToggleItem is hovered
|
7882
|
+
'group-hover/toggle:border-grey-700',
|
7883
|
+
// When ToggleItem is hovered and checkbox inside it is selected
|
7884
|
+
'group-hover/toggle:group-data-[selected]:border-blue-700 group-hover/toggle:group-data-[selected]:bg-blue-700');
|
7898
7885
|
const control = /*#__PURE__*/React__default.createElement(Checkbox, {
|
7899
7886
|
checked: checked,
|
7900
|
-
className:
|
7887
|
+
className: controlClassName,
|
7901
7888
|
disabled: props.disabled,
|
7902
7889
|
onChange: toggle,
|
7903
7890
|
ref: checkboxRef,
|
7904
|
-
|
7891
|
+
excludeFromTabOrder: true
|
7905
7892
|
});
|
7906
7893
|
return /*#__PURE__*/React__default.createElement(ToggleItem, Object.assign({}, attributes, {
|
7907
7894
|
control: control,
|
@@ -8848,20 +8835,41 @@ Menu$1.SubMenu = SubMenu;
|
|
8848
8835
|
|
8849
8836
|
const ModeSwitch = /*#__PURE__*/React.forwardRef(function ModeSwitch(props, ref) {
|
8850
8837
|
const {
|
8838
|
+
checked,
|
8839
|
+
defaultChecked,
|
8840
|
+
readOnly,
|
8851
8841
|
onChange,
|
8842
|
+
disabled,
|
8843
|
+
className,
|
8852
8844
|
...otherProps
|
8853
8845
|
} = props;
|
8854
|
-
const
|
8855
|
-
|
8856
|
-
|
8857
|
-
|
8858
|
-
|
8859
|
-
|
8860
|
-
|
8861
|
-
|
8862
|
-
|
8863
|
-
|
8864
|
-
|
8846
|
+
const inputRef = useMergedRef(ref);
|
8847
|
+
const switchClassName = cn('group w-14 h-8 flex flex-shrink-0 rounded-full inline-flex p-1 cursor-pointer bg-grey-500', 'data-[focus-visible]:yt-focus', 'hover:bg-grey-700',
|
8848
|
+
// When modeswitch is selected
|
8849
|
+
'data-[selected]:bg-blue-500',
|
8850
|
+
// When modeswitch is selected and hovered
|
8851
|
+
'hover:data-[selected]:bg-blue-700',
|
8852
|
+
// When modeswitch is disabled
|
8853
|
+
'data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 data-[disabled]:bg-grey-500 ',
|
8854
|
+
// When modeswitch is disabled and selected
|
8855
|
+
'data-[disabled]:data-[selected]:!bg-blue-500', className);
|
8856
|
+
const switchThumbClassName = cn('pointer-events-none flex h-6 w-6 items-center justify-center rounded-full bg-white transition-transform will-change-transform',
|
8857
|
+
// When modeswitch is disabled
|
8858
|
+
'group-data-[disabled]:opacity-50',
|
8859
|
+
// When modeswitch is selected
|
8860
|
+
'group-data-[selected]:translate-x-full');
|
8861
|
+
return /*#__PURE__*/React.createElement(reactAriaComponents.Switch, Object.assign({}, otherProps, {
|
8862
|
+
className: switchClassName,
|
8863
|
+
defaultSelected: defaultChecked,
|
8864
|
+
id: otherProps.id,
|
8865
|
+
inputRef: inputRef,
|
8866
|
+
isDisabled: disabled,
|
8867
|
+
isReadOnly: readOnly,
|
8868
|
+
isSelected: checked,
|
8869
|
+
onChange: onChange
|
8870
|
+
}), /*#__PURE__*/React.createElement("span", {
|
8871
|
+
className: switchThumbClassName,
|
8872
|
+
"data-taco": "mode"
|
8865
8873
|
}, /*#__PURE__*/React.createElement(Icon, {
|
8866
8874
|
name: "edit-simple",
|
8867
8875
|
className: "pointer-events-none !h-5 !w-5"
|
@@ -13872,6 +13880,7 @@ const MemoedHeader = /*#__PURE__*/React__default.memo(function MemoedHeader(prop
|
|
13872
13880
|
"data-cell-align": isGroup ? 'center' : align,
|
13873
13881
|
"data-cell-id": id,
|
13874
13882
|
"data-cell-pinned": isPinned ? isPinned : undefined,
|
13883
|
+
"data-taco": isGroup ? 'grouped-column-header' : 'column-header',
|
13875
13884
|
style: style,
|
13876
13885
|
ref: setRef
|
13877
13886
|
}), !isPlaceholder ? (/*#__PURE__*/React__default.createElement(HeaderContent, {
|
@@ -14793,6 +14802,11 @@ function RowHeightMenuItem({
|
|
14793
14802
|
}, texts.table.rowHeight.sizes.extraTall)));
|
14794
14803
|
}
|
14795
14804
|
|
14805
|
+
// React 18 has this built-in, when we upgrade this hook should be removed and the uuid dependency should be removed
|
14806
|
+
const useId = nativeId => {
|
14807
|
+
return React__default.useMemo(() => nativeId !== null && nativeId !== void 0 ? nativeId : uuid.v4(), []);
|
14808
|
+
};
|
14809
|
+
|
14796
14810
|
const isAriaSelectionKey = event => {
|
14797
14811
|
if (event.key === 'Enter' || event.key === ' ' || event.key === 'Tab') {
|
14798
14812
|
return true;
|
@@ -22420,11 +22434,11 @@ function useTableDataLoader2(fetchPage, fetchAll, options = {
|
|
22420
22434
|
}) {
|
22421
22435
|
const loadPage = function (pageIndex, sorting, filters, hiddenColumns, search, reset = false) {
|
22422
22436
|
try {
|
22437
|
+
const hasChangedData = JSON.stringify(sorting) !== JSON.stringify(_lastUsedSorting.current) || JSON.stringify(filters) !== JSON.stringify(_lastUsedFilters.current) || search !== _lastUsedSearch.current;
|
22423
22438
|
// if a request is already pending for this page (and it's not a reset), skip it
|
22424
|
-
if (_pendingPageRequests.current[pageIndex] && !reset) {
|
22439
|
+
if (_pendingPageRequests.current[pageIndex] && !hasChangedData && !reset) {
|
22425
22440
|
return Promise.resolve();
|
22426
22441
|
}
|
22427
|
-
const hasChangedData = JSON.stringify(sorting) !== JSON.stringify(_lastUsedSorting.current) || JSON.stringify(filters) !== JSON.stringify(_lastUsedFilters.current) || search !== _lastUsedSearch.current;
|
22428
22442
|
// if the page is already loaded and has actual rows, abort
|
22429
22443
|
if (data.cache[pageIndex] && data.cache[pageIndex][0] && !hasChangedData && !reset) {
|
22430
22444
|
return Promise.resolve();
|