@deephaven/components 0.42.1-beta.0 → 0.42.1-beta.1

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.
@@ -48,7 +48,7 @@ declare class ContextActions extends Component<ContextActionsProps, ContextActio
48
48
  * Items within groups are ordered by their order property, then by their title.
49
49
  */
50
50
  static groups: {
51
- default: null;
51
+ default: undefined;
52
52
  high: number;
53
53
  medium: number;
54
54
  low: number;
@@ -171,7 +171,7 @@ class ContextActions extends Component {
171
171
  }
172
172
  }
173
173
  _defineProperty(ContextActions, "groups", {
174
- default: null,
174
+ default: undefined,
175
175
  high: 100,
176
176
  medium: 5000,
177
177
  low: 10000,
@@ -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 || !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,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,OAAOC,GAAG,MAAM,gBAAgB;AAAC,OAC1BC,kBAAkB,IAEvBC,SAAS;AAAA,OAGJC,oBAAoB;AAAA;AAG3B,IAAMC,GAAG,GAAGJ,GAAG,CAACK,MAAM,CAAC,gBAAgB,CAAC;AAaxC;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,cAAc,SAASP,SAAS,CAGpC;EACA;AACF;AACA;AACA;AACA;AACA;;EAWE,OAAOQ,WAAW,CAChBC,OAAgB,EAChBC,OAAe,EACfC,OAAe,EACfC,OAAwB,EAClB;IACN,IAAIA,OAAO,CAACC,MAAM,KAAK,CAAC,EAAE;MACxB;IACF;IAEA,IAAMC,UAAuC,GAAG,IAAIC,UAAU,CAC5D,aAAa,EACb;MACEL,OAAO;MACPC,OAAO;MACPK,OAAO,EAAE,IAAI;MACbC,UAAU,EAAE;IACd,CAAC,CACF;IACDH,UAAU,CAACI,cAAc,GAAGN,OAAO;IAEnCH,OAAO,CAACU,aAAa,CAACL,UAAU,CA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iB,eAAe,EAAE;QACnBjB,CAAC,CAACkB,cAAc,EAAE;QAElBzD,GAAG,CAACgD,MAAM,CAAC,uDAAuD,CAAC;MACrE;IACF;EACF;EAEAU,MAAM,GAAgB;IACpB,IAAM;MAAE,aAAa,EAAEC;IAAW,CAAC,GAAG,IAAI,CAAC3C,KAAK;IAChD,IAAM;MAAEO;IAAc,CAAC,GAAG,IAAI,CAACD,KAAK;IACpC,oBACE;MACE,SAAS,EAAC,0BAA0B;MACpC,GAAG,EAAE,IAAI,CAACF,SAAU;MACpB,eAAauC;IAAW,gBAExB,oBAAC,oBAAoB;MAAC,OAAO,EAAEpC;IAAc,EAAG,CAC5C;EAEV;AACF;AAAC,gBA1LKrB,cAAc,YAUF;EACd0D,OAAO,EAAE,IAAI;EACbC,IAAI,EAAE,GAAG;EACTC,MAAM,EAAE,IAAI;EACZC,GAAG,EAAE,KAAK;EACVC,MAAM,EAAE,MAAM;EAEdC,IAAI,EAAE;AACR,CAAC;AA0KH,eAAe/D,cAAc"}
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: undefined,\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,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,OAAOC,GAAG,MAAM,gBAAgB;AAAC,OAC1BC,kBAAkB,IAEvBC,SAAS;AAAA,OAGJC,oBAAoB;AAAA;AAG3B,IAAMC,GAAG,GAAGJ,GAAG,CAACK,MAAM,CAAC,gBAAgB,CAAC;AAaxC;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,cAAc,SAASP,SAAS,CAGpC;EACA;AACF;AACA;AACA;AACA;AACA;;EAWE,OAAOQ,WAAW,CAChBC,OAAgB,EAChBC,OAAe,EACfC,OAAe,EACfC,OAAwB,EAClB;IACN,IAAIA,OAAO,CAACC,MAAM,KAAK,CAAC,EAAE;MACxB;IACF;IAEA,IAAMC,UAAuC,GAAG,IAAIC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AChB,CAAC,CAAC,EACvC;QAAA;QACAvC,GAAG,CAACmD,KAAK,CAAC,yBAAyB,EAAEZ,CAAC,CAAC;QAEvC,yBAAAc,cAAc,CAACxB,MAAM,0DAArB,2BAAAwB,cAAc,EAAUd,CAAC,CAAC;QAE1BA,CAAC,CAACiB,eAAe,EAAE;QACnBjB,CAAC,CAACkB,cAAc,EAAE;QAElBzD,GAAG,CAACgD,MAAM,CAAC,uDAAuD,CAAC;MACrE;IACF;EACF;EAEAU,MAAM,GAAgB;IACpB,IAAM;MAAE,aAAa,EAAEC;IAAW,CAAC,GAAG,IAAI,CAAC3C,KAAK;IAChD,IAAM;MAAEO;IAAc,CAAC,GAAG,IAAI,CAACD,KAAK;IACpC,oBACE;MACE,SAAS,EAAC,0BAA0B;MACpC,GAAG,EAAE,IAAI,CAACF,SAAU;MACpB,eAAauC;IAAW,gBAExB,oBAAC,oBAAoB;MAAC,OAAO,EAAEpC;IAAc,EAAG,CAC5C;EAEV;AACF;AAAC,gBA1LKrB,cAAc,YAUF;EACd0D,OAAO,EAAE7B,SAAS;EAClB8B,IAAI,EAAE,GAAG;EACTC,MAAM,EAAE,IAAI;EACZC,GAAG,EAAE,KAAK;EACVC,MAAM,EAAE,MAAM;EAEdC,IAAI,EAAE;AACR,CAAC;AA0KH,eAAe/D,cAAc"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deephaven/components",
3
- "version": "0.42.1-beta.0+b66c0de4",
3
+ "version": "0.42.1-beta.1+7cb073f8",
4
4
  "description": "Deephaven React component library",
5
5
  "author": "Deephaven Data Labs LLC",
6
6
  "license": "Apache-2.0",
@@ -23,10 +23,10 @@
23
23
  "build:sass": "sass --embed-sources --load-path=../../node_modules ./src:./dist ./scss/BaseStyleSheet.scss:./css/BaseStyleSheet.css"
24
24
  },
25
25
  "dependencies": {
26
- "@deephaven/icons": "^0.42.1-beta.0+b66c0de4",
27
- "@deephaven/log": "^0.42.1-beta.0+b66c0de4",
28
- "@deephaven/react-hooks": "^0.42.1-beta.0+b66c0de4",
29
- "@deephaven/utils": "^0.42.1-beta.0+b66c0de4",
26
+ "@deephaven/icons": "^0.42.1-beta.1+7cb073f8",
27
+ "@deephaven/log": "^0.42.1-beta.1+7cb073f8",
28
+ "@deephaven/react-hooks": "^0.42.1-beta.1+7cb073f8",
29
+ "@deephaven/utils": "^0.42.1-beta.1+7cb073f8",
30
30
  "@fortawesome/fontawesome-svg-core": "^6.2.1",
31
31
  "@fortawesome/react-fontawesome": "^0.2.0",
32
32
  "@react-spectrum/theme-default": "^3.5.1",
@@ -50,7 +50,7 @@
50
50
  "react-dom": "^17.x"
51
51
  },
52
52
  "devDependencies": {
53
- "@deephaven/mocks": "^0.42.1-beta.0+b66c0de4"
53
+ "@deephaven/mocks": "^0.42.1-beta.1+7cb073f8"
54
54
  },
55
55
  "files": [
56
56
  "dist",
@@ -63,5 +63,5 @@
63
63
  "publishConfig": {
64
64
  "access": "public"
65
65
  },
66
- "gitHead": "b66c0de44a517c0c283163c23a0687ddb01e701c"
66
+ "gitHead": "7cb073f8897a0a03e2f86c65f94faccc46fded35"
67
67
  }