@adaptabletools/adaptable 23.0.0 → 23.0.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable",
3
- "version": "23.0.0",
3
+ "version": "23.0.2",
4
4
  "description": "Powerful AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements",
5
5
  "keywords": [
6
6
  "web-components",
@@ -44,11 +44,12 @@ export const FloatingFilter = (props) => {
44
44
  const operatorOptions = props.predicateDefs.map((predicateDef) => ({
45
45
  label: (_jsxs(Box, { className: "twa:flex twa:items-center", children: [_jsx(Box, { className: "twa:mr-2 twa:flex twa:items-center", children: predicateDef.icon }), _jsx(Box, { className: "twa:truncate", "data-name": "filter-predicate-label", "data-label": predicateDef.label, children: predicateDef.label })] })),
46
46
  tooltip: predicateDef.label,
47
+ ariaLabel: predicateDef.label,
47
48
  value: predicateDef.operator,
48
49
  }));
49
50
  const renderTriggerValue = () => (_jsxs(Flex, { alignItems: "center", className: "twa:min-w-0", children: [_jsx(Box, { className: "twa:flex twa:items-center", children: !isManualApply && singleFilterPredicateDef?.icon ? (singleFilterPredicateDef?.icon) : (_jsx(AdaptableIconComponent, { icon: { name: 'filter' } })) }), showLabel && (_jsx(Box, { className: "ab-FloatingFilter-label twa:ml-2 twa:flex-1 twa:truncate", title: label, children: label }))] }));
50
51
  let filterDropdown = null;
51
- const filterDropdownSelect = (_jsx(SingleSelect, { chevronIcon: null, "data-name": "floating-filter-button", ariaLabel: "Column Filter Operator Dropdown", size: "small", stopMouseDownPropagation: true, disabled: props.disabled, open: selectOpen, extraWidthChars: 5, onOpenChange: (nextOpen) => {
52
+ const filterDropdownSelect = (_jsx(SingleSelect, { chevronIcon: null, "data-name": "floating-filter-button", ariaLabel: `Column Filter Operator Dropdown: current operator is ${label}`, size: "small", stopMouseDownPropagation: true, disabled: props.disabled, open: selectOpen, extraWidthChars: 5, onOpenChange: (nextOpen) => {
52
53
  // In non-inline mode the select doesn't pick an operator inline; opening it
53
54
  // instead opens the full column filter popup, so keep the dropdown closed.
54
55
  if (nextOpen && !isInlineEditable) {
@@ -45,7 +45,12 @@ export function VirtualizedList({ open, virtualizerRef, showItemTooltip, renderC
45
45
  const label = isUncreatedCreatable ? `Create "${item.label}"` : item.label;
46
46
  const itemLabel = renderItemLabel ? (renderItemLabel(label, item)) : (_jsx("span", { className: "twa:min-w-0 twa:flex-1 twa:truncate", children: label }));
47
47
  const itemContent = isUncreatedCreatable ? (_jsxs(_Fragment, { children: [_jsx(PlusIcon, {}), itemLabel] })) : (itemLabel);
48
- const itemElement = (_jsx(ComboboxItem, { index: virtualItem.index, "data-index": virtualItem.index, ref: virtualizer.measureElement, value: item, renderCheckboxIndicator: renderCheckboxIndicator, "aria-setsize": filteredItems.length, "aria-posinset": virtualItem.index + 1, "aria-label": itemText ?? undefined, style: {
48
+ // The Tooltip must wrap the item's inner content rather than the
49
+ // `ComboboxItem` itself: when the tooltip trigger renders the option
50
+ // element it overwrites the option's `id`, which breaks base-ui's
51
+ // `aria-activedescendant` (`${rootId}-${index}`) link and silences
52
+ // screen readers as you navigate the list.
53
+ return (_jsx(ComboboxItem, { index: virtualItem.index, "data-index": virtualItem.index, ref: virtualizer.measureElement, value: item, renderCheckboxIndicator: renderCheckboxIndicator, "aria-setsize": filteredItems.length, "aria-posinset": virtualItem.index + 1, "aria-label": itemText ?? undefined, style: {
49
54
  position: 'absolute',
50
55
  left: `var(--ab-base-space)`,
51
56
  right: `var(--ab-base-space)`,
@@ -53,10 +58,6 @@ export function VirtualizedList({ open, virtualizerRef, showItemTooltip, renderC
53
58
  width: 'auto',
54
59
  height: virtualItem.size,
55
60
  transform: `translateY(${virtualItem.start}px)`,
56
- } }, virtualItem.key));
57
- if (tooltipText != null) {
58
- return (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { render: itemElement, children: itemContent }), _jsx(TooltipContent, { side: "right", children: tooltipText })] }, virtualItem.key));
59
- }
60
- return itemElement;
61
+ }, children: tooltipText != null ? (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { render: _jsx("span", { className: "twa:flex twa:min-w-0 twa:flex-1 twa:items-center twa:gap-2" }), children: itemContent }), _jsx(TooltipContent, { side: "right", children: tooltipText })] })) : (itemContent) }, virtualItem.key));
61
62
  }) }) }));
