@adaptabletools/adaptable 15.2.0-canary.4 → 15.2.0-canary.6

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.
Files changed (34) hide show
  1. package/bundle.cjs.js +162 -162
  2. package/package.json +1 -1
  3. package/publishTimestamp.d.ts +1 -1
  4. package/publishTimestamp.js +1 -1
  5. package/src/AdaptableOptions/ColumnOptions.d.ts +1 -5
  6. package/src/AdaptableOptions/FilterOptions.d.ts +7 -0
  7. package/src/AdaptableOptions/LayoutOptions.d.ts +1 -1
  8. package/src/Api/GridApi.d.ts +2 -2
  9. package/src/Api/Implementation/ThemeApiImpl.js +2 -0
  10. package/src/Api/Internal/GridInternalApi.js +1 -0
  11. package/src/Strategy/ExportModule.js +5 -0
  12. package/src/Utilities/Defaults/DefaultAdaptableOptions.js +1 -0
  13. package/src/Utilities/Services/ThemeService.d.ts +1 -0
  14. package/src/Utilities/Services/ThemeService.js +38 -3
  15. package/src/View/Components/AdaptableDateInput/index.d.ts +1 -1
  16. package/src/View/Components/FilterForm/FilterForm.js +1 -1
  17. package/src/View/Components/FilterForm/ListBoxFilterForm.js +4 -2
  18. package/src/View/Components/FilterForm/QuickFilterForm.d.ts +0 -5
  19. package/src/View/Components/FilterForm/QuickFilterForm.js +60 -206
  20. package/src/View/Components/FilterForm/QuickFilterValues.d.ts +19 -0
  21. package/src/View/Components/FilterForm/QuickFilterValues.js +168 -0
  22. package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.js +1 -1
  23. package/src/agGrid/Adaptable.js +1 -29
  24. package/src/components/ColorPicker/ColorPicker.d.ts +1 -1
  25. package/src/components/Datepicker/index.d.ts +1 -1
  26. package/src/components/Input/index.d.ts +1 -1
  27. package/src/components/List/ListGroupItem/index.d.ts +1 -1
  28. package/src/components/OverlayTrigger/index.d.ts +3 -1
  29. package/src/components/OverlayTrigger/index.js +2 -1
  30. package/src/metamodel/adaptable.metamodel.d.ts +8 -0
  31. package/src/metamodel/adaptable.metamodel.js +1 -1
  32. package/src/types.d.ts +1 -0
  33. package/version.d.ts +1 -1
  34. package/version.js +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable",
3
- "version": "15.2.0-canary.4",
3
+ "version": "15.2.0-canary.6",
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",
@@ -1,2 +1,2 @@
1
- declare const _default: 1680875814346;
1
+ declare const _default: 1681229596918;
2
2
  export default _default;
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = 1680875814346;
3
+ exports.default = 1681229596918;
@@ -31,11 +31,7 @@ export interface ColumnOptions {
31
31
  */
32
32
  autoOrderGroupedColumns?: boolean;
33
33
  /**
34
- * Automatically removes a column from the grid when it becomes Row Grouped
35
- *
36
- * @defaultValue false
37
- * @gridInfoItem
38
- * @noCodeItem
34
+ * @deprecated - this is now AG Grid behaviour
39
35
  */
40
36
  hideColumnWhenGrouped?: boolean;
41
37
  }
@@ -193,4 +193,11 @@ export interface FilterOptions<TData = any> {
193
193
  * @noCodeItem
194
194
  */
195
195
  showValuesCount?: (column: AdaptableColumn<TData>) => boolean;
196
+ /**
197
+ * Quick filter width can be set in pixels or made to have the same size as the column.
198
+ * - 'auto' will use the column width
199
+ * - number will use the number of pixels
200
+ * @defaultValue '180'
201
+ */
202
+ quickFilterValuesWidth?: 'auto' | number;
196
203
  }
