@adaptabletools/adaptable 23.0.8-canary.0 → 23.0.9

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.8-canary.0",
3
+ "version": "23.0.9",
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",
@@ -330,6 +330,13 @@ export interface ColumnApi {
330
330
  * @param columnId Column to use
331
331
  */
332
332
  getAGGridColDefForColumnId(columnId: string): ColDef | ColGroupDef;
333
+ /**
334
+ * Returns the AdapTable Column that maps to a given AG Grid ColDef
335
+ *
336
+ * The ColDef is matched to a Column by `colId` (falling back to `field`), mirroring how AG Grid derives a Column's `colId`
337
+ * @param colDef AG Grid ColDef to look up
338
+ */
339
+ getColumnForColDef(colDef: ColDef): AdaptableColumn | undefined;
333
340
  /**
334
341
  * Returns the AG Grid Column for a given ColumnId
335
342
  * @param columnId Column to use
@@ -89,6 +89,7 @@ export declare class ColumnApiImpl extends ApiBase implements ColumnApi {
89
89
  getRowGroupedColumns(): AdaptableColumn[];
90
90
  setColumnCaption(columnId: string, caption: string): void;
91
91
  getAGGridColDefForColumnId(columnId: string): ColDef | ColGroupDef;
92
+ getColumnForColDef(colDef: ColDef): AdaptableColumn | undefined;
92
93
  getAGGridColumnForColumnId(columnId: string): Column;
93
94
  hasColumnType(columnIdentifier: string | ColDef, columnType: string): boolean;
94
95
  getColumnSummaryForColumnId(columnId: string): AdaptableColumnSummary;
@@ -522,6 +522,16 @@ export class ColumnApiImpl extends ApiBase {
522
522
  getAGGridColDefForColumnId(columnId) {
523
523
  return this.getAgGridApi().getColumnDef(columnId);
524
524
  }
525
+ getColumnForColDef(colDef) {
526
+ if (!colDef) {
527
+ return undefined;
528
+ }
529
+ const candidateColumnId = colDef.colId ?? colDef.field;
530
+ if (candidateColumnId == undefined) {
531
+ return undefined;
532
+ }
533
+ return this.getColumnWithColumnId(candidateColumnId, false);
534
+ }
525
535
  getAGGridColumnForColumnId(columnId) {
526
536
  return this.getAgGridApi().getColumn(columnId);
527
537
  }
@@ -104,6 +104,10 @@ const AdaptableCombobox_Root = (props) => {
104
104
  eventDetails.cancel?.();
105
105
  return;
106
106
  }
107
+ if (props.searchable === 'menulist' && eventDetails?.reason === 'input-clear' && props.open) {
108
+ eventDetails.cancel?.();
109
+ return;
110
+ }
107
111
  props.onInputValueChange?.(next);
108
112
  };
109
113
  let comboboxItems = props.groups ?? props.items;
@@ -122,6 +126,21 @@ const AdaptableCombobox_Root = (props) => {
122
126
  }
123
127
  return (_jsx(Combobox, { ...props, items: comboboxItems, isItemEqualToValue: isItemEqualToValue, itemToStringLabel: getItemTextLabel, value: internalValue, defaultValue: internalDefaultValue, onValueChange: handleValueChange, onInputValueChange: handleInputValueChange, "aria-label": props.ariaLabel || props['aria-label'], "data-name": props['data-name'], disabled: props.disabled, open: props.open, onOpenChange: props.onOpenChange, multiple: props.multiple, filter: props.filter, autoHighlight: true, children: props.children }));
124
128
  };
129
+ const useMenulistFilterInput = (props, creatableInput) => {
130
+ const isMenulistFilter = props.searchable === 'menulist' && !props.isCreatable;
131
+ const [filterValue, setFilterValue] = React.useState(props.inputValue ?? props.defaultInputValue ?? '');
132
+ if (!isMenulistFilter) {
133
+ return creatableInput;
134
+ }
135
+ const inputValue = props.inputValue !== undefined ? props.inputValue : filterValue;
136
+ const onInputValueChange = (value) => {
137
+ if (props.inputValue === undefined) {
138
+ setFilterValue(value);
139
+ }
140
+ props.onInputValueChange?.(value);
141
+ };
142
+ return { inputValue, onInputValueChange };
143
+ };
125
144
  const useGetAllItems = (props) => {
126
145
  const allItems = props.groups
127
146
  ? props.groups.flatMap((g) => g.items)
@@ -132,7 +151,12 @@ const useGetAllItems = (props) => {
132
151
  const itemByValue = useMemo(() => {
133
152
  return new Map(allItems.map((item) => [item.value, item]));
134
153
  }, [allItems]);
135
- const { inputValue, onInputValueChange, onValueChange, value } = useCreatable(props, allItems, itemByValue);
154
+ const creatableInput = useCreatable(props, allItems, itemByValue);
155
+ const { inputValue, onInputValueChange } = useMenulistFilterInput(props, {
156
+ inputValue: creatableInput.inputValue,
157
+ onInputValueChange: creatableInput.onInputValueChange,
158
+ });
159
+ const { onValueChange, value } = creatableInput;
136
160
  return {
137
161
  value,
138
162
  itemByValue,
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: 1783187213468 || Date.now(),
4
- VERSION: "23.0.8-canary.0" || '--current-version--',
3
+ PUBLISH_TIMESTAMP: 1783674285163 || Date.now(),
4
+ VERSION: "23.0.9" || '--current-version--',
5
5
  };