@adaptabletools/adaptable-cjs 18.0.0-canary.15 → 18.0.0-canary.16

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": "18.0.0-canary.15",
3
+ "version": "18.0.0-canary.16",
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",
@@ -102,6 +102,12 @@ export interface ColumnFilterOptions<TData = any> {
102
102
  * @noCodeItem
103
103
  */
104
104
  showSuspendFilterButton?: boolean;
105
+ /**
106
+ * Wether to show Date Picker or only Date Input
107
+ *
108
+ * @default true
109
+ */
110
+ showDatePicker?: boolean;
105
111
  }
106
112
  /**
107
113
  * Options for managing the Filter Bar (aka Quick Filter)
@@ -177,6 +177,10 @@ type ModuleGroup = {
177
177
  icon?: AdaptableIcon;
178
178
  title: string;
179
179
  };
180
- export declare const DEFAULT_ADAPTABLE_CONTEXT_MENU_STRUCTURE: (AdaptableModule | ModuleGroup)[];
181
180
  export declare const DEFAULT_ADAPTABLE_COLUMN_MENU_STRUCTURE: (AdaptableModule | ModuleGroup)[];
181
+ /**
182
+ * Defines the order of Menu Items in the CONTEXT Menu
183
+ * The items commented out do not have a Context Menu Option
184
+ */
185
+ export declare const DEFAULT_ADAPTABLE_CONTEXT_MENU_STRUCTURE: (AdaptableModule | ModuleGroup)[];
182
186
  export {};