@@ -38,7 +38,7 @@ export interface LayoutOptions {
38
38
  */
39
39
  autoSizeColumnsInLayout?: boolean;
40
40
  /**
41
- * Columns auto-size when Pivot-based Layout loads first time
41
+ * Columns auto-size when Pivot Layout loads first time (overriding Layout width properties)
42
42
  *
43
43
  * @defaultValue false
44
44
  * @gridInfoItem
@@ -29,12 +29,12 @@ export interface GridApi {
29
29
  */
30
30
  getFilteredData(): any[];
31
31
  /**
32
- * Repopulates grid with given data and fires a 'GridDataChanged' event.
32
+ * Repopulates grid with given data and fires a 'GridDataChanged' event
33
33
  * @param data any data from any datasource that is suitable for AG Grid
34
34
  */
35
35
  setGridData(data: any[]): void;
36
36
  /**
37
- * Sets the grid with the given data. It does NOT fire a 'GridDataChanged' event.
37
+ * Sets grid with given data; does NOT fire a 'GridDataChanged' event
38
38
  * @param data any data from any datasource that is suitable for AG Grid
39
39
  */
40
40
  setInitialGridData(data: any): void;
@@ -8,6 +8,7 @@ const ApiBase_1 = require("./ApiBase");
8
8
  const logDeprecation_1 = require("../../Utilities/logDeprecation");
9
9
  const themes_1 = require("../../themes");
10
10
  const ThemeInternalApi_1 = require("../Internal/ThemeInternalApi");
11
+ const AdaptableHelper_1 = tslib_1.__importDefault(require("../../Utilities/Helpers/AdaptableHelper"));
11
12
  class ThemeApiImpl extends ApiBase_1.ApiBase {
12
13
  constructor(adaptable) {
13
14
  super(adaptable);
@@ -105,6 +106,7 @@ class ThemeApiImpl extends ApiBase_1.ApiBase {
105
106
  }
106
107
  }
107
108
  addUserTheme(theme) {
109
+ AdaptableHelper_1.default.addUuidAndSource(theme);
108
110
  this.dispatchAction(ThemeRedux.ThemeAdd(theme));
109
111
  }
110
112
  deleteUserTheme(theme) {
@@ -69,6 +69,7 @@ class GridInternalApi extends ApiBase_1.ApiBase {
69
69
  * @param columnFilter Current applied filter
70
70
  */
71
71
  async getDistinctFilterDisplayValuesForColumn(columnId, filter, showFilteredRowsOnly) {
72
+ console.log('getDistinctFilterDisplayValuesForColumn ', columnId, filter);
72
73
  const abColumn = this.getColumnApi().getColumnWithColumnId(columnId);
73
74
  if (abColumn == undefined) {
74
75
  return {
@@ -110,6 +110,11 @@ class ExportModule extends AdaptableModuleBase_1.AdaptableModuleBase {
110
110
  else {
111
111
  this.api.logInfo(`Export ${report.Name} (${exportDestination}) using data from preProcessExport()`);
112
112
  reportData = preProcessedExport;
113
+ if (!reportData.columns.length) {
114
+ // an empty column array means that all columns have been exported
115
+ // we have to update the report to reflect this
116
+ reportData.columns = this.api.internalApi.getReportService().getReportDataColumns(report);
117
+ }
113
118
  }
114
119
  if (this.isCustomDestination(exportDestination)) {
115
120
  const customDestination = (_a = this.api.optionsApi
@@ -215,6 +215,7 @@ exports.DefaultAdaptableOptions = {
215
215
  quickFilterWildcards: {},
216
216
  quickFilterDebounce: 250,
217
217
  showValuesCount: undefined,
218
+ quickFilterValuesWidth: 180,
218
219
  },
219
220
  searchOptions: {
220
221
  excludeColumnFromQuickSearch: undefined,
@@ -9,4 +9,5 @@ export declare class ThemeService implements IThemeService {
9
9
  onThemeChanged: () => void;
10
10
  applyNewThemeVariables(theme: AdaptableTheme): void;
11
11
  destroy(): void;
12
+ showMissingThemeFiles(theme: AdaptableTheme): void;
12
13
  }
@@ -8,6 +8,9 @@ class ThemeService {
8
8
  this.onThemeChanged = () => {
9
9
  const currentTheme = this.api.themeApi.getCurrentThemeObject();
10
10
  this.applyNewThemeVariables(currentTheme);
11
+ // this needs to be called after variables are set
12
+ // as it may show the warning for a custom/runtime theme
13
+ this.showMissingThemeFiles(currentTheme);
11
14
  };
12
15
  this.api = api;
13
16
  this.subscribe();
@@ -29,10 +32,12 @@ class ThemeService {
29
32
  };
30
33
  }
31
34
  applyNewThemeVariables(theme) {
32
- var _a;
33
- const variables = (_a = theme.CSSVariables) !== null && _a !== void 0 ? _a : {};
35
+ const variables = theme.CSSVariables;
36
+ if (!variables || Object.keys(variables).length === 0) {
37
+ return;
38
+ }
34
39
  let str = `html.${this.api.themeApi.internalApi.getThemeClassName(theme.Name)} {
35
- --ab-theme-loaded: custom-theme;
40
+ --ab-theme-loaded: ab--theme-${theme.Name};
36
41
  `;
37
42
  for (const [key, value] of Object.entries(variables)) {
38
43
  if (key.includes('--')) {
@@ -47,5 +52,35 @@ class ThemeService {
47
52
  this.unsubscribe();
48
53
  document.adoptedStyleSheets = [...document.adoptedStyleSheets].filter((sheet) => sheet !== this.styleSheetObject);
49
54
  }
55
+ showMissingThemeFiles(theme) {
56
+ // run time defined theme
57
+ // because it may be an empty theme
58
+ if (theme.Source === 'User') {
59
+ return;
60
+ }
61
+ const themeName = theme.Name;
62
+ const adaptable = this.api.internalApi.getAdaptableInstance();
63
+ const logger = adaptable.logger;
64
+ const documentElement = document.documentElement;
65
+ const computedDocumentStyle = getComputedStyle(documentElement);
66
+ const [abLoaded, abThemeLoaded] = ['--ab-loaded', '--ab-theme-loaded'].map((variable) => {
67
+ let val = computedDocumentStyle.getPropertyValue(variable);
68
+ if (typeof val === 'string' && val.trim) {
69
+ val = val.trim();
70
+ }
71
+ return val;
72
+ });
73
+ if (abLoaded !== '777') {
74
+ logger.consoleError('Please import Adaptable styles from "@adaptabletools/adaptable/index.css"');
75
+ }
76
+ // every theme should define a custom css variable: --ab-theme-loaded: <themeName> defined on the document element.
77
+ if (abThemeLoaded !== themeName) {
78
+ logger.consoleWarn(`Theme "${themeName}" doesn't seem to be loaded! Make sure you import the css file for the "${themeName}" theme!
79
+
80
+ If it's a default theme, try
81
+
82
+ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
83
+ }
84
+ }
50
85
  }
51
86
  exports.ThemeService = ThemeService;
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
2
  import { AdaptableInputProps } from '../AdaptableInput';
3
3
  export declare type AdaptableDateInputProps = AdaptableInputProps;
4
- declare const AdaptableDateInput: React.ForwardRefExoticComponent<Omit<import("../../../components/Input").InputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
4
+ declare const AdaptableDateInput: React.ForwardRefExoticComponent<Pick<import("../../../components/Input").InputProps, "max" | "required" | "type" | "data" | "default" | "high" | "low" | "key" | "id" | "media" | "height" | "width" | "start" | "open" | "name" | "alignContent" | "alignItems" | "alignSelf" | "backgroundColor" | "color" | "content" | "display" | "flex" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "justifyContent" | "justifyItems" | "justifySelf" | "letterSpacing" | "lineHeight" | "margin" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "opacity" | "order" | "overflow" | "overflowX" | "overflowY" | "padding" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "textAlign" | "translate" | "verticalAlign" | "value" | "hidden" | "cite" | "dir" | "form" | "label" | "p" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "acceptCharset" | "action" | "method" | "noValidate" | "target" | "accessKey" | "draggable" | "lang" | "className" | "prefix" | "children" | "contentEditable" | "inputMode" | "nonce" | "tabIndex" | "async" | "disabled" | "multiple" | "size" | "manifest" | "m" | "wrap" | "accept" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "dateTime" | "defer" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "list" | "loop" | "marginHeight" | "marginWidth" | "maxLength" | "mediaGroup" | "min" | "minLength" | "muted" | "optimum" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "contextMenu" | "placeholder" | "spellCheck" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "step" | "useMap" | "wmode" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "bg" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "css" | "variant" | "tx" | "sx" | "placehoder"> & React.RefAttributes<HTMLInputElement>>;
5
5
  export default AdaptableDateInput;
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
5
5
  const React = tslib_1.__importStar(require("react"));
6
6
  const react_redux_1 = require("react-redux");
7
7
  const LayoutRedux = tslib_1.__importStar(require("../../../Redux/ActionsReducers/LayoutRedux"));
8
+ const LayoutRedux_1 = require("../../../Redux/ActionsReducers/LayoutRedux");
8
9
  const SystemRedux = tslib_1.__importStar(require("../../../Redux/ActionsReducers/SystemRedux"));
9
10
  const Enums_1 = require("../../../PredefinedConfig/Common/Enums");
10
11
  const ListBoxFilterForm_1 = require("./ListBoxFilterForm");
@@ -23,7 +24,6 @@ const renderWithAdaptableContext_1 = require("../../renderWithAdaptableContext")
23
24
  const CheckBox_1 = require("../../../components/CheckBox");
24
25
  const runIfNotResolvedIn_1 = require("../../../Utilities/runIfNotResolvedIn");
25
26
  const getDefaultColumnFilterPredicate_1 = require("./getDefaultColumnFilterPredicate");
26
- const LayoutRedux_1 = require("../../../Redux/ActionsReducers/LayoutRedux");
27
27
  const panelStyle = {
28
28
  width: '100%',
29
29
  minWidth: 150,
@@ -41,15 +41,17 @@ const ListBoxFilterForm = (props) => {
41
41
  }
42
42
  };
43
43
  const columnValuesItemsElements = props.columnDistinctValues.map((distinctValue, index) => {
44
- var _a, _b, _c;
45
44
  const isActive = UiSelectedColumnValues.indexOf(distinctValue.value) >= 0;
46
45
  const columnLabel = distinctValue.label;
47
46
  if (StringExtensions_1.StringExtensions.IsNullOrEmpty(columnLabel)) {
48
47
  return null;
49
48
  }
49
+ const noMatch = StringExtensions_1.StringExtensions.IsNullOrEmpty(FilterValue.toLocaleLowerCase()) ||
50
+ StringExtensions_1.StringExtensions.IsNullOrEmpty(columnLabel === null || columnLabel === void 0 ? void 0 : columnLabel.toLocaleLowerCase()) ||
51
+ columnLabel.toLocaleLowerCase().indexOf(FilterValue.toLocaleLowerCase()) < 0;
50
52
  if (!props.suppressClientSideFilter &&
51
53
  StringExtensions_1.StringExtensions.IsNotNullOrEmpty(FilterValue) &&
52
- ((_c = (_a = columnLabel === null || columnLabel === void 0 ? void 0 : columnLabel.toLocaleLowerCase) === null || _a === void 0 ? void 0 : (_b = _a.call(columnLabel)).indexOf) === null || _c === void 0 ? void 0 : _c.call(_b, FilterValue.toLocaleLowerCase())) < 0) {
54
+ noMatch) {
53
55
  return null;
54
56
  }
55
57
  if (props.useAgGridStyle) {
@@ -1,10 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import { ColumnFilterContext } from '../../../Utilities/Interface/ColumnFilterContext';
3
- import { ColumnFilter } from '../../../types';
4
3
  export interface QuickFilterFormState {
5
- filter: ColumnFilter;
6
- distinctColumnValues: any[];
7
- isDistinctColumnValuesLoading: boolean;
8
- suppressClientSideFilter: boolean;
9
4
  }
10
5
  export declare const QuickFilterFormReact: (FilterContext: ColumnFilterContext) => JSX.Element;