@deephaven/iris-grid 0.20.1-beta.0 → 0.20.1-beta.12
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/dist/format-context-menus/DecimalFormatContextMenu.d.ts.map +1 -1
- package/dist/format-context-menus/DecimalFormatContextMenu.js +3 -0
- package/dist/format-context-menus/DecimalFormatContextMenu.js.map +1 -1
- package/dist/format-context-menus/IntegerFormatContextMenu.d.ts.map +1 -1
- package/dist/format-context-menus/IntegerFormatContextMenu.js +3 -0
- package/dist/format-context-menus/IntegerFormatContextMenu.js.map +1 -1
- package/package.json +15 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DecimalFormatContextMenu.d.ts","sourceRoot":"","sources":["../../src/format-context-menus/DecimalFormatContextMenu.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EAEpB,MAAM,wBAAwB,CAAC;AAChC,OAA+B,EAC7B,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAElC,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;
|
|
1
|
+
{"version":3,"file":"DecimalFormatContextMenu.d.ts","sourceRoot":"","sources":["../../src/format-context-menus/DecimalFormatContextMenu.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EAEpB,MAAM,wBAAwB,CAAC;AAChC,OAA+B,EAC7B,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAElC,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;CA6E7B;AAED,eAAe,wBAAwB,CAAC"}
|
|
@@ -20,6 +20,9 @@ class DecimalFormatContextMenu {
|
|
|
20
20
|
}, {
|
|
21
21
|
format: DecimalColumnFormatter.FORMAT_MILLIONS,
|
|
22
22
|
group: DecimalFormatContextMenu.presetGroup
|
|
23
|
+
}, {
|
|
24
|
+
format: DecimalColumnFormatter.FORMAT_SCIENTIFIC_NOTATION,
|
|
25
|
+
group: DecimalFormatContextMenu.presetGroup
|
|
23
26
|
}, {
|
|
24
27
|
format: DecimalColumnFormatter.FORMAT_ROUND,
|
|
25
28
|
group: DecimalFormatContextMenu.presetRoundGroup
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DecimalFormatContextMenu.js","names":["DecimalColumnFormatter","FormatContextMenuUtils","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"],"sources":["../../src/format-context-menus/DecimalFormatContextMenu.ts"],"sourcesContent":["import {\n DecimalColumnFormat,\n DecimalColumnFormatter,\n} from '@deephaven/jsapi-utils';\nimport FormatContextMenuUtils, {\n FormatContextMenuOption,\n} from './FormatContextMenuUtils';\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 != null) {\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"],"mappings":";;AAAA,SAEEA,sBAFF,QAGO,wBAHP;OAIOC,sB;;AAIP,MAAMC,wBAAN,CAA+B;EAS7B;AACF;AACA;AACA;AACA;AACA;EACmB,OAAVC,UAAU,CACfC,cADe,EAEfC,oBAFe,EAGY;IAC3B,IAAMC,WAAW,GAAG,CAClB;MACEC,MAAM,EAAEP,sBAAsB,CAACQ,cADjC;MAEEC,KAAK,EAAEP,wBAAwB,CAACQ;IAFlC,CADkB,EAKlB;MACEH,MAAM,EAAEP,sBAAsB,CAACW,mBADjC;MAEEF,KAAK,EAAEP,wBAAwB,CAACQ;IAFlC,CALkB,EASlB;MACEH,MAAM,EAAEP,sBAAsB,CAACY,eADjC;MAEEH,KAAK,EAAEP,wBAAwB,CAACQ;IAFlC,CATkB,EAalB;MACEH,MAAM,EAAEP,sBAAsB,CAACa,
|
|
1
|
+
{"version":3,"file":"DecimalFormatContextMenu.js","names":["DecimalColumnFormatter","FormatContextMenuUtils","DecimalFormatContextMenu","getOptions","selectedFormat","onCustomFormatChange","formatItems","format","FORMAT_PERCENT","group","presetGroup","FORMAT_BASIS_POINTS","FORMAT_MILLIONS","FORMAT_SCIENTIFIC_NOTATION","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"],"sources":["../../src/format-context-menus/DecimalFormatContextMenu.ts"],"sourcesContent":["import {\n DecimalColumnFormat,\n DecimalColumnFormatter,\n} from '@deephaven/jsapi-utils';\nimport FormatContextMenuUtils, {\n FormatContextMenuOption,\n} from './FormatContextMenuUtils';\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_SCIENTIFIC_NOTATION,\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 != null) {\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"],"mappings":";;AAAA,SAEEA,sBAFF,QAGO,wBAHP;OAIOC,sB;;AAIP,MAAMC,wBAAN,CAA+B;EAS7B;AACF;AACA;AACA;AACA;AACA;EACmB,OAAVC,UAAU,CACfC,cADe,EAEfC,oBAFe,EAGY;IAC3B,IAAMC,WAAW,GAAG,CAClB;MACEC,MAAM,EAAEP,sBAAsB,CAACQ,cADjC;MAEEC,KAAK,EAAEP,wBAAwB,CAACQ;IAFlC,CADkB,EAKlB;MACEH,MAAM,EAAEP,sBAAsB,CAACW,mBADjC;MAEEF,KAAK,EAAEP,wBAAwB,CAACQ;IAFlC,CALkB,EASlB;MACEH,MAAM,EAAEP,sBAAsB,CAACY,eADjC;MAEEH,KAAK,EAAEP,wBAAwB,CAACQ;IAFlC,CATkB,EAalB;MACEH,MAAM,EAAEP,sBAAsB,CAACa,0BADjC;MAEEJ,KAAK,EAAEP,wBAAwB,CAACQ;IAFlC,CAbkB,EAiBlB;MACEH,MAAM,EAAEP,sBAAsB,CAACc,YADjC;MAEEL,KAAK,EAAEP,wBAAwB,CAACa;IAFlC,CAjBkB,EAqBlB;MACER,MAAM,EAAEP,sBAAsB,CAACgB,yBADjC;MAEEP,KAAK,EAAEP,wBAAwB,CAACa;IAFlC,CArBkB,EAyBlB;MACER,MAAM,EAAEP,sBAAsB,CAACiB,0BADjC;MAEER,KAAK,EAAEP,wBAAwB,CAACa;IAFlC,CAzBkB,CAApB;IA+BA,IAAMG,mBAAmB,GAAGjB,sBAAsB,CAACkB,UAAvB,CAC1B,SAD0B,EAE1B,IAF0B,EAG1BjB,wBAAwB,CAACkB,YAHC,EAI1BnB,sBAAsB,CAACoB,iBAAvB,CAAyCjB,cAAzC,CAJ0B,CAA5B;IAOA,IAAMkB,mBAAmB,GAAGhB,WAAW,CAACiB,GAAZ,CAAgBC,IAAI,IAC9CvB,sBAAsB,CAACkB,UAAvB,CACEK,IAAI,CAACjB,MAAL,CAAYkB,KADd,EAEED,IAAI,CAACjB,MAFP,EAGEiB,IAAI,CAACf,KAHP,EAIET,sBAAsB,CAAC0B,YAAvB,CAAoCF,IAAI,CAACjB,MAAzC,EAAiDH,cAAjD,CAJF,CAD0B,CAA5B;IASA,IAAMuB,gBAAgB,GAAG1B,sBAAsB,CAAC0B,gBAAvB,CACvBvB,cADuB,CAAzB;IAIA,IAAMwB,YAAY,GAAGD,gBAAgB,GACjCvB,cADiC,GAEjCJ,sBAAsB,CAAC6B,gBAAvB,EAFJ;IAIA,IAAMC,kBAAkB,GAAG7B,sBAAsB,CAAC8B,sBAAvB,CACzBH,YADyB,EAEzB1B,wBAAwB,CAAC8B,WAFA,EAGzBhC,sBAAsB,CAACiC,qBAHE,EAIzBN,gBAJyB,EAKzBO,YAAY,IAAI;MACd,IAAIA,YAAY,IAAI,IAApB,EAA0B;QACxB,IAAMC,eAAe,GAAGnC,sBAAsB,CAAC6B,gBAAvB,CACtBK,YADsB,CAAxB;;QAGA,IAAIlC,sBAAsB,CAACoC,OAAvB,CAA+BD,eAA/B,CAAJ,EAAqD;UACnD9B,oBAAoB,CAAC8B,eAAD,CAApB;QACD;MACF,CAPD,MAOO;QACL9B,oBAAoB,CAAC,IAAD,CAApB;MACD;IACF,CAhBwB,CAA3B;IAmBA,OAAO,CAACa,mBAAD,EAAsB,GAAGI,mBAAzB,EAA8CQ,kBAA9C,CAAP;EACD;;AA9F4B;;gBAAzB5B,wB,kBACkB,E;;gBADlBA,wB,iBAGiB,E;;gBAHjBA,wB,sBAKsB,E;;gBALtBA,wB,iBAOiB,E;;AA0FvB,eAAeA,wBAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntegerFormatContextMenu.d.ts","sourceRoot":"","sources":["../../src/format-context-menus/IntegerFormatContextMenu.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EAEpB,MAAM,wBAAwB,CAAC;AAChC,OAA+B,EAC7B,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAElC,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;
|
|
1
|
+
{"version":3,"file":"IntegerFormatContextMenu.d.ts","sourceRoot":"","sources":["../../src/format-context-menus/IntegerFormatContextMenu.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EAEpB,MAAM,wBAAwB,CAAC;AAChC,OAA+B,EAC7B,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAElC,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;CAyD7B;AAED,eAAe,wBAAwB,CAAC"}
|
|
@@ -14,6 +14,9 @@ class IntegerFormatContextMenu {
|
|
|
14
14
|
var formatItems = [{
|
|
15
15
|
format: IntegerColumnFormatter.FORMAT_MILLIONS,
|
|
16
16
|
group: IntegerFormatContextMenu.presetGroup
|
|
17
|
+
}, {
|
|
18
|
+
format: IntegerColumnFormatter.FORMAT_SCIENTIFIC_NOTATION,
|
|
19
|
+
group: IntegerFormatContextMenu.presetGroup
|
|
17
20
|
}];
|
|
18
21
|
var defaultFormatOption = FormatContextMenuUtils.makeOption('Default', null, IntegerFormatContextMenu.defaultGroup, FormatContextMenuUtils.isDefaultSelected(selectedFormat));
|
|
19
22
|
var presetFormatOptions = formatItems.map(item => FormatContextMenuUtils.makeOption(item.format.label, item.format, item.group, IntegerColumnFormatter.isSameFormat(item.format, selectedFormat)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntegerFormatContextMenu.js","names":["IntegerColumnFormatter","FormatContextMenuUtils","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"],"sources":["../../src/format-context-menus/IntegerFormatContextMenu.ts"],"sourcesContent":["import {\n IntegerColumnFormat,\n IntegerColumnFormatter,\n} from '@deephaven/jsapi-utils';\nimport FormatContextMenuUtils, {\n FormatContextMenuOption,\n} from './FormatContextMenuUtils';\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 != null) {\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"],"mappings":";;AAAA,SAEEA,sBAFF,QAGO,wBAHP;OAIOC,sB;;AAIP,MAAMC,wBAAN,CAA+B;EAO7B;AACF;AACA;AACA;AACA;AACA;EACmB,OAAVC,UAAU,CACfC,cADe,EAEfC,oBAFe,EAGY;IAC3B,IAAMC,WAAW,GAAG,CAClB;MACEC,MAAM,EAAEP,sBAAsB,CAACQ,eADjC;MAEEC,KAAK,EAAEP,wBAAwB,CAACQ;IAFlC,CADkB,CAApB;
|
|
1
|
+
{"version":3,"file":"IntegerFormatContextMenu.js","names":["IntegerColumnFormatter","FormatContextMenuUtils","IntegerFormatContextMenu","getOptions","selectedFormat","onCustomFormatChange","formatItems","format","FORMAT_MILLIONS","group","presetGroup","FORMAT_SCIENTIFIC_NOTATION","defaultFormatOption","makeOption","defaultGroup","isDefaultSelected","presetFormatOptions","map","item","label","isSameFormat","isCustomSelected","customFormat","makeCustomFormat","customFormatOption","makeCustomFormatOption","customGroup","DEFAULT_FORMAT_STRING","formatString","newCustomFormat","isValid"],"sources":["../../src/format-context-menus/IntegerFormatContextMenu.ts"],"sourcesContent":["import {\n IntegerColumnFormat,\n IntegerColumnFormatter,\n} from '@deephaven/jsapi-utils';\nimport FormatContextMenuUtils, {\n FormatContextMenuOption,\n} from './FormatContextMenuUtils';\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 format: IntegerColumnFormatter.FORMAT_SCIENTIFIC_NOTATION,\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 != null) {\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"],"mappings":";;AAAA,SAEEA,sBAFF,QAGO,wBAHP;OAIOC,sB;;AAIP,MAAMC,wBAAN,CAA+B;EAO7B;AACF;AACA;AACA;AACA;AACA;EACmB,OAAVC,UAAU,CACfC,cADe,EAEfC,oBAFe,EAGY;IAC3B,IAAMC,WAAW,GAAG,CAClB;MACEC,MAAM,EAAEP,sBAAsB,CAACQ,eADjC;MAEEC,KAAK,EAAEP,wBAAwB,CAACQ;IAFlC,CADkB,EAKlB;MACEH,MAAM,EAAEP,sBAAsB,CAACW,0BADjC;MAEEF,KAAK,EAAEP,wBAAwB,CAACQ;IAFlC,CALkB,CAApB;IAWA,IAAME,mBAAmB,GAAGX,sBAAsB,CAACY,UAAvB,CAC1B,SAD0B,EAE1B,IAF0B,EAG1BX,wBAAwB,CAACY,YAHC,EAI1Bb,sBAAsB,CAACc,iBAAvB,CAAyCX,cAAzC,CAJ0B,CAA5B;IAOA,IAAMY,mBAAmB,GAAGV,WAAW,CAACW,GAAZ,CAAgBC,IAAI,IAC9CjB,sBAAsB,CAACY,UAAvB,CACEK,IAAI,CAACX,MAAL,CAAYY,KADd,EAEED,IAAI,CAACX,MAFP,EAGEW,IAAI,CAACT,KAHP,EAIET,sBAAsB,CAACoB,YAAvB,CAAoCF,IAAI,CAACX,MAAzC,EAAiDH,cAAjD,CAJF,CAD0B,CAA5B;IASA,IAAMiB,gBAAgB,GAAGpB,sBAAsB,CAACoB,gBAAvB,CACvBjB,cADuB,CAAzB;IAIA,IAAMkB,YAAY,GAAGD,gBAAgB,GACjCjB,cADiC,GAEjCJ,sBAAsB,CAACuB,gBAAvB,EAFJ;IAIA,IAAMC,kBAAkB,GAAGvB,sBAAsB,CAACwB,sBAAvB,CACzBH,YADyB,EAEzBpB,wBAAwB,CAACwB,WAFA,EAGzB1B,sBAAsB,CAAC2B,qBAHE,EAIzBN,gBAJyB,EAKzBO,YAAY,IAAI;MACd,IAAIA,YAAY,IAAI,IAApB,EAA0B;QACxB,IAAMC,eAAe,GAAG7B,sBAAsB,CAACuB,gBAAvB,CACtBK,YADsB,CAAxB;;QAGA,IAAI5B,sBAAsB,CAAC8B,OAAvB,CAA+BD,eAA/B,CAAJ,EAAqD;UACnDxB,oBAAoB,CAACwB,eAAD,CAApB;QACD;MACF,CAPD,MAOO;QACLxB,oBAAoB,CAAC,IAAD,CAApB;MACD;IACF,CAhBwB,CAA3B;IAmBA,OAAO,CAACO,mBAAD,EAAsB,GAAGI,mBAAzB,EAA8CQ,kBAA9C,CAAP;EACD;;AAxE4B;;gBAAzBtB,wB,kBACkB,E;;gBADlBA,wB,iBAGiB,E;;gBAHjBA,wB,iBAKiB,E;;AAsEvB,eAAeA,wBAAf"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deephaven/iris-grid",
|
|
3
|
-
"version": "0.20.1-beta.
|
|
3
|
+
"version": "0.20.1-beta.12+c57bd32",
|
|
4
4
|
"description": "Deephaven Iris Grid",
|
|
5
5
|
"author": "Deephaven Data Labs LLC",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,17 +31,17 @@
|
|
|
31
31
|
"start": "cross-env NODE_ENV=development npm run watch"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@deephaven/components": "^0.20.1-beta.
|
|
35
|
-
"@deephaven/console": "^0.20.1-beta.
|
|
36
|
-
"@deephaven/filters": "^0.20.1-beta.
|
|
37
|
-
"@deephaven/grid": "^0.20.1-beta.
|
|
38
|
-
"@deephaven/icons": "^0.20.1-beta.
|
|
39
|
-
"@deephaven/jsapi-shim": "^0.20.1-beta.
|
|
40
|
-
"@deephaven/jsapi-utils": "^0.20.1-beta.
|
|
41
|
-
"@deephaven/log": "^0.20.1-beta.
|
|
42
|
-
"@deephaven/react-hooks": "^0.20.1-beta.
|
|
43
|
-
"@deephaven/storage": "^0.20.1-beta.
|
|
44
|
-
"@deephaven/utils": "^0.20.1-beta.
|
|
34
|
+
"@deephaven/components": "^0.20.1-beta.12+c57bd32",
|
|
35
|
+
"@deephaven/console": "^0.20.1-beta.12+c57bd32",
|
|
36
|
+
"@deephaven/filters": "^0.20.1-beta.12+c57bd32",
|
|
37
|
+
"@deephaven/grid": "^0.20.1-beta.12+c57bd32",
|
|
38
|
+
"@deephaven/icons": "^0.20.1-beta.12+c57bd32",
|
|
39
|
+
"@deephaven/jsapi-shim": "^0.20.1-beta.12+c57bd32",
|
|
40
|
+
"@deephaven/jsapi-utils": "^0.20.1-beta.12+c57bd32",
|
|
41
|
+
"@deephaven/log": "^0.20.1-beta.12+c57bd32",
|
|
42
|
+
"@deephaven/react-hooks": "^0.20.1-beta.12+c57bd32",
|
|
43
|
+
"@deephaven/storage": "^0.20.1-beta.12+c57bd32",
|
|
44
|
+
"@deephaven/utils": "^0.20.1-beta.12+c57bd32",
|
|
45
45
|
"@fortawesome/react-fontawesome": "^0.1.18",
|
|
46
46
|
"classnames": "^2.3.1",
|
|
47
47
|
"deep-equal": "^2.0.5",
|
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
"react": "^17.x"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
-
"@deephaven/mocks": "^0.20.1-beta.
|
|
65
|
-
"@deephaven/tsconfig": "^0.20.1-beta.
|
|
64
|
+
"@deephaven/mocks": "^0.20.1-beta.12+c57bd32",
|
|
65
|
+
"@deephaven/tsconfig": "^0.20.1-beta.12+c57bd32"
|
|
66
66
|
},
|
|
67
67
|
"files": [
|
|
68
68
|
"dist"
|
|
@@ -73,5 +73,5 @@
|
|
|
73
73
|
"publishConfig": {
|
|
74
74
|
"access": "public"
|
|
75
75
|
},
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "c57bd32ae2c2c122287998071e4b2e208d112ab3"
|
|
77
77
|
}
|