@adaptabletools/adaptable 23.0.14 → 23.0.15

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/index.css CHANGED
@@ -663,6 +663,9 @@
663
663
  .twa\:h-\[22px\] {
664
664
  height: 22px;
665
665
  }
666
+ .twa\:h-\[24px\] {
667
+ height: 24px;
668
+ }
666
669
  .twa\:h-\[33px\] {
667
670
  height: 33px;
668
671
  }
@@ -867,6 +870,9 @@
867
870
  .twa\:w-\[15rem\] {
868
871
  width: 15rem;
869
872
  }
873
+ .twa\:w-\[36px\] {
874
+ width: 36px;
875
+ }
870
876
  .twa\:w-\[44px\] {
871
877
  width: 44px;
872
878
  }
@@ -3513,6 +3519,19 @@
3513
3519
  background-color: color-mix(in oklab, var(--ab-color-destructive) 20%, transparent);
3514
3520
  }
3515
3521
  }
3522
+ .twa\:\[\&_\.ab-ColorPicker-swatch\]\:absolute .ab-ColorPicker-swatch {
3523
+ position: absolute;
3524
+ }
3525
+ .twa\:\[\&_\.ab-ColorPicker-swatch\]\:inset-0 .ab-ColorPicker-swatch {
3526
+ inset: 0px;
3527
+ }
3528
+ .twa\:\[\&_\.ab-ColorPicker-swatch\]\:size-full .ab-ColorPicker-swatch {
3529
+ width: 100%;
3530
+ height: 100%;
3531
+ }
3532
+ .twa\:\[\&_\.ab-ColorPicker-swatch\]\:opacity-0 .ab-ColorPicker-swatch {
3533
+ opacity: 0%;
3534
+ }
3516
3535
  .twa\:\[\&_\.ab-Input\]\:w-full .ab-Input {
3517
3536
  width: 100%;
3518
3537
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable",
3
- "version": "23.0.14",
3
+ "version": "23.0.15",
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",
@@ -39,9 +39,19 @@ export interface ColumnOptions {
39
39
  */
40
40
  export interface BaseColumnHeaderContext extends BaseContext {
41
41
  /**
42
- * Default header name for Column
42
+ * Resolved header name for the Column — the layout-specific header if one is defined, otherwise the ColDef header.
43
+ * This is the value that would be displayed when no `columnHeader` function is provided.
43
44
  */
44
45
  defaultHeaderName: string;
46
+ /**
47
+ * Original header name from the Column Definition (`headerName`, or a humanised `field` when `headerName` is not set).
48
+ * Never affected by Layout-specific headers.
49
+ */
50
+ colDefHeaderName: string;
51
+ /**
52
+ * Layout-specific header name for the Column, when one is defined in the current Layout's `ColumnHeaders`.
53
+ */
54
+ layoutSpecificHeaderName?: string;
45
55
  /**
46
56
  * Name of Current Layout
47
57
  */
@@ -47,6 +47,7 @@ const DefaultAdaptableOptions = {
47
47
  showMissingColumnsWarning: true,
48
48
  addColumnGroupToColumnFriendlyName: false,
49
49
  columnHeader: undefined,
50
+ alwaysCallHeaderFunction: false,
50
51
  },
51
52
  columnMenuOptions: {
52
53
  customColumnMenu: undefined,
@@ -61,18 +61,20 @@ export class ColumnInternalApi extends ApiBase {
61
61
  const columnParams = params;
62
62
  const isColumnGroup = !!params.columnGroup;
63
63
  const columnGroupParams = params;
64
- const defaultHeaderName = params.colDef?.headerName ??
64
+ const colDefHeaderName = params.colDef?.headerName ??
65
65
  (isColumn ? StringExtensions.CamelCaseToHumanText(columnParams.colDef?.field) : '') ??
66
66
  '';
67
67
  if (params.location !== 'header') {
68
- return defaultHeaderName;
68
+ return colDefHeaderName;
69
69
  }
70
- const layoutSpecificCustomHeader = this.getLayoutApi().getCurrentLayout().ColumnHeaders?.[isColumn ? columnParams.column.getColId() : columnGroupParams.columnGroup.getGroupId()];
71
- if (layoutSpecificCustomHeader) {
72
- return layoutSpecificCustomHeader;
70
+ const layoutSpecificHeaderName = this.getLayoutApi().getCurrentLayout().ColumnHeaders?.[isColumn ? columnParams.column.getColId() : columnGroupParams.columnGroup.getGroupId()];
71
+ const defaultHeaderName = layoutSpecificHeaderName ?? colDefHeaderName;
72
+ const alwaysCallHeaderFunction = this.getColumnOptions().alwaysCallHeaderFunction;
73
+ if (layoutSpecificHeaderName && !alwaysCallHeaderFunction) {
74
+ return layoutSpecificHeaderName;
73
75
  }
74
76
  if (typeof this.getColumnOptions().columnHeader === 'function') {
75
- const columnHeaderContext = this.buildColumnHeaderContext(params, defaultHeaderName);
77
+ const columnHeaderContext = this.buildColumnHeaderContext(params, colDefHeaderName, layoutSpecificHeaderName);
76
78
  if (columnHeaderContext === 'skip') {
77
79
  return defaultHeaderName;
78
80
  }
@@ -81,12 +83,14 @@ export class ColumnInternalApi extends ApiBase {
81
83
  }
82
84
  return defaultHeaderName;
83
85
  }
84
- buildColumnHeaderContext(params, defaultHeaderName) {
86
+ buildColumnHeaderContext(params, colDefHeaderName, layoutSpecificHeaderName) {
85
87
  const currentLayoutType = this.getLayoutApi().isCurrentLayoutPivot() ? 'pivot' : 'table';
86
88
  const currentLayout = this.getLayoutApi().getCurrentLayout();
87
89
  const baseContext = {
88
90
  ...this.getAdaptableApi().internalApi.buildBaseContext(),
89
- defaultHeaderName,
91
+ defaultHeaderName: layoutSpecificHeaderName ?? colDefHeaderName,
92
+ colDefHeaderName,
93
+ layoutSpecificHeaderName,
90
94
  currentLayout,
91
95
  currentLayoutName: currentLayout.Name,
92
96
  currentLayoutType: currentLayoutType,
@@ -1,5 +1,4 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useEffect, useRef } from 'react';
3
2
  import { Box, Flex } from '../Flex';
4
3
  import SimpleButton from '../SimpleButton';
5
4
  import { twMerge } from '../../twMerge';
@@ -7,20 +6,8 @@ import { ColorPicker } from './ColorPicker';
7
6
  const DEFAULT_COLOR = '#000000';
8
7
  export const OptionalColorPicker = (props) => {
9
8
  const { api, value, onChange, defaultColor = DEFAULT_COLOR, disabled = false, includeAlpha = true, className, } = props;
10
- const pickerRef = useRef(null);
11
- const pendingOpenRef = useRef(false);
12
- useEffect(() => {
13
- if (pendingOpenRef.current && value && pickerRef.current) {
14
- pendingOpenRef.current = false;
15
- pickerRef.current.click();
16
- }
17
- }, [value]);
18
- const handleActivate = () => {
19
- pendingOpenRef.current = true;
20
- onChange(defaultColor);
21
- };
22
9
  if (!value) {
23
- return (_jsxs(Flex, { alignItems: "center", className: twMerge('OptionalColorPicker twa:gap-1', className), children: [_jsx("button", { type: "button", disabled: disabled, className: "ab-OptionalColorPicker-empty", onClick: handleActivate, "aria-label": "Set colour", title: "Click to set colour" }), _jsx(Box, { className: "twa:text-2 twa:text-muted-foreground", children: "None" })] }));
10
+ return (_jsxs(Flex, { alignItems: "center", className: twMerge('OptionalColorPicker twa:gap-1', className), children: [_jsxs(Box, { className: "twa:relative twa:w-[36px] twa:h-[24px] twa:shrink-0", children: [_jsx(Box, { className: "ab-OptionalColorPicker-empty twa:absolute twa:inset-0 twa:pointer-events-none", "aria-hidden": true }), _jsx(ColorPicker, { api: api, value: defaultColor, disabled: disabled, includeAlpha: false, onChange: onChange, title: "Click to set colour", className: twMerge('twa:absolute twa:inset-0 twa:gap-0', 'twa:[&_.ab-ColorPicker-swatch]:absolute twa:[&_.ab-ColorPicker-swatch]:inset-0', 'twa:[&_.ab-ColorPicker-swatch]:size-full twa:[&_.ab-ColorPicker-swatch]:opacity-0') })] }), _jsx(Box, { className: "twa:text-2 twa:text-muted-foreground", children: "None" })] }));
24
11
  }
25
- return (_jsxs(Flex, { alignItems: "center", className: twMerge('OptionalColorPicker twa:gap-1', className), children: [_jsx(ColorPicker, { ref: pickerRef, api: api, value: value, disabled: disabled, includeAlpha: includeAlpha, onChange: onChange }), _jsx(SimpleButton, { icon: "close", variant: "text", disabled: disabled, tooltip: "Clear colour", onClick: () => onChange(undefined) })] }));
12
+ return (_jsxs(Flex, { alignItems: "center", className: twMerge('OptionalColorPicker twa:gap-1', className), children: [_jsx(ColorPicker, { api: api, value: value, disabled: disabled, includeAlpha: includeAlpha, onChange: onChange }), _jsx(SimpleButton, { icon: "close", variant: "text", disabled: disabled, tooltip: "Clear colour", onClick: () => onChange(undefined) })] }));
26
13
  };
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: 1784643848184 || Date.now(),
4
- VERSION: "23.0.14" || '--current-version--',
3
+ PUBLISH_TIMESTAMP: 1785238938170 || Date.now(),
4
+ VERSION: "23.0.15" || '--current-version--',
5
5
  };