@@ -1,99 +1,100 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DEFAULT_ADAPTABLE_COLUMN_MENU_STRUCTURE = exports.DEFAULT_ADAPTABLE_CONTEXT_MENU_STRUCTURE = void 0;
3
+ exports.DEFAULT_ADAPTABLE_CONTEXT_MENU_STRUCTURE = exports.DEFAULT_ADAPTABLE_COLUMN_MENU_STRUCTURE = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const ModuleConstants = tslib_1.__importStar(require("../Utilities/Constants/ModuleConstants"));
6
- exports.DEFAULT_ADAPTABLE_CONTEXT_MENU_STRUCTURE = [
7
- ModuleConstants.SettingsPanelModuleId,
6
+ exports.DEFAULT_ADAPTABLE_COLUMN_MENU_STRUCTURE = [
7
+ ModuleConstants.CalculatedColumnModuleId,
8
+ ModuleConstants.CellSummaryModuleId,
9
+ ModuleConstants.ColumnFilterModuleId,
10
+ ModuleConstants.ColumnInfoModuleId,
11
+ ModuleConstants.CustomSortModuleId,
8
12
  ModuleConstants.DashboardModuleId,
9
- ModuleConstants.ToolPanelModuleId,
10
- ModuleConstants.StatusBarModuleId,
11
- ModuleConstants.LayoutModuleId,
12
- ModuleConstants.FormatColumnModuleId,
13
- ModuleConstants.StyledColumnModuleId,
13
+ ModuleConstants.DataImportModuleId,
14
14
  ModuleConstants.FlashingCellModuleId,
15
- ModuleConstants.CustomSortModuleId,
16
- ModuleConstants.CellSummaryModuleId,
17
- ModuleConstants.Fdc3ModuleId,
15
+ ModuleConstants.FormatColumnModuleId,
16
+ ModuleConstants.FreeTextColumnModuleId,
18
17
  ModuleConstants.GridInfoModuleId,
19
- ModuleConstants.ColumnInfoModuleId,
18
+ ModuleConstants.LayoutModuleId,
19
+ ModuleConstants.PlusMinusModuleId,
20
+ ModuleConstants.SettingsPanelModuleId,
21
+ ModuleConstants.StyledColumnModuleId,
22
+ ModuleConstants.SystemStatusModuleId, // Single Item - Always present
23
+ /*
24
+ // Modules that dont provide a Column Menu
20
25
  ModuleConstants.AlertModuleId,
21
- ModuleConstants.CalculatedColumnModuleId,
22
- ModuleConstants.ExportModuleId,
23
- ModuleConstants.ColumnFilterModuleId,
24
- {
25
- title: 'Edit',
26
- icon: {
27
- name: 'edit',
28
- },
29
- modules: [ModuleConstants.SmartEditModuleId, ModuleConstants.BulkUpdateModuleId],
30
- },
31
- ModuleConstants.TeamSharingModuleId,
26
+ ModuleConstants.BulkUpdateModuleId,
27
+ ModuleConstants.ChartingModuleId,
28
+ ModuleConstants.CommentModuleId,
32
29
  ModuleConstants.DataChangeHistoryModuleId,
33
30
  ModuleConstants.DataSetModuleId,
34
- ModuleConstants.FreeTextColumnModuleId,
31
+ ModuleConstants.ExportModuleId,
32
+ ModuleConstants.Fdc3ModuleId,
33
+ ModuleConstants.GridFilterModuleId,
35
34
  ModuleConstants.NamedQueryModuleId,
35
+ ModuleConstants.NoteModuleId,
36
36
  ModuleConstants.QuickSearchModuleId,
37
- ModuleConstants.DataSetModuleId,
38
- ModuleConstants.AlertModuleId,
39
- ModuleConstants.SystemStatusModuleId,
40
- ModuleConstants.CalculatedColumnModuleId,
41
- ModuleConstants.FreeTextColumnModuleId,
42
- ModuleConstants.ExportModuleId,
43
- ModuleConstants.DataImportModuleId,
44
- ModuleConstants.DataChangeHistoryModuleId,
45
- ModuleConstants.PlusMinusModuleId,
46
- ModuleConstants.ShortcutModuleId,
47
- ModuleConstants.TeamSharingModuleId,
48
37
  ModuleConstants.ScheduleModuleId,
38
+ ModuleConstants.ShortcutModuleId,
39
+ ModuleConstants.SmartEditModuleId,
49
40
  ModuleConstants.StateManagementModuleId,
41
+ ModuleConstants.StatusBarModuleId,
42
+ ModuleConstants.TeamSharingModuleId,
50
43
  ModuleConstants.ThemeModuleId,
51
- ModuleConstants.ChartingModuleId,
52
- ModuleConstants.NoteModuleId,
53
- ModuleConstants.CommentModuleId,
54
- ];
55
- exports.DEFAULT_ADAPTABLE_COLUMN_MENU_STRUCTURE = [
56
- ModuleConstants.SettingsPanelModuleId,
57
- ModuleConstants.DashboardModuleId,
58
44
  ModuleConstants.ToolPanelModuleId,
59
- ModuleConstants.StatusBarModuleId,
60
- ModuleConstants.LayoutModuleId,
61
- ModuleConstants.FormatColumnModuleId,
62
- ModuleConstants.StyledColumnModuleId,
63
- ModuleConstants.FlashingCellModuleId,
64
- ModuleConstants.CustomSortModuleId,
65
- ModuleConstants.CellSummaryModuleId,
66
- ModuleConstants.Fdc3ModuleId,
67
- ModuleConstants.GridInfoModuleId,
68
- ModuleConstants.ColumnInfoModuleId,
45
+ */
46
+ ];
47
+ /**
48
+ * Defines the order of Menu Items in the CONTEXT Menu
49
+ * The items commented out do not have a Context Menu Option
50
+ */
51
+ exports.DEFAULT_ADAPTABLE_CONTEXT_MENU_STRUCTURE = [
69
52
  ModuleConstants.AlertModuleId,
53
+ ModuleConstants.BulkUpdateModuleId,
70
54
  ModuleConstants.CalculatedColumnModuleId,
71
- ModuleConstants.ExportModuleId,
55
+ ModuleConstants.CellSummaryModuleId,
72
56
  ModuleConstants.ColumnFilterModuleId,
73
- {
74
- title: 'Edit',
75
- modules: [ModuleConstants.SmartEditModuleId, ModuleConstants.BulkUpdateModuleId],
76
- },
77
- ModuleConstants.TeamSharingModuleId,
57
+ ModuleConstants.ColumnInfoModuleId,
58
+ ModuleConstants.CommentModuleId,
59
+ ModuleConstants.DashboardModuleId,
60
+ ModuleConstants.DataImportModuleId,
61
+ ModuleConstants.ExportModuleId,
62
+ ModuleConstants.Fdc3ModuleId,
63
+ ModuleConstants.FlashingCellModuleId,
64
+ ModuleConstants.GridInfoModuleId,
65
+ ModuleConstants.LayoutModuleId,
66
+ ModuleConstants.NoteModuleId,
67
+ ModuleConstants.SettingsPanelModuleId,
68
+ ModuleConstants.SmartEditModuleId,
69
+ ModuleConstants.SystemStatusModuleId, // Single Item - Always present
70
+ // this currently doesnt work
71
+ // {
72
+ // title: 'Edit',
73
+ // icon: {
74
+ // name: 'edit',
75
+ // },
76
+ // modules: [ModuleConstants.SmartEditModuleId, ModuleConstants.BulkUpdateModuleId],
77
+ // },
78
+ /*
79
+ // Modules that dont provide a Context Menu
80
+ ModuleConstants.ChartingModuleId,
81
+ ModuleConstants.CustomSortModuleId,
78
82
  ModuleConstants.DataChangeHistoryModuleId,
79
83
  ModuleConstants.DataSetModuleId,
84
+ ModuleConstants.FormatColumnModuleId,
80
85
  ModuleConstants.FreeTextColumnModuleId,
86
+ ModuleConstants.GridFilterModuleId,
81
87
  ModuleConstants.NamedQueryModuleId,
82
- ModuleConstants.QuickSearchModuleId,
83
- ModuleConstants.DataSetModuleId,
84
- ModuleConstants.AlertModuleId,
85
- ModuleConstants.SystemStatusModuleId,
86
- ModuleConstants.CalculatedColumnModuleId,
87
- ModuleConstants.FreeTextColumnModuleId,
88
- ModuleConstants.ExportModuleId,
89
- ModuleConstants.DataImportModuleId,
90
- ModuleConstants.DataChangeHistoryModuleId,
91
88
  ModuleConstants.PlusMinusModuleId,
92
- ModuleConstants.ShortcutModuleId,
93
- ModuleConstants.TeamSharingModuleId,
89
+ ModuleConstants.QuickSearchModuleId,
94
90
  ModuleConstants.ScheduleModuleId,
91
+ ModuleConstants.ShortcutModuleId,
95
92
  ModuleConstants.StateManagementModuleId,
93
+ ModuleConstants.StatusBarModuleId,
94
+ ModuleConstants.StyledColumnModuleId,
95
+ ModuleConstants.TeamSharingModuleId,
96
96
  ModuleConstants.ThemeModuleId,
97
- ModuleConstants.ChartingModuleId,
98
- ModuleConstants.NoteModuleId,
97
+ ModuleConstants.ToolPanelModuleId,
98
+
99
+ */
99
100
  ];
@@ -295,8 +295,10 @@ const LayoutReducer = (state = initialState, action) => {
295
295
  return Object.assign(Object.assign({}, state), { Layouts });
296
296
  }
297
297
  case exports.LAYOUT_COLUMN_FILTER_ADD: {
298
- let columnFilters = [...((_b = currentLayout.ColumnFilters) !== null && _b !== void 0 ? _b : [])];
299
298
  const columnFilterAction = action.columnFilter;
299
+ let columnFilters = ((_b = currentLayout.ColumnFilters) !== null && _b !== void 0 ? _b : []).filter(
300
+ // make sure we are not adding a filter that already exists
301
+ (cf) => cf.ColumnId !== columnFilterAction.ColumnId);
300
302
  AdaptableHelper_1.default.addUuidAndSource(columnFilterAction);
301
303
  columnFilters.push(columnFilterAction);
302
304
  const Layouts = state.Layouts.map((layout) => {
@@ -309,10 +311,13 @@ const LayoutReducer = (state = initialState, action) => {
309
311
  }
310
312
  case exports.LAYOUT_COLUMN_FILTER_EDIT: {
311
313
  const columnFilterAction = action.columnFilter;
312
- let columnFilters = ((_c = currentLayout.ColumnFilters) !== null && _c !== void 0 ? _c : []).map((abObject) => abObject.Uuid === columnFilterAction.Uuid ? columnFilterAction : abObject);
314
+ // it is safer to change the col id, we cannot have multiple filter on the same id
315
+ // first we filter out other filters with the same colId, to ensure we have only one
316
+ const cleanColumnFilters = ((_c = currentLayout.ColumnFilters) !== null && _c !== void 0 ? _c : []).filter((cf) => cf.ColumnId !== columnFilterAction.ColumnId);
317
+ cleanColumnFilters.push(columnFilterAction);
313
318
  const Layouts = state.Layouts.map((layout) => {
314
319
  if (layout.Name === currentLayout.Name) {
315
- return Object.assign(Object.assign({}, layout), { ColumnFilters: columnFilters });
320
+ return Object.assign(Object.assign({}, layout), { ColumnFilters: cleanColumnFilters });
316
321
  }
317
322
  return layout;
318
323
  });
@@ -328,14 +333,11 @@ const LayoutReducer = (state = initialState, action) => {
328
333
  return Object.assign(Object.assign({}, state), { Layouts });
329
334
  }
330
335
  case exports.LAYOUT_COLUMN_FILTER_CLEAR: {
331
- let columnFilters = [...((_d = currentLayout.ColumnFilters) !== null && _d !== void 0 ? _d : [])];
332
336
  const actionTypedDelete = action;
333
- const index = actionTypedDelete.columnFilter
334
- ? columnFilters.findIndex((i) => i.Uuid == actionTypedDelete.columnFilter.Uuid)
335
- : -1;
336
- if (index != -1) {
337
- columnFilters.splice(index, 1);
338
- }
337
+ const columnFilters = ((_d = currentLayout.ColumnFilters) !== null && _d !== void 0 ? _d : []).filter((cf) => {
338
+ // make sure we are deleting all filters on the same column
339
+ return cf.ColumnId !== actionTypedDelete.columnFilter.ColumnId;
340
+ });
339
341
  const Layouts = state.Layouts.map((layout) => {
340
342
  if (layout.Name === currentLayout.Name) {
341
343
  return Object.assign(Object.assign({}, layout), { ColumnFilters: columnFilters });
@@ -7,5 +7,5 @@ export declare class DataImportModule extends AdaptableModuleBase implements IMo
7
7
  addModuleMenuItem(source: 'ModuleMenu' | 'ModuleButton'): AdaptableMenuItem | undefined;
8
8
  addContextMenuItems(): AdaptableMenuItem[] | undefined;
9
9
  addColumnMenuItems(): AdaptableMenuItem[] | undefined;
10
- private getOpenPopupMenuItem;
10
+ private createDataImportMenuItem;
11
11
  }
@@ -10,21 +10,21 @@ class DataImportModule extends AdaptableModuleBase_1.AdaptableModuleBase {
10
10
  }
11
11
  addModuleMenuItem(source) {
12
12
  if (this.isModuleAvailable()) {
13
- return this.getOpenPopupMenuItem(source);
13
+ return this.createDataImportMenuItem(source);
14
14
  }
15
15
  }
16
16
  addContextMenuItems() {
17
17
  if (this.isModuleAvailable()) {
18
- return [this.getOpenPopupMenuItem('ContextMenu')];
18
+ return [this.createDataImportMenuItem('ContextMenu')];
19
19
  }
20
20
  return undefined;
21
21
  }
22
22
  addColumnMenuItems() {
23
23
  if (this.isModuleAvailable()) {
24
- return [this.getOpenPopupMenuItem('ColumnMenu')];
24
+ return [this.createDataImportMenuItem('ColumnMenu')];
25
25
  }
26
26
  }
27
- getOpenPopupMenuItem(source) {
27
+ createDataImportMenuItem(source) {
28
28
  const moduleParams = {
29
29
  action: 'New',
30
30
  source: source,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LicenseService=exports.LicenseValidityType=void 0;const e=require("tslib"),a=require("../../../Redux/ActionsReducers/SystemRedux"),t=require("../../../Redux/ActionsReducers/PopupRedux"),s=e.__importDefault(require("../../ObjectFactory")),i=e.__importDefault(require("lodash/clamp")),o=require("../../Constants/DocumentationLinkConstants"),n=require("../../license/decode"),r=require("./shouldLogThankYouMessage"),l="sales@adaptabletools.com",c=10,d=864e5;var p;!function(e){e.INVALID_LICENSE="INVALID_LICENSE",e.NO_LICENSE="NO_LICENSE",e.NON_PRODUCTION_VALID="NON_PRODUCTION_VALID",e.NON_PRODUCTION_EXPIRED_IN_SCOPE="NON_PRODUCTION_EXPIRED_IN_SCOPE",e.NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE="NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE",e.COMMERCIAL_VALID="COMMERCIAL_VALID",e.COMMERCIAL_EXPIRED_IN_SCOPE="COMMERCIAL_EXPIRED_IN_SCOPE",e.COMMERCIAL_EXPIRED_OUT_OF_SCOPE="COMMERCIAL_EXPIRED_OUT_OF_SCOPE"}(p=exports.LicenseValidityType||(exports.LicenseValidityType={}));const h=/(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g,E=/(https):\/\/\S+(\.csb\.app)/g,_=/(https):\/\/\S+(\.adaptabletools\.com)/g,I=()=>"undefined"!=typeof window?window.location.origin:"",O=()=>{const[e,a,t]=Array.from(h.exec(I())||[]);return"https"===a&&"sandpack.codesandbox.io"===t},u=()=>{const[e,a,t]=Array.from(E.exec(I())||[]);return"https"===a&&".csb.app"===t},A=()=>{const[e,a,t]=Array.from(_.exec(I())||[]);return"https"===a&&".adaptabletools.com"===t};class N{constructor(e,a,t){this.adaptable=e,this.licenseKey=a,this.packageDetails=t,this.adaptable=e,this.adaptable.api.eventApi.on("AdaptableReady",(()=>{requestAnimationFrame((()=>{this.init()}))}))}init(){let e=null;if(this.licenseKey)try{e=(0,n.decode)(this.licenseKey)}catch(a){e=a}O()||u()||A()||this.handleLicenseValidation(e,this.getValidityType(e,this.packageDetails))}getValidityType(e,a){if(!e)return p.NO_LICENSE;if(e instanceof Error)return p.INVALID_LICENSE;const t=new Date(a.publishedAt),s=new Date(e.end),i=s<new Date,o=e.trial;let n=null;return n=i?s>t?o?p.NON_PRODUCTION_EXPIRED_IN_SCOPE:p.COMMERCIAL_EXPIRED_IN_SCOPE:o?p.NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE:p.COMMERCIAL_EXPIRED_OUT_OF_SCOPE:o?p.NON_PRODUCTION_VALID:p.COMMERCIAL_VALID,n}handleLicenseValidation(e,a){var t;const s=new Date;s.setHours(0,0,0,0);let p=0;e instanceof Error||!(null==e?void 0:e.end)||(p=Math.floor(((null===(t=null==e?void 0:e.end)||void 0===t?void 0:t.getTime())-s.getTime())/d),p=(0,i.default)(p,0,1/0));let h="",E="";!e||e instanceof Error||!e.appName||e.appName==n.GENERIC_APP_NAME||(h=e.appName,E=" for application [APP_NAME]");const _=(e,a=o.LicenseDocsLink,t=l,s=p,i=h)=>e.replace("[LINK]",a).replace("[EMAIL]",t).replace("[APP_NAME]",i).replace("[DAYS]",`${s}`);switch(a){case"NO_LICENSE":case"NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE":this.adaptable.logger.consoleLogByMessageType(_("This instance of AdapTable does not have a license, and some functionality has therefore been removed. In order to use a fully-featured version of AdapTable, please contact [EMAIL]. You can learn more about the different AdapTable license options at [LINK]."),"Error"),this.showNotification("No AdapTable License found."),this.showWatermark("This instance of AdapTable does not have a license, and some functionality has therefore been removed."),this.disableStatePersistence();break;case"INVALID_LICENSE":this.adaptable.logger.consoleLogByMessageType(_("This instance of AdapTable seems to use a corrupted License, and some functionality has therefore been removed. In order to use a fully-featured version of AdapTable, please contact [EMAIL]. You can learn more about the different AdapTable license options at [LINK]."),"Error"),this.showNotification("Corrupted AdapTable License found."),this.showWatermark("This instance of AdapTable has a corrupted License, and some functionality has therefore been removed."),this.disableStatePersistence();break;case"NON_PRODUCTION_VALID":this.adaptable.logger.consoleLogByMessageType(_("This AdapTable trial license expires in [DAYS] days. Please contact [EMAIL] to upgrade to a commercial version of AdapTable. You can learn more about the different AdapTable license options at [LINK]."),"Info");break;case"NON_PRODUCTION_EXPIRED_IN_SCOPE":this.adaptable.logger.consoleLogByMessageType(_("This AdapTable trial license has now expired. Please contact [EMAIL] to upgrade to a commercial version of AdapTable. You can learn more about the different AdapTable license options at [LINK]."),"Warning"),this.showWatermark("AdapTable License has expired");break;case"COMMERCIAL_VALID":if(p<=c)this.adaptable.logger.consoleLogByMessageType(_(`This AdapTable license${E} expires in [DAYS] days. Please contact [EMAIL] to renew (giving you access to Support and Updates)`),"Info");else try{(0,r.shouldLogThankYouMessage)()&&this.adaptable.logger.consoleLogByMessageType(_(`Thank you for using a valid AdapTable license${E}. Your license will expire in [DAYS] days.`),"Info")}catch(e){}break;case"COMMERCIAL_EXPIRED_IN_SCOPE":this.adaptable.logger.consoleLogByMessageType(_(`This AdapTable license${E} has expired. Please contact [EMAIL] if you wish to renew (giving you access to Support and Updates)`),"Warning");break;case"COMMERCIAL_EXPIRED_OUT_OF_SCOPE":this.adaptable.logger.consoleLogByMessageType(_(`This AdapTable license${E} has expired. Adaptable version was published after the license expired. Please contact [EMAIL] if you wish to renew your license.`),"Error"),this.showNotification("Adaptable License has expired"),this.showWatermark("Adaptable License has expired")}}showNotification(e){this.adaptable.api.internalApi.dispatchReduxAction((0,t.PopupShowAlert)({alertType:"generic",header:"License Error",message:e,alertDefinition:s.default.CreateInternalAlertDefinitionForMessages("Error")}))}showWatermark(e){this.adaptable.api.internalApi.dispatchReduxAction((0,a.SystemLicenseShowWatermark)(e))}disableStatePersistence(){this.adaptable.api.internalApi.dispatchReduxAction((0,a.SystemLicenseDisablePersistence)())}destroy(){}}exports.LicenseService=N;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LicenseService=exports.LicenseValidityType=void 0;const e=require("tslib"),a=require("../../../Redux/ActionsReducers/SystemRedux"),t=require("../../../Redux/ActionsReducers/PopupRedux"),s=e.__importDefault(require("../../ObjectFactory")),o=e.__importDefault(require("lodash/clamp")),i=require("../../Constants/DocumentationLinkConstants"),n=require("../../license/decode"),r=require("./shouldLogThankYouMessage"),l="sales@adaptabletools.com",c=10,d=864e5;var p;!function(e){e.INVALID_LICENSE="INVALID_LICENSE",e.NO_LICENSE="NO_LICENSE",e.NON_PRODUCTION_VALID="NON_PRODUCTION_VALID",e.NON_PRODUCTION_EXPIRED_IN_SCOPE="NON_PRODUCTION_EXPIRED_IN_SCOPE",e.NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE="NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE",e.COMMERCIAL_VALID="COMMERCIAL_VALID",e.COMMERCIAL_EXPIRED_IN_SCOPE="COMMERCIAL_EXPIRED_IN_SCOPE",e.COMMERCIAL_EXPIRED_OUT_OF_SCOPE="COMMERCIAL_EXPIRED_OUT_OF_SCOPE"}(p=exports.LicenseValidityType||(exports.LicenseValidityType={}));const h=/(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g,E=/(https):\/\/\S+(\.csb\.app)/g,I=/(https):\/\/\S+(\.adaptabletools\.com)/g,_=()=>"undefined"!=typeof window?window.location.origin:"",O=()=>{const e=_();console.log("isInsideSandpack",e);const[a,t,s]=Array.from(h.exec(e)||[]);return"https"===t&&"sandpack.codesandbox.io"===s},u=()=>{const e=_();console.log("isInsideSandbox",e);const[a,t,s]=Array.from(E.exec(e)||[]);return"https"===t&&".csb.app"===s},A=()=>{const e=_();console.log("isDemoApp",e);const[a,t,s]=Array.from(I.exec(e)||[]);return"https"===t&&".adaptabletools.com"===s};class N{constructor(e,a,t){this.adaptable=e,this.licenseKey=a,this.packageDetails=t,this.adaptable=e,this.adaptable.api.eventApi.on("AdaptableReady",(()=>{requestAnimationFrame((()=>{this.init()}))}))}init(){let e=null;if(this.licenseKey)try{e=(0,n.decode)(this.licenseKey)}catch(a){e=a}O()||u()||A()||this.handleLicenseValidation(e,this.getValidityType(e,this.packageDetails))}getValidityType(e,a){if(!e)return p.NO_LICENSE;if(e instanceof Error)return p.INVALID_LICENSE;const t=new Date(a.publishedAt),s=new Date(e.end),o=s<new Date,i=e.trial;let n=null;return n=o?s>t?i?p.NON_PRODUCTION_EXPIRED_IN_SCOPE:p.COMMERCIAL_EXPIRED_IN_SCOPE:i?p.NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE:p.COMMERCIAL_EXPIRED_OUT_OF_SCOPE:i?p.NON_PRODUCTION_VALID:p.COMMERCIAL_VALID,n}handleLicenseValidation(e,a){var t;const s=new Date;s.setHours(0,0,0,0);let p=0;e instanceof Error||!(null==e?void 0:e.end)||(p=Math.floor(((null===(t=null==e?void 0:e.end)||void 0===t?void 0:t.getTime())-s.getTime())/d),p=(0,o.default)(p,0,1/0));let h="",E="";!e||e instanceof Error||!e.appName||e.appName==n.GENERIC_APP_NAME||(h=e.appName,E=" for application [APP_NAME]");const I=(e,a=i.LicenseDocsLink,t=l,s=p,o=h)=>e.replace("[LINK]",a).replace("[EMAIL]",t).replace("[APP_NAME]",o).replace("[DAYS]",`${s}`);switch(a){case"NO_LICENSE":case"NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE":this.adaptable.logger.consoleLogByMessageType(I("This instance of AdapTable does not have a license, and some functionality has therefore been removed. In order to use a fully-featured version of AdapTable, please contact [EMAIL]. You can learn more about the different AdapTable license options at [LINK]."),"Error"),this.showNotification("No AdapTable License found."),this.showWatermark("This instance of AdapTable does not have a license, and some functionality has therefore been removed."),this.disableStatePersistence();break;case"INVALID_LICENSE":this.adaptable.logger.consoleLogByMessageType(I("This instance of AdapTable seems to use a corrupted License, and some functionality has therefore been removed. In order to use a fully-featured version of AdapTable, please contact [EMAIL]. You can learn more about the different AdapTable license options at [LINK]."),"Error"),this.showNotification("Corrupted AdapTable License found."),this.showWatermark("This instance of AdapTable has a corrupted License, and some functionality has therefore been removed."),this.disableStatePersistence();break;case"NON_PRODUCTION_VALID":this.adaptable.logger.consoleLogByMessageType(I("This AdapTable trial license expires in [DAYS] days. Please contact [EMAIL] to upgrade to a commercial version of AdapTable. You can learn more about the different AdapTable license options at [LINK]."),"Info");break;case"NON_PRODUCTION_EXPIRED_IN_SCOPE":this.adaptable.logger.consoleLogByMessageType(I("This AdapTable trial license has now expired. Please contact [EMAIL] to upgrade to a commercial version of AdapTable. You can learn more about the different AdapTable license options at [LINK]."),"Warning"),this.showWatermark("AdapTable License has expired");break;case"COMMERCIAL_VALID":if(p<=c)this.adaptable.logger.consoleLogByMessageType(I(`This AdapTable license${E} expires in [DAYS] days. Please contact [EMAIL] to renew (giving you access to Support and Updates)`),"Info");else try{(0,r.shouldLogThankYouMessage)()&&this.adaptable.logger.consoleLogByMessageType(I(`Thank you for using a valid AdapTable license${E}. Your license will expire in [DAYS] days.`),"Info")}catch(e){}break;case"COMMERCIAL_EXPIRED_IN_SCOPE":this.adaptable.logger.consoleLogByMessageType(I(`This AdapTable license${E} has expired. Please contact [EMAIL] if you wish to renew (giving you access to Support and Updates)`),"Warning");break;case"COMMERCIAL_EXPIRED_OUT_OF_SCOPE":this.adaptable.logger.consoleLogByMessageType(I(`This AdapTable license${E} has expired. Adaptable version was published after the license expired. Please contact [EMAIL] if you wish to renew your license.`),"Error"),this.showNotification("Adaptable License has expired"),this.showWatermark("Adaptable License has expired")}}showNotification(e){this.adaptable.api.internalApi.dispatchReduxAction((0,t.PopupShowAlert)({alertType:"generic",header:"License Error",message:e,alertDefinition:s.default.CreateInternalAlertDefinitionForMessages("Error")}))}showWatermark(e){this.adaptable.api.internalApi.dispatchReduxAction((0,a.SystemLicenseShowWatermark)(e))}disableStatePersistence(){this.adaptable.api.internalApi.dispatchReduxAction((0,a.SystemLicenseDisablePersistence)())}destroy(){}}exports.LicenseService=N;
@@ -87,7 +87,7 @@ const UIOptionsStatusbarForm = (props) => {
87
87
  React.createElement(rebass_1.Box, { as: "b" }, "Create Adaptable Statusbar Panel"),
88
88
  React.createElement(FormLayout_1.default, { mt: 2 },
89
89
  React.createElement(FormLayout_1.FormRow, { label: "Panel Name" },
90
- React.createElement(Input_1.default, { value: adaptablePanelTitle, placehoder: 'Adaptable Panel Name', onChange: (event) => setAdaptablePanelTitle(event.target.value) })),
90
+ React.createElement(Input_1.default, { value: adaptablePanelTitle, placeholder: 'Adaptable Panel Name', onChange: (event) => setAdaptablePanelTitle(event.target.value) })),
91
91
  React.createElement(FormLayout_1.FormRow, { label: "Align" },
92
92
  React.createElement(DropdownButton_1.default, { columns: ['label'], items: alignOptions }, (_d = alignOptions.find((option) => option.value === adaptablePanelAlign)) === null || _d === void 0 ? void 0 : _d.label)),
93
93
  React.createElement(FormLayout_1.FormRow, { label: "" },
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
2
  import { AdaptableInputProps } from '../AdaptableInput';
3
3
  export type AdaptableDateInputProps = AdaptableInputProps;
4
- declare const AdaptableDateInput: React.ForwardRefExoticComponent<Pick<import("../../../components/Input").InputProps, "children" | "size" | "name" | "tabIndex" | "color" | "style" | "cite" | "data" | "form" | "label" | "p" | "slot" | "span" | "summary" | "title" | "pattern" | "start" | "hidden" | "content" | "default" | "flex" | "wrap" | "open" | "padding" | "multiple" | "disabled" | "checked" | "download" | "list" | "order" | "target" | "rows" | "src" | "className" | "onTransitionEnd" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "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" | "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" | "onTransitionEndCapture" | "opacity" | "value" | "key" | "sizes" | "variant" | "tx" | "as" | "css" | "m" | "margin" | "mt" | "marginTop" | "mr" | "marginRight" | "mb" | "marginBottom" | "ml" | "marginLeft" | "mx" | "marginX" | "my" | "marginY" | "pt" | "paddingTop" | "pr" | "paddingRight" | "pb" | "paddingBottom" | "pl" | "paddingLeft" | "px" | "paddingX" | "py" | "paddingY" | "width" | "height" | "minWidth" | "minHeight" | "maxWidth" | "maxHeight" | "display" | "verticalAlign" | "overflow" | "overflowX" | "overflowY" | "fontFamily" | "fontSize" | "fontWeight" | "lineHeight" | "letterSpacing" | "fontStyle" | "textAlign" | "bg" | "backgroundColor" | "alignItems" | "alignContent" | "justifyItems" | "justifyContent" | "flexWrap" | "flexDirection" | "flexGrow" | "flexShrink" | "flexBasis" | "justifySelf" | "alignSelf" | "sx" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "dateTime" | "defer" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "muted" | "nonce" | "noValidate" | "optimum" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "srcDoc" | "srcLang" | "srcSet" | "step" | "type" | "useMap" | "wmode" | "placehoder"> & React.RefAttributes<HTMLInputElement>>;
4
+ declare const AdaptableDateInput: React.ForwardRefExoticComponent<Pick<import("../../../components/Input").InputProps, "children" | "size" | "name" | "tabIndex" | "color" | "style" | "cite" | "data" | "form" | "label" | "p" | "slot" | "span" | "summary" | "title" | "pattern" | "start" | "hidden" | "content" | "default" | "flex" | "wrap" | "open" | "padding" | "multiple" | "disabled" | "checked" | "download" | "list" | "order" | "target" | "rows" | "src" | "className" | "onTransitionEnd" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "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" | "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" | "onTransitionEndCapture" | "opacity" | "value" | "key" | "sizes" | "variant" | "tx" | "as" | "css" | "m" | "margin" | "mt" | "marginTop" | "mr" | "marginRight" | "mb" | "marginBottom" | "ml" | "marginLeft" | "mx" | "marginX" | "my" | "marginY" | "pt" | "paddingTop" | "pr" | "paddingRight" | "pb" | "paddingBottom" | "pl" | "paddingLeft" | "px" | "paddingX" | "py" | "paddingY" | "width" | "height" | "minWidth" | "minHeight" | "maxWidth" | "maxHeight" | "display" | "verticalAlign" | "overflow" | "overflowX" | "overflowY" | "fontFamily" | "fontSize" | "fontWeight" | "lineHeight" | "letterSpacing" | "fontStyle" | "textAlign" | "bg" | "backgroundColor" | "alignItems" | "alignContent" | "justifyItems" | "justifyContent" | "flexWrap" | "flexDirection" | "flexGrow" | "flexShrink" | "flexBasis" | "justifySelf" | "alignSelf" | "sx" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "dateTime" | "defer" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "muted" | "nonce" | "noValidate" | "optimum" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "srcDoc" | "srcLang" | "srcSet" | "step" | "type" | "useMap" | "wmode"> & React.RefAttributes<HTMLInputElement>>;
5
5
  export default AdaptableDateInput;
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ export declare const AdaptableDateInlineInput: React.ForwardRefExoticComponent<Pick<Omit<import("../../../components/Input").InputProps, "onChange" | "value"> & {
3
+ onChange: (value: string) => void;
4
+ value: string;
5
+ }, "children" | "size" | "name" | "tabIndex" | "color" | "style" | "cite" | "data" | "form" | "label" | "p" | "slot" | "span" | "summary" | "title" | "pattern" | "start" | "hidden" | "content" | "default" | "flex" | "wrap" | "open" | "padding" | "multiple" | "disabled" | "checked" | "download" | "list" | "order" | "target" | "rows" | "src" | "className" | "onTransitionEnd" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "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" | "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" | "onTransitionEndCapture" | "opacity" | "value" | "key" | "sizes" | "variant" | "tx" | "as" | "css" | "m" | "margin" | "mt" | "marginTop" | "mr" | "marginRight" | "mb" | "marginBottom" | "ml" | "marginLeft" | "mx" | "marginX" | "my" | "marginY" | "pt" | "paddingTop" | "pr" | "paddingRight" | "pb" | "paddingBottom" | "pl" | "paddingLeft" | "px" | "paddingX" | "py" | "paddingY" | "width" | "height" | "minWidth" | "minHeight" | "maxWidth" | "maxHeight" | "display" | "verticalAlign" | "overflow" | "overflowX" | "overflowY" | "fontFamily" | "fontSize" | "fontWeight" | "lineHeight" | "letterSpacing" | "fontStyle" | "textAlign" | "bg" | "backgroundColor" | "alignItems" | "alignContent" | "justifyItems" | "justifyContent" | "flexWrap" | "flexDirection" | "flexGrow" | "flexShrink" | "flexBasis" | "justifySelf" | "alignSelf" | "sx" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "dateTime" | "defer" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "muted" | "nonce" | "noValidate" | "optimum" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "srcDoc" | "srcLang" | "srcSet" | "step" | "type" | "useMap" | "wmode"> & React.RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AdaptableDateInlineInput = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const React = tslib_1.__importStar(require("react"));
6
+ const date_fns_1 = require("date-fns");
7
+ const react_1 = require("react");
8
+ const Input_1 = tslib_1.__importDefault(require("../../../components/Input"));
9
+ const AdaptableContext_1 = require("../../AdaptableContext");
10
+ exports.AdaptableDateInlineInput = React.forwardRef((props, ref) => {
11
+ var _a;
12
+ const [hasFocus, setHasFocus] = (0, react_1.useState)(false);
13
+ const dateInputOptions = (0, AdaptableContext_1.useAdaptable)().adaptableOptions.userInterfaceOptions.dateInputOptions;
14
+ const dateProps = {
15
+ format: dateInputOptions.dateFormat,
16
+ locale: dateInputOptions.locale,
17
+ };
18
+ const [inputValue, setInputValue] = (0, react_1.useState)(() => {
19
+ return props.value;
20
+ });
21
+ React.useEffect(() => {
22
+ if (hasFocus) {
23
+ return;
24
+ }
25
+ setInputValue(props.value);
26
+ }, [props.value]);
27
+ const handleInputChange = (e) => {
28
+ setInputValue(e.currentTarget.value);
29
+ const date = (0, date_fns_1.parse)(e.currentTarget.value, dateProps.format, new Date());
30
+ if ((0, date_fns_1.isValid)(date)) {
31
+ props.onChange(e.currentTarget.value);
32
+ }
33
+ else {
34
+ props.onChange(undefined);
35
+ }
36
+ };
37
+ return (React.createElement(Input_1.default, Object.assign({}, props, { onFocus: (event) => {
38
+ var _a;
39
+ (_a = props.onFocus) === null || _a === void 0 ? void 0 : _a.call(props, event);
40
+ setHasFocus(true);
41
+ }, onBlur: (event) => {
42
+ var _a;
43
+ (_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props, event);
44
+ setHasFocus(false);
45
+ }, ref: ref, value: inputValue, onChange: (e) => handleInputChange(e), placeholder: (_a = props.placeholder) !== null && _a !== void 0 ? _a : dateProps.format, style: props.style, disabled: props.disabled })));
46
+ });
@@ -18,12 +18,13 @@ const ObjectFactory_1 = require("../../../Utilities/ObjectFactory");
18
18
  const HelpBlock_1 = tslib_1.__importDefault(require("../../../components/HelpBlock"));
19
19
  const rebass_1 = require("rebass");
20
20
  const Radio_1 = tslib_1.__importDefault(require("../../../components/Radio"));
21
- const Helper_1 = tslib_1.__importDefault(require("../../../Utilities/Helpers/Helper"));
21
+ const Helper_1 = tslib_1.__importStar(require("../../../Utilities/Helpers/Helper"));
22
22
  const AdaptableInput_1 = tslib_1.__importDefault(require("../AdaptableInput"));
23
23
  const renderWithAdaptableContext_1 = require("../../renderWithAdaptableContext");
24
24
  const CheckBox_1 = require("../../../components/CheckBox");
25
25
  const runIfNotResolvedIn_1 = require("../../../Utilities/runIfNotResolvedIn");
26
26
  const getDefaultColumnFilterPredicate_1 = require("./getDefaultColumnFilterPredicate");
27
+ const AdaptableDateInlineInput_1 = require("../AdaptableInput/AdaptableDateInlineInput");
27
28
  const panelStyle = {
28
29
  width: '100%',
29
30
  minWidth: 150,
@@ -178,13 +179,20 @@ class FilterFormComponent extends React.Component {
178
179
  this.changeColumnPredicateInput(newCheckedValue, 0);
179
180
  } })));
180
181
  }
181
- return (_a = predicateDef.inputs) === null || _a === void 0 ? void 0 : _a.map((predicateInput, index) => (React.createElement(rebass_1.Flex, { key: index, flexDirection: "row" },
182
- React.createElement(AdaptableInput_1.default, { onMouseDown: (event) => {
183
- if (predicateInput.type === 'date') {
184
- // This prevents the ag-grid dropdown closing when a date is selected
185
- event.stopPropagation();
186
- }
187
- }, disabled: this.isFilterDisabled(), type: predicateInput.type, autoFocus: index === 0, value: filter.Predicate.Inputs[index], onChange: (e) => this.changeColumnPredicateInput(e.target.value, index), mb: 1, flex: 1, fontSize: 2 }))));
182
+ return (_a = predicateDef.inputs) === null || _a === void 0 ? void 0 : _a.map((predicateInput, index) => {
183
+ var _a, _b;
184
+ const showDatePicker = (_b = (_a = this.props.api.optionsApi) === null || _a === void 0 ? void 0 : _a.getColumnFilterOptions()) === null || _b === void 0 ? void 0 : _b.showDatePicker;
185
+ if (predicateInput.type === 'date' && !showDatePicker) {
186
+ return (React.createElement(AdaptableDateInlineInput_1.AdaptableDateInlineInput, { value: filter.Predicate.Inputs[index], onChange: (value) => this.changeColumnPredicateInput(value, index) }));
187
+ }
188
+ return (React.createElement(rebass_1.Flex, { key: index, flexDirection: "row" },
189
+ React.createElement(AdaptableInput_1.default, { onMouseDown: (event) => {
190
+ if (predicateInput.type === 'date') {
191
+ // This prevents the ag-grid dropdown closing when a date is selected
192
+ event.stopPropagation();
193
+ }
194
+ }, disabled: this.isFilterDisabled(), type: predicateInput.type, autoFocus: index === 0, value: filter.Predicate.Inputs[index], onChange: (e) => this.changeColumnPredicateInput(e.target.value, index), mb: 1, flex: 1, fontSize: 2 })));
195
+ });
188
196
  }
189
197
  isFilterDisabled() {
190
198
  var _a;
@@ -259,12 +267,12 @@ class FilterFormComponent extends React.Component {
259
267
  }
260
268
  changeColumnPredicateInput(value, index) {
261
269
  const { editedColumnFilter } = this.state;
262
- editedColumnFilter.Predicate.Inputs[index] = value;
263
- this.setState({ editedColumnFilter });
270
+ const newEditedColumnFilter = (0, Helper_1.cloneObject)(editedColumnFilter);
271
+ newEditedColumnFilter.Predicate.Inputs[index] = value;
272
+ this.setState({ editedColumnFilter: newEditedColumnFilter });
264
273
  if (this.props.api.optionsApi.getColumnFilterOptions().autoApplyFilter) {
265
- this.props.onSetColumnFilter(editedColumnFilter);
274
+ this.props.onSetColumnFilter(newEditedColumnFilter);
266
275
  }
267
- // this.props.onSetColumnFilter(editedColumnFilter);
268
276
  }
269
277
  }
270
278
  function mapStateToProps(state, ownProps) {
@@ -19,6 +19,7 @@ const getDefaultColumnFilterPredicate_1 = require("./getDefaultColumnFilterPredi
19
19
  const Icon_1 = require("../../../components/Icon");
20
20
  const QuickFilterValues_1 = require("./QuickFilterValues");
21
21
  const AdaptableIconComponent_1 = require("../AdaptableIconComponent");
22
+ const AdaptableDateInlineInput_1 = require("../AdaptableInput/AdaptableDateInlineInput");
22
23
  class QuickFilterFormComponent extends React.Component {
23
24
  constructor(props) {
24
25
  super(props);
@@ -140,17 +141,23 @@ class QuickFilterFormComponent extends React.Component {
140
141
  } })));
141
142
  }
142
143
  return (_a = predicateDef === null || predicateDef === void 0 ? void 0 : predicateDef.inputs) === null || _a === void 0 ? void 0 : _a.map((predicateInput, index) => {
143
- var _a, _b;
144
+ var _a, _b, _c, _d, _e, _f;
145
+ const showDatePicker = (_b = (_a = this.props.api.optionsApi) === null || _a === void 0 ? void 0 : _a.getColumnFilterOptions()) === null || _b === void 0 ? void 0 : _b.showDatePicker;
146
+ const value = (_d = (_c = filter.Predicate.Inputs) === null || _c === void 0 ? void 0 : _c[index]) !== null && _d !== void 0 ? _d : '';
147
+ const onKeyDownCapture = (e) => {
148
+ if (e.nativeEvent.key === 'Escape') {
149
+ e.nativeEvent.preventDefault();
150
+ e.nativeEvent.stopPropagation();
151
+ this.clearFilter();
152
+ }
153
+ };
154
+ if (predicateInput.type === 'date' && !showDatePicker) {
155
+ return (React.createElement(AdaptableDateInlineInput_1.AdaptableDateInlineInput, { value: value, onKeyDownCapture: onKeyDownCapture, onChange: (value) => this.changeColumnPredicateInput(value, index) }));
156
+ }
144
157
  return (React.createElement(AdaptableInput_1.default, { disabled: this.isFilterDisabled(), key: index, type: predicateInput.type === 'number' ? 'text' : predicateInput.type,
145
158
  // autoFocus has to be FALSE because if the input receives focus in the init phase,
146
159
  // it may scroll the AG Grid header viewport into view and de-synchronize it (relative to the content viewport)
147
- autoFocus: false, value: (_b = (_a = filter.Predicate.Inputs) === null || _a === void 0 ? void 0 : _a[index]) !== null && _b !== void 0 ? _b : '', onChange: (e) => this.changeColumnPredicateInput(e.target.value, index), onKeyDownCapture: (e) => {
148
- if (e.nativeEvent.key === 'Escape') {
149
- e.nativeEvent.preventDefault();
150
- e.nativeEvent.stopPropagation();
151
- this.clearFilter();
152
- }
153
- }, style: {
160
+ autoFocus: false, value: (_f = (_e = filter.Predicate.Inputs) === null || _e === void 0 ? void 0 : _e[index]) !== null && _f !== void 0 ? _f : '', onChange: (e) => this.changeColumnPredicateInput(e.target.value, index), onKeyDownCapture: onKeyDownCapture, style: {
154
161
  width: '100%',
155
162
  padding: 'var(--ab-space-1)',
156
163
  borderRadius: 0,
@@ -53,7 +53,7 @@ const QueryViewPanelComponent = (props) => {
53
53
  paddingTop: 6,
54
54
  overflow: 'hidden',
55
55
  zIndex: 100,
56
- }, placehoder: "Grid Filter", onChange: (x) => setExpression(x.target.value), value: expression })),
56
+ }, placeholder: "Grid Filter", onChange: (x) => setExpression(x.target.value), value: expression })),
57
57
  isExpressionValid && (React.createElement(ButtonPlay_1.ButtonPlay, { onClick: () => runQuery(), tooltip: '', accessLevel: gridFilterAccessLevel, variant: "text", tone: "neutral", disabled: disabled || expression == '' || expression == (gridFilter === null || gridFilter === void 0 ? void 0 : gridFilter.Expression), marginRight: 1 })),
58
58
  gridFilter && !isExpressionValid && (React.createElement(ButtonInvalid_1.ButtonInvalid, { variant: "text", tone: "neutral", tooltip: "Invalid Grid Filter", marginRight: 1 })),
59
59
  ' ',
@@ -79,7 +79,7 @@ const QueryViewPanelComponent = (props) => {
79
79
  zIndex: 100,
80
80
  height: '100%',
81
81
  overflow: 'hidden',
82
- }, placehoder: "Grid Filter", onChange: (x) => setExpression(x.target.value), value: expression }))));
82
+ }, placeholder: "Grid Filter", onChange: (x) => setExpression(x.target.value), value: expression }))));
83
83
  };
