@deephaven/iris-grid 0.8.2-beta.1 → 0.9.1-beta.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.
Files changed (125) hide show
  1. package/dist/AdvancedFilterCreator.d.ts +2 -2
  2. package/dist/AdvancedFilterCreator.d.ts.map +1 -1
  3. package/dist/AdvancedFilterCreatorFilterItem.d.ts +30 -31
  4. package/dist/AdvancedFilterCreatorFilterItem.d.ts.map +1 -1
  5. package/dist/AdvancedFilterCreatorFilterItem.js +21 -28
  6. package/dist/AdvancedFilterCreatorFilterItem.js.map +1 -1
  7. package/dist/CrossColumnSearch.d.ts +1 -1
  8. package/dist/CrossColumnSearch.d.ts.map +1 -1
  9. package/dist/DateUtils.d.ts +46 -44
  10. package/dist/DateUtils.d.ts.map +1 -1
  11. package/dist/DateUtils.js +37 -32
  12. package/dist/DateUtils.js.map +1 -1
  13. package/dist/Formatter.d.ts +37 -42
  14. package/dist/Formatter.d.ts.map +1 -1
  15. package/dist/Formatter.js +58 -38
  16. package/dist/Formatter.js.map +1 -1
  17. package/dist/FormatterUtils.d.ts +12 -8
  18. package/dist/FormatterUtils.d.ts.map +1 -1
  19. package/dist/FormatterUtils.js.map +1 -1
  20. package/dist/IrisGrid.d.ts +12 -4
  21. package/dist/IrisGrid.d.ts.map +1 -1
  22. package/dist/IrisGrid.js +20 -4
  23. package/dist/IrisGrid.js.map +1 -1
  24. package/dist/IrisGridMetricCalculator.d.ts +16 -2
  25. package/dist/IrisGridMetricCalculator.d.ts.map +1 -1
  26. package/dist/IrisGridMetricCalculator.js +4 -3
  27. package/dist/IrisGridMetricCalculator.js.map +1 -1
  28. package/dist/IrisGridTheme.d.ts +5 -75
  29. package/dist/IrisGridTheme.d.ts.map +1 -1
  30. package/dist/IrisGridTheme.js +2 -1
  31. package/dist/IrisGridTheme.js.map +1 -1
  32. package/dist/IrisGridUtils.d.ts +4 -4
  33. package/dist/IrisGridUtils.d.ts.map +1 -1
  34. package/dist/MissingKeyError.js +4 -0
  35. package/dist/MissingKeyError.js.map +1 -1
  36. package/dist/PartitionSelectorSearch.d.ts +1 -1
  37. package/dist/TableUtils.d.ts +127 -114
  38. package/dist/TableUtils.d.ts.map +1 -1
  39. package/dist/TableUtils.js +76 -69
  40. package/dist/TableUtils.js.map +1 -1
  41. package/dist/declaration.d.js +2 -0
  42. package/dist/declaration.d.js.map +1 -0
  43. package/dist/filters/FilterOperator.d.ts +5 -5
  44. package/dist/filters/FilterOperator.d.ts.map +1 -1
  45. package/dist/filters/FilterOperator.js +1 -3
  46. package/dist/filters/FilterOperator.js.map +1 -1
  47. package/dist/filters/FilterType.d.ts +23 -23
  48. package/dist/filters/FilterType.d.ts.map +1 -1
  49. package/dist/filters/FilterType.js +1 -3
  50. package/dist/filters/FilterType.js.map +1 -1
  51. package/dist/filters/index.d.ts +2 -2
  52. package/dist/filters/index.d.ts.map +1 -1
  53. package/dist/filters/index.js +2 -2
  54. package/dist/filters/index.js.map +1 -1
  55. package/dist/format-context-menus/CustomFormatAction.d.ts +27 -39
  56. package/dist/format-context-menus/CustomFormatAction.d.ts.map +1 -1
  57. package/dist/format-context-menus/CustomFormatAction.js +24 -23
  58. package/dist/format-context-menus/CustomFormatAction.js.map +1 -1
  59. package/dist/format-context-menus/DateTimeFormatContextMenu.d.ts +8 -5
  60. package/dist/format-context-menus/DateTimeFormatContextMenu.d.ts.map +1 -1
  61. package/dist/format-context-menus/DateTimeFormatContextMenu.js +3 -3
  62. package/dist/format-context-menus/DateTimeFormatContextMenu.js.map +1 -1
  63. package/dist/format-context-menus/DecimalFormatContextMenu.d.ts +7 -5
  64. package/dist/format-context-menus/DecimalFormatContextMenu.d.ts.map +1 -1
  65. package/dist/format-context-menus/DecimalFormatContextMenu.js +3 -3
  66. package/dist/format-context-menus/DecimalFormatContextMenu.js.map +1 -1
  67. package/dist/format-context-menus/FormatContextMenuUtils.d.ts +28 -27
  68. package/dist/format-context-menus/FormatContextMenuUtils.d.ts.map +1 -1
  69. package/dist/format-context-menus/FormatContextMenuUtils.js +12 -10
  70. package/dist/format-context-menus/FormatContextMenuUtils.js.map +1 -1
  71. package/dist/format-context-menus/IntegerFormatContextMenu.d.ts +7 -5
  72. package/dist/format-context-menus/IntegerFormatContextMenu.d.ts.map +1 -1
  73. package/dist/format-context-menus/IntegerFormatContextMenu.js +3 -3
  74. package/dist/format-context-menus/IntegerFormatContextMenu.js.map +1 -1
  75. package/dist/format-context-menus/index.d.ts +3 -3
  76. package/dist/format-context-menus/index.d.ts.map +1 -1
  77. package/dist/format-context-menus/index.js.map +1 -1
  78. package/dist/formatters/BooleanColumnFormatter.d.ts +4 -4
  79. package/dist/formatters/BooleanColumnFormatter.d.ts.map +1 -1
  80. package/dist/formatters/BooleanColumnFormatter.js.map +1 -1
  81. package/dist/formatters/CharColumnFormatter.d.ts +4 -4
  82. package/dist/formatters/CharColumnFormatter.d.ts.map +1 -1
  83. package/dist/formatters/CharColumnFormatter.js.map +1 -1
  84. package/dist/formatters/DateTimeColumnFormatter.d.ts +13 -11
  85. package/dist/formatters/DateTimeColumnFormatter.d.ts.map +1 -1
  86. package/dist/formatters/DateTimeColumnFormatter.js +12 -2
  87. package/dist/formatters/DateTimeColumnFormatter.js.map +1 -1
  88. package/dist/formatters/DecimalColumnFormatter.d.ts +55 -59
  89. package/dist/formatters/DecimalColumnFormatter.d.ts.map +1 -1
  90. package/dist/formatters/DecimalColumnFormatter.js +66 -27
  91. package/dist/formatters/DecimalColumnFormatter.js.map +1 -1
  92. package/dist/formatters/DefaultColumnFormatter.d.ts +4 -4
  93. package/dist/formatters/DefaultColumnFormatter.d.ts.map +1 -1
  94. package/dist/formatters/DefaultColumnFormatter.js.map +1 -1
  95. package/dist/formatters/IntegerColumnFormatter.d.ts +50 -29
  96. package/dist/formatters/IntegerColumnFormatter.d.ts.map +1 -1
  97. package/dist/formatters/IntegerColumnFormatter.js +60 -19
  98. package/dist/formatters/IntegerColumnFormatter.js.map +1 -1
  99. package/dist/formatters/index.d.ts +8 -7
  100. package/dist/formatters/index.d.ts.map +1 -1
  101. package/dist/formatters/index.js +4 -3
  102. package/dist/formatters/index.js.map +1 -1
  103. package/dist/index.d.ts +1 -0
  104. package/dist/index.js +1 -0
  105. package/dist/index.js.map +1 -1
  106. package/dist/key-handlers/ClearFilterKeyHandler.js +5 -0
  107. package/dist/key-handlers/ClearFilterKeyHandler.js.map +1 -1
  108. package/dist/key-handlers/CopyKeyHandler.js +5 -0
  109. package/dist/key-handlers/CopyKeyHandler.js.map +1 -1
  110. package/dist/key-handlers/ReverseKeyHandler.js +5 -0
  111. package/dist/key-handlers/ReverseKeyHandler.js.map +1 -1
  112. package/dist/mousehandlers/IrisGridContextMenuHandler.d.ts +14 -5
  113. package/dist/mousehandlers/IrisGridContextMenuHandler.d.ts.map +1 -1
  114. package/dist/sidebar/ChartBuilder.d.ts +1 -1
  115. package/dist/sidebar/ChartBuilder.d.ts.map +1 -1
  116. package/dist/sidebar/TableCsvExporter.d.ts +1 -1
  117. package/dist/sidebar/TableCsvExporter.d.ts.map +1 -1
  118. package/dist/sidebar/aggregations/AggregationEdit.d.ts +2 -4
  119. package/dist/sidebar/aggregations/AggregationEdit.d.ts.map +1 -1
  120. package/dist/sidebar/aggregations/AggregationEdit.js.map +1 -1
  121. package/dist/sidebar/aggregations/AggregationUtils.d.ts +1 -4
  122. package/dist/sidebar/aggregations/AggregationUtils.d.ts.map +1 -1
  123. package/dist/sidebar/aggregations/AggregationUtils.js.map +1 -1
  124. package/package.json +11 -11
  125. package/dist/tsconfig.tsbuildinfo +0 -1
@@ -1,4 +1,13 @@
1
- export default CustomFormatAction;
1
+ import React, { Component } from 'react';
2
+ import './CustomFormatAction.scss';
3
+ declare type CustomFormatActionProps = typeof CustomFormatAction.defaultProps & {
4
+ forwardedProps: {
5
+ menuItem: {
6
+ title?: string;
7
+ description?: string;
8
+ };
9
+ };
10
+ };
2
11
  /**
3
12
  * Renders menuElement option with custom format input for use in formatting context menus
4
13
  *
@@ -6,47 +15,26 @@ export default CustomFormatAction;
6
15
  * - capture focus when this menu action is selected via ArrowUp/ArrowDown keys
7
16
  * - dynamically update selected menu item when clicking on the input box
8
17
  */
