@adaptabletools/adaptable-cjs 21.0.0-canary.7 → 21.0.0

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.
@@ -10,6 +10,7 @@ const hooks_1 = require("./hooks");
10
10
  const Radio_1 = tslib_1.__importDefault(require("../../../components/Radio"));
11
11
  const AdaptableContext_1 = require("../../AdaptableContext");
12
12
  const Select_1 = require("../../../components/Select");
13
+ const utils_1 = require("./utils");
13
14
  const ColumnFilterPredicateDropdown = (props) => {
14
15
  const predicateDef = (0, hooks_1.usePredicateDef)(props.predicate?.operator, props.predicateDefs);
15
16
  const options = props.predicateDefs.map((predicateDef) => {
@@ -82,6 +83,10 @@ const ColumnFilterComponent = (props) => {
82
83
  setPredicateNotYetApplied(predicate);
83
84
  }
84
85
  };
86
+ const clearAllFilters = () => {
87
+ props.onPredicateChange(null);
88
+ setPredicateNotYetApplied(undefined);
89
+ };
85
90
  const onNewPredicate = (predicateDef) => {
86
91
  const currentPredicate = currentPredicateRef.current;
87
92
  const newPredicate = {
@@ -115,10 +120,29 @@ const ColumnFilterComponent = (props) => {
115
120
  variant: 'raised',
116
121
  children: 'Add Condition',
117
122
  } }));
123
+ const isAtLeastOneColumnFilterValid = (qlPredicates) => {
124
+ if (!qlPredicates?.length) {
125
+ return false;
126
+ }
127
+ return qlPredicates
128
+ .map((qlPredicate) => (0, utils_1.mapQlPredicateToAdaptablePredicate)(qlPredicate))
129
+ .some((adaptablePredicate) => adaptable.api.predicateApi.isValidPredicate(adaptablePredicate));
130
+ };
118
131
  return (React.createElement(React.Fragment, null,
119
- React.createElement(rebass_1.Flex, { m: 2 },
120
- React.createElement(AndOrInput, { onChange: onCombineChange, operator: currentPredicate.operator }),
121
- React.createElement(SimpleButton_1.default, { ml: 2, onClick: () => onPredicateChange(null) }, "Clear All")),
132
+ React.createElement(rebass_1.Flex, { flexDirection: "column", backgroundColor: "primarylight", pb: !props.hideActionButtons ? 2 : undefined, mb: props.location === 'filterForm' ? 2 : undefined, mt: props.location === 'columnMenu' ? 2 : undefined, ml: props.location === 'columnMenu' ? 2 : undefined, mr: props.location === 'columnMenu' ? 2 : undefined, style: { borderRadius: 'var(--ab__border-radius)' } },
133
+ React.createElement(rebass_1.Flex, { m: 2 },
134
+ React.createElement(AndOrInput, { onChange: onCombineChange, operator: currentPredicate.operator })),
135
+ !props.hideActionButtons && (React.createElement(rebass_1.Flex, { ml: 2, mr: 2, className: "ab-ColumnFilter-actions", justifyContent: "space-between" },
136
+ React.createElement(rebass_1.Box, { className: "ab-ColumnFilter-action-clearall" },
137
+ React.createElement(SimpleButton_1.default, { "aria-label": 'Clear All Filters', onClick: () => clearAllFilters() }, "Clear All")),
138
+ manuallyApplyColumnFilter ? (React.createElement(React.Fragment, null,
139
+ React.createElement(rebass_1.Box, { flex: 1, "data-name": "spacer" }),
140
+ React.createElement(rebass_1.Box, { className: "ab-ColumnFilter-action-reset", mr: 2 },
141
+ React.createElement(SimpleButton_1.default, { "aria-label": 'Reset All', tone: "neutral", variant: "raised", onClick: () => {
142
+ setPredicateNotYetApplied(props.predicate);
143
+ } }, "Reset")),
144
+ React.createElement(rebass_1.Box, { className: "ab-ColumnFilter-action-apply" },
145
+ React.createElement(SimpleButton_1.default, { "aria-label": 'Apply Filter', tone: "accent", variant: "raised", onClick: applyFilter, disabled: !isAtLeastOneColumnFilterValid(predicateNotYetApplied?.args) && !isAtLeastOneColumnFilterValid(currentPredicate.args) }, "Apply")))) : null))),
122
146
  React.createElement(rebass_1.Flex, { flexDirection: "column", className: "ab-ColumnFilter", flex: 1, minHeight: 0, ...props.wrapperProps },
123
147
  React.createElement(rebass_1.Box, { style: { overflow: 'auto' } },
124
148
  currentPredicate.args.map((predicate, index) => {
@@ -144,15 +168,6 @@ const ColumnFilterComponent = (props) => {
144
168
  });
145
169
  } }));
146
170
  }),
