@adaptabletools/adaptable-cjs 21.1.0-canary.3 → 21.1.1

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": "21.1.0-canary.3",
3
+ "version": "21.1.1",
4
4
  "description": "Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements",
5
5
  "keywords": [
6
6
  "web-components",
@@ -220,7 +220,7 @@ const DefaultAdaptableOptions = {
220
220
  systemFlashingCellPredicates: AdaptablePredicate_1.SystemFlashingCellPredicateIds,
221
221
  systemBadgeStylePredicates: AdaptablePredicate_1.SystemBadgeStylePredicateIds,
222
222
  caseSensitivePredicates: false,
223
- evaluateInPredicateUsingTime: true,
223
+ evaluateInPredicateUsingTime: false,
224
224
  },
225
225
  quickSearchOptions: {
226
226
  clearQuickSearchOnStartUp: false,
@@ -38,8 +38,8 @@ export interface PredicateOptions {
38
38
  caseSensitivePredicates?: boolean | ((context: AdaptableColumnContext) => boolean);
39
39
  /**
40
40
  *
41
- * Should Values (IN) Predicate evaluate using datetime (rather than date)
42
- * @defaultValue true
41
+ * Should In Predicate evaluate using datetime, rather than date (the default)
42
+ * @defaultValue false
43
43
  * @noCodeItem
44
44
  */
45
45
  evaluateInPredicateUsingTime?: boolean | ((context: AdaptableColumnContext) => boolean);
@@ -20,4 +20,4 @@ export interface LayoutChangedInfo extends BaseContext {
20
20
  /**
21
21
  * Trigger for Layout Changed Event
22
22
  */
23
- export type LayoutChangedAction = 'ADAPTABLE_READY' | 'LAYOUT_ADD' | 'LAYOUT_EDIT' | 'LAYOUT_SAVE' | 'LAYOUT_DELETE' | 'LAYOUT_SELECT' | 'LAYOUT_COLUMN_FILTER_ADD' | 'LAYOUT_COLUMN_FILTER_EDIT' | 'LAYOUT_COLUMN_FILTER_SET' | 'LAYOUT_COLUMN_FILTER_CLEAR' | 'LAYOUT_COLUMN_FILTER_CLEAR_ALL' | 'LAYOUT_COLUMN_FILTER_SUSPEND' | 'LAYOUT_COLUMN_FILTER_SUSPEND_ALL' | 'LAYOUT_COLUMN_FILTER_UNSUSPEND' | 'LAYOUT_COLUMN_FILTER_UNSUSPEND_ALL' | 'LAYOUT_GRID_FILTER_SET' | 'LAYOUT_GRID_FILTER_CLEAR' | 'LAYOUT_GRID_FILTER_SUSPEND' | 'LAYOUT_GRID_FILTER_UNSUSPEND';
23
+ export type LayoutChangedAction = 'LAYOUT_READY' | 'LAYOUT_ADD' | 'LAYOUT_EDIT' | 'LAYOUT_SAVE' | 'LAYOUT_DELETE' | 'LAYOUT_SELECT' | 'LAYOUT_COLUMN_FILTER_ADD' | 'LAYOUT_COLUMN_FILTER_EDIT' | 'LAYOUT_COLUMN_FILTER_SET' | 'LAYOUT_COLUMN_FILTER_CLEAR' | 'LAYOUT_COLUMN_FILTER_CLEAR_ALL' | 'LAYOUT_COLUMN_FILTER_SUSPEND' | 'LAYOUT_COLUMN_FILTER_SUSPEND_ALL' | 'LAYOUT_COLUMN_FILTER_UNSUSPEND' | 'LAYOUT_COLUMN_FILTER_UNSUSPEND_ALL' | 'LAYOUT_GRID_FILTER_SET' | 'LAYOUT_GRID_FILTER_CLEAR' | 'LAYOUT_GRID_FILTER_SUSPEND' | 'LAYOUT_GRID_FILTER_UNSUSPEND';
@@ -64,9 +64,9 @@ export interface LayoutApi {
64
64
  getExtendedLayoutByName(layoutName: string): ExtendedLayout | undefined;
65
65
  /**
66
66
  * Creates (or Updates) an Extended Layout
67
- * @param extendedLayoutInfo extendedLayout to Create
67
+ * @param extendedLayout extendedLayout to Create
68
68
  */
69
- createOrUpdateExtendedLayout(extendedLayoutInfo: ExtendedLayout): void;
69
+ createOrUpdateExtendedLayout(extendedLayout: ExtendedLayout): void;
70
70
  /**
71
71
  * Retrieves all Layouts in Adaptable State
72
72
  * @returns layouts
@@ -38,7 +38,7 @@ class LayoutModule extends AdaptableModuleBase_1.AdaptableModuleBase {
38
38
  if (this.api.isDestroyed()) {
39
39
  return;
40
40
  }
41
- this.api.eventApi.internalApi.fireLayoutChangedEvent('ADAPTABLE_READY', null, this.api.layoutApi.getLayoutState());
41
+ this.api.eventApi.internalApi.fireLayoutChangedEvent('LAYOUT_READY', null, this.api.layoutApi.getLayoutState());
42
42
  });
43
43
  }
44
44
  getModuleAdaptableObjects() {
@@ -3958,13 +3958,19 @@ You need to define at least one Layout!`);
3958
3958
  const prevLayoutForRefresh = this.__prevLayoutForRefresh || this.api.layoutApi.getCurrentLayout();
3959
3959
  // see #on-regroup-expect-group-column-to-be-recomputed-and-setup-properly
3960
3960
  const rowGroupsChanged = this.isRowGroupDifferentInLayout(prevLayoutForRefresh, layout);
3961
- // when grouping changes, if we have a filter on the grouped column, we need to remove it
3962
- // as it is no longer valid
3963
- if (rowGroupsChanged && layout.ColumnFilters) {
3964
- const newFilters = layout.ColumnFilters.filter((filter) => filter.ColumnId !== GeneralConstants_1.AG_GRID_GROUPED_COLUMN);
3965
- if (newFilters.length != layout.ColumnFilters.length) {
3966
- layout = { ...layout };
3967
- layout.ColumnFilters = newFilters;
3961
+ if (rowGroupsChanged) {
3962
+ // when grouping changes, if we have a filter on the grouped column, we need to remove it
3963
+ // as it is no longer valid
3964
+ if (layout.ColumnFilters) {
3965
+ const newFilters = layout.ColumnFilters.filter((filter) => filter.ColumnId !== GeneralConstants_1.AG_GRID_GROUPED_COLUMN);
3966
+ if (newFilters.length != layout.ColumnFilters.length) {
3967
+ layout = { ...layout };
3968
+ layout.ColumnFilters = newFilters;
3969
+ }
3970
+ }
3971
+ // also we need to reset the cache for the group column, when we have rowGripDisplayType single
3972
+ if (layout.RowGroupDisplayType === 'single') {
3973
+ this.api.filterApi.columnFilterApi.resetFilterValues(GeneralConstants_1.AG_GRID_GROUPED_COLUMN);
3968
3974
  }
3969
3975
  }
3970
3976
  const hasPivotTotalsInLayout = this.hasPivotTotalsInLayout(prevLayoutForRefresh, layout);
@@ -112,7 +112,7 @@ class AgGridExportAdapter {
112
112
  };
113
113
  }
114
114
  catch (error) {
115
- this.logger.consoleError(`Error exporting ${report.Name} in ${format} format to ${config.destination}`, error.message);
115
+ this.logger.consoleError(`Error exporting ${report.Name} in ${format} format to ${config.destination}`, error.stack);
116
116
  }
117
117
  finally {
118
118
  /**
@@ -417,9 +417,9 @@ class AgGridExportAdapter {
417
417
  }
418
418
  const getColIdAndRawValue = () => {
419
419
  if (this.adaptableApi.columnApi.isAutoRowGroupColumn(agColumn?.getColId())) {
420
- const columnId = rowNode.field ??
421
- rowNode.rowGroupColumn?.getColId() ??
422
- rowNode.rowGroupColumn?.getColDef()?.field;
420
+ const columnId = rowNode.rowGroupColumn?.getColId() ??
421
+ rowNode.rowGroupColumn?.getColDef()?.field ??
422
+ rowNode.field;
423
423
  let rawValue = rowNode.key;
424
424
  return { columnId, rawValue };
425
425
  }
@@ -28,7 +28,7 @@ function toDisplayValueDefault(value) {
28
28
  return value.map((v) => (Array.isArray(v) ? v.join('-') : v)).join(', ');
29
29
  }
30
30
  exports.toDisplayValueDefault = toDisplayValueDefault;
31
- const getLabelColumn = (field) => {
31
+ const getLabelColumn = (field, { includeExpandCollapseButton }) => {
32
32
  return {
33
33
  field,
34
34
  defaultFlex: 1,
@@ -63,14 +63,14 @@ const getLabelColumn = (field) => {
63
63
  api.focus();
64
64
  } }),
65
65
  React.createElement(rebass_1.Flex, { flex: 1 }),
66
- React.createElement(SimpleButton_1.default, { label: "toggle-expand-collapse", icon: allFirstLevelCollapsed ? 'expand-all' : 'collapse-all', onMouseDown: () => {
66
+ includeExpandCollapseButton ? (React.createElement(SimpleButton_1.default, { label: "toggle-expand-collapse", icon: allFirstLevelCollapsed ? 'expand-all' : 'collapse-all', onMouseDown: () => {
67
67
  if (allFirstLevelCollapsed) {
68
68
  dataSourceApi.treeApi.expandAll();
69
69
  }
70
70
  else {
71
71
  dataSourceApi.treeApi.collapseAll();
72
72
  }
73
- }, iconPosition: "end" }, allFirstLevelCollapsed ? 'Expand All' : 'Collapse All')));
73
+ }, iconPosition: "end" }, allFirstLevelCollapsed ? 'Expand All' : 'Collapse All')) : null));
74
74
  },
75
75
  };
76
76
  };
@@ -94,11 +94,6 @@ function TreeDropdown(props) {
94
94
  const [treeExpandState, setTreeExpandState] = (0, react_1.useState)(undefined);
95
95
  const [searchValue, setSearchValue] = (0, react_1.useState)('');
96
96
  const labelField = props.labelField ?? 'label';
97
- const columns = (0, react_1.useMemo)(() => {
98
- return {
99
- label: getLabelColumn(labelField),
100
- };
101
- }, [labelField]);
102
97
  const [stateValue, setStateValue] = (0, react_1.useState)(props.value !== undefined ? props.value : props.defaultValue || []);
103
98
  const onChange = (0, react_1.useCallback)((value) => {
104
99
  const paths = value instanceof InfiniteTable_1.TreeSelectionState
@@ -120,6 +115,14 @@ function TreeDropdown(props) {
120
115
  const rowCount = (0, react_1.useMemo)(() => {
121
116
  return getRowCount(props.options);
122
117
  }, [props.options]);
118
+ const hasChildren = rowCount > props.options.length;
119
+ const columns = (0, react_1.useMemo)(() => {
120
+ return {
121
+ label: getLabelColumn(labelField, {
122
+ includeExpandCollapseButton: hasChildren,
123
+ }),
124
+ };
125
+ }, [labelField, hasChildren]);
123
126
  const [size, setSize] = (0, react_1.useState)({
124
127
  width: 0,
125
128
  height: rowCount * 35,
@@ -196,7 +199,13 @@ function TreeDropdown(props) {
196
199
  React.createElement(NotifyResize_1.default, { onResize: (newSize) => {
197
200
  setWidth(newSize.width);
198
201
  } }),
199
- React.createElement(OverlayTrigger_1.default, { visible: visible, targetOffset: 20, render: () => {
202
+ React.createElement(OverlayTrigger_1.default, { visible: visible, targetOffset: 20, alignPosition: [
203
+ // overlay - target
204
+ ['TopLeft', 'BottomLeft'],
205
+ ['TopRight', 'BottomRight'],
206
+ ['BottomLeft', 'TopLeft'],
207
+ ['BottomRight', 'TopRight'],
208
+ ], render: () => {
200
209
  const minWidth = listSizeConstraints?.minWidth ||
201
210
  computedCSSVars['--ab-cmp-select-menu__min-width'] ||
202
211
  240;
@@ -208,19 +217,24 @@ function TreeDropdown(props) {
208
217
  computedCSSVars['--ab-cmp-select-menu__max-height'] ||
209
218
  '50vh';
210
219
  const resizable = getProps().resizable;
211
- const treeList = (React.createElement(TreeList_1.TreeList, { primaryKey: props.primaryKey ?? 'id', treeFilterFunction: filterFunction, columnHeaderHeight: 40, onReady: ({ api }) => {
220
+ const treeListStyle = resizable
221
+ ? { ...sizeFull }
222
+ : {
223
+ width: size.width,
224
+ height: size.height,
225
+ maxWidth,
226
+ minHeight,
227
+ maxHeight,
228
+ minWidth,
229
+ };
230
+ if (!hasChildren) {
231
+ // @ts-ignore - don't leave any space for the > expand icon, as there are no children
232
+ treeListStyle['--infinite-group-row-column-nesting'] = 'var(--ab-space-2)';
233
+ }
234
+ const treeList = (React.createElement(TreeList_1.TreeList, { primaryKey: props.primaryKey ?? 'id', treeFilterFunction: filterFunction, columnHeaderHeight: 32, onReady: ({ api }) => {
212
235
  setTreeListApi(api);
213
236
  api.focus();
214
- }, defaultTreeExpandState: treeExpandState, onTreeExpandStateChange: setTreeExpandState, columns: columns, options: props.options, treeSelection: treeSelection, onTreeSelectionChange: (0, InfiniteTable_1.withSelectedLeafNodesOnly)(onChange), style: resizable
215
- ? sizeFull
216
- : {
217
- width: size.width,
218
- height: size.height,
219
- maxWidth,
220
- minHeight,
221
- maxHeight,
222
- minWidth,
223
- } }));
237
+ }, defaultTreeExpandState: treeExpandState, onTreeExpandStateChange: setTreeExpandState, columns: columns, options: props.options, treeSelection: treeSelection, onTreeSelectionChange: (0, InfiniteTable_1.withSelectedLeafNodesOnly)(onChange), style: treeListStyle }));
224
238
  let children = (React.createElement(rebass_1.Flex, { flexDirection: 'column', height: '100%' },
225
239
  React.createElement(rebass_1.Flex, { backgroundColor: 'defaultbackground', p: 1, alignItems: 'center', justifyContent: 'stretch', justifyItems: 'stretch' },
226
240
  React.createElement(Input_1.default, { "data-name": "menulist-search-input", placeholder: "Search...", style: { width: '100%' }, value: searchValue, onChange: (e) => setSearchValue(e.target.value) })),
@@ -238,7 +252,9 @@ function TreeDropdown(props) {
238
252
  e.preventDefault();
239
253
  } }, children));
240
254
  }
241
- return (React.createElement(rebass_1.Box, { ref: overlayDOMRef, className: "ab-TreeDropdownOverlay", "data-name": "menu-container" }, children));
255
+ return (React.createElement(rebass_1.Box, { ref: overlayDOMRef, className: "ab-TreeDropdownOverlay", "data-name": "menu-container", style: {
256
+ fontSize: 'var(--ab-cmp-select__font-size)',
257
+ } }, children));
242
258
  } },
243
259
  React.createElement(FieldWrap_1.default, { style: { width: '100%', ...props.fieldStyle } },
244
260
  React.createElement(Input_1.default, { type: "text", readOnly: true, "data-name": "Select Values", placeholder: props.placeholder ?? 'Select a value', style: {
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: 1763413218524 || Date.now(),
6
- VERSION: "21.1.0-canary.3" || '--current-version--',
5
+ PUBLISH_TIMESTAMP: 1764248918368 || Date.now(),
6
+ VERSION: "21.1.1" || '--current-version--',
7
7
  };