You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

helpers.js 1.0 KiB

3 years ago
12345678910111213141516171819202122232425262728293031
  1. export function callIfExists(func) {
  2. for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  3. args[_key - 1] = arguments[_key];
  4. }
  5. return typeof func === 'function' && func.apply(undefined, args);
  6. }
  7. export function hasOwnProp(obj, prop) {
  8. return Object.prototype.hasOwnProperty.call(obj, prop);
  9. }
  10. export function uniqueId() {
  11. return Math.random().toString(36).substring(7);
  12. }
  13. export var cssClasses = {
  14. menu: 'react-contextmenu',
  15. menuVisible: 'react-contextmenu--visible',
  16. menuWrapper: 'react-contextmenu-wrapper',
  17. menuItem: 'react-contextmenu-item',
  18. menuItemActive: 'react-contextmenu-item--active',
  19. menuItemDisabled: 'react-contextmenu-item--disabled',
  20. menuItemDivider: 'react-contextmenu-item--divider',
  21. menuItemSelected: 'react-contextmenu-item--selected',
  22. subMenu: 'react-contextmenu-submenu'
  23. };
  24. export var store = {};
  25. export var canUseDOM = Boolean(typeof window !== 'undefined' && window.document && window.document.createElement);