@adaptabletools/adaptable 23.0.2 → 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",
3
- "version": "23.0.2",
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';
@@ -20,14 +20,14 @@ export class ThemeService {
20
20
  document.adoptedStyleSheets = [...document.adoptedStyleSheets].filter((sheet) => sheet !== this.styleSheetObject);
21
21
  }
22
22
  subscribe() {
23
- const themeChangedUnsubscribe = this.api.eventApi.on('ThemeSelected', this.onThemeChanged);
23
+ const themeChangedUnsubscribe = this.api.eventApi.on('ThemeSelected', this.onThemeSelected);
24
24
  const prefferedColorSchemeUnsubscribe = this.attachPrefferedColorSchemeListener();
25
25
  this.unsubscribe = () => {
26
26
  themeChangedUnsubscribe();
27
27
  prefferedColorSchemeUnsubscribe();
28
28
  };
29
29
  }
30
- onThemeChanged = () => {
30
+ onThemeSelected = () => {
31
31
  let currentTheme = this.api.themeApi.getCurrentThemeObject();
32
32
  currentTheme = this.mapOsTheme(currentTheme);
33
33
  this.applyNewThemeVariables(currentTheme);
@@ -7,7 +7,7 @@ import { useAdaptable } from '../../../AdaptableContext';
7
7
  import { getActionPanelSize, getMiddlePosition, getSettingsPanelSize } from '../Utilities';
8
8
  import { cn } from '../../../../lib/utils';
9
9
  const WindowDialog = (props) => {
10
- const { onChange, style, baseClassName, className, isActionModule, settingsPanelOptionsKey, onHide, ...dialogProps } = props;
10
+ const { onChange, style, baseClassName, className, isActionModule, settingsPanelOptionsKey, onHide, dataName, ...dialogProps } = props;
11
11
  const adaptable = useAdaptable();
12
12
  const dispatch = useDispatch();
13
13
  const settingsPanelOptions = adaptable.adaptableOptions.settingsPanelOptions;
@@ -34,7 +34,7 @@ const WindowDialog = (props) => {
34
34
  position: popupSettings.position,
35
35
  onChange: handleWindowSettings,
36
36
  };
37
- return (_jsx(Dialog, { windowModal: true, fixed: false, windowModalProps: windowModalProps, style: props.style, onDismiss: onHide, isOpen: true, showCloseButton: true, ...dialogProps, className: cn('twa:p-0 twa:h-full', className) }));
37
+ return (_jsx(Dialog, { "data-name": dataName, windowModal: true, fixed: false, windowModalProps: windowModalProps, style: props.style, onDismiss: onHide, isOpen: true, showCloseButton: true, ...dialogProps, className: cn('twa:p-0 twa:h-full', className) }));
38
38
  };
39
39
  const PopupDialog = (props) => {
40
40
  const { style, className, onHide, children, ...dialogProps } = props;
@@ -35,6 +35,10 @@ export const agGridDataTypeDefinitions = {
35
35
  // boolean: is kept as is
36
36
  // object: is kept as is
37
37
  // Adaptable specific types
38
+ unknown: {
39
+ baseDataType: 'text',
40
+ extendsDataType: 'text',
41
+ },
38
42
  [TEXT_ARRAY_DATA_TYPE]: {
39
43
  baseDataType: 'text',
40
44
  extendsDataType: 'text',
@@ -100,9 +100,22 @@ export const WindowModal = (props) => {
100
100
  }
101
101
  }, []);
102
102
  const ResizableCmp = Resizable;
103
+ // React propagates events through the component tree, not the DOM tree. A
104
+ // nested popup (e.g. a modal wizard) rendered as a React child of this window
105
+ // is portaled elsewhere in the DOM, so a mousedown inside it would bubble here
106
+ // and incorrectly bring this window to the front (covering the popup). Guard
107
+ // against this by only reacting to mousedowns that happen inside this window's
108
+ // own DOM subtree.
109
+ const handleMouseDown = (event) => {
110
+ const node = targetRef.current;
111
+ if (node && event.target instanceof Node && !node.contains(event.target)) {
112
+ return;
113
+ }
114
+ stacking.bringInFront();
115
+ };
103
116
  return createPortal(_jsx("div", { style: style,
104
117
  //@ts-ignore
105
- ref: targetRef, onMouseDown: stacking.bringInFront, children: _jsx(ResizableCmp, { minWidth: props.minWidth, minHeight: props.minHeight, onResizeStop: handleResizeStop, onResize: handleResize, bounds: "window", defaultSize: {
118
+ ref: targetRef, onMouseDown: handleMouseDown, children: _jsx(ResizableCmp, { minWidth: props.minWidth, minHeight: props.minHeight, onResizeStop: handleResizeStop, onResize: handleResize, bounds: "window", defaultSize: {
106
119
  width: props.size.width,
107
120
  height: props.size.height,
108
121
  }, children: props.children }) }), portalElement);
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: 1782298993334 || Date.now(),
4
- VERSION: "23.0.2" || '--current-version--',
3
+ PUBLISH_TIMESTAMP: 1782392443346 || Date.now(),
4
+ VERSION: "23.0.3" || '--current-version--',
5
5
  };