62
63
  }
@@ -36,11 +36,12 @@ const AdaptableComboboxList = (props) => {
36
36
  ? `Create "${itemText}"`
37
37
  : itemText
38
38
  : undefined;
39
- const itemElement = (_jsx(ComboboxItem, { value: item, "aria-label": itemText ?? undefined, className: 'ab-Combobox-Row', disabled: item.disabled, renderCheckboxIndicator: props.renderCheckboxIndicator, children: itemContent }, item.value));
40
- if (tooltipText != null) {
41
- return (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { render: itemElement, children: itemContent }), _jsx(TooltipContent, { side: "right", children: tooltipText })] }, item.value));
42
- }
43
- return itemElement;
39
+ // The Tooltip must wrap the item's inner content rather than the
40
+ // `ComboboxItem` itself: when the tooltip trigger renders the option element
41
+ // it overwrites the option's `id`, which breaks base-ui's
42
+ // `aria-activedescendant` (`${rootId}-${index}`) link and silences screen
43
+ // readers as you navigate the list.
44
+ return (_jsx(ComboboxItem, { value: item, "aria-label": itemText ?? undefined, className: 'ab-Combobox-Row', disabled: item.disabled, renderCheckboxIndicator: props.renderCheckboxIndicator, children: tooltipText != null ? (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { render: _jsx("span", { className: "twa:flex twa:min-w-0 twa:flex-1 twa:items-center twa:gap-2" }), children: itemContent }), _jsx(TooltipContent, { side: "right", children: tooltipText })] })) : (itemContent) }, item.value));
44
45
  };
45
46
  const list = props.groups ? (_jsx(ComboboxList, { className: loadingClassName, children: (group, index) => (_jsxs(React.Fragment, { children: [_jsxs(ComboboxGroup, { items: group.items, children: [group.label && _jsx(ComboboxLabel, { children: group.label }), _jsx(ComboboxCollection, { children: renderItem })] }), index < (props.groups?.length || 0) - 1 && _jsx(ComboboxSeparator, {})] }, typeof group.label === 'string' ? group.label : `${index}`)) })) : props.virtualized ? (_jsx(ComboboxPrimitive.List, { className: cn(loadingClassName, RESIZABLE_VIRTUALIZED_LIST_CLASS), children: _jsx(VirtualizedList, { open: props.open, renderItemLabel: props.renderItemLabel, virtualizerRef: virtualizerRef, showItemTooltip: props.showItemTooltip, renderCheckboxIndicator: props.renderCheckboxIndicator }) })) : (_jsx(ComboboxList, { className: loadingClassName, children: renderItem }));
