@adaptabletools/adaptable-cjs 23.0.1 → 23.0.3

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-cjs",
3
- "version": "23.0.1",
3
+ "version": "23.0.3",
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",
@@ -7,7 +7,7 @@ import { CustomRenderContext } from '../agGrid/AdaptableFrameworkComponent';
7
7
  */
8
8
  export interface SettingsPanelOptions {
9
9
  /**
10
- * Title for the Settings Panel
10
+ * Title for Settings Panel
11
11
  *
12
12
  * @defaultValue 'Settings Panel'
13
13
  */
@@ -45,7 +45,7 @@ export interface SettingsPanelOptions {
45
45
  */
46
46
  navigation?: SettingsPanelNavigationConfigurer;
47
47
  /**
48
- * Initial position of Settings Panel window
48
+ * Initial position of Settings Panel — pixel offset of top-left corner from top-left of viewport (requires `popupType` to be `'window'`)
49
49
  *
50
50
  * @defaultValue Middle of Screen
51
51
  */
@@ -54,7 +54,7 @@ export interface SettingsPanelOptions {
54
54
  y: number;
55
55
  };
56
56
  /**
57
- * Initial size of Settings Panel
57
+ * Initial size (in pixels) of Settings Panel (requires `popupType` to be `'window'`)
58
58
  *
59
59
  * @defaultValue Computed based on size of screen
60
60
  */
@@ -63,7 +63,7 @@ export interface SettingsPanelOptions {
63
63
  height: number;
64
64
  };
65
65
  /**
66
- * Whether Settings Panel is 'window' (i.e. movable, resizable, no backdrop) or 'modal' (centre of screen with backdrop)
66
+ * How the Settings Panel is rendered: `'modal'` (centred and unmovable and resizable) or `'window'` (supports size, position, drag and resize)
67
67
  *
68
68
  * @defaultValue 'modal'
69
69
  */
@@ -7,7 +7,7 @@ export declare class ThemeService implements IThemeService {
7
7
  constructor(api: AdaptableApi);
8
8
  destroy(): void;
9
9
  subscribe(): void;
10
- onThemeChanged: () => void;
10
+ onThemeSelected: () => void;
11
11
  applyNewThemeVariables(theme: AdaptableTheme): void;
12
12
  showMissingThemeFiles(theme: AdaptableTheme): void;
13
13
  getDOMPrefferedColorScheme(): 'dark' | 'light';
@@ -23,14 +23,14 @@ class ThemeService {
23
23
  document.adoptedStyleSheets = [...document.adoptedStyleSheets].filter((sheet) => sheet !== this.styleSheetObject);
24
24
  }
25
25
  subscribe() {
26
- const themeChangedUnsubscribe = this.api.eventApi.on('ThemeSelected', this.onThemeChanged);
26
+ const themeChangedUnsubscribe = this.api.eventApi.on('ThemeSelected', this.onThemeSelected);
27
27
  const prefferedColorSchemeUnsubscribe = this.attachPrefferedColorSchemeListener();
28
28
  this.unsubscribe = () => {
29
29
  themeChangedUnsubscribe();
30
30
  prefferedColorSchemeUnsubscribe();
31
31
  };
32
32
  }
33
- onThemeChanged = () => {
33
+ onThemeSelected = () => {
34
34
  let currentTheme = this.api.themeApi.getCurrentThemeObject();
35
35
  currentTheme = this.mapOsTheme(currentTheme);
36
36
  this.applyNewThemeVariables(currentTheme);
@@ -48,11 +48,12 @@ const FloatingFilter = (props) => {
48
48
  const operatorOptions = props.predicateDefs.map((predicateDef) => ({
49
49
  label: ((0, jsx_runtime_1.jsxs)(Flex_1.Box, { className: "twa:flex twa:items-center", children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:mr-2 twa:flex twa:items-center", children: predicateDef.icon }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:truncate", "data-name": "filter-predicate-label", "data-label": predicateDef.label, children: predicateDef.label })] })),
50
50
  tooltip: predicateDef.label,
51
+ ariaLabel: predicateDef.label,
51
52
  value: predicateDef.operator,
52
53
  }));
53
54
  const renderTriggerValue = () => ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { alignItems: "center", className: "twa:min-w-0", children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:flex twa:items-center", children: !isManualApply && singleFilterPredicateDef?.icon ? (singleFilterPredicateDef?.icon) : ((0, jsx_runtime_1.jsx)(AdaptableIconComponent_1.AdaptableIconComponent, { icon: { name: 'filter' } })) }), showLabel && ((0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "ab-FloatingFilter-label twa:ml-2 twa:flex-1 twa:truncate", title: label, children: label }))] }));
54
55
  let filterDropdown = null;
55
- const filterDropdownSelect = ((0, jsx_runtime_1.jsx)(NewSelect_1.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) => {
56
+ const filterDropdownSelect = ((0, jsx_runtime_1.jsx)(NewSelect_1.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) => {
56
57
  // In non-inline mode the select doesn't pick an operator inline; opening it
57
58
  // instead opens the full column filter popup, so keep the dropdown closed.
58
59
  if (nextOpen && !isInlineEditable) {
@@ -11,7 +11,7 @@ const AdaptableContext_1 = require("../../../AdaptableContext");
11
11
  const Utilities_1 = require("../Utilities");
12
12
  const utils_1 = require("../../../../lib/utils");
13
13
  const WindowDialog = (props) => {
14
- const { onChange, style, baseClassName, className, isActionModule, settingsPanelOptionsKey, onHide, ...dialogProps } = props;
14
+ const { onChange, style, baseClassName, className, isActionModule, settingsPanelOptionsKey, onHide, dataName, ...dialogProps } = props;
15
15
  const adaptable = (0, AdaptableContext_1.useAdaptable)();
16
16
  const dispatch = (0, react_redux_1.useDispatch)();
17
17
  const settingsPanelOptions = adaptable.adaptableOptions.settingsPanelOptions;
@@ -38,7 +38,7 @@ const WindowDialog = (props) => {
38
38
  position: popupSettings.position,
39
39
  onChange: handleWindowSettings,
40
40
  };
41
- return ((0, jsx_runtime_1.jsx)(Dialog_1.default, { windowModal: true, fixed: false, windowModalProps: windowModalProps, style: props.style, onDismiss: onHide, isOpen: true, showCloseButton: true, ...dialogProps, className: (0, utils_1.cn)('twa:p-0 twa:h-full', className) }));
41
+ return ((0, jsx_runtime_1.jsx)(Dialog_1.default, { "data-name": dataName, windowModal: true, fixed: false, windowModalProps: windowModalProps, style: props.style, onDismiss: onHide, isOpen: true, showCloseButton: true, ...dialogProps, className: (0, utils_1.cn)('twa:p-0 twa:h-full', className) }));
42
42
  };
43
43
  const PopupDialog = (props) => {
44
44
  const { style, className, onHide, children, ...dialogProps } = props;
@@ -38,6 +38,10 @@ exports.agGridDataTypeDefinitions = {
38
38
  // boolean: is kept as is
39
39
  // object: is kept as is
40
40
  // Adaptable specific types
41
+ unknown: {
42
+ baseDataType: 'text',
43
+ extendsDataType: 'text',
44
+ },
41
45
  [exports.TEXT_ARRAY_DATA_TYPE]: {
42
46
  baseDataType: 'text',
43
47
  extendsDataType: 'text',
@@ -58,6 +58,10 @@ const AdaptableComboboxList = (props) => {
58
58
  : false;
59
59
  return ((0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { checked: allChecked, onChange: (checked) => {
60
60
  props.onCheckAllChange?.(checked);
61
+ }, onKeyDown: (e) => {
62
+ if (e.key === 'Enter') {
63
+ props.onCheckAllChange?.(!allChecked);
64
+ }
61
65
  }, onMouseDown: (e) => {
62
66
  // Prevent focus from moving to the checkbox input;
63
67
  // 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;
@@ -69,9 +69,12 @@ const NewSelect = (props) => {
69
69
  : undefined, children: (0, jsx_runtime_1.jsx)(select_1.SelectValue, { placeholder: props.placeholder, className: 'twa:truncate twa:block!', children: renderValueChild }) }), (0, jsx_runtime_1.jsx)(select_1.SelectContent, { "aria-label": props.ariaLabel ? `${props.ariaLabel} content` : undefined, alignItemWithTrigger: false, container: props.container, stopMouseDownPropagation: props.stopMouseDownPropagation, style: contentStyle, children: groups.map((group, index) => {
70
70
  return ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsxs)(select_1.SelectGroup, { children: [group.label && (0, jsx_runtime_1.jsx)(select_1.SelectLabel, { children: group.label }), group.items.map((item) => {
71
71
  const itemTitle = getItemTitle(item.label, item.value);
72
- const tooltipText = props.showItemTooltip ? itemTitle : undefined;
72
+ const tooltipText = props.showItemTooltip ? item.tooltip ?? itemTitle : undefined;
73
73
  const itemContent = item.label;
74
- const itemElement = ((0, jsx_runtime_1.jsx)(select_1.SelectItem, { value: item.value, "aria-label": itemTitle || undefined, className: 'ab-Select-Row', disabled: item.disabled, children: itemContent }, item.value));
74
+ const itemElement = ((0, jsx_runtime_1.jsx)(select_1.SelectItem, { value: item.value, "aria-label": item.ariaLabel ||
75
+ itemTitle ||
76
+ (typeof item.tooltip === 'string' ? item.tooltip : undefined) ||
77
+ undefined, className: 'ab-Select-Row', disabled: item.disabled, children: itemContent }, item.value));
75
78
  if (tooltipText != null) {
76
79
  return ((0, jsx_runtime_1.jsxs)(tooltip_1.Tooltip, { children: [(0, jsx_runtime_1.jsx)(tooltip_1.TooltipTrigger, { render: itemElement, children: itemContent }), (0, jsx_runtime_1.jsx)(tooltip_1.TooltipContent, { side: "right", children: tooltipText })] }, item.value));
77
80
  }
@@ -104,9 +104,22 @@ const WindowModal = (props) => {
104
104
  }
105
105
  }, []);
106
106
  const ResizableCmp = re_resizable_1.Resizable;
107
+ // React propagates events through the component tree, not the DOM tree. A
108
+ // nested popup (e.g. a modal wizard) rendered as a React child of this window
109
+ // is portaled elsewhere in the DOM, so a mousedown inside it would bubble here
110
+ // and incorrectly bring this window to the front (covering the popup). Guard
111
+ // against this by only reacting to mousedowns that happen inside this window's
112
+ // own DOM subtree.
113
+ const handleMouseDown = (event) => {
114
+ const node = targetRef.current;
115
+ if (node && event.target instanceof Node && !node.contains(event.target)) {
116
+ return;
117
+ }
118
+ stacking.bringInFront();
119
+ };
107
120
  return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)("div", { style: style,
108
121
  //@ts-ignore
109
- ref: targetRef, onMouseDown: stacking.bringInFront, children: (0, jsx_runtime_1.jsx)(ResizableCmp, { minWidth: props.minWidth, minHeight: props.minHeight, onResizeStop: handleResizeStop, onResize: handleResize, bounds: "window", defaultSize: {
122
+ ref: targetRef, onMouseDown: handleMouseDown, children: (0, jsx_runtime_1.jsx)(ResizableCmp, { minWidth: props.minWidth, minHeight: props.minHeight, onResizeStop: handleResizeStop, onResize: handleResize, bounds: "window", defaultSize: {
110
123
  width: props.size.width,
111
124
  height: props.size.height,
112
125
  }, children: props.children }) }), portalElement);
package/src/env.js CHANGED
@@ -2,6 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = {
4
4
  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" || '',
5
- PUBLISH_TIMESTAMP: 1782250584329 || Date.now(),
6
- VERSION: "23.0.1" || '--current-version--',
5
+ PUBLISH_TIMESTAMP: 1782392473893 || Date.now(),
6
+ VERSION: "23.0.3" || '--current-version--',
7
7
  };