9
- declare class CustomFormatAction extends React.Component<any, any, any> {
10
- constructor(props: any);
18
+ declare class CustomFormatAction extends Component<CustomFormatActionProps> {
19
+ static defaultProps: {
20
+ formatString: string;
21
+ forwardedProps: {
22
+ menuItem: {};
23
+ closeMenu(focusInput: boolean): void;
24
+ iconElement: null;
25
+ };
26
+ placeholder: string;
27
+ title: string;
28
+ onChange(value: string | null): void;
29
+ };
30
+ constructor(props?: CustomFormatActionProps);
31
+ inputRef: React.RefObject<HTMLInputElement>;
11
32
  handleInputChange(): void;
12
- handleKeyDown(event: any): void;
13
- inputRef: React.RefObject<any>;
14
33
  closeContextMenu(): void;
15
34
  revertToDefault(): void;
16
35
  returnFocusToContextMenu(): void;
36
+ handleKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void;
37
+ render(): JSX.Element;
17
38
  }
18
- declare namespace CustomFormatAction {
19
- namespace propTypes {
20
- const formatString: PropTypes.Requireable<string>;
21
- const forwardedProps: PropTypes.Requireable<PropTypes.InferProps<{
22
- menuItem: PropTypes.Requireable<PropTypes.InferProps<{
23
- title: PropTypes.Requireable<string>;
24
- description: PropTypes.Requireable<string>;
25
- }>>;
26
- closeMenu: PropTypes.Requireable<(...args: any[]) => any>;
27
- iconElement: PropTypes.Requireable<PropTypes.ReactNodeLike>;
28
- }>>;
29
- const placeholder: PropTypes.Requireable<string>;
30
- const title: PropTypes.Requireable<string>;
31
- const onChange: PropTypes.Requireable<(...args: any[]) => any>;
32
- }
33
- namespace defaultProps {
34
- const formatString_1: string;
35
- export { formatString_1 as formatString };
36
- export namespace forwardedProps_1 {
37
- const menuItem: {};
38
- function closeMenu(): void;
39
- const iconElement: null;
40
- }
41
- export { forwardedProps_1 as forwardedProps };
42
- const placeholder_1: string;
43
- export { placeholder_1 as placeholder };
44
- const title_1: string;
45
- export { title_1 as title };
46
- export function onChange_1(): void;
47
- export { onChange_1 as onChange };
48
- }
49
- }
50
- import React from "react";
51
- import PropTypes from "prop-types";
39
+ export default CustomFormatAction;
52
40
  //# sourceMappingURL=CustomFormatAction.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CustomFormatAction.d.ts","sourceRoot":"","sources":["../../src/format-context-menus/CustomFormatAction.jsx"],"names":[],"mappings":";AAOA;;;;;;GAMG;AACH;IACE,wBAOC;IAED,0BAGC;IAuBD,gCAsBC;IAnDC,+BAAiC;IAQnC,yBAIC;IAED,wBAGC;IAED,iCAQC;CA4DF;;;;;;;;;;;;;;;;;;;;;YAqBc,2BAAQ;;;;;;;;QAKX,mCAAQ"}
1
+ {"version":3,"file":"CustomFormatAction.d.ts","sourceRoot":"","sources":["../../src/format-context-menus/CustomFormatAction.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIzC,OAAO,2BAA2B,CAAC;AAEnC,aAAK,uBAAuB,GAAG,OAAO,kBAAkB,CAAC,YAAY,GAAG;IACtE,cAAc,EAAE;QACd,QAAQ,EAAE;YACR,KAAK,CAAC,EAAE,MAAM,CAAC;YACf,WAAW,CAAC,EAAE,MAAM,CAAC;SACtB,CAAC;KACH,CAAC;CACH,CAAC;AAEF;;;;;;GAMG;AACH,cAAM,kBAAmB,SAAQ,SAAS,CAAC,uBAAuB,CAAC;IACjE,MAAM,CAAC,YAAY;;;;kCAIO,OAAO,GAAG,IAAI;;;;;wBAOtB,MAAM,GAAG,IAAI,GAAG,IAAI;MAGpC;gBAGA,KAAK,GAAE,uBAAyD;IAUlE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAE5C,iBAAiB,IAAI,IAAI;IAOzB,gBAAgB,IAAI,IAAI;IAMxB,eAAe,IAAI,IAAI;IAKvB,wBAAwB,IAAI,IAAI;IAUhC,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,GAAG,IAAI;IAwBjE,MAAM,IAAI,GAAG,CAAC,OAAO;CAkCtB;AAED,eAAe,kBAAkB,CAAC"}
@@ -1,8 +1,10 @@
1
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+
1
3
  import React, { Component } from 'react';
2
- import PropTypes from 'prop-types';
3
4
  import { Tooltip } from '@deephaven/components';
4
5
  import { DOMUtils } from '@deephaven/utils';
5
6
  import "./CustomFormatAction.css";
7
+
6
8
  /**
7
9
  * Renders menuElement option with custom format input for use in formatting context menus
8
10
  *
@@ -10,10 +12,13 @@ import "./CustomFormatAction.css";
10
12
  * - capture focus when this menu action is selected via ArrowUp/ArrowDown keys
11
13
  * - dynamically update selected menu item when clicking on the input box
12
14
  */
13
-
14
15
  class CustomFormatAction extends Component {
15
- constructor(props) {
16
+ constructor() {
17
+ var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : CustomFormatAction.defaultProps;
16
18
  super(props);
19
+
20
+ _defineProperty(this, "inputRef", void 0);
21
+
17
22
  this.handleInputChange = this.handleInputChange.bind(this);
18
23
  this.handleKeyDown = this.handleKeyDown.bind(this);
19
24
  this.inputRef = /*#__PURE__*/React.createRef();
@@ -23,7 +28,10 @@ class CustomFormatAction extends Component {
23
28
  var {
24
29
  onChange
25
30
  } = this.props;
26
- onChange(this.inputRef.current.value);
31
+
32
+ if (this.inputRef.current) {
33
+ onChange(this.inputRef.current.value);
34
+ }
27
35
  }
28
36
 
29
37
  closeContextMenu() {
@@ -46,7 +54,7 @@ class CustomFormatAction extends Component {
46
54
  returnFocusToContextMenu() {
47
55
  var parentContextMenu = DOMUtils.getClosestByClassName(this.inputRef.current, 'context-menu-container');
48
56
 
49
- if (parentContextMenu) {
57
+ if (parentContextMenu instanceof HTMLElement) {
50
58
  parentContextMenu.focus();
51
59
  }
52
60
  }
@@ -121,30 +129,23 @@ class CustomFormatAction extends Component {
121
129
 
122
130
  }
123
131
 
124
- CustomFormatAction.propTypes = {
125
- formatString: PropTypes.string,
126
- forwardedProps: PropTypes.shape({
127
- menuItem: PropTypes.shape({
128
- title: PropTypes.string,
129
- description: PropTypes.string
130
- }),
131
- closeMenu: PropTypes.func,
132
- iconElement: PropTypes.node
133
- }),
134
- placeholder: PropTypes.string,
135
- title: PropTypes.string,
136
- onChange: PropTypes.func
137
- };
138
- CustomFormatAction.defaultProps = {
132
+ _defineProperty(CustomFormatAction, "defaultProps", {
139
133
  formatString: '',
140
134
  forwardedProps: {
141
135
  menuItem: {},
142
- closeMenu: () => {},
136
+
137
+ closeMenu(focusInput) {// no-op
138
+ },
139
+
143
140
  iconElement: null
144
141
  },
145
142
  placeholder: '',
146
143
  title: '',
147
- onChange: () => {}
148
- };
144
+
145
+ onChange(value) {// no-op
146
+ }
147
+
148
+ });
149
+
149
150
  export default CustomFormatAction;
150
151
  //# sourceMappingURL=CustomFormatAction.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/format-context-menus/CustomFormatAction.jsx"],"names":["React","Component","PropTypes","Tooltip","DOMUtils","CustomFormatAction","constructor","props","handleInputChange","bind","handleKeyDown","inputRef","createRef","onChange","current","value","closeContextMenu","forwardedProps","closeMenu","revertToDefault","returnFocusToContextMenu","parentContextMenu","getClosestByClassName","focus","event","key","stopPropagation","render","formatString","placeholder","title","menuItem","description","iconElement","propTypes","string","shape","func","node","defaultProps"],"mappings":"AAAA,OAAOA,KAAP,IAAgBC,SAAhB,QAAiC,OAAjC;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SAASC,OAAT,QAAwB,uBAAxB;AACA,SAASC,QAAT,QAAyB,kBAAzB;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMC,kBAAN,SAAiCJ,SAAjC,CAA2C;AACzCK,EAAAA,WAAW,CAACC,KAAD,EAAQ;AACjB,UAAMA,KAAN;AAEA,S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,EAAE7B,SAAS,CAACkC,KAAV,CAAgB;AACxBN,MAAAA,KAAK,EAAE5B,SAAS,CAACiC,MADO;AAExBH,MAAAA,WAAW,EAAE9B,SAAS,CAACiC;AAFC,KAAhB,CADoB;AAK9BjB,IAAAA,SAAS,EAAEhB,SAAS,CAACmC,IALS;AAM9BJ,IAAAA,WAAW,EAAE/B,SAAS,CAACoC;AANO,GAAhB,CAFa;AAU7BT,EAAAA,WAAW,EAAE3B,SAAS,CAACiC,MAVM;AAW7BL,EAAAA,KAAK,EAAE5B,SAAS,CAACiC,MAXY;AAY7BtB,EAAAA,QAAQ,EAAEX,SAAS,CAACmC;AAZS,CAA/B;AAeAhC,kBAAkB,CAACkC,YAAnB,GAAkC;AAChCX,EAAAA,YAAY,EAAE,EADkB;AAEhCX,EAAAA,cAAc,EAAE;AACdc,IAAAA,QAAQ,EAAE,EADI;AAEdb,IAAAA,SAAS,EAAE,MAAM,CAAE,CAFL;AAGde,IAAAA,WAAW,EAAE;AAHC,GAFgB;AAOhCJ,EAAAA,WAAW,EAAE,EAPmB;AAQhCC,EAAAA,KAAK,EAAE,EARyB;AAShCjB,EAAAA,QAAQ,EAAE,MAAM,CAAE;AATc,CAAlC;AAYA,eAAeR,kBAAf","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { Tooltip } from '@deephaven/components';\nimport { DOMUtils } from '@deephaven/utils';\n\nimport './CustomFormatAction.scss';\n\n/**\n * Renders menuElement option with custom format input for use in formatting context menus\n *\n * TODO:\n * - capture focus when this menu action is selected via ArrowUp/ArrowDown keys\n * - dynamically update selected menu item when clicking on the input box\n */\nclass CustomFormatAction extends Component {\n constructor(props) {\n super(props);\n\n this.handleInputChange = this.handleInputChange.bind(this);\n this.handleKeyDown = this.handleKeyDown.bind(this);\n\n this.inputRef = React.createRef();\n }\n\n handleInputChange() {\n const { onChange } = this.props;\n onChange(this.inputRef.current.value);\n }\n\n closeContextMenu() {\n const { forwardedProps } = this.props;\n const { closeMenu } = forwardedProps;\n closeMenu(true);\n }\n\n revertToDefault() {\n const { onChange } = this.props;\n onChange(null);\n }\n\n returnFocusToContextMenu() {\n const parentContextMenu = DOMUtils.getClosestByClassName(\n this.inputRef.current,\n 'context-menu-container'\n );\n if (parentContextMenu) {\n parentContextMenu.focus();\n }\n }\n\n handleKeyDown(event) {\n switch (event.key) {\n case 'Enter':\n event.stopPropagation();\n this.closeContextMenu();\n break;\n case 'Escape':\n event.stopPropagation();\n this.revertToDefault();\n this.closeContextMenu();\n break;\n case 'ArrowRight':\n case 'ArrowLeft':\n event.stopPropagation();\n break;\n case 'ArrowUp':\n case 'ArrowDown':\n this.returnFocusToContextMenu();\n break;\n default:\n event.stopPropagation();\n }\n }\n\n render() {\n const { formatString, forwardedProps, placeholder, title } = this.props;\n const {\n menuItem: { description },\n iconElement,\n } = forwardedProps;\n return (\n <div className=\"form-group flex-grow mb-0\">\n <div className=\"custom-format-title\">\n <span className=\"icon\">{iconElement}</span>\n <label className=\"title mb-0\" htmlFor=\"custom-format-input\">\n {title}\n {description && <Tooltip>{description}</Tooltip>}\n </label>\n </div>\n <div className=\"pl-2 pr-2 pb-2\">\n <input\n id=\"custom-format-input\"\n className=\"form-control text-right mb-0\"\n type=\"text\"\n defaultValue={formatString}\n ref={this.inputRef}\n placeholder={placeholder}\n onKeyDown={this.handleKeyDown}\n onChange={this.handleInputChange}\n autoComplete=\"off\"\n autoCorrect=\"off\"\n autoCapitalize=\"off\"\n spellCheck=\"false\"\n />\n </div>\n </div>\n );\n }\n}\n\nCustomFormatAction.propTypes = {\n formatString: PropTypes.string,\n forwardedProps: PropTypes.shape({\n menuItem: PropTypes.shape({\n title: PropTypes.string,\n description: PropTypes.string,\n }),\n closeMenu: PropTypes.func,\n iconElement: PropTypes.node,\n }),\n placeholder: PropTypes.string,\n title: PropTypes.string,\n onChange: PropTypes.func,\n};\n\nCustomFormatAction.defaultProps = {\n formatString: '',\n forwardedProps: {\n menuItem: {},\n closeMenu: () => {},\n iconElement: null,\n },\n placeholder: '',\n title: '',\n onChange: () => {},\n};\n\nexport default CustomFormatAction;\n"],"file":"CustomFormatAction.js"}
1
+ {"version":3,"sources":["../../src/format-context-menus/CustomFormatAction.tsx"],"names":["React","Component","Tooltip","DOMUtils","CustomFormatAction","constructor","props","defaultProps","handleInputChange","bind","handleKeyDown","inputRef","createRef","onChange","current","value","closeContextMenu","forwardedProps","closeMenu","revertToDefault","returnFocusToContextMenu","parentContextMenu","getClosestByClassName","HTMLElement","focus","event","key","stopPropagation","render","formatString","placeholder","title","menuItem","description","iconElement","focusInput"],"mappings":";;AAAA,OAAOA,KAAP,IAAgBC,SAAhB,QAAiC,OAAjC;AACA,SAASC,OAAT,QAAwB,uBAAxB;AACA,SAASC,QAAT,QAAyB,kBAAzB;;;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,kBAAN,SAAiCH,SAAjC,CAAoE;AAiBlEI,EAAAA,WAAW,GAET;AAAA,QADAC,KACA,uEADiCF,kBAAkB,CAACG,YACpD;AACA,UAAMD,KAAN;;AADA;;AAGA,SAAKE,iBAAL,GAAyB,KAAKA,iBAAL,CAAuBC,IAAvB,CAA4B,IAA5B,CAAzB;AACA,SAAKC,aAAL,GAAqB,KAAKA,aAAL,CAAmBD,IAAnB,CAAwB,IAAxB,CAArB;AAEA,SAAKE,QAAL,gBAAgBX,KAAK,CAACY,SAAN,EAAhB;AACD;;AAIDJ,EAAAA,iBAAiB,GAAS;AACxB,QAAM;AAAEK,MAAAA;AAAF,QAAe,KAAKP,KAA1B;;AACA,QAAI,KAAKK,QAAL,CAAcG,OAAlB,EAA2B;AACzBD,MAAAA,QAAQ,CAAC,KAAKF,QAAL,CAAcG,OAAd,CAAsBC,KAAvB,CAAR;AACD;AACF;;AAEDC,EAAAA,gBAAgB,GAAS;AACvB,QAAM;AAAEC,MAAAA;AAAF,QAAqB,KAAKX,KAAhC;AACA,QAAM;AAAEY,MAAAA;AAAF,QAAgBD,cAAtB;AACAC,IA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A8B,MAAA,OAAO,EAAC;AAAtC,OACGH,KADH,EAEGE,WAAW,iBAAI,oBAAC,OAAD,QAAUA,WAAV,CAFlB,CAFF,CADF,eAQE;AAAK,MAAA,SAAS,EAAC;AAAf,oBACE;AACE,MAAA,EAAE,EAAC,qBADL;AAEE,MAAA,SAAS,EAAC,8BAFZ;AAGE,MAAA,IAAI,EAAC,MAHP;AAIE,MAAA,YAAY,EAAEJ,YAJhB;AAKE,MAAA,GAAG,EAAE,KAAKlB,QALZ;AAME,MAAA,WAAW,EAAEmB,WANf;AAOE,MAAA,SAAS,EAAE,KAAKpB,aAPlB;AAQE,MAAA,QAAQ,EAAE,KAAKF,iBARjB;AASE,MAAA,YAAY,EAAC,KATf;AAUE,MAAA,WAAW,EAAC,KAVd;AAWE,MAAA,cAAc,EAAC,KAXjB;AAYE,MAAA,UAAU,EAAC;AAZb,MADF,CARF,CADF;AA2BD;;AAnHiE;;gBAA9DJ,kB,kBACkB;AACpByB,EAAAA,YAAY,EAAE,EADM;AAEpBZ,EAAAA,cAAc,EAAE;AACde,IAAAA,QAAQ,EAAE,EADI;;AAEdd,IAAAA,SAAS,CAACiB,UAAD,EAA4B,CACnC;AACD,KAJa;;AAKdD,IAAAA,WAAW,EAAE;AALC,GAFI;AASpBJ,EAAAA,WAAW,EAAE,EATO;AAUpBC,EAAAA,KAAK,EAAE,EAVa;;AAWpBlB,EAAAA,QAAQ,CAACE,KAAD,EAA6B,CACnC;AACD;;AAbmB,C;;AAqHxB,eAAeX,kBAAf","sourcesContent":["import React, { Component } from 'react';\nimport { Tooltip } from '@deephaven/components';\nimport { DOMUtils } from '@deephaven/utils';\n\nimport './CustomFormatAction.scss';\n\ntype CustomFormatActionProps = typeof CustomFormatAction.defaultProps & {\n forwardedProps: {\n menuItem: {\n title?: string;\n description?: string;\n };\n };\n};\n\n/**\n * Renders menuElement option with custom format input for use in formatting context menus\n *\n * TODO:\n * - capture focus when this menu action is selected via ArrowUp/ArrowDown keys\n * - dynamically update selected menu item when clicking on the input box\n */\nclass CustomFormatAction extends Component<CustomFormatActionProps> {\n static defaultProps = {\n formatString: '',\n forwardedProps: {\n menuItem: {},\n closeMenu(focusInput: boolean): void {\n // no-op\n },\n iconElement: null,\n },\n placeholder: '',\n title: '',\n onChange(value: string | null): void {\n // no-op\n },\n };\n\n constructor(\n props: CustomFormatActionProps = CustomFormatAction.defaultProps\n ) {\n super(props);\n\n this.handleInputChange = this.handleInputChange.bind(this);\n this.handleKeyDown = this.handleKeyDown.bind(this);\n\n this.inputRef = React.createRef();\n }\n\n inputRef: React.RefObject<HTMLInputElement>;\n\n handleInputChange(): void {\n const { onChange } = this.props;\n if (this.inputRef.current) {\n onChange(this.inputRef.current.value);\n }\n }\n\n closeContextMenu(): void {\n const { forwardedProps } = this.props;\n const { closeMenu } = forwardedProps;\n closeMenu(true);\n }\n\n revertToDefault(): void {\n const { onChange } = this.props;\n onChange(null);\n }\n\n returnFocusToContextMenu(): void {\n const parentContextMenu = DOMUtils.getClosestByClassName(\n this.inputRef.current,\n 'context-menu-container'\n );\n if (parentContextMenu instanceof HTMLElement) {\n parentContextMenu.focus();\n }\n }\n\n handleKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n switch (event.key) {\n case 'Enter':\n event.stopPropagation();\n this.closeContextMenu();\n break;\n case 'Escape':\n event.stopPropagation();\n this.revertToDefault();\n this.closeContextMenu();\n break;\n case 'ArrowRight':\n case 'ArrowLeft':\n event.stopPropagation();\n break;\n case 'ArrowUp':\n case 'ArrowDown':\n this.returnFocusToContextMenu();\n break;\n default:\n event.stopPropagation();\n }\n }\n\n render(): JSX.Element {\n const { formatString, forwardedProps, placeholder, title } = this.props;\n const {\n menuItem: { description },\n iconElement,\n } = forwardedProps;\n return (\n <div className=\"form-group flex-grow mb-0\">\n <div className=\"custom-format-title\">\n <span className=\"icon\">{iconElement}</span>\n <label className=\"title mb-0\" htmlFor=\"custom-format-input\">\n {title}\n {description && <Tooltip>{description}</Tooltip>}\n </label>\n </div>\n <div className=\"pl-2 pr-2 pb-2\">\n <input\n id=\"custom-format-input\"\n className=\"form-control text-right mb-0\"\n type=\"text\"\n defaultValue={formatString}\n ref={this.inputRef}\n placeholder={placeholder}\n onKeyDown={this.handleKeyDown}\n onChange={this.handleInputChange}\n autoComplete=\"off\"\n autoCorrect=\"off\"\n autoCapitalize=\"off\"\n spellCheck=\"false\"\n />\n </div>\n </div>\n );\n }\n}\n\nexport default CustomFormatAction;\n"],"file":"CustomFormatAction.js"}
@@ -1,14 +1,17 @@
1
- export default DateTimeFormatContextMenu;
1
+ import { TableColumnFormat } from '../formatters';
2
+ import { FormatContextMenuOption } from './FormatContextMenuUtils';
3
+ import type Formatter from '../Formatter';
2
4
  declare class DateTimeFormatContextMenu {
3
5
  static dateGroup: number;
4
6
  static timeGroup: number;
5
7
  static dateTimeGroup: number;
6
8
  /**
7
9
  * Creates list of formatting options for DateTime context menu
8
- * @param {Formatter} formatter Formatter instance
9
- * @param {Object} selectedFormat Selected format object, null for no selected format
10
- * @returns {Array} Array of formatting options for the context menu
10
+ * @param formatter Formatter instance
11
+ * @param selectedFormat Selected format object, null for no selected format
12
+ * @returns Array of formatting options for the context menu
11
13
  */
12
- static getOptions(formatter: any, selectedFormat: Object): any[];
14
+ static getOptions(formatter: Formatter, selectedFormat: TableColumnFormat): FormatContextMenuOption[];
13
15
  }
16
+ export default DateTimeFormatContextMenu;
14
17
  //# sourceMappingURL=DateTimeFormatContextMenu.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DateTimeFormatContextMenu.d.ts","sourceRoot":"","sources":["../../src/format-context-menus/DateTimeFormatContextMenu.js"],"names":[],"mappings":";AAIA;IACE,yBAAsB;IAEtB,yBAAsB;IAEtB,6BAA0B;IAE1B;;;;;OAKG;IACH,kDAHW,MAAM,SAuEhB;CACF"}
1
+ {"version":3,"file":"DateTimeFormatContextMenu.d.ts","sourceRoot":"","sources":["../../src/format-context-menus/DateTimeFormatContextMenu.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC3E,OAA+B,EAC7B,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,SAAS,MAAM,cAAc,CAAC;AAE1C,cAAM,yBAAyB;IAC7B,MAAM,CAAC,SAAS,SAAM;IAEtB,MAAM,CAAC,SAAS,SAAM;IAEtB,MAAM,CAAC,aAAa,SAAM;IAE1B;;;;;OAKG;IACH,MAAM,CAAC,UAAU,CACf,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,iBAAiB,GAChC,uBAAuB,EAAE;CAqE7B;AAED,eAAe,yBAAyB,CAAC"}
@@ -7,9 +7,9 @@ import TableUtils from "../TableUtils.js";
7
7
  class DateTimeFormatContextMenu {
8
8
  /**
9
9
  * Creates list of formatting options for DateTime context menu
10
- * @param {Formatter} formatter Formatter instance
11
- * @param {Object} selectedFormat Selected format object, null for no selected format
12
- * @returns {Array} Array of formatting options for the context menu
10
+ * @param formatter Formatter instance
11
+ * @param selectedFormat Selected format object, null for no selected format
12
+ * @returns Array of formatting options for the context menu
13
13
  */
14
14
  static getOptions(formatter, selectedFormat) {
15
15
  var currentTime = new Date();
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/format-context-menus/DateTimeFormatContextMenu.js"],"names":["DateTimeColumnFormatter","FormatContextMenuUtils","TableUtils","DateTimeFormatContextMenu","getOptions","formatter","selectedFormat","currentTime","Date","formatItems","group","dateGroup","formatString","timeGroup","dateTimeGroup","presetFormatOptions","map","item","format","makeFormat","TYPE_CONTEXT_PRESET","title","getFormattedString","dataType","DATETIME","makeOption","isSameFormat","defaultOption","isDefaultSelected"],"mappings":";;SAASA,uB;OACFC,sB;OACAC,U;;AAEP,MAAMC,yBAAN,CAAgC;AAO9B;AACF;AACA;AACA;AACA;AACA;AACmB,SAAVC,UAAU,CAACC,SAAD,EAAYC,cAAZ,EAA4B;AAC3C,QAAMC,WAAW,GAAG,IAAIC,IAAJ,EAApB;AAC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CZ,cAA7C,CAJK,CAAP;AAMD,KAnB2B,CAA5B;AAqBA,QAAMqB,aAAa,GAAG1B,sBAAsB,CAACwB,UAAvB,CACpB,SADoB,EAEpB,IAFoB,EAGpBtB,yBAAyB,CAACQ,SAHN,EAIpBV,sBAAsB,CAAC2B,iBAAvB,CAAyCtB,cAAzC,CAJoB,CAAtB;AAOA,WAAO,CAACqB,aAAD,EAAgB,GAAGZ,mBAAnB,CAAP;AACD;;AAjF6B;;gBAA1BZ,yB,eACe,E;;gBADfA,yB,eAGe,E;;gBAHfA,yB,mBAKmB,E;;AA+EzB,eAAeA,yBAAf","sourcesContent":["import { DateTimeColumnFormatter } from '../formatters';\nimport FormatContextMenuUtils from './FormatContextMenuUtils';\nimport TableUtils from '../TableUtils';\n\nclass DateTimeFormatContextMenu {\n static dateGroup = 10;\n\n static timeGroup = 20;\n\n static dateTimeGroup = 30;\n\n /**\n * Creates list of formatting options for DateTime context menu\n * @param {Formatter} formatter Formatter instance\n * @param {Object} selectedFormat Selected format object, null for no selected format\n * @returns {Array} Array of formatting options for the context menu\n */\n static getOptions(formatter, selectedFormat) {\n const currentTime = new Date();\n const formatItems = [\n {\n group: DateTimeFormatContextMenu.dateGroup,\n formatString: 'yyyy-MM-dd',\n },\n {\n group: DateTimeFormatContextMenu.dateGroup,\n formatString: 'MM-dd-yyyy',\n },\n\n {\n group: DateTimeFormatContextMenu.timeGroup,\n formatString: 'HH:mm:ss',\n },\n {\n group: DateTimeFormatContextMenu.timeGroup,\n formatString: 'HH:mm:ss.SSS',\n },\n {\n group: DateTimeFormatContextMenu.timeGroup,\n formatString: 'HH:mm:ss.SSSSSSSSS',\n },\n\n {\n group: DateTimeFormatContextMenu.dateTimeGroup,\n formatString: `yyyy-MM-dd HH:mm:ss`,\n },\n {\n group: DateTimeFormatContextMenu.dateTimeGroup,\n formatString: `yyyy-MM-dd HH:mm:ss.SSS`,\n },\n {\n group: DateTimeFormatContextMenu.dateTimeGroup,\n formatString: `yyyy-MM-dd HH:mm:ss.SSSSSSSSS`,\n },\n ];\n\n const presetFormatOptions = formatItems.map(item => {\n const format = DateTimeColumnFormatter.makeFormat(\n '',\n item.formatString,\n DateTimeColumnFormatter.TYPE_CONTEXT_PRESET\n );\n const title = formatter.getFormattedString(\n currentTime,\n TableUtils.dataType.DATETIME,\n '',\n format\n );\n\n return FormatContextMenuUtils.makeOption(\n title,\n format,\n item.group,\n DateTimeColumnFormatter.isSameFormat(format, selectedFormat)\n );\n });\n\n const defaultOption = FormatContextMenuUtils.makeOption(\n 'Default',\n null,\n DateTimeFormatContextMenu.dateGroup,\n FormatContextMenuUtils.isDefaultSelected(selectedFormat)\n );\n\n return [defaultOption, ...presetFormatOptions];\n }\n}\n\nexport default DateTimeFormatContextMenu;\n"],"file":"DateTimeFormatContextMenu.js"}
1
+ {"version":3,"sources":["../../src/format-context-menus/DateTimeFormatContextMenu.ts"],"names":["DateTimeColumnFormatter","FormatContextMenuUtils","TableUtils","DateTimeFormatContextMenu","getOptions","formatter","selectedFormat","currentTime","Date","formatItems","group","dateGroup","formatString","timeGroup","dateTimeGroup","presetFormatOptions","map","item","format","makeFormat","TYPE_CONTEXT_PRESET","title","getFormattedString","dataType","DATETIME","makeOption","isSameFormat","defaultOption","isDefaultSelected"],"mappings":";;SAASA,uB;OACFC,sB;OAGAC,U;;AAGP,MAAMC,yBAAN,CAAgC;AAO9B;AACF;AACA;AACA;AACA;AACA;AACmB,SAAVC,UAAU,CACfC,SADe,EAEfC,cAFe,EAGY;AAC3B,QAAMC,WAAW,GAAG,IAAIC,IAAJ,EAApB;AACA,QAAMC,WAAW,GAAG,CAClB;AACEC,MAAAA,KAAK,EAAEP,yBAAyB,CAACQ,SADnC;AAEEC,MAAAA,YAAY,EAAE;AAFhB,KADkB,EAKlB;AACEF,MAAAA,KAAK,EAAEP,yBAAyB,CAACQ,SADnC;AAEEC,MAAAA,YAAY,EAAE;AAFhB,KALkB,EAUlB;AACEF,MAAAA,KAAK,EAAEP,yBAAyB,C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GAAGZ,mBAAnB,CAAP;AACD;;AApF6B;;gBAA1BZ,yB,eACe,E;;gBADfA,yB,eAGe,E;;gBAHfA,yB,mBAKmB,E;;AAkFzB,eAAeA,yBAAf","sourcesContent":["import { DateTimeColumnFormatter, TableColumnFormat } from '../formatters';\nimport FormatContextMenuUtils, {\n FormatContextMenuOption,\n} from './FormatContextMenuUtils';\nimport TableUtils from '../TableUtils';\nimport type Formatter from '../Formatter';\n\nclass DateTimeFormatContextMenu {\n static dateGroup = 10;\n\n static timeGroup = 20;\n\n static dateTimeGroup = 30;\n\n /**\n * Creates list of formatting options for DateTime context menu\n * @param formatter Formatter instance\n * @param selectedFormat Selected format object, null for no selected format\n * @returns Array of formatting options for the context menu\n */\n static getOptions(\n formatter: Formatter,\n selectedFormat: TableColumnFormat\n ): FormatContextMenuOption[] {\n const currentTime = new Date();\n const formatItems = [\n {\n group: DateTimeFormatContextMenu.dateGroup,\n formatString: 'yyyy-MM-dd',\n },\n {\n group: DateTimeFormatContextMenu.dateGroup,\n formatString: 'MM-dd-yyyy',\n },\n\n {\n group: DateTimeFormatContextMenu.timeGroup,\n formatString: 'HH:mm:ss',\n },\n {\n group: DateTimeFormatContextMenu.timeGroup,\n formatString: 'HH:mm:ss.SSS',\n },\n {\n group: DateTimeFormatContextMenu.timeGroup,\n formatString: 'HH:mm:ss.SSSSSSSSS',\n },\n\n {\n group: DateTimeFormatContextMenu.dateTimeGroup,\n formatString: `yyyy-MM-dd HH:mm:ss`,\n },\n {\n group: DateTimeFormatContextMenu.dateTimeGroup,\n formatString: `yyyy-MM-dd HH:mm:ss.SSS`,\n },\n {\n group: DateTimeFormatContextMenu.dateTimeGroup,\n formatString: `yyyy-MM-dd HH:mm:ss.SSSSSSSSS`,\n },\n ];\n\n const presetFormatOptions = formatItems.map(item => {\n const format = DateTimeColumnFormatter.makeFormat(\n '',\n item.formatString,\n DateTimeColumnFormatter.TYPE_CONTEXT_PRESET\n );\n const title = formatter.getFormattedString(\n currentTime,\n TableUtils.dataType.DATETIME,\n '',\n format\n );\n\n return FormatContextMenuUtils.makeOption(\n title,\n format,\n item.group,\n DateTimeColumnFormatter.isSameFormat(format, selectedFormat)\n );\n });\n\n const defaultOption = FormatContextMenuUtils.makeOption(\n 'Default',\n null,\n DateTimeFormatContextMenu.dateGroup,\n FormatContextMenuUtils.isDefaultSelected(selectedFormat)\n );\n\n return [defaultOption, ...presetFormatOptions];\n }\n}\n\nexport default DateTimeFormatContextMenu;\n"],"file":"DateTimeFormatContextMenu.js"}
@@ -1,4 +1,5 @@
1
- export default DecimalFormatContextMenu;
1
+ import { FormatContextMenuOption } from './FormatContextMenuUtils';
2
+ import { DecimalColumnFormat } from '../formatters';
2
3
  declare class DecimalFormatContextMenu {
3
4
  static defaultGroup: number;
4
5
  static presetGroup: number;
@@ -6,10 +7,11 @@ declare class DecimalFormatContextMenu {
6
7
  static customGroup: number;
7
8
  /**
8
9
  * Creates list of formatting options for Decimal context menu
9
- * @param {Object} selectedFormat Selected format object, null for no selected format
10
- * @param {function} onCustomFormatChange Callback to call when the custom format is changed
11
- * @returns {Array} Array of formatting options for the context menu
10
+ * @param selectedFormat Selected format object, null for no selected format
11
+ * @param onCustomFormatChange Callback to call when the custom format is changed
12
+ * @returns Array of formatting options for the context menu
12
13
  */
13
- static getOptions(selectedFormat: Object, onCustomFormatChange: Function): any[];
14
+ static getOptions(selectedFormat: DecimalColumnFormat, onCustomFormatChange: (value: DecimalColumnFormat | null) => void): FormatContextMenuOption[];
14
15
  }
16
+ export default DecimalFormatContextMenu;
15
17
  //# sourceMappingURL=DecimalFormatContextMenu.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DecimalFormatContextMenu.d.ts","sourceRoot":"","sources":["../../src/format-context-menus/DecimalFormatContextMenu.js"],"names":[],"mappings":";AAGA;IACE,4BAAyB;IAEzB,2BAAwB;IAExB,gCAA6B;IAE7B,2BAAwB;IAExB;;;;;OAKG;IACH,kCAJW,MAAM,yCA4EhB;CACF"}
1
+ {"version":3,"file":"DecimalFormatContextMenu.d.ts","sourceRoot":"","sources":["../../src/format-context-menus/DecimalFormatContextMenu.ts"],"names":[],"mappings":"AAAA,OAA+B,EAC7B,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAA0B,MAAM,eAAe,CAAC;AAE5E,cAAM,wBAAwB;IAC5B,MAAM,CAAC,YAAY,SAAM;IAEzB,MAAM,CAAC,WAAW,SAAM;IAExB,MAAM,CAAC,gBAAgB,SAAM;IAE7B,MAAM,CAAC,WAAW,SAAM;IAExB;;;;;OAKG;IACH,MAAM,CAAC,UAAU,CACf,cAAc,EAAE,mBAAmB,EACnC,oBAAoB,EAAE,CAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI,KAAK,IAAI,GAChE,uBAAuB,EAAE;CAyE7B;AAED,eAAe,wBAAwB,CAAC"}
@@ -6,9 +6,9 @@ import { DecimalColumnFormatter } from "../formatters/index.js";
6
6
  class DecimalFormatContextMenu {
7
7
  /**
8
8
  * Creates list of formatting options for Decimal context menu
9
- * @param {Object} selectedFormat Selected format object, null for no selected format
10
- * @param {function} onCustomFormatChange Callback to call when the custom format is changed
11
- * @returns {Array} Array of formatting options for the context menu
9
+ * @param selectedFormat Selected format object, null for no selected format
10
+ * @param onCustomFormatChange Callback to call when the custom format is changed
11
+ * @returns Array of formatting options for the context menu
12
12
  */
13
13
  static getOptions(selectedFormat, onCustomFormatChange) {
14
14
  var formatItems = [{
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/format-context-menus/DecimalFormatContextMenu.js"],"names":["FormatContextMenuUtils","DecimalColumnFormatter","DecimalFormatContextMenu","getOptions","selectedFormat","onCustomFormatChange","formatItems","format","FORMAT_PERCENT","group","presetGroup","FORMAT_BASIS_POINTS","FORMAT_MILLIONS","FORMAT_ROUND","presetRoundGroup","FORMAT_ROUND_TWO_DECIMALS","FORMAT_ROUND_FOUR_DECIMALS","defaultFormatOption","makeOption","defaultGroup","isDefaultSelected","presetFormatOptions","map","item","label","isSameFormat","isCustomSelected","customFormat","makeCustomFormat","customFormatOption","makeCustomFormatOption","customGroup","DEFAULT_FORMAT_STRING","formatString","newCustomFormat","isValid"],"mappings":";;OAAOA,sB;SACEC,sB;;AAET,MAAMC,wBAAN,CAA+B;AAS7B;AACF;AACA;AACA;AACA;AACA;AACmB,SAAVC,UAAU,CAACC,cAAD,EAAiBC,oBAAjB,EAAuC;AACtD,QAAMC,WAAW,GAAG,CAClB;AACEC,MAAAA,MAAM,EAAEN,sBAAsB,CAACO,cADjC;AAEEC,MAAAA,KAAK,EAAEP,wBAAwB,CAACQ;AAFlC,KADkB,EAKlB;AACEH,MAAAA,MAAM,EAAEN,sBAAsB,CAACU,mBADjC;AAEEF,MAAAA,KAAK,EAAEP,wBAAwB,CAACQ;AAFlC,KALkB,EASlB;AACEH,MAAAA,MAAM,EAAEN,sBAAsB,CAACW,eADjC;AAEEH,MAAAA,KAAK,EAAEP,wBAAwB,CAACQ;AAFlC,KATkB,EAalB;AACEH,MAAAA,MAAM,EAAEN,sBAAsB,CAACY,YADjC;AAEEJ,MAAAA,KAAK,EAAEP,wBAAwB,CAACY;AAFlC,KAbkB,EAiBlB;AACEP,MAAAA,MAAM,EAAEN,sBAAsB,CAACc,yBADjC;AAEEN,MAAAA,KAAK,EAAEP,wBAAwB,CAACY;AAFlC,KAjBkB,EAqBlB;AACEP,MAAAA,MAAM,EAAEN,sBAAsB,CAACe,0BADjC;AAEEP,MAAAA,KAAK,EAAEP,wBAAwB,CAACY;AAFlC,KArBkB,CAApB;AA2BA,QAAMG,mBAAmB,GAAGjB,sBAAsB,CAACkB,UAAvB,CAC1B,SAD0B,EAE1B,IAF0B,EAG1BhB,wBAAwB,CAACiB,YAHC,EAI1BnB,sBAAsB,CAACoB,iBAAvB,CAAyChB,cAAzC,CAJ0B,CAA5B;AAOA,QAAMiB,mBAAmB,GAAGf,WAAW,CAACgB,GAAZ,CAAgBC,IAAI,IAC9CvB,sBAAsB,CAACkB,UAAvB,CACEK,IAAI,CAAChB,MAAL,CAAYiB,KADd,EAEED,IAAI,CAAChB,MAFP,EAGEgB,IAAI,CAACd,KAHP,EAIER,sBAAsB,CAACwB,YAAvB,CAAoCF,IAAI,CAAChB,MAAzC,EAAiDH,cAAjD,CAJF,CAD0B,CAA5B;AASA,QAAMsB,gBAAgB,GAAG1B,sBAAsB,CAAC0B,gBAAvB,CACvBtB,cADuB,CAAzB;AAIA,QAAMuB,YAAY,GAAGD,gBAAgB,GACjCtB,cADiC,GAEjCH,sBAAsB,CAAC2B,gBAAvB,EAFJ;AAIA,QAAMC,kBAAkB,GAAG7B,sBAAsB,CAAC8B,sBAAvB,CACzBH,YADyB,EAEzBzB,wBAAwB,CAAC6B,WAFA,EAGzB9B,sBAAsB,CAAC+B,qBAHE,EAIzBN,gBAJyB,EAKzBO,YAAY,IAAI;AACd,UAAIA,YAAJ,EAAkB;AAChB,YAAMC,eAAe,GAAGjC,sBAAsB,CAAC2B,gBAAvB,CACtBK,YADsB,CAAxB;;AAGA,YAAIhC,sBAAsB,CAACkC,OAAvB,CAA+BD,eAA/B,CAAJ,EAAqD;AACnD7B,UAAAA,oBAAoB,CAAC6B,eAAD,CAApB;AACD;AACF,OAPD,MAOO;AACL7B,QAAAA,oBAAoB,CAAC,IAAD,CAApB;AACD;AACF,KAhBwB,CAA3B;AAmBA,WAAO,CAACY,mBAAD,EAAsB,GAAGI,mBAAzB,EAA8CQ,kBAA9C,CAAP;AACD;;AAvF4B;;gBAAzB3B,wB,kBACkB,E;;gBADlBA,wB,iBAGiB,E;;gBAHjBA,wB,sBAKsB,E;;gBALtBA,wB,iBAOiB,E;;AAmFvB,eAAeA,wBAAf","sourcesContent":["import FormatContextMenuUtils from './FormatContextMenuUtils';\nimport { DecimalColumnFormatter } from '../formatters';\n\nclass DecimalFormatContextMenu {\n static defaultGroup = 10;\n\n static presetGroup = 20;\n\n static presetRoundGroup = 30;\n\n static customGroup = 40;\n\n /**\n * Creates list of formatting options for Decimal context menu\n * @param {Object} selectedFormat Selected format object, null for no selected format\n * @param {function} onCustomFormatChange Callback to call when the custom format is changed\n * @returns {Array} Array of formatting options for the context menu\n */\n static getOptions(selectedFormat, onCustomFormatChange) {\n const formatItems = [\n {\n format: DecimalColumnFormatter.FORMAT_PERCENT,\n group: DecimalFormatContextMenu.presetGroup,\n },\n {\n format: DecimalColumnFormatter.FORMAT_BASIS_POINTS,\n group: DecimalFormatContextMenu.presetGroup,\n },\n {\n format: DecimalColumnFormatter.FORMAT_MILLIONS,\n group: DecimalFormatContextMenu.presetGroup,\n },\n {\n format: DecimalColumnFormatter.FORMAT_ROUND,\n group: DecimalFormatContextMenu.presetRoundGroup,\n },\n {\n format: DecimalColumnFormatter.FORMAT_ROUND_TWO_DECIMALS,\n group: DecimalFormatContextMenu.presetRoundGroup,\n },\n {\n format: DecimalColumnFormatter.FORMAT_ROUND_FOUR_DECIMALS,\n group: DecimalFormatContextMenu.presetRoundGroup,\n },\n ];\n\n const defaultFormatOption = FormatContextMenuUtils.makeOption(\n 'Default',\n null,\n DecimalFormatContextMenu.defaultGroup,\n FormatContextMenuUtils.isDefaultSelected(selectedFormat)\n );\n\n const presetFormatOptions = formatItems.map(item =>\n FormatContextMenuUtils.makeOption(\n item.format.label,\n item.format,\n item.group,\n DecimalColumnFormatter.isSameFormat(item.format, selectedFormat)\n )\n );\n\n const isCustomSelected = FormatContextMenuUtils.isCustomSelected(\n selectedFormat\n );\n\n const customFormat = isCustomSelected\n ? selectedFormat\n : DecimalColumnFormatter.makeCustomFormat();\n\n const customFormatOption = FormatContextMenuUtils.makeCustomFormatOption(\n customFormat,\n DecimalFormatContextMenu.customGroup,\n DecimalColumnFormatter.DEFAULT_FORMAT_STRING,\n isCustomSelected,\n formatString => {\n if (formatString) {\n const newCustomFormat = DecimalColumnFormatter.makeCustomFormat(\n formatString\n );\n if (DecimalColumnFormatter.isValid(newCustomFormat)) {\n onCustomFormatChange(newCustomFormat);\n }\n } else {\n onCustomFormatChange(null);\n }\n }\n );\n\n return [defaultFormatOption, ...presetFormatOptions, customFormatOption];\n }\n}\n\nexport default DecimalFormatContextMenu;\n"],"file":"DecimalFormatContextMenu.js"}
1
+ {"version":3,"sources":["../../src/format-context-menus/DecimalFormatContextMenu.ts"],"names":["FormatContextMenuUtils","DecimalColumnFormatter","DecimalFormatContextMenu","getOptions","selectedFormat","onCustomFormatChange","formatItems","format","FORMAT_PERCENT","group","presetGroup","FORMAT_BASIS_POINTS","FORMAT_MILLIONS","FORMAT_ROUND","presetRoundGroup","FORMAT_ROUND_TWO_DECIMALS","FORMAT_ROUND_FOUR_DECIMALS","defaultFormatOption","makeOption","defaultGroup","isDefaultSelected","presetFormatOptions","map","item","label","isSameFormat","isCustomSelected","customFormat","makeCustomFormat","customFormatOption","makeCustomFormatOption","customGroup","DEFAULT_FORMAT_STRING","formatString","newCustomFormat","isValid"],"mappings":";;OAAOA,sB;SAGuBC,sB;;AAE9B,MAAMC,wBAAN,CAA+B;AAS7B;AACF;AACA;AACA;AACA;AACA;AACmB,SAAVC,UAAU,CACfC,cADe,EAEfC,oBAFe,EAGY;AAC3B,QAAMC,WAAW,GAAG,CAClB;AACEC,MAAAA,MAAM,EAAEN,sBAAsB,CAACO,cADjC;AAEEC,MAAAA,KAAK,EAAEP,wBAAwB,CAACQ;AAFlC,KADkB,EAKlB;AACEH,MAAAA,MAAM,EAAEN,sBAAsB,CAACU,mBADjC;AAEEF,MAAAA,KAAK,EAAEP,wBAAwB,CAACQ;AAFlC,KALkB,EASlB;AACEH,MAAAA,MAAM,EAAEN,sBAAsB,CAACW,eADjC;AAEEH,MAAAA,KAAK,EAAEP,wBAAwB,CAACQ;AAFlC,KATkB,EAalB;AACEH,MAAAA,MAAM,EAAEN,sBAAsB,CAACY,YADjC;AAEEJ,MAAAA,KAAK,EAAEP,wBAAwB,CAACY;AAFlC,KAbkB,EAiBlB;AACEP,MAAAA,MAAM,EAAEN,sBAAsB,CAACc,yBADjC;AAEEN,MAAAA,KA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AApB;AACD;AACF,KAhBwB,CAA3B;AAmBA,WAAO,CAACY,mBAAD,EAAsB,GAAGI,mBAAzB,EAA8CQ,kBAA9C,CAAP;AACD;;AA1F4B;;gBAAzB3B,wB,kBACkB,E;;gBADlBA,wB,iBAGiB,E;;gBAHjBA,wB,sBAKsB,E;;gBALtBA,wB,iBAOiB,E;;AAsFvB,eAAeA,wBAAf","sourcesContent":["import FormatContextMenuUtils, {\n FormatContextMenuOption,\n} from './FormatContextMenuUtils';\nimport { DecimalColumnFormat, DecimalColumnFormatter } from '../formatters';\n\nclass DecimalFormatContextMenu {\n static defaultGroup = 10;\n\n static presetGroup = 20;\n\n static presetRoundGroup = 30;\n\n static customGroup = 40;\n\n /**\n * Creates list of formatting options for Decimal context menu\n * @param selectedFormat Selected format object, null for no selected format\n * @param onCustomFormatChange Callback to call when the custom format is changed\n * @returns Array of formatting options for the context menu\n */\n static getOptions(\n selectedFormat: DecimalColumnFormat,\n onCustomFormatChange: (value: DecimalColumnFormat | null) => void\n ): FormatContextMenuOption[] {\n const formatItems = [\n {\n format: DecimalColumnFormatter.FORMAT_PERCENT,\n group: DecimalFormatContextMenu.presetGroup,\n },\n {\n format: DecimalColumnFormatter.FORMAT_BASIS_POINTS,\n group: DecimalFormatContextMenu.presetGroup,\n },\n {\n format: DecimalColumnFormatter.FORMAT_MILLIONS,\n group: DecimalFormatContextMenu.presetGroup,\n },\n {\n format: DecimalColumnFormatter.FORMAT_ROUND,\n group: DecimalFormatContextMenu.presetRoundGroup,\n },\n {\n format: DecimalColumnFormatter.FORMAT_ROUND_TWO_DECIMALS,\n group: DecimalFormatContextMenu.presetRoundGroup,\n },\n {\n format: DecimalColumnFormatter.FORMAT_ROUND_FOUR_DECIMALS,\n group: DecimalFormatContextMenu.presetRoundGroup,\n },\n ];\n\n const defaultFormatOption = FormatContextMenuUtils.makeOption(\n 'Default',\n null,\n DecimalFormatContextMenu.defaultGroup,\n FormatContextMenuUtils.isDefaultSelected(selectedFormat)\n );\n\n const presetFormatOptions = formatItems.map(item =>\n FormatContextMenuUtils.makeOption(\n item.format.label,\n item.format,\n item.group,\n DecimalColumnFormatter.isSameFormat(item.format, selectedFormat)\n )\n );\n\n const isCustomSelected = FormatContextMenuUtils.isCustomSelected(\n selectedFormat\n );\n\n const customFormat = isCustomSelected\n ? selectedFormat\n : DecimalColumnFormatter.makeCustomFormat();\n\n const customFormatOption = FormatContextMenuUtils.makeCustomFormatOption(\n customFormat,\n DecimalFormatContextMenu.customGroup,\n DecimalColumnFormatter.DEFAULT_FORMAT_STRING,\n isCustomSelected,\n formatString => {\n if (formatString) {\n const newCustomFormat = DecimalColumnFormatter.makeCustomFormat(\n formatString\n );\n if (DecimalColumnFormatter.isValid(newCustomFormat)) {\n onCustomFormatChange(newCustomFormat);\n }\n } else {\n onCustomFormatChange(null);\n }\n }\n );\n\n return [defaultFormatOption, ...presetFormatOptions, customFormatOption];\n }\n}\n\nexport default DecimalFormatContextMenu;\n"],"file":"DecimalFormatContextMenu.js"}
@@ -1,42 +1,43 @@
1
- export default FormatContextMenuUtils;
1
+ import React from 'react';
2
+ import { TableColumnFormat } from '../formatters';
3
+ export interface FormatContextMenuOption {
4
+ title: string;
5
+ description: string;
6
+ group: number;
7
+ format: TableColumnFormat | null;
8
+ isSelected: boolean;
9
+ }
10
+ export interface CustomFormatOption extends FormatContextMenuOption {
11
+ menuElement: React.ReactElement;
12
+ }
2
13
  declare class FormatContextMenuUtils {
3
14
  /**
4
15
  * Returns true if default option should be active in the context menu
5
- * @param {Object} selectedFormat selected format object or null
16
+ * @param selectedFormat selected format object or null
6
17
  */
7
- static isDefaultSelected(selectedFormat: Object): boolean;
18
+ static isDefaultSelected(selectedFormat: TableColumnFormat): boolean;
8
19
  /**
9
20
  * Returns true if custom format option should be active in the context menu
10
- * @param {Object} selectedFormat selected format object or null
21
+ * @param selectedFormat selected format object or null
11
22
  */
12
- static isCustomSelected(selectedFormat: Object): boolean;
23
+ static isCustomSelected(selectedFormat: TableColumnFormat): boolean;
13
24
  /**
14
25
  * Creates context menu option
15
- * @param {Object} format Format object
16
- * @param {number} group Context menu group
17
- * @param {boolean} isSelected Is current option selected
26
+ * @param title Context menu title
27
+ * @param format Format object
28
+ * @param group Context menu group
29
+ * @param isSelected Is current option selected
18
30
  */
19
- static makeOption(title: any, format: Object, group: number, isSelected: boolean): {
20
- title: any;
21
- description: any;
22
- group: number;
23
- format: Object;
24
- isSelected: boolean;
25
- };
31
+ static makeOption(title: string, format: TableColumnFormat | null, group: number, isSelected: boolean): FormatContextMenuOption;
26
32
  /**
27
33
  * Creates context menu option with an input element
28
- * @param {Object} format Format object
29
- * @param {number} group Context menu group
30
- * @param {string} placeholder Input element placeholder
31
- * @param {boolean} isSelected Is current option selected
32
- * @param {function} onChange Input element onChange callback
34
+ * @param format Format object
35
+ * @param group Context menu group
36
+ * @param placeholder Input element placeholder
37
+ * @param isSelected Is current option selected
38
+ * @param onChange Input element onChange callback
33
39
  */
34
- static makeCustomFormatOption(format: Object, group: number, placeholder: string, isSelected: boolean, onChange: Function): {
35
- title: any;
36
- format: Object;
37
- group: number;
38
- isSelected: boolean;
39
- menuElement: JSX.Element;
40
- };
40
+ static makeCustomFormatOption(format: TableColumnFormat, group: number, placeholder: string, isSelected: boolean, onChange: (value: string | null) => void): CustomFormatOption;
41
41
  }
42
+ export default FormatContextMenuUtils;
42
43
  //# sourceMappingURL=FormatContextMenuUtils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormatContextMenuUtils.d.ts","sourceRoot":"","sources":["../../src/format-context-menus/FormatContextMenuUtils.jsx"],"names":[],"mappings":";AAIA;IACE;;;OAGG;IACH,yCAFW,MAAM,WAUhB;IAED;;;OAGG;IACH,wCAFW,MAAM,WAOhB;IAED;;;;;OAKG;IACH,sCAJW,MAAM,SACN,MAAM,cACN,OAAO;;;;;;MAUjB;IAED;;;;;;;OAOG;IACH,sCANW,MAAM,SACN,MAAM,eACN,MAAM,cACN,OAAO;;;;;;MAwBjB;CACF"}
1
+ {"version":3,"file":"FormatContextMenuUtils.d.ts","sourceRoot":"","sources":["../../src/format-context-menus/FormatContextMenuUtils.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAwB,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAExE,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACjC,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,kBAAmB,SAAQ,uBAAuB;IACjE,WAAW,EAAE,KAAK,CAAC,YAAY,CAAC;CACjC;AAED,cAAM,sBAAsB;IAC1B;;;OAGG;IACH,MAAM,CAAC,iBAAiB,CAAC,cAAc,EAAE,iBAAiB,GAAG,OAAO;IAUpE;;;OAGG;IACH,MAAM,CAAC,gBAAgB,CAAC,cAAc,EAAE,iBAAiB,GAAG,OAAO;IAOnE;;;;;;OAMG;IACH,MAAM,CAAC,UAAU,CACf,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,iBAAiB,GAAG,IAAI,EAChC,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,OAAO,GAClB,uBAAuB;IAU1B;;;;;;;OAOG;IACH,MAAM,CAAC,sBAAsB,CAC3B,MAAM,EAAE,iBAAiB,EACzB,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,OAAO,EACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,GACvC,kBAAkB;CAiBtB;AAED,eAAe,sBAAsB,CAAC"}
@@ -5,14 +5,14 @@ import { TableColumnFormatter } from "../formatters/index.js";
5
5
  class FormatContextMenuUtils {
6
6
  /**
7
7
  * Returns true if default option should be active in the context menu
8
- * @param {Object} selectedFormat selected format object or null
8
+ * @param selectedFormat selected format object or null
9
9
  */
10
10
  static isDefaultSelected(selectedFormat) {
11
11
  return !selectedFormat || ![TableColumnFormatter.TYPE_CONTEXT_CUSTOM, TableColumnFormatter.TYPE_CONTEXT_PRESET].includes(selectedFormat.type);
12
12
  }
13
13
  /**
14
14
  * Returns true if custom format option should be active in the context menu
15
- * @param {Object} selectedFormat selected format object or null
15
+ * @param selectedFormat selected format object or null
16
16
  */
17
17
 
18
18
 
@@ -21,9 +21,10 @@ class FormatContextMenuUtils {
21
21
  }
22
22
  /**
23
23
  * Creates context menu option
24
- * @param {Object} format Format object
25
- * @param {number} group Context menu group
26
- * @param {boolean} isSelected Is current option selected
24
+ * @param title Context menu title
25
+ * @param format Format object
26
+ * @param group Context menu group
27
+ * @param isSelected Is current option selected
27
28
  */
28
29
 
29
30
 
@@ -38,17 +39,18 @@ class FormatContextMenuUtils {
38
39
  }
39
40
  /**
40
41
  * Creates context menu option with an input element
41
- * @param {Object} format Format object
42
- * @param {number} group Context menu group
43
- * @param {string} placeholder Input element placeholder
44
- * @param {boolean} isSelected Is current option selected
45
- * @param {function} onChange Input element onChange callback
42
+ * @param format Format object
43
+ * @param group Context menu group
44
+ * @param placeholder Input element placeholder
45
+ * @param isSelected Is current option selected
46
+ * @param onChange Input element onChange callback
46
47
  */
47
48
 
48
49
 
49
50
  static makeCustomFormatOption(format, group, placeholder, isSelected, onChange) {
50
51
  return {
51
52
  title: format.label,
53
+ description: format.label,
52
54
  format,
53
55
  group,
54
56
  isSelected,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/format-context-menus/FormatContextMenuUtils.jsx"],"names":["React","CustomFormatAction","TableColumnFormatter","FormatContextMenuUtils","isDefaultSelected","selectedFormat","TYPE_CONTEXT_CUSTOM","TYPE_CONTEXT_PRESET","includes","type","isCustomSelected","makeOption","title","format","group","isSelected","description","makeCustomFormatOption","placeholder","onChange","label","menuElement","formatString"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;OACOC,kB;SACEC,oB;;AAET,MAAMC,sBAAN,CAA6B;AAC3B;AACF;AACA;AACA;AAC0B,SAAjBC,iBAAiB,CAACC,cAAD,EAAiB;AACvC,WACE,CAACA,cAAD,IACA,CAAC,CACCH,oBAAoB,CAACI,mBADtB,EAECJ,oBAAoB,CAACK,mBAFtB,EAGCC,QAHD,CAGUH,cAAc,CAACI,IAHzB,CAFH;AAOD;AAED;AACF;AACA;AACA;;;AACyB,SAAhBC,gBAAgB,CAACL,cAAD,EAAiB;AACtC,WACEA,cAAc,IACdA,cAAc,CAACI,IAAf,KAAwBP,oBAAoB,CAACI,mBAF/C;AAID;AAED;AACF;AACA;AACA;AACA;AACA;;;AACmB,SAAVK,UAAU,CAACC,KAAD,EAAQC,MAAR,EAAgBC,KAAhB,EAAuBC,UAAvB,EAAmC;AAClD,WAAO;AACLH,MAAAA,KADK;AAELI,MAAAA,WAAW,EAAEJ,KAFR;AAGLE,MAAAA,KAHK;AAILD,MAAAA,MAJK;AAKLE,MAAAA;AALK,KAAP;AAOD;AAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;;;AAC+B,SAAtBE,sBAAsB,CAC3BJ,MAD2B,EAE3BC,KAF2B,EAG3BI,WAH2B,EAI3BH,UAJ2B,EAK3BI,QAL2B,EAM3B;AACA,WAAO;AACLP,MAAAA,KAAK,EAAEC,MAAM,CAACO,KADT;AAELP,MAAAA,MAFK;AAGLC,MAAAA,KAHK;AAILC,MAAAA,UAJK;AAKLM,MAAAA,WAAW,eACT,oBAAC,kBAAD;AACE,QAAA,YAAY,EAAER,MAAM,CAACS,YADvB;AAEE,QAAA,KAAK,EAAET,MAAM,CAACO,KAFhB;AAGE,QAAA,WAAW,EAAEF,WAHf;AAIE,QAAA,QAAQ,EAAEC;AAJZ;AANG,KAAP;AAcD;;AAvE0B;;AA0E7B,eAAehB,sBAAf","sourcesContent":["import React from 'react';\nimport CustomFormatAction from './CustomFormatAction';\nimport { TableColumnFormatter } from '../formatters';\n\nclass FormatContextMenuUtils {\n /**\n * Returns true if default option should be active in the context menu\n * @param {Object} selectedFormat selected format object or null\n */\n static isDefaultSelected(selectedFormat) {\n return (\n !selectedFormat ||\n ![\n TableColumnFormatter.TYPE_CONTEXT_CUSTOM,\n TableColumnFormatter.TYPE_CONTEXT_PRESET,\n ].includes(selectedFormat.type)\n );\n }\n\n /**\n * Returns true if custom format option should be active in the context menu\n * @param {Object} selectedFormat selected format object or null\n */\n static isCustomSelected(selectedFormat) {\n return (\n selectedFormat &&\n selectedFormat.type === TableColumnFormatter.TYPE_CONTEXT_CUSTOM\n );\n }\n\n /**\n * Creates context menu option\n * @param {Object} format Format object\n * @param {number} group Context menu group\n * @param {boolean} isSelected Is current option selected\n */\n static makeOption(title, format, group, isSelected) {\n return {\n title,\n description: title,\n group,\n format,\n isSelected,\n };\n }\n\n /**\n * Creates context menu option with an input element\n * @param {Object} format Format object\n * @param {number} group Context menu group\n * @param {string} placeholder Input element placeholder\n * @param {boolean} isSelected Is current option selected\n * @param {function} onChange Input element onChange callback\n */\n static makeCustomFormatOption(\n format,\n group,\n placeholder,\n isSelected,\n onChange\n ) {\n return {\n title: format.label,\n format,\n group,\n isSelected,\n menuElement: (\n <CustomFormatAction\n formatString={format.formatString}\n title={format.label}\n placeholder={placeholder}\n onChange={onChange}\n />\n ),\n };\n }\n}\n\nexport default FormatContextMenuUtils;\n"],"file":"FormatContextMenuUtils.js"}
1
+ {"version":3,"sources":["../../src/format-context-menus/FormatContextMenuUtils.tsx"],"names":["React","CustomFormatAction","TableColumnFormatter","FormatContextMenuUtils","isDefaultSelected","selectedFormat","TYPE_CONTEXT_CUSTOM","TYPE_CONTEXT_PRESET","includes","type","isCustomSelected","makeOption","title","format","group","isSelected","description","makeCustomFormatOption","placeholder","onChange","label","menuElement","formatString"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;OACOC,kB;SACEC,oB;;AAcT,MAAMC,sBAAN,CAA6B;AAC3B;AACF;AACA;AACA;AAC0B,SAAjBC,iBAAiB,CAACC,cAAD,EAA6C;AACnE,WACE,CAACA,cAAD,IACA,CAAC,CACCH,oBAAoB,CAACI,mBADtB,EAECJ,oBAAoB,CAACK,mBAFtB,EAGCC,QAHD,CAGUH,cAAc,CAACI,IAHzB,CAFH;AAOD;AAED;AACF;AACA;AACA;;;AACyB,SAAhBC,gBAAgB,CAACL,cAAD,EAA6C;AAClE,WACEA,cAAc,IACdA,cAAc,CAACI,IAAf,KAAwBP,oBAAoB,CAACI,mBAF/C;AAID;AAED;AACF;AACA;AACA;AACA;AACA;AACA;;;AACmB,SAAVK,UAAU,CACfC,KADe,EAEfC,MAFe,EAGfC,KAHe,EAIfC,UAJe,EAKU;AACzB,WAAO;AACLH,MAAAA,KADK;AAELI,MAAAA,WAAW,EAAEJ,KAFR;AAGLE,MAAAA,KAHK;AAILD,MAAAA,MAJK;AAKLE,MAAAA;AALK,KAAP;AAOD;AAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;;;AAC+B,SAAtBE,sBAAsB,CAC3BJ,MAD2B,EAE3BC,KAF2B,EAG3BI,WAH2B,EAI3BH,UAJ2B,EAK3BI,QAL2B,EAMP;AACpB,WAAO;AACLP,MAAAA,KAAK,EAAEC,MAAM,CAACO,KADT;AAELJ,MAAAA,WAAW,EAAEH,MAAM,CAACO,KAFf;AAGLP,MAAAA,MAHK;AAILC,MAAAA,KAJK;AAKLC,MAAAA,UALK;AAMLM,MAAAA,WAAW,eACT,oBAAC,kBAAD;AACE,QAAA,YAAY,EAAER,MAAM,CAACS,YADvB;AAEE,QAAA,KAAK,EAAET,MAAM,CAACO,KAFhB;AAGE,QAAA,WAAW,EAAEF,WAHf;AAIE,QAAA,QAAQ,EAAEC;AAJZ;AAPG,KAAP;AAeD;;AA9E0B;;AAiF7B,eAAehB,sBAAf","sourcesContent":["import React from 'react';\nimport CustomFormatAction from './CustomFormatAction';\nimport { TableColumnFormatter, TableColumnFormat } from '../formatters';\n\nexport interface FormatContextMenuOption {\n title: string;\n description: string;\n group: number;\n format: TableColumnFormat | null;\n isSelected: boolean;\n}\n\nexport interface CustomFormatOption extends FormatContextMenuOption {\n menuElement: React.ReactElement;\n}\n\nclass FormatContextMenuUtils {\n /**\n * Returns true if default option should be active in the context menu\n * @param selectedFormat selected format object or null\n */\n static isDefaultSelected(selectedFormat: TableColumnFormat): boolean {\n return (\n !selectedFormat ||\n ![\n TableColumnFormatter.TYPE_CONTEXT_CUSTOM,\n TableColumnFormatter.TYPE_CONTEXT_PRESET,\n ].includes(selectedFormat.type)\n );\n }\n\n /**\n * Returns true if custom format option should be active in the context menu\n * @param selectedFormat selected format object or null\n */\n static isCustomSelected(selectedFormat: TableColumnFormat): boolean {\n return (\n selectedFormat &&\n selectedFormat.type === TableColumnFormatter.TYPE_CONTEXT_CUSTOM\n );\n }\n\n /**\n * Creates context menu option\n * @param title Context menu title\n * @param format Format object\n * @param group Context menu group\n * @param isSelected Is current option selected\n */\n static makeOption(\n title: string,\n format: TableColumnFormat | null,\n group: number,\n isSelected: boolean\n ): FormatContextMenuOption {\n return {\n title,\n description: title,\n group,\n format,\n isSelected,\n };\n }\n\n /**\n * Creates context menu option with an input element\n * @param format Format object\n * @param group Context menu group\n * @param placeholder Input element placeholder\n * @param isSelected Is current option selected\n * @param onChange Input element onChange callback\n */\n static makeCustomFormatOption(\n format: TableColumnFormat,\n group: number,\n placeholder: string,\n isSelected: boolean,\n onChange: (value: string | null) => void\n ): CustomFormatOption {\n return {\n title: format.label,\n description: format.label,\n format,\n group,\n isSelected,\n menuElement: (\n <CustomFormatAction\n formatString={format.formatString}\n title={format.label}\n placeholder={placeholder}\n onChange={onChange}\n />\n ),\n };\n }\n}\n\nexport default FormatContextMenuUtils;\n"],"file":"FormatContextMenuUtils.js"}
@@ -1,14 +1,16 @@
1
- export default IntegerFormatContextMenu;
1
+ import { FormatContextMenuOption } from './FormatContextMenuUtils';
2
+ import { IntegerColumnFormat } from '../formatters';
2
3
  declare class IntegerFormatContextMenu {
3
4
  static defaultGroup: number;
4
5
  static presetGroup: number;
5
6
  static customGroup: number;
6
7
  /**
7
8
  * Creates list of formatting options for Integer context menu
8
- * @param {Object} selectedFormat Selected format object, null for no selected format
9
- * @param {function} onCustomFormatChange Callback to call when the custom format is changed
10
- * @returns {Array} Array of formatting options for the context menu
9
+ * @param selectedFormat Selected format object, null for no selected format
10
+ * @param onCustomFormatChange Callback to call when the custom format is changed
11
+ * @returns Array of formatting options for the context menu
11
12
  */
12
- static getOptions(selectedFormat: Object, onCustomFormatChange: Function): any[];
13
+ static getOptions(selectedFormat: IntegerColumnFormat, onCustomFormatChange: (value: IntegerColumnFormat | null) => void): FormatContextMenuOption[];
13
14
  }
15
+ export default IntegerFormatContextMenu;
14
16
  //# sourceMappingURL=IntegerFormatContextMenu.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"IntegerFormatContextMenu.d.ts","sourceRoot":"","sources":["../../src/format-context-menus/IntegerFormatContextMenu.js"],"names":[],"mappings":";AAGA;IACE,4BAAyB;IAEzB,2BAAwB;IAExB,2BAAwB;IAExB;;;;;OAKG;IACH,kCAJW,MAAM,yCAwDhB;CACF"}
1
+ {"version":3,"file":"IntegerFormatContextMenu.d.ts","sourceRoot":"","sources":["../../src/format-context-menus/IntegerFormatContextMenu.ts"],"names":[],"mappings":"AAAA,OAA+B,EAC7B,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAA0B,MAAM,eAAe,CAAC;AAE5E,cAAM,wBAAwB;IAC5B,MAAM,CAAC,YAAY,SAAM;IAEzB,MAAM,CAAC,WAAW,SAAM;IAExB,MAAM,CAAC,WAAW,SAAM;IAExB;;;;;OAKG;IACH,MAAM,CAAC,UAAU,CACf,cAAc,EAAE,mBAAmB,EACnC,oBAAoB,EAAE,CAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI,KAAK,IAAI,GAChE,uBAAuB,EAAE;CAqD7B;AAED,eAAe,wBAAwB,CAAC"}
@@ -6,9 +6,9 @@ import { IntegerColumnFormatter } from "../formatters/index.js";
6
6
  class IntegerFormatContextMenu {
7
7
  /**
8
8
  * Creates list of formatting options for Integer context menu
9
- * @param {Object} selectedFormat Selected format object, null for no selected format
10
- * @param {function} onCustomFormatChange Callback to call when the custom format is changed
11
- * @returns {Array} Array of formatting options for the context menu
9
+ * @param selectedFormat Selected format object, null for no selected format
10
+ * @param onCustomFormatChange Callback to call when the custom format is changed
11
+ * @returns Array of formatting options for the context menu
12
12
  */
13
13
  static getOptions(selectedFormat, onCustomFormatChange) {
14
14
  var formatItems = [{
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/format-context-menus/IntegerFormatContextMenu.js"],"names":["FormatContextMenuUtils","IntegerColumnFormatter","IntegerFormatContextMenu","getOptions","selectedFormat","onCustomFormatChange","formatItems","format","FORMAT_MILLIONS","group","presetGroup","defaultFormatOption","makeOption","defaultGroup","isDefaultSelected","presetFormatOptions","map","item","label","isSameFormat","isCustomSelected","customFormat","makeCustomFormat","customFormatOption","makeCustomFormatOption","customGroup","DEFAULT_FORMAT_STRING","formatString","newCustomFormat","isValid"],"mappings":";;OAAOA,sB;SACEC,sB;;AAET,MAAMC,wBAAN,CAA+B;AAO7B;AACF;AACA;AACA;AACA;AACA;AACmB,SAAVC,UAAU,CAACC,cAAD,EAAiBC,oBAAjB,EAAuC;AACtD,QAAMC,WAAW,GAAG,CAClB;AACEC,MAAAA,MAAM,EAAEN,sBAAsB,CAACO,eADjC;AAEEC,MAAAA,KAAK,EAAEP,wBAAwB,CAACQ;AAFlC,KADkB,CAApB;AAOA,QAAMC,mBAAmB,GAAGX,sBAAsB,CAACY,UAAvB,CAC1B,SAD0B,EAE1B,IAF0B,EAG1BV,wBAAwB,CAACW,YAHC,EAI1Bb,sBAAsB,CAACc,iBAAvB,CAAyCV,cAAzC,CAJ0B,CAA5B;AAOA,QAAMW,mBAAmB,GAAGT,WAAW,CAACU,GAAZ,CAAgBC,IAAI,IAC9CjB,sBAAsB,CAACY,UAAvB,CACEK,IAAI,CAACV,MAAL,CAAYW,KADd,EAEED,IAAI,CAACV,MAFP,EAGEU,IAAI,CAACR,KAHP,EAIER,sBAAsB,CAACkB,YAAvB,CAAoCF,IAAI,CAACV,MAAzC,EAAiDH,cAAjD,CAJF,CAD0B,CAA5B;AASA,QAAMgB,gBAAgB,GAAGpB,sBAAsB,CAACoB,gBAAvB,CACvBhB,cADuB,CAAzB;AAIA,QAAMiB,YAAY,GAAGD,gBAAgB,GACjChB,cADiC,GAEjCH,sBAAsB,CAACqB,gBAAvB,EAFJ;AAIA,QAAMC,kBAAkB,GAAGvB,sBAAsB,CAACwB,sBAAvB,CACzBH,YADyB,EAEzBnB,wBAAwB,CAACuB,WAFA,EAGzBxB,sBAAsB,CAACyB,qBAHE,EAIzBN,gBAJyB,EAKzBO,YAAY,IAAI;AACd,UAAIA,YAAJ,EAAkB;AAChB,YAAMC,eAAe,GAAG3B,sBAAsB,CAACqB,gBAAvB,CACtBK,YADsB,CAAxB;;AAGA,YAAI1B,sBAAsB,CAAC4B,OAAvB,CAA+BD,eAA/B,CAAJ,EAAqD;AACnDvB,UAAAA,oBAAoB,CAACuB,eAAD,CAApB;AACD;AACF,OAPD,MAOO;AACLvB,QAAAA,oBAAoB,CAAC,IAAD,CAApB;AACD;AACF,KAhBwB,CAA3B;AAmBA,WAAO,CAACM,mBAAD,EAAsB,GAAGI,mBAAzB,EAA8CQ,kBAA9C,CAAP;AACD;;AAjE4B;;gBAAzBrB,wB,kBACkB,E;;gBADlBA,wB,iBAGiB,E;;gBAHjBA,wB,iBAKiB,E;;AA+DvB,eAAeA,wBAAf","sourcesContent":["import FormatContextMenuUtils from './FormatContextMenuUtils';\nimport { IntegerColumnFormatter } from '../formatters';\n\nclass IntegerFormatContextMenu {\n static defaultGroup = 10;\n\n static presetGroup = 20;\n\n static customGroup = 30;\n\n /**\n * Creates list of formatting options for Integer context menu\n * @param {Object} selectedFormat Selected format object, null for no selected format\n * @param {function} onCustomFormatChange Callback to call when the custom format is changed\n * @returns {Array} Array of formatting options for the context menu\n */\n static getOptions(selectedFormat, onCustomFormatChange) {\n const formatItems = [\n {\n format: IntegerColumnFormatter.FORMAT_MILLIONS,\n group: IntegerFormatContextMenu.presetGroup,\n },\n ];\n\n const defaultFormatOption = FormatContextMenuUtils.makeOption(\n 'Default',\n null,\n IntegerFormatContextMenu.defaultGroup,\n FormatContextMenuUtils.isDefaultSelected(selectedFormat)\n );\n\n const presetFormatOptions = formatItems.map(item =>\n FormatContextMenuUtils.makeOption(\n item.format.label,\n item.format,\n item.group,\n IntegerColumnFormatter.isSameFormat(item.format, selectedFormat)\n )\n );\n\n const isCustomSelected = FormatContextMenuUtils.isCustomSelected(\n selectedFormat\n );\n\n const customFormat = isCustomSelected\n ? selectedFormat\n : IntegerColumnFormatter.makeCustomFormat();\n\n const customFormatOption = FormatContextMenuUtils.makeCustomFormatOption(\n customFormat,\n IntegerFormatContextMenu.customGroup,\n IntegerColumnFormatter.DEFAULT_FORMAT_STRING,\n isCustomSelected,\n formatString => {\n if (formatString) {\n const newCustomFormat = IntegerColumnFormatter.makeCustomFormat(\n formatString\n );\n if (IntegerColumnFormatter.isValid(newCustomFormat)) {\n onCustomFormatChange(newCustomFormat);\n }\n } else {\n onCustomFormatChange(null);\n }\n }\n );\n\n return [defaultFormatOption, ...presetFormatOptions, customFormatOption];\n }\n}\n\nexport default IntegerFormatContextMenu;\n"],"file":"IntegerFormatContextMenu.js"}
1
+ {"version":3,"sources":["../../src/format-context-menus/IntegerFormatContextMenu.ts"],"names":["FormatContextMenuUtils","IntegerColumnFormatter","IntegerFormatContextMenu","getOptions","selectedFormat","onCustomFormatChange","formatItems","format","FORMAT_MILLIONS","group","presetGroup","defaultFormatOption","makeOption","defaultGroup","isDefaultSelected","presetFormatOptions","map","item","label","isSameFormat","isCustomSelected","customFormat","makeCustomFormat","customFormatOption","makeCustomFormatOption","customGroup","DEFAULT_FORMAT_STRING","formatString","newCustomFormat","isValid"],"mappings":";;OAAOA,sB;SAGuBC,sB;;AAE9B,M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;AACD;AACF,OAPD,MAOO;AACLvB,QAAAA,oBAAoB,CAAC,IAAD,CAApB;AACD;AACF,KAhBwB,CAA3B;AAmBA,WAAO,CAACM,mBAAD,EAAsB,GAAGI,mBAAzB,EAA8CQ,kBAA9C,CAAP;AACD;;AApE4B;;gBAAzBrB,wB,kBACkB,E;;gBADlBA,wB,iBAGiB,E;;gBAHjBA,wB,iBAKiB,E;;AAkEvB,eAAeA,wBAAf","sourcesContent":["import FormatContextMenuUtils, {\n FormatContextMenuOption,\n} from './FormatContextMenuUtils';\nimport { IntegerColumnFormat, IntegerColumnFormatter } from '../formatters';\n\nclass IntegerFormatContextMenu {\n static defaultGroup = 10;\n\n static presetGroup = 20;\n\n static customGroup = 30;\n\n /**\n * Creates list of formatting options for Integer context menu\n * @param selectedFormat Selected format object, null for no selected format\n * @param onCustomFormatChange Callback to call when the custom format is changed\n * @returns Array of formatting options for the context menu\n */\n static getOptions(\n selectedFormat: IntegerColumnFormat,\n onCustomFormatChange: (value: IntegerColumnFormat | null) => void\n ): FormatContextMenuOption[] {\n const formatItems = [\n {\n format: IntegerColumnFormatter.FORMAT_MILLIONS,\n group: IntegerFormatContextMenu.presetGroup,\n },\n ];\n\n const defaultFormatOption = FormatContextMenuUtils.makeOption(\n 'Default',\n null,\n IntegerFormatContextMenu.defaultGroup,\n FormatContextMenuUtils.isDefaultSelected(selectedFormat)\n );\n\n const presetFormatOptions = formatItems.map(item =>\n FormatContextMenuUtils.makeOption(\n item.format.label,\n item.format,\n item.group,\n IntegerColumnFormatter.isSameFormat(item.format, selectedFormat)\n )\n );\n\n const isCustomSelected = FormatContextMenuUtils.isCustomSelected(\n selectedFormat\n );\n\n const customFormat = isCustomSelected\n ? selectedFormat\n : IntegerColumnFormatter.makeCustomFormat();\n\n const customFormatOption = FormatContextMenuUtils.makeCustomFormatOption(\n customFormat,\n IntegerFormatContextMenu.customGroup,\n IntegerColumnFormatter.DEFAULT_FORMAT_STRING,\n isCustomSelected,\n formatString => {\n if (formatString) {\n const newCustomFormat = IntegerColumnFormatter.makeCustomFormat(\n formatString\n );\n if (IntegerColumnFormatter.isValid(newCustomFormat)) {\n onCustomFormatChange(newCustomFormat);\n }\n } else {\n onCustomFormatChange(null);\n }\n }\n );\n\n return [defaultFormatOption, ...presetFormatOptions, customFormatOption];\n }\n}\n\nexport default IntegerFormatContextMenu;\n"],"file":"IntegerFormatContextMenu.js"}
@@ -1,4 +1,4 @@
1
- export { default as DateTimeFormatContextMenu } from "./DateTimeFormatContextMenu";
2
- export { default as DecimalFormatContextMenu } from "./DecimalFormatContextMenu";
3
- export { default as IntegerFormatContextMenu } from "./IntegerFormatContextMenu";
1
+ export { default as DateTimeFormatContextMenu } from './DateTimeFormatContextMenu';
2
+ export { default as DecimalFormatContextMenu } from './DecimalFormatContextMenu';
3
+ export { default as IntegerFormatContextMenu } from './IntegerFormatContextMenu';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/format-context-menus/index.js"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/format-context-menus/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACnF,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,4BAA4B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/format-context-menus/index.js"],"names":["default","DateTimeFormatContextMenu","DecimalFormatContextMenu","IntegerFormatContextMenu"],"mappings":"SAASA,OAAO,IAAIC,yB;SACXD,OAAO,IAAIE,wB;SACXF,OAAO,IAAIG,wB","sourcesContent":["export { default as DateTimeFormatContextMenu } from './DateTimeFormatContextMenu';\nexport { default as DecimalFormatContextMenu } from './DecimalFormatContextMenu';\nexport { default as IntegerFormatContextMenu } from './IntegerFormatContextMenu';\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../src/format-context-menus/index.ts"],"names":["default","DateTimeFormatContextMenu","DecimalFormatContextMenu","IntegerFormatContextMenu"],"mappings":"SAASA,OAAO,IAAIC,yB;SACXD,OAAO,IAAIE,wB;SACXF,OAAO,IAAIG,wB","sourcesContent":["export { default as DateTimeFormatContextMenu } from './DateTimeFormatContextMenu';\nexport { default as DecimalFormatContextMenu } from './DecimalFormatContextMenu';\nexport { default as IntegerFormatContextMenu } from './IntegerFormatContextMenu';\n"],"file":"index.js"}