147
- isLastPredicateValid && filterPredicateDropdown),
148
- manuallyApplyColumnFilter ? (React.createElement(React.Fragment, null,
149
- React.createElement(rebass_1.Box, { flex: 1, "data-name": "spacer" }),
150
- React.createElement(rebass_1.Flex, { pt: 2, className: "ab-ColumnFilter-actions", justifyContent: "space-between" },
151
- React.createElement(rebass_1.Box, { className: "ab-ColumnFilter-action-apply" },
152
- React.createElement(SimpleButton_1.default, { tone: "accent", variant: "raised", onClick: applyFilter }, "Apply Filter")),
153
- React.createElement(rebass_1.Box, { className: "ab-ColumnFilter-action-reset" },
154
- React.createElement(SimpleButton_1.default, { tone: "neutral", variant: "raised", onClick: () => {
155
- setPredicateNotYetApplied(props.predicate);
156
- } }, "Reset Filter"))))) : null)));
171
+ isLastPredicateValid && filterPredicateDropdown))));
157
172
  };
158
173
  exports.ColumnFilterComponent = ColumnFilterComponent;
@@ -33,6 +33,6 @@ const ColumnFilterWindow = (props) => {
33
33
  }
34
34
  return label;
35
35
  }, onChange: (column) => setColumnId(column), filterColumn: (column) => column.queryable, isMulti: false, value: columnId })))),
36
- React.createElement(AdaptableColumnFilter_1.AdaptableColumnFilter, { columnId: columnId })));
36
+ React.createElement(AdaptableColumnFilter_1.AdaptableColumnFilter, { columnId: columnId, location: 'filterForm' })));
37
37
  };
38
38
  exports.ColumnFilterWindow = ColumnFilterWindow;
@@ -25,6 +25,6 @@ const LayoutColumnFilter = (props) => {
25
25
  };
26
26
  props.onColumnFilterChange(newFilter);
27
27
  };
28
- return (React.createElement(ColumnFilter_1.ColumnFilterComponent, { columnId: props.columnFilter.ColumnId, predicate: qlPredicate, predicateDefs: qlPredicateDefs, disabled: props.columnFilter?.IsSuspended, onPredicateChange: handlePredicateChange }));
28
+ return (React.createElement(ColumnFilter_1.ColumnFilterComponent, { location: 'filterForm', columnId: props.columnFilter.ColumnId, predicate: qlPredicate, predicateDefs: qlPredicateDefs, disabled: props.columnFilter?.IsSuspended, onPredicateChange: handlePredicateChange, hideActionButtons: true }));
29
29
  };
30
30
  exports.LayoutColumnFilter = LayoutColumnFilter;
@@ -113,7 +113,7 @@ const EntityRulesEditor = (props) => {
113
113
  }
114
114
  };
115
115
  const filteredPredicateDefs = predicateDefs.filter((def) => {
116
- if (api.predicateApi.internalApi.IsInorNotInPredicateDef(def)) {
116
+ if (api.predicateApi.internalApi.IsInOrNotInPredicateDef(def)) {
117
117
  return 'ColumnIds' in data.Scope && data.Scope.ColumnIds.length === 1;
118
118
  }
119
119
  return true;
@@ -83,7 +83,7 @@ const PredicateEditor = (props) => {
83
83
  index > 0 && React.createElement(HelpBlock_1.default, { margin: 2 }, "AND"),
84
84
  React.createElement(rebass_1.Flex, { key: index, flex: 1, flexDirection: "column" },
85
85
  React.createElement(AdaptableInput_1.default, { "data-name": `predicate-input-${index}`, marginTop: 2, type: predicateDefInput.type, autoFocus: index === 0, value: props.predicate.Inputs?.[index] ?? '', onChange: (e) => handlePredicateInputChange(e, index) })))))),