84
84
  const saveButton = (React.createElement(ButtonSave_1.ButtonSave, { onClick: () => saveQuery(), tooltip: "Save as Named Query", accessLevel: namedQueryModuleAccessLevel, disabled: disabled || !isExpressionValid || isExpressionNamedQuery || expression == '', variant: "text", tone: "neutral", marginRight: 1 }));
85
85
  const suspendButton = (React.createElement(ButtonPause_1.ButtonPause, { onClick: () => suspendGridFilter(), tooltip: "Suspend Grid Filter", accessLevel: gridFilterAccessLevel, disabled: disabled || !isExpressionValid, variant: "text", tone: "neutral", marginRight: 1 }));
@@ -175,7 +175,7 @@ const ColumnRow = (props) => {
175
175
  React.createElement(FormLayout_1.FormRow, { label: "ColumnId" },
176
176
  React.createElement(Tag_1.Tag, null, props.column.columnId)),
177
177
  React.createElement(FormLayout_1.FormRow, { label: "Header" },
178
- React.createElement(Input_1.default, { "data-name": "column-header", className: "ab-Layout-Wizard__ColumnRow__Input", placehoder: "Custom name (optional)", onChange: () => {
178
+ React.createElement(Input_1.default, { "data-name": "column-header", className: "ab-Layout-Wizard__ColumnRow__Input", placeholder: "Custom name (optional)", onChange: () => {
179
179
  props.onColumnNameChange(props.column.columnId, event.target.value);
180
180
  }, value: customHeader })),
181
181
  React.createElement(FormLayout_1.FormRow, { label: "Width" },