@deephaven/components 0.19.2-beta.12 → 0.19.2-beta.14

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.
@@ -44,12 +44,12 @@ declare class ContextActionUtils {
44
44
  */
45
45
  static getModifierKey(): 'metaKey' | 'ctrlKey';
46
46
  /**
47
- * Returns true if the modifier key for the current platform is down for the event (Ctrl for windows/linux, Command (meta) for mac)
47
+ * Returns true if the modifier key for the current platform is down for the event (Ctrl for windows/linux, Command (meta) for mac)
48
48
  * @param event The event to get the meta key status from
49
49
  */
50
50
  static isModifierKeyDown(event: KeyboardEvent | MouseEvent | React.KeyboardEvent | React.MouseEvent): boolean;
51
51
  /**
52
- * Copy the p assed in text to the clipboard.
52
+ * Copy the passed in text to the clipboard.
53
53
  * @param text The text to copy
54
54
  * @returns Promise Resolved on success, rejected on failure
55
55
  */
@@ -61,7 +61,7 @@ declare class ContextActionUtils {
61
61
  */
62
62
  static copyToClipboardExecCommand(text: string): void;
63
63
  /**
64
- * Returns the menu items for the provided context actions, or empty array if none foun d.
64
+ * Returns the menu items for the provided context actions, or empty array if none found.
65
65
  * @param actionsParam The actions to get menu items for
66
66
  * @param includePromises Whether or not to include promises in the returned menu items
67
67
  */
@@ -83,7 +83,7 @@ class ContextActionUtils {
83
83
  return 'ctrlKey';
84
84
  }
85
85
  /**
86
- * Returns true if the modifier key for the current platform is down for the event (Ctrl for windows/linux, Command (meta) for mac)
86
+ * Returns true if the modifier key for the current platform is down for the event (Ctrl for windows/linux, Command (meta) for mac)
87
87
  * @param event The event to get the meta key status from
88
88
  */
89
89
 
@@ -93,7 +93,7 @@ class ContextActionUtils {
93
93
  return event[modifierKey];
94
94
  }
95
95
  /**
96
- * Copy the p assed in text to the clipboard.
96
+ * Copy the passed in text to the clipboard.
97
97
  * @param text The text to copy
98
98
  * @returns Promise Resolved on success, rejected on failure
99
99
  */
@@ -139,7 +139,7 @@ class ContextActionUtils {
139
139
  }
140
140
  }
141
141
  /**
142
- * Returns the menu items for the provided context actions, or empty array if none foun d.
142
+ * Returns the menu items for the provided context actions, or empty array if none found.
143
143
  * @param actionsParam The actions to get menu items for
144
144
  * @param includePromises Whether or not to include promises in the returned menu items
145
145
  */
@@ -1 +1 @@
1
- {"version":3,"file":"ContextActionUtils.js","names":["isPromise","value","then","undefined","ContextActionUtils","disableAllActions","actionsDisabled","enableAllActions","isContextActionEvent","e","Array","isArray","contextActions","compareActions","a","b","group","order","title","sortActions","actions","sortedActions","slice","sort","isMacPlatform","platform","window","navigator","startsWith","getModifierKey","isModifierKeyDown","event","modifierKey","copyToClipboard","text","clipboard","copyToClipboardExecCommand","Promise","resolve","writeText","catch","oldFocus","document","activeElement","textArea","createElement","body","appendChild","focus","select","execCommand","Error","removeChild","HTMLElement","getMenuItems","actionsParam","includePromises","menuItems","i","length","action","newMenuItems","push","concat","filter","menuElement","getNextMenuItem","startIndex","delta","firstIndex","menuIndex","item","disabled"],"sources":["../../src/context-actions/ContextActionUtils.ts"],"sourcesContent":["import { IconDefinition } from '@deephaven/icons';\nimport React from 'react';\nimport type { Shortcut } from '../shortcuts';\n\nexport type ResolvableContextAction =\n | ContextAction\n | Promise<ContextAction[]>\n | (() => Promise<ContextAction[]> | ContextAction[] | ContextAction);\n\nexport type MenuItem = ContextAction | Promise<ContextAction[]>;\n\nexport interface ContextAction {\n title?: string;\n description?: string;\n action?(event?: KeyboardEvent): void;\n actions?: ResolvableContextAction[];\n icon?: IconDefinition | React.ReactElement;\n iconColor?: string;\n shortcut?: Shortcut;\n isGlobal?: boolean;\n group?: number;\n order?: number;\n disabled?: boolean;\n menuElement?: React.ReactElement;\n iconOutline?: boolean;\n}\n\nexport interface ContextActionEvent extends MouseEvent {\n contextActions: ResolvableContextAction[];\n}\n\nexport function isPromise<A, T>(value: A | Promise<T>): value is Promise<T> {\n return (value as Promise<T>).then !== undefined;\n}\n\nclass ContextActionUtils {\n static actionsDisabled = false;\n\n static disableAllActions(): void {\n ContextActionUtils.actionsDisabled = true;\n }\n\n static enableAllActions(): void {\n ContextActionUtils.actionsDisabled = false;\n }\n\n static isContextActionEvent(e: MouseEvent): e is ContextActionEvent {\n return Array.isArray((e as ContextActionEvent).contextActions);\n }\n\n /**\n * Compare two action items. Useful in Array.sort\n * @param a First context action to compare\n * @param b Second context action to compare\n */\n static compareActions(a: ContextAction, b: ContextAction): number {\n if (a.group !== b.group) {\n return (a.group ?? 0) > (b.group ?? 0) ? 1 : -1;\n }\n\n if (a.order !== b.order) {\n return (a.order ?? 0) > (b.order ?? 0) ? 1 : -1;\n }\n\n if (a.title !== b.title) {\n return (a.title ?? '') > (b.title ?? '') ? 1 : -1;\n }\n\n if (a !== b) {\n return a > b ? 1 : -1;\n }\n\n return 0;\n }\n\n /**\n *\n * @param actions The array of actions to sort\n */\n static sortActions(actions: ContextAction[]): ContextAction[] {\n if (actions == null || !Array.isArray(actions)) {\n return [];\n }\n\n const sortedActions = actions.slice();\n sortedActions.sort(ContextActionUtils.compareActions);\n return sortedActions;\n }\n\n static isMacPlatform(): boolean {\n const { platform } = window.navigator;\n return platform.startsWith('Mac');\n }\n\n /**\n * Retrieve the preferred modifier key based on the current platform\n */\n static getModifierKey(): 'metaKey' | 'ctrlKey' {\n if (ContextActionUtils.isMacPlatform()) {\n return 'metaKey';\n }\n\n return 'ctrlKey';\n }\n\n /**\n * Returns true if the modifier key for the current platform is down for the event (Ctrl for windows/linux, Command (meta) for mac)\n * @param event The event to get the meta key status from\n */\n static isModifierKeyDown(\n event: KeyboardEvent | MouseEvent | React.KeyboardEvent | React.MouseEvent\n ): boolean {\n const modifierKey = ContextActionUtils.getModifierKey();\n return event[modifierKey];\n }\n\n /**\n * Copy the p assed in text to the clipboard.\n * @param text The text to copy\n * @returns Promise Resolved on success, rejected on failure\n */\n static copyToClipboard(text: string): Promise<void> {\n const { clipboard } = navigator;\n if (clipboard === undefined) {\n ContextActionUtils.copyToClipboardExecCommand(text);\n return Promise.resolve();\n }\n return navigator.clipboard.writeText(text).catch(() => {\n ContextActionUtils.copyToClipboardExecCommand(text);\n });\n }\n\n /**\n * Copy the passed in text to the clipboard using the `execCommand` functionality\n * Throws on error/failure\n * @param text The text to copy\n */\n static copyToClipboardExecCommand(text: string): void {\n const oldFocus = document.activeElement;\n const textArea = document.createElement('textarea');\n textArea.value = text;\n document.body.appendChild(textArea);\n textArea.focus();\n textArea.select();\n\n if (!document.execCommand('copy')) {\n throw new Error('Unable to execute copy command');\n }\n\n document.body.removeChild(textArea);\n\n if (oldFocus instanceof HTMLElement) {\n oldFocus.focus();\n }\n }\n\n /**\n * Returns the menu items for the provided context actions, or empty array if none foun d.\n * @param actionsParam The actions to get menu items for\n * @param includePromises Whether or not to include promises in the returned menu items\n */\n static getMenuItems(\n actionsParam: ResolvableContextAction | ResolvableContextAction[],\n includePromises?: true\n ): MenuItem[];\n\n // If ignoring promises, then the return type is narrowed\n static getMenuItems(\n actionsParam: ResolvableContextAction | ResolvableContextAction[],\n includePromises: false\n ): ContextAction[];\n\n static getMenuItems(\n actionsParam: ResolvableContextAction | ResolvableContextAction[],\n includePromises = true\n ): MenuItem[] {\n let menuItems: MenuItem[] = [];\n let actions = actionsParam;\n if (!Array.isArray(actions)) {\n actions = [actions];\n }\n\n for (let i = 0; i < actions.length; i += 1) {\n const action = actions[i];\n let newMenuItems:\n | ContextAction\n | ContextAction[]\n | Promise<ContextAction[]>;\n if (typeof action === 'function') {\n newMenuItems = action();\n } else {\n newMenuItems = action;\n }\n\n if (newMenuItems != null) {\n if (newMenuItems instanceof Promise) {\n if (includePromises) {\n menuItems.push(newMenuItems);\n }\n } else if (Array.isArray(newMenuItems)) {\n menuItems = menuItems.concat(newMenuItems);\n } else {\n menuItems.push(newMenuItems);\n }\n }\n }\n\n menuItems = menuItems.filter(\n action =>\n (action as ContextAction).title !== undefined ||\n (action as Promise<ContextAction[]>).then ||\n (action as ContextAction).menuElement\n );\n\n return menuItems;\n }\n\n /**\n * Returns the index of the next menu item in a list that doesn't have a disabled=true prop\n * @param startIndex the starting position for the iteration\n * @param delta the direction of travel, -1 or 1\n * @param menuItems an array of menuItems\n */\n static getNextMenuItem(\n startIndex: number,\n delta: -1 | 1,\n menuItems: MenuItem[]\n ): number {\n let firstIndex = startIndex;\n if (firstIndex < 0 && delta < 0) {\n // if menu index is -1 and delta -1 manually set start point\n firstIndex = menuItems.length;\n }\n // find the next non disabled menu option, iterating the list only once\n for (let i = 1; i < menuItems.length + 1; i += 1) {\n const menuIndex =\n (firstIndex + delta * i + menuItems.length) % menuItems.length;\n const item = menuItems[menuIndex];\n if (!(item instanceof Promise) && item.disabled !== true) {\n return menuIndex;\n }\n }\n return startIndex;\n }\n}\n\nexport default ContextActionUtils;\n"],"mappings":";;AA+BA,OAAO,SAASA,SAAT,CAAyBC,KAAzB,EAAqE;EAC1E,OAAQA,KAAD,CAAsBC,IAAtB,KAA+BC,SAAtC;AACD;;AAED,MAAMC,kBAAN,CAAyB;EAGC,OAAjBC,iBAAiB,GAAS;IAC/BD,kBAAkB,CAACE,eAAnB,GAAqC,IAArC;EACD;;EAEsB,OAAhBC,gBAAgB,GAAS;IAC9BH,kBAAkB,CAACE,eAAnB,GAAqC,KAArC;EACD;;EAE0B,OAApBE,oBAAoB,CAACC,CAAD,EAAyC;IAClE,OAAOC,KAAK,CAACC,OAAN,CAAeF,CAAD,CAA0BG,cAAxC,CAAP;EACD;EAED;AACF;AACA;AACA;AACA;;;EACuB,OAAdC,cAAc,CAACC,CAAD,EAAmBC,CAAnB,EAA6C;IAChE,IAAID,CAAC,CAACE,KAAF,KAAYD,CAAC,CAACC,KAAlB,EAAyB;MAAA;;MACvB,OAAO,aAACF,CAAC,CAACE,KAAH,+CAAY,CAAZ,iBAAkBD,CAAC,CAACC,KAApB,+CAA6B,CAA7B,IAAkC,CAAlC,GAAsC,CAAC,CAA9C;IACD;;IAED,IAAIF,CAAC,CAACG,KAAF,KAAYF,CAAC,CAACE,KAAlB,EAAyB;MAAA;;MACvB,OAAO,aAACH,CAAC,C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/C,EAAkD;MAChD,IAAMY,SAAS,GACb,CAACD,UAAU,GAAGD,KAAK,GAAGV,CAArB,GAAyBD,SAAS,CAACE,MAApC,IAA8CF,SAAS,CAACE,MAD1D;MAEA,IAAMY,IAAI,GAAGd,SAAS,CAACa,SAAD,CAAtB;;MACA,IAAI,EAAEC,IAAI,YAAYlC,OAAlB,KAA8BkC,IAAI,CAACC,QAAL,KAAkB,IAApD,EAA0D;QACxD,OAAOF,SAAP;MACD;IACF;;IACD,OAAOH,UAAP;EACD;;AAhNsB;;gBAAnB/D,kB,qBACqB,K;;AAkN3B,eAAeA,kBAAf"}
1
+ {"version":3,"file":"ContextActionUtils.js","names":["isPromise","value","then","undefined","ContextActionUtils","disableAllActions","actionsDisabled","enableAllActions","isContextActionEvent","e","Array","isArray","contextActions","compareActions","a","b","group","order","title","sortActions","actions","sortedActions","slice","sort","isMacPlatform","platform","window","navigator","startsWith","getModifierKey","isModifierKeyDown","event","modifierKey","copyToClipboard","text","clipboard","copyToClipboardExecCommand","Promise","resolve","writeText","catch","oldFocus","document","activeElement","textArea","createElement","body","appendChild","focus","select","execCommand","Error","removeChild","HTMLElement","getMenuItems","actionsParam","includePromises","menuItems","i","length","action","newMenuItems","push","concat","filter","menuElement","getNextMenuItem","startIndex","delta","firstIndex","menuIndex","item","disabled"],"sources":["../../src/context-actions/ContextActionUtils.ts"],"sourcesContent":["import { IconDefinition } from '@deephaven/icons';\nimport React from 'react';\nimport type { Shortcut } from '../shortcuts';\n\nexport type ResolvableContextAction =\n | ContextAction\n | Promise<ContextAction[]>\n | (() => Promise<ContextAction[]> | ContextAction[] | ContextAction);\n\nexport type MenuItem = ContextAction | Promise<ContextAction[]>;\n\nexport interface ContextAction {\n title?: string;\n description?: string;\n action?(event?: KeyboardEvent): void;\n actions?: ResolvableContextAction[];\n icon?: IconDefinition | React.ReactElement;\n iconColor?: string;\n shortcut?: Shortcut;\n isGlobal?: boolean;\n group?: number;\n order?: number;\n disabled?: boolean;\n menuElement?: React.ReactElement;\n iconOutline?: boolean;\n}\n\nexport interface ContextActionEvent extends MouseEvent {\n contextActions: ResolvableContextAction[];\n}\n\nexport function isPromise<A, T>(value: A | Promise<T>): value is Promise<T> {\n return (value as Promise<T>).then !== undefined;\n}\n\nclass ContextActionUtils {\n static actionsDisabled = false;\n\n static disableAllActions(): void {\n ContextActionUtils.actionsDisabled = true;\n }\n\n static enableAllActions(): void {\n ContextActionUtils.actionsDisabled = false;\n }\n\n static isContextActionEvent(e: MouseEvent): e is ContextActionEvent {\n return Array.isArray((e as ContextActionEvent).contextActions);\n }\n\n /**\n * Compare two action items. Useful in Array.sort\n * @param a First context action to compare\n * @param b Second context action to compare\n */\n static compareActions(a: ContextAction, b: ContextAction): number {\n if (a.group !== b.group) {\n return (a.group ?? 0) > (b.group ?? 0) ? 1 : -1;\n }\n\n if (a.order !== b.order) {\n return (a.order ?? 0) > (b.order ?? 0) ? 1 : -1;\n }\n\n if (a.title !== b.title) {\n return (a.title ?? '') > (b.title ?? '') ? 1 : -1;\n }\n\n if (a !== b) {\n return a > b ? 1 : -1;\n }\n\n return 0;\n }\n\n /**\n *\n * @param actions The array of actions to sort\n */\n static sortActions(actions: ContextAction[]): ContextAction[] {\n if (actions == null || !Array.isArray(actions)) {\n return [];\n }\n\n const sortedActions = actions.slice();\n sortedActions.sort(ContextActionUtils.compareActions);\n return sortedActions;\n }\n\n static isMacPlatform(): boolean {\n const { platform } = window.navigator;\n return platform.startsWith('Mac');\n }\n\n /**\n * Retrieve the preferred modifier key based on the current platform\n */\n static getModifierKey(): 'metaKey' | 'ctrlKey' {\n if (ContextActionUtils.isMacPlatform()) {\n return 'metaKey';\n }\n\n return 'ctrlKey';\n }\n\n /**\n * Returns true if the modifier key for the current platform is down for the event (Ctrl for windows/linux, Command (meta) for mac)\n * @param event The event to get the meta key status from\n */\n static isModifierKeyDown(\n event: KeyboardEvent | MouseEvent | React.KeyboardEvent | React.MouseEvent\n ): boolean {\n const modifierKey = ContextActionUtils.getModifierKey();\n return event[modifierKey];\n }\n\n /**\n * Copy the passed in text to the clipboard.\n * @param text The text to copy\n * @returns Promise Resolved on success, rejected on failure\n */\n static copyToClipboard(text: string): Promise<void> {\n const { clipboard } = navigator;\n if (clipboard === undefined) {\n ContextActionUtils.copyToClipboardExecCommand(text);\n return Promise.resolve();\n }\n return navigator.clipboard.writeText(text).catch(() => {\n ContextActionUtils.copyToClipboardExecCommand(text);\n });\n }\n\n /**\n * Copy the passed in text to the clipboard using the `execCommand` functionality\n * Throws on error/failure\n * @param text The text to copy\n */\n static copyToClipboardExecCommand(text: string): void {\n const oldFocus = document.activeElement;\n const textArea = document.createElement('textarea');\n textArea.value = text;\n document.body.appendChild(textArea);\n textArea.focus();\n textArea.select();\n\n if (!document.execCommand('copy')) {\n throw new Error('Unable to execute copy command');\n }\n\n document.body.removeChild(textArea);\n\n if (oldFocus instanceof HTMLElement) {\n oldFocus.focus();\n }\n }\n\n /**\n * Returns the menu items for the provided context actions, or empty array if none found.\n * @param actionsParam The actions to get menu items for\n * @param includePromises Whether or not to include promises in the returned menu items\n */\n static getMenuItems(\n actionsParam: ResolvableContextAction | ResolvableContextAction[],\n includePromises?: true\n ): MenuItem[];\n\n // If ignoring promises, then the return type is narrowed\n static getMenuItems(\n actionsParam: ResolvableContextAction | ResolvableContextAction[],\n includePromises: false\n ): ContextAction[];\n\n static getMenuItems(\n actionsParam: ResolvableContextAction | ResolvableContextAction[],\n includePromises = true\n ): MenuItem[] {\n let menuItems: MenuItem[] = [];\n let actions = actionsParam;\n if (!Array.isArray(actions)) {\n actions = [actions];\n }\n\n for (let i = 0; i < actions.length; i += 1) {\n const action = actions[i];\n let newMenuItems:\n | ContextAction\n | ContextAction[]\n | Promise<ContextAction[]>;\n if (typeof action === 'function') {\n newMenuItems = action();\n } else {\n newMenuItems = action;\n }\n\n if (newMenuItems != null) {\n if (newMenuItems instanceof Promise) {\n if (includePromises) {\n menuItems.push(newMenuItems);\n }\n } else if (Array.isArray(newMenuItems)) {\n menuItems = menuItems.concat(newMenuItems);\n } else {\n menuItems.push(newMenuItems);\n }\n }\n }\n\n menuItems = menuItems.filter(\n action =>\n (action as ContextAction).title !== undefined ||\n (action as Promise<ContextAction[]>).then ||\n (action as ContextAction).menuElement\n );\n\n return menuItems;\n }\n\n /**\n * Returns the index of the next menu item in a list that doesn't have a disabled=true prop\n * @param startIndex the starting position for the iteration\n * @param delta the direction of travel, -1 or 1\n * @param menuItems an array of menuItems\n */\n static getNextMenuItem(\n startIndex: number,\n delta: -1 | 1,\n menuItems: MenuItem[]\n ): number {\n let firstIndex = startIndex;\n if (firstIndex < 0 && delta < 0) {\n // if menu index is -1 and delta -1 manually set start point\n firstIndex = menuItems.length;\n }\n // find the next non disabled menu option, iterating the list only once\n for (let i = 1; i < menuItems.length + 1; i += 1) {\n const menuIndex =\n (firstIndex + delta * i + menuItems.length) % menuItems.length;\n const item = menuItems[menuIndex];\n if (!(item instanceof Promise) && item.disabled !== true) {\n return menuIndex;\n }\n }\n return startIndex;\n }\n}\n\nexport default ContextActionUtils;\n"],"mappings":";;AA+BA,OAAO,SAASA,SAAT,CAAyBC,KAAzB,EAAqE;EAC1E,OAAQA,KAAD,CAAsBC,IAAtB,KAA+BC,SAAtC;AACD;;AAED,MAAMC,kBAAN,CAAyB;EAGC,OAAjBC,iBAAiB,GAAS;IAC/BD,kBAAkB,CAACE,eAAnB,GAAqC,IAArC;EACD;;EAEsB,OAAhBC,gBAAgB,GAAS;IAC9BH,kBAAkB,CAACE,eAAnB,GAAqC,KAArC;EACD;;EAE0B,OAApBE,oBAAoB,CAACC,CAAD,EAAyC;IAClE,OAAOC,KAAK,CAACC,OAAN,CAAeF,CAAD,CAA0BG,cAAxC,CAAP;EACD;EAED;AACF;AACA;AACA;AACA;;;EACuB,OAAdC,cAAc,CAACC,CAAD,EAAmBC,CAAnB,EAA6C;IAChE,IAAID,CAAC,CAACE,KAAF,KAAYD,CAAC,CAACC,KAAlB,EAAyB;MAAA;;MACvB,OAAO,aA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Ab,IAAkBD,KAAK,GAAG,CAA9B,EAAiC;MAC/B;MACAC,UAAU,GAAGZ,SAAS,CAACE,MAAvB;IACD,CALO,CAMR;;;IACA,KAAK,IAAID,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGD,SAAS,CAACE,MAAV,GAAmB,CAAvC,EAA0CD,CAAC,IAAI,CAA/C,EAAkD;MAChD,IAAMY,SAAS,GACb,CAACD,UAAU,GAAGD,KAAK,GAAGV,CAArB,GAAyBD,SAAS,CAACE,MAApC,IAA8CF,SAAS,CAACE,MAD1D;MAEA,IAAMY,IAAI,GAAGd,SAAS,CAACa,SAAD,CAAtB;;MACA,IAAI,EAAEC,IAAI,YAAYlC,OAAlB,KAA8BkC,IAAI,CAACC,QAAL,KAAkB,IAApD,EAA0D;QACxD,OAAOF,SAAP;MACD;IACF;;IACD,OAAOH,UAAP;EACD;;AAhNsB;;gBAAnB/D,kB,qBACqB,K;;AAkN3B,eAAeA,kBAAf"}
@@ -1 +1 @@
1
- {"version":3,"file":"ContextActions.d.ts","sourceRoot":"","sources":["../../src/context-actions/ContextActions.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzC,OAA2B,EACzB,uBAAuB,EAExB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,aAAa,EAAsB,MAAM,sBAAsB,CAAC;AAE9E,OAAO,uBAAuB,CAAC;AAI/B,UAAU,mBAAmB;IAC3B,OAAO,EAAE,uBAAuB,GAAG,uBAAuB,EAAE,CAAC;IAC7D,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,UAAU,mBAAmB;IAC3B,aAAa,EAAE,aAAa,EAAE,CAAC;IAC/B,eAAe,EAAE,aAAa,EAAE,CAAC;CAClC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,cAAM,cAAe,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AAM,cAAe,SAAQ,SAAS,CACpC,mBAAmB,EACnB,mBAAmB,CACpB;IACC;;;;;OAKG;IACH,MAAM,CAAC,MAAM;;;;;;;MAQX;IAEF,MAAM,CAAC,WAAW,CAChB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,aAAa,EAAE,GACvB,IAAI;gBAmBK,KAAK,EAAE,mBAAmB;IAWtC,MAAM,CAAC,wBAAwB,CAC7B,KAAK,EAAE,mBAAmB,GACzB,mBAAmB;IAmBtB,iBAAiB,IAAI,IAAI;IAazB,oBAAoB,IAAI,IAAI;IAa5B,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAE3C,iBAAiB,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI;IAgDtC,aAAa,CAAC,CAAC,EAAE,aAAa,GAAG,IAAI;IAqBrC,MAAM,IAAI,GAAG,CAAC,OAAO;CAatB;AAED,eAAe,cAAc,CAAC"}
@@ -81,7 +81,7 @@ class ContextActions extends Component {
81
81
  }
82
82
 
83
83
  var globalActions = props.actions.filter(action => !isPromise(action) && typeof action !== 'function' && action.isGlobal);
84
- var keyboardActions = props.actions.filter(action => !isPromise(action) && typeof action !== 'function' && action.isGlobal !== undefined && !action.isGlobal && action.shortcut != null);
84
+ var keyboardActions = props.actions.filter(action => !isPromise(action) && typeof action !== 'function' && (action.isGlobal === undefined || !action.isGlobal) && action.shortcut != null);
85
85
  return {
86
86
  globalActions,
87
87
  keyboardActions
@@ -153,7 +153,7 @@ class ContextActions extends Component {
153
153
  var contextActions = actions;
154
154
 
155
155
  if (Array.isArray(contextActions)) {
156
- contextActions = contextActions.filter(action => isPromise(action) || typeof action === 'function' || action.isGlobal === undefined || action.isGlobal);
156
+ contextActions = contextActions.filter(action => isPromise(action) || typeof action === 'function' || action.isGlobal === undefined || !action.isGlobal);
157
157
  }
158
158
 
159
159
  e.contextActions = e.contextActions.concat(contextActions);
@@ -1 +1 @@
1
- {"version":3,"file":"ContextActions.js","names":["React","Component","Log","ContextActionUtils","isPromise","GlobalContextActions","log","module","ContextActions","triggerMenu","element","clientX","clientY","actions","length","mouseEvent","MouseEvent","bubbles","cancelable","contextActions","dispatchEvent","constructor","props","handleContextMenu","bind","handleKeyDown","container","createRef","state","globalActions","keyboardActions","getDerivedStateFromProps","Array","isArray","filter","action","isGlobal","undefined","shortcut","componentDidMount","current","parentElement","addEventListener","componentWillUnmount","removeEventListener","e","ignoreClassNames","el","target","classList","ignoredClassName","find","className","contains","debug2","isContextActionEvent","concat","debug","i","keyboardAction","actionsDisabled","matchesEvent","stopPropagation","preventDefault","render","dataTestId","default","high","medium","low","global","edit"],"sources":["../../src/context-actions/ContextActions.tsx"],"sourcesContent":["/**\n * Just a simple utility class for displaying a popup menu.\n */\nimport React, { Component } from 'react';\nimport Log from '@deephaven/log';\nimport ContextActionUtils, {\n ResolvableContextAction,\n isPromise,\n} from './ContextActionUtils';\nimport type { ContextAction, ContextActionEvent } from './ContextActionUtils';\nimport GlobalContextActions from './GlobalContextActions';\nimport './ContextActions.scss';\n\nconst log = Log.module('ContextActions');\n\ninterface ContextActionsProps {\n actions: ResolvableContextAction | ResolvableContextAction[];\n ignoreClassNames?: string[];\n 'data-testid'?: string;\n}\n\ninterface ContextActionsState {\n globalActions: ContextAction[];\n keyboardActions: ContextAction[];\n}\n\n/**\n * ContextActions that you add onto any component.\n *\n * Usage:\n * let actions = [{\n * title: 'My Action', // Omit the title to hide it from the context menu\n * action: () => { alert('My Action Clicked!') }\n * actions: [] // Submenu of actions\n * icon: faPrint, // Limited to FontAwesome icons for now.\n * iconColor: '#ff0000, // Color to use for the icon\n * shortcut: Shortcut, // Defaults to null\n * isGlobal: false, // Global context action. Defaults to false.\n * group: ContextActions.groups.default, // What group to group the context action with\n * order: null, // Int where to order within group\n * disabled: true // disable action\n * menuElement: null // Custom menu element for displaying in context menu. When null, creates a default menu item based on title\n * }];\n *\n * <div>\n * Right click in this container\n * <ContextActions actions={actions}/>\n * </div>\n *\n * Right clicking the container will then build the context menu, bubbling up until an element with a ContextMenuRoot is on it.\n * You should generally have a ContextMenuRoot on the root node of your document.\n */\nclass ContextActions extends Component<\n ContextActionsProps,\n ContextActionsState\n> {\n /**\n * Group you can assign to context menu actions to group them together.\n * Lower group IDs appear at the top of the list.\n * Groups are separated by a separator item.\n * Items within groups are ordered by their order property, then by their title.\n */\n static groups = {\n default: null,\n high: 100,\n medium: 5000,\n low: 10000,\n global: 100000,\n\n edit: 100,\n };\n\n static triggerMenu(\n element: Element,\n clientX: number,\n clientY: number,\n actions: ContextAction[]\n ): void {\n if (actions.length === 0) {\n return;\n }\n\n const mouseEvent: Partial<ContextActionEvent> = new MouseEvent(\n 'contextmenu',\n {\n clientX,\n clientY,\n bubbles: true,\n cancelable: true,\n }\n );\n mouseEvent.contextActions = actions;\n\n element.dispatchEvent(mouseEvent as ContextActionEvent);\n }\n\n constructor(props: ContextActionsProps) {\n super(props);\n\n this.handleContextMenu = this.handleContextMenu.bind(this);\n this.handleKeyDown = this.handleKeyDown.bind(this);\n\n this.container = React.createRef();\n\n this.state = { globalActions: [], keyboardActions: [] };\n }\n\n static getDerivedStateFromProps(\n props: ContextActionsProps\n ): ContextActionsState {\n if (props.actions == null || !Array.isArray(props.actions)) {\n return { globalActions: [], keyboardActions: [] };\n }\n const globalActions = props.actions.filter(\n action =>\n !isPromise(action) && typeof action !== 'function' && action.isGlobal\n ) as ContextAction[];\n const keyboardActions = props.actions.filter(\n action =>\n !isPromise(action) &&\n typeof action !== 'function' &&\n action.isGlobal !== undefined &&\n !action.isGlobal &&\n action.shortcut != null\n ) as ContextAction[];\n\n return { globalActions, keyboardActions };\n }\n\n componentDidMount(): void {\n if (this.container.current?.parentElement) {\n this.container.current.parentElement.addEventListener(\n 'contextmenu',\n this.handleContextMenu\n );\n this.container.current.parentElement.addEventListener(\n 'keydown',\n this.handleKeyDown\n );\n }\n }\n\n componentWillUnmount(): void {\n if (this.container.current?.parentElement) {\n this.container.current.parentElement.removeEventListener(\n 'contextmenu',\n this.handleContextMenu\n );\n this.container.current.parentElement.removeEventListener(\n 'keydown',\n this.handleKeyDown\n );\n }\n }\n\n container: React.RefObject<HTMLDivElement>;\n\n handleContextMenu(e: MouseEvent): void {\n const { ignoreClassNames = [] } = this.props;\n if (ignoreClassNames.length > 0) {\n let el = e.target as Element | null;\n while (el != null) {\n const { classList } = el;\n const ignoredClassName = ignoreClassNames.find(className =>\n classList.contains(className)\n );\n if (ignoredClassName !== undefined) {\n log.debug2(\n `Contextmenu event ignored based on the target className \"${ignoredClassName}\"`\n );\n return;\n }\n el = el.parentElement;\n }\n }\n if (!ContextActionUtils.isContextActionEvent(e)) {\n (e as ContextActionEvent).contextActions = [];\n }\n\n if (!ContextActionUtils.isContextActionEvent(e)) {\n return;\n }\n\n const { actions } = this.props;\n if (actions != null) {\n let contextActions = actions;\n if (Array.isArray(contextActions)) {\n contextActions = contextActions.filter(\n action =>\n isPromise(action) ||\n typeof action === 'function' ||\n action.isGlobal === undefined ||\n action.isGlobal\n );\n }\n\n e.contextActions = e.contextActions.concat(contextActions);\n }\n\n log.debug(\n 'Received context menu event! Menu items are now: ',\n e.contextActions\n );\n }\n\n handleKeyDown(e: KeyboardEvent): void {\n const { keyboardActions } = this.state;\n for (let i = 0; i < keyboardActions.length; i += 1) {\n const keyboardAction = keyboardActions[i];\n if (\n !ContextActionUtils.actionsDisabled &&\n keyboardAction.shortcut != null &&\n keyboardAction.shortcut.matchesEvent(e)\n ) {\n log.debug('Context hotkey matched!', e);\n\n keyboardAction.action?.(e);\n\n e.stopPropagation();\n e.preventDefault();\n\n log.debug2('Matched hotkey returned false, key event not consumed');\n }\n }\n }\n\n render(): JSX.Element {\n const { 'data-testid': dataTestId } = this.props;\n const { globalActions } = this.state;\n return (\n <div\n className=\"context-actions-listener\"\n ref={this.container}\n data-testid={dataTestId}\n >\n <GlobalContextActions actions={globalActions} />\n </div>\n );\n }\n}\n\nex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,MALM;EAOdC,IAAI,EAAE;AAPQ,C;;AAmLlB,eAAe/D,cAAf"}
1
+ {"version":3,"file":"ContextActions.js","names":["React","Component","Log","ContextActionUtils","isPromise","GlobalContextActions","log","module","ContextActions","triggerMenu","element","clientX","clientY","actions","length","mouseEvent","MouseEvent","bubbles","cancelable","contextActions","dispatchEvent","constructor","props","handleContextMenu","bind","handleKeyDown","container","createRef","state","globalActions","keyboardActions","getDerivedStateFromProps","Array","isArray","filter","action","isGlobal","undefined","shortcut","componentDidMount","current","parentElement","addEventListener","componentWillUnmount","removeEventListener","e","ignoreClassNames","el","target","classList","ignoredClassName","find","className","contains","debug2","isContextActionEvent","concat","debug","i","keyboardAction","actionsDisabled","matchesEvent","stopPropagation","preventDefault","render","dataTestId","default","high","medium","low","global","edit"],"sources":["../../src/context-actions/ContextActions.tsx"],"sourcesContent":["/**\n * Just a simple utility class for displaying a popup menu.\n */\nimport React, { Component } from 'react';\nimport Log from '@deephaven/log';\nimport ContextActionUtils, {\n ResolvableContextAction,\n isPromise,\n} from './ContextActionUtils';\nimport type { ContextAction, ContextActionEvent } from './ContextActionUtils';\nimport GlobalContextActions from './GlobalContextActions';\nimport './ContextActions.scss';\n\nconst log = Log.module('ContextActions');\n\ninterface ContextActionsProps {\n actions: ResolvableContextAction | ResolvableContextAction[];\n ignoreClassNames?: string[];\n 'data-testid'?: string;\n}\n\ninterface ContextActionsState {\n globalActions: ContextAction[];\n keyboardActions: ContextAction[];\n}\n\n/**\n * ContextActions that you add onto any component.\n *\n * Usage:\n * let actions = [{\n * title: 'My Action', // Omit the title to hide it from the context menu\n * action: () => { alert('My Action Clicked!') }\n * actions: [] // Submenu of actions\n * icon: faPrint, // Limited to FontAwesome icons for now.\n * iconColor: '#ff0000, // Color to use for the icon\n * shortcut: Shortcut, // Defaults to null\n * isGlobal: false, // Global context action. Defaults to false.\n * group: ContextActions.groups.default, // What group to group the context action with\n * order: null, // Int where to order within group\n * disabled: true // disable action\n * menuElement: null // Custom menu element for displaying in context menu. When null, creates a default menu item based on title\n * }];\n *\n * <div>\n * Right click in this container\n * <ContextActions actions={actions}/>\n * </div>\n *\n * Right clicking the container will then build the context menu, bubbling up until an element with a ContextMenuRoot is on it.\n * You should generally have a ContextMenuRoot on the root node of your document.\n */\nclass ContextActions extends Component<\n ContextActionsProps,\n ContextActionsState\n> {\n /**\n * Group you can assign to context menu actions to group them together.\n * Lower group IDs appear at the top of the list.\n * Groups are separated by a separator item.\n * Items within groups are ordered by their order property, then by their title.\n */\n static groups = {\n default: null,\n high: 100,\n medium: 5000,\n low: 10000,\n global: 100000,\n\n edit: 100,\n };\n\n static triggerMenu(\n element: Element,\n clientX: number,\n clientY: number,\n actions: ContextAction[]\n ): void {\n if (actions.length === 0) {\n return;\n }\n\n const mouseEvent: Partial<ContextActionEvent> = new MouseEvent(\n 'contextmenu',\n {\n clientX,\n clientY,\n bubbles: true,\n cancelable: true,\n }\n );\n mouseEvent.contextActions = actions;\n\n element.dispatchEvent(mouseEvent as ContextActionEvent);\n }\n\n constructor(props: ContextActionsProps) {\n super(props);\n\n this.handleContextMenu = this.handleContextMenu.bind(this);\n this.handleKeyDown = this.handleKeyDown.bind(this);\n\n this.container = React.createRef();\n\n this.state = { globalActions: [], keyboardActions: [] };\n }\n\n static getDerivedStateFromProps(\n props: ContextActionsProps\n ): ContextActionsState {\n if (props.actions == null || !Array.isArray(props.actions)) {\n return { globalActions: [], keyboardActions: [] };\n }\n const globalActions = props.actions.filter(\n action =>\n !isPromise(action) && typeof action !== 'function' && action.isGlobal\n ) as ContextAction[];\n const keyboardActions = props.actions.filter(\n action =>\n !isPromise(action) &&\n typeof action !== 'function' &&\n (action.isGlobal === undefined || !action.isGlobal) &&\n action.shortcut != null\n ) as ContextAction[];\n\n return { globalActions, keyboardActions };\n }\n\n componentDidMount(): void {\n if (this.container.current?.parentElement) {\n this.container.current.parentElement.addEventListener(\n 'contextmenu',\n this.handleContextMenu\n );\n this.container.current.parentElement.addEventListener(\n 'keydown',\n this.handleKeyDown\n );\n }\n }\n\n componentWillUnmount(): void {\n if (this.container.current?.parentElement) {\n this.container.current.parentElement.removeEventListener(\n 'contextmenu',\n this.handleContextMenu\n );\n this.container.current.parentElement.removeEventListener(\n 'keydown',\n this.handleKeyDown\n );\n }\n }\n\n container: React.RefObject<HTMLDivElement>;\n\n handleContextMenu(e: MouseEvent): void {\n const { ignoreClassNames = [] } = this.props;\n if (ignoreClassNames.length > 0) {\n let el = e.target as Element | null;\n while (el != null) {\n const { classList } = el;\n const ignoredClassName = ignoreClassNames.find(className =>\n classList.contains(className)\n );\n if (ignoredClassName !== undefined) {\n log.debug2(\n `Contextmenu event ignored based on the target className \"${ignoredClassName}\"`\n );\n return;\n }\n el = el.parentElement;\n }\n }\n if (!ContextActionUtils.isContextActionEvent(e)) {\n (e as ContextActionEvent).contextActions = [];\n }\n\n if (!ContextActionUtils.isContextActionEvent(e)) {\n return;\n }\n\n const { actions } = this.props;\n if (actions != null) {\n let contextActions = actions;\n if (Array.isArray(contextActions)) {\n contextActions = contextActions.filter(\n action =>\n isPromise(action) ||\n typeof action === 'function' ||\n action.isGlobal === undefined ||\n !action.isGlobal\n );\n }\n\n e.contextActions = e.contextActions.concat(contextActions);\n }\n\n log.debug(\n 'Received context menu event! Menu items are now: ',\n e.contextActions\n );\n }\n\n handleKeyDown(e: KeyboardEvent): void {\n const { keyboardActions } = this.state;\n for (let i = 0; i < keyboardActions.length; i += 1) {\n const keyboardAction = keyboardActions[i];\n if (\n !ContextActionUtils.actionsDisabled &&\n keyboardAction.shortcut != null &&\n keyboardAction.shortcut.matchesEvent(e)\n ) {\n log.debug('Context hotkey matched!', e);\n\n keyboardAction.action?.(e);\n\n e.stopPropagation();\n e.preventDefault();\n\n log.debug2('Matched hotkey returned false, key event not consumed');\n }\n }\n }\n\n render(): JSX.Element {\n const { 'data-testid': dataTestId } = this.props;\n const { globalActions } = this.state;\n return (\n <div\n className=\"context-actions-listener\"\n ref={this.container}\n data-testid={dataTestId}\n >\n <GlobalContextActions actions={globalActions} />\n </div>\n );\n }\n}\n\nexport default ContextActions;\n"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,KAAP,IAAgBC,SAAhB,QAAiC,OAAjC;AACA,OAAOC,GAAP,MAAgB,gBAAhB;OACOC,kB,IAELC,S;OAGKC,oB;;AAGP,IAAMC,GAAG,GAAGJ,GAAG,CAACK,MAAJ,CAAW,gBAAX,CAAZ;;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,cAAN,SAA6BP,SAA7B,CAGE;EACA;AACF;AACA;AACA;AACA;AACA;EAWoB,OAAXQ,WAAW,CAChBC,OADgB,EAEhBC,OAFgB,EAGhBC,OAHgB,EAIhBC,OAJgB,EAKV;IACN,IAAIA,OAAO,CAACC,MAAR,KAAmB,CAAvB,EAA0B;MACxB;IACD;;IAED,IAAMC,UAAuC,GAAG,IAAIC,UAAJ,CAC9C,aAD8C,EAE9C;MACEL,OADF;MAEEC,OAFF;MAGEK,OAAO,EAAE,IAHX;MAIEC,UAAU,EAAE;IAJd,CAF8C,CAAhD;IASAH,UAAU,CAACI,cAAX,GAA4BN,OAA5B;IAEAH,OAAO,CAACU,aAAR,CAAsBL,UAAtB;EACD;;EAEDM,WAAW,CAACC,KAAD,EAA6B;IACtC,MAAMA,KAAN;;IADsC;;IAGtC,KAAKC,iBAAL,GAAyB,KAAKA,iBAAL,CAAuBC,IAAvB,CAA4B,IAA5B,CAAzB;IACA,KAAKC,aAAL,GAAqB,KAAKA,aAAL,CAAmBD,IAAnB,CAAwB,IAAxB,CAArB;IAEA,KAAKE,SAAL,gBAAiB1B,KAAK,CAAC2B,SAAN,EAAjB;IAEA,KAAKC,KAAL,GAAa;MAAEC,aAAa,EAAE,EAAjB;MAAqBC,eAAe,EAAE;IAAtC,CAAb;EACD;;EAE8B,OAAxBC,wBA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E,IAHM;EAIdC,GAAG,EAAE,KAJS;EAKdC,MAAM,EAAE,MALM;EAOdC,IAAI,EAAE;AAPQ,C;;AAkLlB,eAAe/D,cAAf"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deephaven/components",
3
- "version": "0.19.2-beta.12+12ab02d",
3
+ "version": "0.19.2-beta.14+edf63de",
4
4
  "description": "Deephaven React component library",
5
5
  "author": "Deephaven Data Labs LLC",
6
6
  "license": "Apache-2.0",
@@ -31,10 +31,10 @@
31
31
  "start": "cross-env NODE_ENV=development npm run watch"
32
32
  },
33
33
  "dependencies": {
34
- "@deephaven/icons": "^0.19.2-beta.12+12ab02d",
35
- "@deephaven/log": "^0.19.2-beta.12+12ab02d",
36
- "@deephaven/react-hooks": "^0.19.2-beta.12+12ab02d",
37
- "@deephaven/utils": "^0.19.2-beta.12+12ab02d",
34
+ "@deephaven/icons": "^0.19.2-beta.14+edf63de",
35
+ "@deephaven/log": "^0.19.2-beta.14+edf63de",
36
+ "@deephaven/react-hooks": "^0.19.2-beta.14+edf63de",
37
+ "@deephaven/utils": "^0.19.2-beta.14+edf63de",
38
38
  "@fortawesome/fontawesome-svg-core": "^6.1.1",
39
39
  "@fortawesome/react-fontawesome": "^0.1.18",
40
40
  "bootstrap": "4.6.2",
@@ -57,8 +57,8 @@
57
57
  "react-dom": "^17.x"
58
58
  },
59
59
  "devDependencies": {
60
- "@deephaven/mocks": "^0.19.2-beta.12+12ab02d",
61
- "@deephaven/tsconfig": "^0.19.2-beta.12+12ab02d"
60
+ "@deephaven/mocks": "^0.19.2-beta.14+edf63de",
61
+ "@deephaven/tsconfig": "^0.19.2-beta.14+edf63de"
62
62
  },
63
63
  "files": [
64
64
  "dist",
@@ -70,5 +70,5 @@
70
70
  "publishConfig": {
71
71
  "access": "public"
72
72
  },
73
- "gitHead": "12ab02d7174c9dd99142551829d93ca7b18bc02d"
73
+ "gitHead": "edf63dee93e8926940765424f50a424bb759b421"
74
74
  }