86
- adaptable.api.predicateApi.internalApi.IsInorNotInPredicateDef(currentPredicateDef) && (React.createElement(rebass_1.Box, { mt: 2 },
86
+ adaptable.api.predicateApi.internalApi.IsInOrNotInPredicateDef(currentPredicateDef) && (React.createElement(rebass_1.Box, { mt: 2 },
87
87
  React.createElement(ListBoxFilterForm_1.ColumnValuesSelect, { isLoading: isDistinctColumnValuesLoading, column: column, options: quickFilterValues.values, selectProps: {
88
88
  onMenuOpen,
89
89
  onInputChange,
@@ -41,6 +41,7 @@ const AgGridFilterAdapterFactory = (adaptable) => {
41
41
  this.unmountReactRoot = adaptable.renderReactRoot((0, renderWithAdaptableContext_1.renderWithAdaptableContext)(React.createElement(AdaptableColumnFilter_1.AdaptableColumnFilter, {
42
42
  columnId,
43
43
  wrapperProps: { p: 2 },
44
+ location: 'columnMenu',
44
45
  }), adaptable), this.filterContainer);
45
46
  }
46
47
  }
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: 1757331115735 || Date.now(),
6
- VERSION: "21.0.0-canary.7" || '--current-version--',
5
+ PUBLISH_TIMESTAMP: 1757491006270 || Date.now(),
6
+ VERSION: "21.0.0" || '--current-version--',
7
7
  };
@@ -3021,33 +3021,6 @@ export declare const ADAPTABLE_METAMODEL: {
3021
3021
  kind: string;
3022
3022
  desc: string;
3023
3023
  };
3024
- DefaultLayoutProperties: {
3025
- name: string;
3026
- kind: string;
3027
- desc: string;
3028
- props: {
3029
- name: string;
3030
- kind: string;
3031
- desc: string;
3032
- isOpt: boolean;
3033
- ref: string;
3034
- }[];
3035
- };
3036
- DefaultLayoutPropertiesContext: {
3037
- name: string;
3038
- kind: string;
3039
- desc: string;
3040
- props: {
3041
- name: string;
3042
- kind: string;
3043
- desc: string;
3044
- }[];
3045
- };
3046
- DefaultPivotLayoutProperties: {
3047
- name: string;
3048
- kind: string;
3049
- desc: string;
3050
- };
3051
3024
  DefaultPredicateFilterContext: {
3052
3025
  name: string;
3053
3026
  kind: string;
@@ -3064,11 +3037,6 @@ export declare const ADAPTABLE_METAMODEL: {
3064
3037
  ref: string;
3065
3038
  })[];
3066
3039
  };
3067
- DefaultTableLayoutProperties: {
3068
- name: string;
3069
- kind: string;
3070
- desc: string;
3071
- };
3072
3040
  DetailInitContext: {
3073
3041
  name: string;
3074
3042
  kind: string;
@@ -4249,6 +4217,28 @@ export declare const ADAPTABLE_METAMODEL: {
4249
4217
  ref?: undefined;
4250
4218
  })[];
4251
4219
  };
4220
+ LayoutCreationDefaultProperties: {
4221
+ name: string;
4222
+ kind: string;
4223
+ desc: string;
4224
+ props: {
4225
+ name: string;
4226
+ kind: string;
4227
+ desc: string;
4228
+ isOpt: boolean;
4229
+ ref: string;
4230
+ }[];
4231
+ };
4232
+ LayoutCreationDefaultPropertiesContext: {
4233
+ name: string;
4234
+ kind: string;
4235
+ desc: string;
4236
+ props: {
4237
+ name: string;
4238
+ kind: string;
4239
+ desc: string;
4240
+ }[];
4241
+ };
4252
4242
  LayoutExtendedConfig: {
4253
4243
  name: string;
4254
4244
  kind: string;
@@ -4707,6 +4697,11 @@ export declare const ADAPTABLE_METAMODEL: {
4707
4697
  ref?: undefined;
4708
4698
  })[];
4709
4699
  };
4700
+ PivotLayoutCreationDefaultProperties: {
4701
+ name: string;
4702
+ kind: string;
4703
+ desc: string;
4704
+ };
4710
4705
  PivotPreviewColumnsContext: {
4711
4706
  name: string;
4712
4707
  kind: string;
@@ -5895,6 +5890,11 @@ export declare const ADAPTABLE_METAMODEL: {
5895
5890
  ref?: undefined;
5896
5891
  })[];
5897
5892
  };
5893
+ TableLayoutCreationDefaultProperties: {
5894
+ name: string;
5895
+ kind: string;
5896
+ desc: string;
5897
+ };
5898
5898
  TeamSharingOptions: {
5899
5899
  name: string;
5900
5900
  kind: string;