46
47
  return (_jsxs(_Fragment, { children: [props.showSelectAllCheckbox && (_jsx(ComboboxValue, { children: (selectedItems) => {
@@ -53,6 +54,10 @@ const AdaptableComboboxList = (props) => {
53
54
  : false;
54
55
  return (_jsx(CheckBox, { checked: allChecked, onChange: (checked) => {
55
56
  props.onCheckAllChange?.(checked);
57
+ }, onKeyDown: (e) => {
58
+ if (e.key === 'Enter') {
59
+ props.onCheckAllChange?.(!allChecked);
60
+ }
56
61
  }, onMouseDown: (e) => {
57
62
  // Prevent focus from moving to the checkbox input;
58
63
  // keeps focus on the combobox input so arrow-key navigation still works.
@@ -3,6 +3,17 @@ type SelectItemType = {
3
3
  label: React.ReactNode;
4
4
  value: any;
5
5
  disabled?: boolean;
6
+ /**
7
+ * Explicit accessible name for the item. Use when `label` is a React node
8
+ * (so a readable string can't be derived) and the `value` is not meaningful
9
+ * to assistive technologies.
10
+ */
11
+ ariaLabel?: string;
12
+ /**
13
+ * Tooltip content shown on hover when `showItemTooltip` is enabled. Takes
14
+ * precedence over the label-derived text.
15
+ */
16
+ tooltip?: React.ReactNode;
6
17
  };
7
18
  type SelectGroupType<T extends SelectItemType> = {
8
19
  label: React.ReactNode;
@@ -65,9 +65,12 @@ const NewSelect = (props) => {
65
65
  : undefined, children: _jsx(SelectValue, { placeholder: props.placeholder, className: 'twa:truncate twa:block!', children: renderValueChild }) }), _jsx(SelectContent, { "aria-label": props.ariaLabel ? `${props.ariaLabel} content` : undefined, alignItemWithTrigger: false, container: props.container, stopMouseDownPropagation: props.stopMouseDownPropagation, style: contentStyle, children: groups.map((group, index) => {
66
66
  return (_jsxs(React.Fragment, { children: [_jsxs(SelectGroup, { children: [group.label && _jsx(SelectLabel, { children: group.label }), group.items.map((item) => {
67
67
  const itemTitle = getItemTitle(item.label, item.value);
68
- const tooltipText = props.showItemTooltip ? itemTitle : undefined;
68
+ const tooltipText = props.showItemTooltip ? item.tooltip ?? itemTitle : undefined;
69
69
  const itemContent = item.label;
70
- const itemElement = (_jsx(SelectItem, { value: item.value, "aria-label": itemTitle || undefined, className: 'ab-Select-Row', disabled: item.disabled, children: itemContent }, item.value));
70
+ const itemElement = (_jsx(SelectItem, { value: item.value, "aria-label": item.ariaLabel ||
71
+ itemTitle ||
72
+ (typeof item.tooltip === 'string' ? item.tooltip : undefined) ||
73
+ undefined, className: 'ab-Select-Row', disabled: item.disabled, children: itemContent }, item.value));
71
74
  if (tooltipText != null) {
72
75
  return (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { render: itemElement, children: itemContent }), _jsx(TooltipContent, { side: "right", children: tooltipText })] }, item.value));
73
76
  }
package/src/env.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export default {
2
2
  NEXT_PUBLIC_INFINITE_TABLE_LICENSE_KEY: "StartDate=2021-06-29|EndDate=2030-01-01|Owner=Adaptable|Type=distribution|TS=1624971462479|C=137829811,1004007071,2756196225,1839832928,3994409405,636616862" || '',
3
- PUBLISH_TIMESTAMP: 1782227625016 || Date.now(),
4
- VERSION: "23.0.0" || '--current-version--',
3
+ PUBLISH_TIMESTAMP: 1782298993334 || Date.now(),
4
+ VERSION: "23.0.2" || '--current-version--',
5
5
  };