@hypericon/mico 0.5.0 → 0.5.2

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 (35) hide show
  1. package/dist/cjs/components/markdown-editor/MarkdownEditor.js +7 -17
  2. package/dist/cjs/components/menu/Menu.d.ts +2 -0
  3. package/dist/cjs/components/menu/menu-manager.d.ts +7 -0
  4. package/dist/cjs/components/menu/menu-manager.js +24 -2
  5. package/dist/cjs/components/menu/menu-settings.d.ts +1 -0
  6. package/dist/cjs/components/menu/menu-settings.js +1 -0
  7. package/dist/cjs/components/select/SelectOptionsPanel.d.ts +1 -0
  8. package/dist/cjs/components/table/Table.d.ts +2 -2
  9. package/dist/cjs/components/table/Table.js +2 -2
  10. package/dist/cjs/components/toast/toast.js +9 -19
  11. package/dist/cjs/components/tooltip/tooltip-function.js +3 -2
  12. package/dist/cjs/components/tree/Tree.d.ts +30 -30
  13. package/dist/cjs/components/tree/Tree.js +3 -3
  14. package/dist/cjs/components/tree/tree-utils.js +2 -1
  15. package/dist/cjs/utils/date-time.js +3 -2
  16. package/dist/cjs/utils/dom.js +3 -2
  17. package/dist/cjs/utils/events.js +2 -1
  18. package/dist/esm/components/markdown-editor/MarkdownEditor.js +7 -17
  19. package/dist/esm/components/menu/Menu.d.ts +2 -0
  20. package/dist/esm/components/menu/menu-manager.d.ts +7 -0
  21. package/dist/esm/components/menu/menu-manager.js +24 -2
  22. package/dist/esm/components/menu/menu-settings.d.ts +1 -0
  23. package/dist/esm/components/menu/menu-settings.js +1 -0
  24. package/dist/esm/components/select/SelectOptionsPanel.d.ts +1 -0
  25. package/dist/esm/components/table/Table.d.ts +2 -2
  26. package/dist/esm/components/table/Table.js +2 -2
  27. package/dist/esm/components/toast/toast.js +9 -19
  28. package/dist/esm/components/tooltip/tooltip-function.js +3 -2
  29. package/dist/esm/components/tree/Tree.d.ts +30 -30
  30. package/dist/esm/components/tree/Tree.js +3 -3
  31. package/dist/esm/components/tree/tree-utils.js +2 -1
  32. package/dist/esm/utils/date-time.js +3 -2
  33. package/dist/esm/utils/dom.js +3 -2
  34. package/dist/esm/utils/events.js +2 -1
  35. package/package.json +1 -1
@@ -15,23 +15,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
35
25
  Object.defineProperty(exports, "__esModule", { value: true });
36
26
  exports.MarkdownEditor = void 0;
37
27
  const mithril_1 = __importStar(require("mithril"));
@@ -4,6 +4,8 @@ export interface MenuOptions {
4
4
  noFlipH?: boolean;
5
5
  forceFlipV?: boolean;
6
6
  forceFlipH?: boolean;
7
+ /** Add the menu directly to the element which raised the event */
8
+ asChild?: boolean;
7
9
  }
8
10
  export declare const Menu: m.Component<{
9
11
  x: number | undefined;
@@ -2,6 +2,8 @@ import m from "mithril";
2
2
  import { MenuOptions } from "./Menu";
3
3
  export declare class MenuManager {
4
4
  private containerEl;
5
+ private directParentEl;
6
+ private directParentWrapperEl;
5
7
  private _menuVnode;
6
8
  menuVnode$: import("rxjs").Observable<m.Vnode<any, any> | undefined>;
7
9
  get menuVnode(): m.Vnode<any, any> | undefined;
@@ -18,5 +20,10 @@ export declare class MenuManager {
18
20
  */
19
21
  show(ev: MouseEvent | undefined, menuContents: m.ChildArrayOrPrimitive, options?: MenuOptions): Promise<void>;
20
22
  hide(): void;
23
+ /**
24
+ * Set the default behavior for whether menus are added as children of the element that raised the event.
25
+ * @param asChild
26
+ */
27
+ setDefaultAsChild(asChild: boolean): void;
21
28
  }
22
29
  export declare const menuMgr: MenuManager;
@@ -25,6 +25,7 @@ class MenuManager {
25
25
  constructor() {
26
26
  this._menuVnode = new rxjs_1.BehaviorSubject(undefined);
27
27
  this.menuVnode$ = this._menuVnode.asObservable();
28
+ // Set up the default container element for the menu
28
29
  this.containerEl = document.createElement("div");
29
30
  this.containerEl.classList.add("menu-container");
30
31
  document.body.append(this.containerEl);
@@ -49,6 +50,7 @@ class MenuManager {
49
50
  * @param menuContents
50
51
  */
51
52
  show(ev, menuContents, options) {
53
+ var _a;
52
54
  return __awaiter(this, void 0, void 0, function* () {
53
55
  ev === null || ev === void 0 ? void 0 : ev.stopPropagation();
54
56
  if (this.isOpen) {
@@ -65,15 +67,35 @@ class MenuManager {
65
67
  menuContents,
66
68
  ]);
67
69
  this._menuVnode.next(menuVnode);
68
- mithril_1.default.render(this.containerEl, menuVnode);
69
- // console.log("Added menu");
70
+ // m.render(this.containerEl, menuVnode);
71
+ const asChild = (_a = options === null || options === void 0 ? void 0 : options.asChild) !== null && _a !== void 0 ? _a : menu_settings_1.MENU_SETTINGS.AS_CHILD;
72
+ if (asChild && (ev === null || ev === void 0 ? void 0 : ev.target) && ev.target instanceof HTMLElement) {
73
+ this.directParentEl = ev.target;
74
+ this.directParentWrapperEl = document.createElement("div");
75
+ this.directParentEl.append(this.directParentWrapperEl);
76
+ mithril_1.default.render(this.directParentWrapperEl, menuVnode);
77
+ }
78
+ else {
79
+ mithril_1.default.render(this.containerEl, menuVnode);
80
+ }
70
81
  });
71
82
  }
72
83
  hide() {
84
+ var _a;
73
85
  this._menuVnode.next(undefined);
74
86
  mithril_1.default.render(this.containerEl, []);
87
+ (_a = this.directParentWrapperEl) === null || _a === void 0 ? void 0 : _a.remove();
88
+ this.directParentWrapperEl = undefined;
89
+ this.directParentEl = undefined;
75
90
  // console.log("Closed menu");
76
91
  }
92
+ /**
93
+ * Set the default behavior for whether menus are added as children of the element that raised the event.
94
+ * @param asChild
95
+ */
96
+ setDefaultAsChild(asChild) {
97
+ menu_settings_1.MENU_SETTINGS.AS_CHILD = asChild;
98
+ }
77
99
  }
78
100
  exports.MenuManager = MenuManager;
79
101
  exports.menuMgr = new MenuManager();
@@ -6,4 +6,5 @@ export declare const MENU_SETTINGS: {
6
6
  MENU_BUTTON_ICON_CLASS: string;
7
7
  MENU_BUTTON_HINT_CLASS: string;
8
8
  MENU_SEPARATOR_CLASS: string;
9
+ AS_CHILD: boolean;
9
10
  };
@@ -9,4 +9,5 @@ exports.MENU_SETTINGS = {
9
9
  MENU_BUTTON_ICON_CLASS: "",
10
10
  MENU_BUTTON_HINT_CLASS: "",
11
11
  MENU_SEPARATOR_CLASS: "",
12
+ AS_CHILD: false, // Default to not adding the menu as a child of the element that raised the event
12
13
  };
@@ -1,3 +1,4 @@
1
+ /// <reference types="node" />
1
2
  import m from "mithril";
2
3
  import { Subscription } from "rxjs";
3
4
  export declare const SelectOptionsPanel: m.Component<{}, {
@@ -59,10 +59,10 @@ export declare function typedTable<T>(): {
59
59
  col: TableColumnDefinitionFn<T>;
60
60
  oninit?(this: m._NoLifecycle<m.Component<TableAttrs<T>, TableState<T>> & TableState<T>>, vnode: m.Vnode<TableAttrs<T>, m._NoLifecycle<m.Component<TableAttrs<T>, TableState<T>> & TableState<T>>>): any;
61
61
  oncreate?(this: m._NoLifecycle<m.Component<TableAttrs<T>, TableState<T>> & TableState<T>>, vnode: m.VnodeDOM<TableAttrs<T>, m._NoLifecycle<m.Component<TableAttrs<T>, TableState<T>> & TableState<T>>>): any;
62
- onbeforeremove?(this: m._NoLifecycle<m.Component<TableAttrs<T>, TableState<T>> & TableState<T>>, vnode: m.VnodeDOM<TableAttrs<T>, m._NoLifecycle<m.Component<TableAttrs<T>, TableState<T>> & TableState<T>>>): Promise<any> | void;
62
+ onbeforeremove?(this: m._NoLifecycle<m.Component<TableAttrs<T>, TableState<T>> & TableState<T>>, vnode: m.VnodeDOM<TableAttrs<T>, m._NoLifecycle<m.Component<TableAttrs<T>, TableState<T>> & TableState<T>>>): void | Promise<any>;
63
63
  onremove?(this: m._NoLifecycle<m.Component<TableAttrs<T>, TableState<T>> & TableState<T>>, vnode: m.VnodeDOM<TableAttrs<T>, m._NoLifecycle<m.Component<TableAttrs<T>, TableState<T>> & TableState<T>>>): any;
64
64
  onbeforeupdate?(this: m._NoLifecycle<m.Component<TableAttrs<T>, TableState<T>> & TableState<T>>, vnode: m.Vnode<TableAttrs<T>, m._NoLifecycle<m.Component<TableAttrs<T>, TableState<T>> & TableState<T>>>, old: m.VnodeDOM<TableAttrs<T>, m._NoLifecycle<m.Component<TableAttrs<T>, TableState<T>> & TableState<T>>>): boolean | void;
65
65
  onupdate?(this: m._NoLifecycle<m.Component<TableAttrs<T>, TableState<T>> & TableState<T>>, vnode: m.VnodeDOM<TableAttrs<T>, m._NoLifecycle<m.Component<TableAttrs<T>, TableState<T>> & TableState<T>>>): any;
66
- view(this: m._NoLifecycle<m.Component<TableAttrs<T>, TableState<T>> & TableState<T>>, vnode: m.Vnode<TableAttrs<T>, m._NoLifecycle<m.Component<TableAttrs<T>, TableState<T>> & TableState<T>>>): m.Children | null | void;
66
+ view(this: m._NoLifecycle<m.Component<TableAttrs<T>, TableState<T>> & TableState<T>>, vnode: m.Vnode<TableAttrs<T>, m._NoLifecycle<m.Component<TableAttrs<T>, TableState<T>> & TableState<T>>>): void | m.Children;
67
67
  };
68
68
  export declare const Table: m.Component<TableAttrs<any>, TableState<any>>;
@@ -3,8 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.Table = void 0;
7
- exports.typedTable = typedTable;
6
+ exports.Table = exports.typedTable = void 0;
8
7
  const mithril_1 = __importDefault(require("mithril"));
9
8
  /**
10
9
  * Build a typed Table component which includes type checking for column definitions
@@ -28,6 +27,7 @@ function typedTable() {
28
27
  };
29
28
  return Object.assign(Object.assign({}, typedTable), { col });
30
29
  }
30
+ exports.typedTable = typedTable;
31
31
  exports.Table = {
32
32
  view({ attrs }) {
33
33
  var _a, _b, _c, _d;
@@ -15,29 +15,18 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
35
25
  var __importDefault = (this && this.__importDefault) || function (mod) {
36
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
37
27
  };
38
28
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.DefaultToastOptions = void 0;
40
- exports.toast = toast;
29
+ exports.toast = exports.DefaultToastOptions = void 0;
41
30
  const toastify_js_1 = __importStar(require("toastify-js"));
42
31
  const mithril_1 = __importDefault(require("mithril"));
43
32
  require("toastify-js/src/toastify.css");
@@ -69,3 +58,4 @@ function toast(message, options) {
69
58
  hide: () => toastify.hideToast(),
70
59
  };
71
60
  }
61
+ exports.toast = toast;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.tooltip = tooltip;
4
- exports.tooltipSpread = tooltipSpread;
3
+ exports.tooltipSpread = exports.tooltip = void 0;
5
4
  const tooltip_defaults_1 = require("./tooltip-defaults");
6
5
  /**
7
6
  * Display a tooltip using the given mouse event.
@@ -63,6 +62,7 @@ function tooltip(ev, tooltip, opts) {
63
62
  };
64
63
  target.addEventListener("mouseleave", clearFn);
65
64
  }
65
+ exports.tooltip = tooltip;
66
66
  /**
67
67
  * Return an object that can be spread into an element's attrs to add a tooltip using the mouseenter event
68
68
  *
@@ -85,6 +85,7 @@ function tooltipSpread(value, opts) {
85
85
  onmouseenter: (ev) => tooltip(ev, value, opts),
86
86
  };
87
87
  }
88
+ exports.tooltipSpread = tooltipSpread;
88
89
  /**
89
90
  * TODO: consider adding arrows to top/bottom/left/right positioned tooltips
90
91
  * e.g.: https://getbootstrap.com/docs/3.4/javascript/#tooltips
@@ -7,11 +7,11 @@ export declare const Tree: m.Component<{
7
7
  /** The root list of nodes to display in the tree (circular references will crash) */
8
8
  nodes: TreeNode<any>[];
9
9
  /** Enable drag and drop reordering */
10
- enableReordering?: boolean;
10
+ enableReordering?: boolean | undefined;
11
11
  /** Enable expanding/collapsing of nodes with children */
12
- enableToggling?: boolean;
12
+ enableToggling?: boolean | undefined;
13
13
  /** Enable debug logging of certain events */
14
- enableLogging?: boolean;
14
+ enableLogging?: boolean | undefined;
15
15
  /** Function called when a node with children is toggled */
16
16
  ontoggle?: ((toggle: {
17
17
  node: TreeNode<any>;
@@ -30,23 +30,23 @@ export declare const Tree: m.Component<{
30
30
  above: boolean;
31
31
  }) => void) | undefined;
32
32
  /** Optional message to display in defined but empty children lists */
33
- emptyChildrenMessage?: string;
33
+ emptyChildrenMessage?: string | undefined;
34
34
  /** Optionally override the default icon for a collapsed node */
35
- collapsedIcon?: m.Vnode<any, any>;
35
+ collapsedIcon?: m.Vnode<any, any> | undefined;
36
36
  /** Optionally override the default icon for an expanded node */
37
- expandedIcon?: m.Vnode<any, any>;
37
+ expandedIcon?: m.Vnode<any, any> | undefined;
38
38
  /** Optionally override the default toggle icon for a node that cannot toggle */
39
- noToggleIcon?: m.Vnode<any, any>;
39
+ noToggleIcon?: m.Vnode<any, any> | undefined;
40
40
  /** Optionally enable toggling of expansion nodes by clicking their labels */
41
- toggleExpansionWithLabel?: boolean;
41
+ toggleExpansionWithLabel?: boolean | undefined;
42
42
  /** Optionally override the default nesting width */
43
- nestingWidth?: string;
43
+ nestingWidth?: string | undefined;
44
44
  /** Optionally override the default toggle button width */
45
- toggleButtonWidth?: string;
45
+ toggleButtonWidth?: string | undefined;
46
46
  /** Optional CSS classes to apply to the root div */
47
- class?: string;
47
+ class?: string | undefined;
48
48
  /** Optional CSS styles to apply to the root div */
49
- style?: string;
49
+ style?: string | undefined;
50
50
  }, {
51
51
  isReordering: boolean;
52
52
  thisEl: Element;
@@ -62,46 +62,46 @@ export declare function createTree<TNodeData extends object = {}>(): m.Component
62
62
  /** The root list of nodes to display in the tree (circular references will crash) */
63
63
  nodes: TreeNode<TNodeData>[];
64
64
  /** Enable drag and drop reordering */
65
- enableReordering?: boolean;
65
+ enableReordering?: boolean | undefined;
66
66
  /** Enable expanding/collapsing of nodes with children */
67
- enableToggling?: boolean;
67
+ enableToggling?: boolean | undefined;
68
68
  /** Enable debug logging of certain events */
69
- enableLogging?: boolean;
69
+ enableLogging?: boolean | undefined;
70
70
  /** Function called when a node with children is toggled */
71
- ontoggle?: (toggle: {
71
+ ontoggle?: ((toggle: {
72
72
  node: TreeNode<TNodeData>;
73
73
  expanded: boolean;
74
74
  recursive: boolean;
75
- }) => void;
75
+ }) => void) | undefined;
76
76
  /** Function called when a node label is clicked */
77
- onclick?: (click: {
77
+ onclick?: ((click: {
78
78
  ev: MouseEvent;
79
79
  node: TreeNode<TNodeData>;
80
- }) => void;
80
+ }) => void) | undefined;
81
81
  /** Function called when a node has been dragged to a new position in the tree */
82
- onreorder?: (reorder: {
82
+ onreorder?: ((reorder: {
83
83
  moved: TNodeData;
84
84
  target: TNodeData;
85
85
  above: boolean;
86
- }) => void;
86
+ }) => void) | undefined;
87
87
  /** Optional message to display in defined but empty children lists */
88
- emptyChildrenMessage?: string;
88
+ emptyChildrenMessage?: string | undefined;
89
89
  /** Optionally override the default icon for a collapsed node */
90
- collapsedIcon?: m.Vnode<any, any>;
90
+ collapsedIcon?: m.Vnode<any, any> | undefined;
91
91
  /** Optionally override the default icon for an expanded node */
92
- expandedIcon?: m.Vnode<any, any>;
92
+ expandedIcon?: m.Vnode<any, any> | undefined;
93
93
  /** Optionally override the default toggle icon for a node that cannot toggle */
94
- noToggleIcon?: m.Vnode<any, any>;
94
+ noToggleIcon?: m.Vnode<any, any> | undefined;
95
95
  /** Optionally enable toggling of expansion nodes by clicking their labels */
96
- toggleExpansionWithLabel?: boolean;
96
+ toggleExpansionWithLabel?: boolean | undefined;
97
97
  /** Optionally override the default nesting width */
98
- nestingWidth?: string;
98
+ nestingWidth?: string | undefined;
99
99
  /** Optionally override the default toggle button width */
100
- toggleButtonWidth?: string;
100
+ toggleButtonWidth?: string | undefined;
101
101
  /** Optional CSS classes to apply to the root div */
102
- class?: string;
102
+ class?: string | undefined;
103
103
  /** Optional CSS styles to apply to the root div */
104
- style?: string;
104
+ style?: string | undefined;
105
105
  }, {
106
106
  isReordering: boolean;
107
107
  thisEl: Element;
@@ -3,8 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.Tree = void 0;
7
- exports.createTree = createTree;
6
+ exports.createTree = exports.Tree = void 0;
8
7
  const utils_1 = require("@hypericon/utils");
9
8
  const mithril_1 = __importDefault(require("mithril"));
10
9
  const icon_1 = require("../icon");
@@ -168,7 +167,7 @@ function createTree() {
168
167
  }, attrs.noToggleIcon || (0, mithril_1.default)(icon_1.Icon, { fas: "caret-right" })) : [],
169
168
  (0, mithril_1.default)(".mico-tree-label", {
170
169
  class: `${targettingDragClass}`,
171
- style: "position: relative; flex: 1 1 0%; overflow-x: hidden;", // width: calc(100% - 1.5rem);
170
+ style: "position: relative; flex: 1 1 0%; overflow-x: hidden;",
172
171
  draggable: enableReordering && (node.draggable !== false),
173
172
  onclick: (ev) => {
174
173
  var _a;
@@ -227,3 +226,4 @@ function createTree() {
227
226
  };
228
227
  return Tree;
229
228
  }
229
+ exports.createTree = createTree;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.allTreeDescendants = allTreeDescendants;
3
+ exports.allTreeDescendants = void 0;
4
4
  /**
5
5
  * Recursively find the list of all descendants of the given node.
6
6
  *
@@ -19,3 +19,4 @@ function allTreeDescendants(node) {
19
19
  }
20
20
  return descendants;
21
21
  }
22
+ exports.allTreeDescendants = allTreeDescendants;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.dateToHtml = dateToHtml;
4
- exports.dateToHtmlUTC = dateToHtmlUTC;
3
+ exports.dateToHtmlUTC = exports.dateToHtml = void 0;
5
4
  function dateToHtml(d) {
6
5
  if (d === undefined)
7
6
  return undefined;
@@ -13,6 +12,7 @@ function dateToHtml(d) {
13
12
  String(d.getDate()).padStart(2, "0"),
14
13
  ].join("-");
15
14
  }
15
+ exports.dateToHtml = dateToHtml;
16
16
  function dateToHtmlUTC(d) {
17
17
  if (d === undefined)
18
18
  return undefined;
@@ -24,3 +24,4 @@ function dateToHtmlUTC(d) {
24
24
  String(d.getUTCDate()).padStart(2, "0"),
25
25
  ].join("-");
26
26
  }
27
+ exports.dateToHtmlUTC = dateToHtmlUTC;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.coordsWithinElement = coordsWithinElement;
4
- exports.mouseWithinElement = mouseWithinElement;
3
+ exports.mouseWithinElement = exports.coordsWithinElement = void 0;
5
4
  /**
6
5
  *
7
6
  * @param x
@@ -16,6 +15,7 @@ function coordsWithinElement(x, y, element, strict = false) {
16
15
  ? (rect.left < x && x < rect.right && rect.top < y && y < rect.bottom)
17
16
  : (rect.left <= x && x <= rect.right && rect.top <= y && y <= rect.bottom);
18
17
  }
18
+ exports.coordsWithinElement = coordsWithinElement;
19
19
  /**
20
20
  * Find whether a mouse event is within a given DOM element using clientX/Y and the bounding client rect
21
21
  * @param ev
@@ -30,3 +30,4 @@ function mouseWithinElement(ev, element) {
30
30
  (ev.clientX <= elementRect.right);
31
31
  return isWithin;
32
32
  }
33
+ exports.mouseWithinElement = mouseWithinElement;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.dragEventFiles = dragEventFiles;
3
+ exports.dragEventFiles = void 0;
4
4
  function dragEventFiles(ev) {
5
5
  var _a, _b, _c;
6
6
  const files = [];
@@ -26,3 +26,4 @@ function dragEventFiles(ev) {
26
26
  }
27
27
  return files;
28
28
  }
29
+ exports.dragEventFiles = dragEventFiles;
@@ -15,23 +15,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
35
25
  Object.defineProperty(exports, "__esModule", { value: true });
36
26
  exports.MarkdownEditor = void 0;
37
27
  const mithril_1 = __importStar(require("mithril"));
@@ -4,6 +4,8 @@ export interface MenuOptions {
4
4
  noFlipH?: boolean;
5
5
  forceFlipV?: boolean;
6
6
  forceFlipH?: boolean;
7
+ /** Add the menu directly to the element which raised the event */
8
+ asChild?: boolean;
7
9
  }
8
10
  export declare const Menu: m.Component<{
9
11
  x: number | undefined;
@@ -2,6 +2,8 @@ import m from "mithril";
2
2
  import { MenuOptions } from "./Menu";
3
3
  export declare class MenuManager {
4
4
  private containerEl;
5
+ private directParentEl;
6
+ private directParentWrapperEl;
5
7
  private _menuVnode;
6
8
  menuVnode$: import("rxjs").Observable<m.Vnode<any, any> | undefined>;
7
9
  get menuVnode(): m.Vnode<any, any> | undefined;
@@ -18,5 +20,10 @@ export declare class MenuManager {
18
20
  */
19
21
  show(ev: MouseEvent | undefined, menuContents: m.ChildArrayOrPrimitive, options?: MenuOptions): Promise<void>;
20
22
  hide(): void;
23
+ /**
24
+ * Set the default behavior for whether menus are added as children of the element that raised the event.
25
+ * @param asChild
26
+ */
27
+ setDefaultAsChild(asChild: boolean): void;
21
28
  }
22
29
  export declare const menuMgr: MenuManager;
@@ -25,6 +25,7 @@ class MenuManager {
25
25
  constructor() {
26
26
  this._menuVnode = new rxjs_1.BehaviorSubject(undefined);
27
27
  this.menuVnode$ = this._menuVnode.asObservable();
28
+ // Set up the default container element for the menu
28
29
  this.containerEl = document.createElement("div");
29
30
  this.containerEl.classList.add("menu-container");
30
31
  document.body.append(this.containerEl);
@@ -49,6 +50,7 @@ class MenuManager {
49
50
  * @param menuContents
50
51
  */
51
52
  show(ev, menuContents, options) {
53
+ var _a;
52
54
  return __awaiter(this, void 0, void 0, function* () {
53
55
  ev === null || ev === void 0 ? void 0 : ev.stopPropagation();
54
56
  if (this.isOpen) {
@@ -65,15 +67,35 @@ class MenuManager {
65
67
  menuContents,
66
68
  ]);
67
69
  this._menuVnode.next(menuVnode);
68
- mithril_1.default.render(this.containerEl, menuVnode);
69
- // console.log("Added menu");
70
+ // m.render(this.containerEl, menuVnode);
71
+ const asChild = (_a = options === null || options === void 0 ? void 0 : options.asChild) !== null && _a !== void 0 ? _a : menu_settings_1.MENU_SETTINGS.AS_CHILD;
72
+ if (asChild && (ev === null || ev === void 0 ? void 0 : ev.target) && ev.target instanceof HTMLElement) {
73
+ this.directParentEl = ev.target;
74
+ this.directParentWrapperEl = document.createElement("div");
75
+ this.directParentEl.append(this.directParentWrapperEl);
76
+ mithril_1.default.render(this.directParentWrapperEl, menuVnode);
77
+ }
78
+ else {
79
+ mithril_1.default.render(this.containerEl, menuVnode);
80
+ }
70
81
  });
71
82
  }
72
83
  hide() {
84
+ var _a;
73
85
  this._menuVnode.next(undefined);
74
86
  mithril_1.default.render(this.containerEl, []);
87
+ (_a = this.directParentWrapperEl) === null || _a === void 0 ? void 0 : _a.remove();
88
+ this.directParentWrapperEl = undefined;
89
+ this.directParentEl = undefined;
75
90
  // console.log("Closed menu");
76
91
  }
92
+ /**
93
+ * Set the default behavior for whether menus are added as children of the element that raised the event.
94
+ * @param asChild
95
+ */
96
+ setDefaultAsChild(asChild) {
97
+ menu_settings_1.MENU_SETTINGS.AS_CHILD = asChild;
98
+ }
77
99
  }
78
100
  exports.MenuManager = MenuManager;
79
101
  exports.menuMgr = new MenuManager();
@@ -6,4 +6,5 @@ export declare const MENU_SETTINGS: {
6
6
  MENU_BUTTON_ICON_CLASS: string;
7
7
  MENU_BUTTON_HINT_CLASS: string;
8
8
  MENU_SEPARATOR_CLASS: string;
9
+ AS_CHILD: boolean;
9
10
  };
@@ -9,4 +9,5 @@ exports.MENU_SETTINGS = {
9
9
  MENU_BUTTON_ICON_CLASS: "",
10
10
  MENU_BUTTON_HINT_CLASS: "",
11
11
  MENU_SEPARATOR_CLASS: "",
12
+ AS_CHILD: false, // Default to not adding the menu as a child of the element that raised the event
12
13
  };
@@ -1,3 +1,4 @@
1
+ /// <reference types="node" />
1
2
  import m from "mithril";
2
3
  import { Subscription } from "rxjs";
3
4
  export declare const SelectOptionsPanel: m.Component<{}, {
@@ -59,10 +59,10 @@ export declare function typedTable<T>(): {
59
59
  col: TableColumnDefinitionFn<T>;
60
60
  oninit?(this: m._NoLifecycle<m.Component<TableAttrs<T>, TableState<T>> & TableState<T>>, vnode: m.Vnode<TableAttrs<T>, m._NoLifecycle<m.Component<TableAttrs<T>, TableState<T>> & TableState<T>>>): any;
61
61
  oncreate?(this: m._NoLifecycle<m.Component<TableAttrs<T>, TableState<T>> & TableState<T>>, vnode: m.VnodeDOM<TableAttrs<T>, m._NoLifecycle<m.Component<TableAttrs<T>, TableState<T>> & TableState<T>>>): any;
62
- onbeforeremove?(this: m._NoLifecycle<m.Component<TableAttrs<T>, TableState<T>> & TableState<T>>, vnode: m.VnodeDOM<TableAttrs<T>, m._NoLifecycle<m.Component<TableAttrs<T>, TableState<T>> & TableState<T>>>): Promise<any> | void;
62
+ onbeforeremove?(this: m._NoLifecycle<m.Component<TableAttrs<T>, TableState<T>> & TableState<T>>, vnode: m.VnodeDOM<TableAttrs<T>, m._NoLifecycle<m.Component<TableAttrs<T>, TableState<T>> & TableState<T>>>): void | Promise<any>;
63
63
  onremove?(this: m._NoLifecycle<m.Component<TableAttrs<T>, TableState<T>> & TableState<T>>, vnode: m.VnodeDOM<TableAttrs<T>, m._NoLifecycle<m.Component<TableAttrs<T>, TableState<T>> & TableState<T>>>): any;
64
64
  onbeforeupdate?(this: m._NoLifecycle<m.Component<TableAttrs<T>, TableState<T>> & TableState<T>>, vnode: m.Vnode<TableAttrs<T>, m._NoLifecycle<m.Component<TableAttrs<T>, TableState<T>> & TableState<T>>>, old: m.VnodeDOM<TableAttrs<T>, m._NoLifecycle<m.Component<TableAttrs<T>, TableState<T>> & TableState<T>>>): boolean | void;
65
65
  onupdate?(this: m._NoLifecycle<m.Component<TableAttrs<T>, TableState<T>> & TableState<T>>, vnode: m.VnodeDOM<TableAttrs<T>, m._NoLifecycle<m.Component<TableAttrs<T>, TableState<T>> & TableState<T>>>): any;
66
- view(this: m._NoLifecycle<m.Component<TableAttrs<T>, TableState<T>> & TableState<T>>, vnode: m.Vnode<TableAttrs<T>, m._NoLifecycle<m.Component<TableAttrs<T>, TableState<T>> & TableState<T>>>): m.Children | null | void;
66
+ view(this: m._NoLifecycle<m.Component<TableAttrs<T>, TableState<T>> & TableState<T>>, vnode: m.Vnode<TableAttrs<T>, m._NoLifecycle<m.Component<TableAttrs<T>, TableState<T>> & TableState<T>>>): void | m.Children;
67
67
  };
68
68
  export declare const Table: m.Component<TableAttrs<any>, TableState<any>>;
@@ -3,8 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.Table = void 0;
7
- exports.typedTable = typedTable;
6
+ exports.Table = exports.typedTable = void 0;
8
7
  const mithril_1 = __importDefault(require("mithril"));
9
8
  /**
10
9
  * Build a typed Table component which includes type checking for column definitions
@@ -28,6 +27,7 @@ function typedTable() {
28
27
  };
29
28
  return Object.assign(Object.assign({}, typedTable), { col });
30
29
  }
30
+ exports.typedTable = typedTable;
31
31
  exports.Table = {
32
32
  view({ attrs }) {
33
33
  var _a, _b, _c, _d;
@@ -15,29 +15,18 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
35
25
  var __importDefault = (this && this.__importDefault) || function (mod) {
36
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
37
27
  };
38
28
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.DefaultToastOptions = void 0;
40
- exports.toast = toast;
29
+ exports.toast = exports.DefaultToastOptions = void 0;
41
30
  const toastify_js_1 = __importStar(require("toastify-js"));
42
31
  const mithril_1 = __importDefault(require("mithril"));
43
32
  require("toastify-js/src/toastify.css");
@@ -69,3 +58,4 @@ function toast(message, options) {
69
58
  hide: () => toastify.hideToast(),
70
59
  };
71
60
  }
61
+ exports.toast = toast;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.tooltip = tooltip;
4
- exports.tooltipSpread = tooltipSpread;
3
+ exports.tooltipSpread = exports.tooltip = void 0;
5
4
  const tooltip_defaults_1 = require("./tooltip-defaults");
6
5
  /**
7
6
  * Display a tooltip using the given mouse event.
@@ -63,6 +62,7 @@ function tooltip(ev, tooltip, opts) {
63
62
  };
64
63
  target.addEventListener("mouseleave", clearFn);
65
64
  }
65
+ exports.tooltip = tooltip;
66
66
  /**
67
67
  * Return an object that can be spread into an element's attrs to add a tooltip using the mouseenter event
68
68
  *
@@ -85,6 +85,7 @@ function tooltipSpread(value, opts) {
85
85
  onmouseenter: (ev) => tooltip(ev, value, opts),
86
86
  };
87
87
  }
88
+ exports.tooltipSpread = tooltipSpread;
88
89
  /**
89
90
  * TODO: consider adding arrows to top/bottom/left/right positioned tooltips
90
91
  * e.g.: https://getbootstrap.com/docs/3.4/javascript/#tooltips
@@ -7,11 +7,11 @@ export declare const Tree: m.Component<{
7
7
  /** The root list of nodes to display in the tree (circular references will crash) */
8
8
  nodes: TreeNode<any>[];
9
9
  /** Enable drag and drop reordering */
10
- enableReordering?: boolean;
10
+ enableReordering?: boolean | undefined;
11
11
  /** Enable expanding/collapsing of nodes with children */
12
- enableToggling?: boolean;
12
+ enableToggling?: boolean | undefined;
13
13
  /** Enable debug logging of certain events */
14
- enableLogging?: boolean;
14
+ enableLogging?: boolean | undefined;
15
15
  /** Function called when a node with children is toggled */
16
16
  ontoggle?: ((toggle: {
17
17
  node: TreeNode<any>;
@@ -30,23 +30,23 @@ export declare const Tree: m.Component<{
30
30
  above: boolean;
31
31
  }) => void) | undefined;
32
32
  /** Optional message to display in defined but empty children lists */
33
- emptyChildrenMessage?: string;
33
+ emptyChildrenMessage?: string | undefined;
34
34
  /** Optionally override the default icon for a collapsed node */
35
- collapsedIcon?: m.Vnode<any, any>;
35
+ collapsedIcon?: m.Vnode<any, any> | undefined;
36
36
  /** Optionally override the default icon for an expanded node */
37
- expandedIcon?: m.Vnode<any, any>;
37
+ expandedIcon?: m.Vnode<any, any> | undefined;
38
38
  /** Optionally override the default toggle icon for a node that cannot toggle */
39
- noToggleIcon?: m.Vnode<any, any>;
39
+ noToggleIcon?: m.Vnode<any, any> | undefined;
40
40
  /** Optionally enable toggling of expansion nodes by clicking their labels */
41
- toggleExpansionWithLabel?: boolean;
41
+ toggleExpansionWithLabel?: boolean | undefined;
42
42
  /** Optionally override the default nesting width */
43
- nestingWidth?: string;
43
+ nestingWidth?: string | undefined;
44
44
  /** Optionally override the default toggle button width */
45
- toggleButtonWidth?: string;
45
+ toggleButtonWidth?: string | undefined;
46
46
  /** Optional CSS classes to apply to the root div */
47
- class?: string;
47
+ class?: string | undefined;
48
48
  /** Optional CSS styles to apply to the root div */
49
- style?: string;
49
+ style?: string | undefined;
50
50
  }, {
51
51
  isReordering: boolean;
52
52
  thisEl: Element;
@@ -62,46 +62,46 @@ export declare function createTree<TNodeData extends object = {}>(): m.Component
62
62
  /** The root list of nodes to display in the tree (circular references will crash) */
63
63
  nodes: TreeNode<TNodeData>[];
64
64
  /** Enable drag and drop reordering */
65
- enableReordering?: boolean;
65
+ enableReordering?: boolean | undefined;
66
66
  /** Enable expanding/collapsing of nodes with children */
67
- enableToggling?: boolean;
67
+ enableToggling?: boolean | undefined;
68
68
  /** Enable debug logging of certain events */
69
- enableLogging?: boolean;
69
+ enableLogging?: boolean | undefined;
70
70
  /** Function called when a node with children is toggled */
71
- ontoggle?: (toggle: {
71
+ ontoggle?: ((toggle: {
72
72
  node: TreeNode<TNodeData>;
73
73
  expanded: boolean;
74
74
  recursive: boolean;
75
- }) => void;
75
+ }) => void) | undefined;
76
76
  /** Function called when a node label is clicked */
77
- onclick?: (click: {
77
+ onclick?: ((click: {
78
78
  ev: MouseEvent;
79
79
  node: TreeNode<TNodeData>;
80
- }) => void;
80
+ }) => void) | undefined;
81
81
  /** Function called when a node has been dragged to a new position in the tree */
82
- onreorder?: (reorder: {
82
+ onreorder?: ((reorder: {
83
83
  moved: TNodeData;
84
84
  target: TNodeData;
85
85
  above: boolean;
86
- }) => void;
86
+ }) => void) | undefined;
87
87
  /** Optional message to display in defined but empty children lists */
88
- emptyChildrenMessage?: string;
88
+ emptyChildrenMessage?: string | undefined;
89
89
  /** Optionally override the default icon for a collapsed node */
90
- collapsedIcon?: m.Vnode<any, any>;
90
+ collapsedIcon?: m.Vnode<any, any> | undefined;
91
91
  /** Optionally override the default icon for an expanded node */
92
- expandedIcon?: m.Vnode<any, any>;
92
+ expandedIcon?: m.Vnode<any, any> | undefined;
93
93
  /** Optionally override the default toggle icon for a node that cannot toggle */
94
- noToggleIcon?: m.Vnode<any, any>;
94
+ noToggleIcon?: m.Vnode<any, any> | undefined;
95
95
  /** Optionally enable toggling of expansion nodes by clicking their labels */
96
- toggleExpansionWithLabel?: boolean;
96
+ toggleExpansionWithLabel?: boolean | undefined;
97
97
  /** Optionally override the default nesting width */
98
- nestingWidth?: string;
98
+ nestingWidth?: string | undefined;
99
99
  /** Optionally override the default toggle button width */
100
- toggleButtonWidth?: string;
100
+ toggleButtonWidth?: string | undefined;
101
101
  /** Optional CSS classes to apply to the root div */
102
- class?: string;
102
+ class?: string | undefined;
103
103
  /** Optional CSS styles to apply to the root div */
104
- style?: string;
104
+ style?: string | undefined;
105
105
  }, {
106
106
  isReordering: boolean;
107
107
  thisEl: Element;
@@ -3,8 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.Tree = void 0;
7
- exports.createTree = createTree;
6
+ exports.createTree = exports.Tree = void 0;
8
7
  const utils_1 = require("@hypericon/utils");
9
8
  const mithril_1 = __importDefault(require("mithril"));
10
9
  const icon_1 = require("../icon");
@@ -168,7 +167,7 @@ function createTree() {
168
167
  }, attrs.noToggleIcon || (0, mithril_1.default)(icon_1.Icon, { fas: "caret-right" })) : [],
169
168
  (0, mithril_1.default)(".mico-tree-label", {
170
169
  class: `${targettingDragClass}`,
171
- style: "position: relative; flex: 1 1 0%; overflow-x: hidden;", // width: calc(100% - 1.5rem);
170
+ style: "position: relative; flex: 1 1 0%; overflow-x: hidden;",
172
171
  draggable: enableReordering && (node.draggable !== false),
173
172
  onclick: (ev) => {
174
173
  var _a;
@@ -227,3 +226,4 @@ function createTree() {
227
226
  };
228
227
  return Tree;
229
228
  }
229
+ exports.createTree = createTree;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.allTreeDescendants = allTreeDescendants;
3
+ exports.allTreeDescendants = void 0;
4
4
  /**
5
5
  * Recursively find the list of all descendants of the given node.
6
6
  *
@@ -19,3 +19,4 @@ function allTreeDescendants(node) {
19
19
  }
20
20
  return descendants;
21
21
  }
22
+ exports.allTreeDescendants = allTreeDescendants;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.dateToHtml = dateToHtml;
4
- exports.dateToHtmlUTC = dateToHtmlUTC;
3
+ exports.dateToHtmlUTC = exports.dateToHtml = void 0;
5
4
  function dateToHtml(d) {
6
5
  if (d === undefined)
7
6
  return undefined;
@@ -13,6 +12,7 @@ function dateToHtml(d) {
13
12
  String(d.getDate()).padStart(2, "0"),
14
13
  ].join("-");
15
14
  }
15
+ exports.dateToHtml = dateToHtml;
16
16
  function dateToHtmlUTC(d) {
17
17
  if (d === undefined)
18
18
  return undefined;
@@ -24,3 +24,4 @@ function dateToHtmlUTC(d) {
24
24
  String(d.getUTCDate()).padStart(2, "0"),
25
25
  ].join("-");
26
26
  }
27
+ exports.dateToHtmlUTC = dateToHtmlUTC;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.coordsWithinElement = coordsWithinElement;
4
- exports.mouseWithinElement = mouseWithinElement;
3
+ exports.mouseWithinElement = exports.coordsWithinElement = void 0;
5
4
  /**
6
5
  *
7
6
  * @param x
@@ -16,6 +15,7 @@ function coordsWithinElement(x, y, element, strict = false) {
16
15
  ? (rect.left < x && x < rect.right && rect.top < y && y < rect.bottom)
17
16
  : (rect.left <= x && x <= rect.right && rect.top <= y && y <= rect.bottom);
18
17
  }
18
+ exports.coordsWithinElement = coordsWithinElement;
19
19
  /**
20
20
  * Find whether a mouse event is within a given DOM element using clientX/Y and the bounding client rect
21
21
  * @param ev
@@ -30,3 +30,4 @@ function mouseWithinElement(ev, element) {
30
30
  (ev.clientX <= elementRect.right);
31
31
  return isWithin;
32
32
  }
33
+ exports.mouseWithinElement = mouseWithinElement;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.dragEventFiles = dragEventFiles;
3
+ exports.dragEventFiles = void 0;
4
4
  function dragEventFiles(ev) {
5
5
  var _a, _b, _c;
6
6
  const files = [];
@@ -26,3 +26,4 @@ function dragEventFiles(ev) {
26
26
  }
27
27
  return files;
28
28
  }
29
+ exports.dragEventFiles = dragEventFiles;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hypericon/mico",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "UI components and utilities with Mithril",
5
5
  "author": "Ed Johnson, Hypericon Ltd",
6
6
  "license": "MIT",