@hypericon/mico 0.4.1 → 0.5.0

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 (95) hide show
  1. package/dist/cjs/components/dialog/dialog-manager.js +1 -1
  2. package/dist/cjs/components/markdown-editor/MarkdownEditor.js +17 -7
  3. package/dist/cjs/components/select/SelectOptionsPanel.d.ts +0 -1
  4. package/dist/cjs/components/table/Table.d.ts +6 -2
  5. package/dist/cjs/components/table/Table.js +7 -3
  6. package/dist/cjs/components/toast/toast.js +19 -9
  7. package/dist/cjs/components/tooltip/tooltip-function.d.ts +1 -1
  8. package/dist/cjs/components/tooltip/tooltip-function.js +3 -4
  9. package/dist/cjs/components/tree/Tree.d.ts +30 -30
  10. package/dist/cjs/components/tree/Tree.js +3 -3
  11. package/dist/cjs/components/tree/tree-utils.js +1 -2
  12. package/dist/cjs/utils/date-time.js +2 -3
  13. package/dist/cjs/utils/dom.js +2 -3
  14. package/dist/cjs/utils/events.js +1 -2
  15. package/dist/esm/components/accordion/index.d.ts +1 -0
  16. package/dist/esm/components/accordion/index.js +1 -0
  17. package/dist/esm/components/data-grid/index.d.ts +1 -0
  18. package/dist/esm/components/data-grid/index.js +1 -0
  19. package/dist/esm/components/data-table/index.d.ts +1 -0
  20. package/dist/esm/components/data-table/index.js +1 -0
  21. package/dist/esm/components/dialog/Dialog.js +2 -1
  22. package/dist/esm/components/dialog/dialog-manager.js +21 -14
  23. package/dist/esm/components/dialog/index.js +17 -1
  24. package/dist/esm/components/drag-handler/DragHandler.js +9 -3
  25. package/dist/esm/components/drag-handler/index.js +17 -1
  26. package/dist/esm/components/drawer/index.d.ts +1 -0
  27. package/dist/esm/components/drawer/index.js +1 -0
  28. package/dist/esm/components/drop-target/DropTarget.js +15 -9
  29. package/dist/esm/components/drop-target/drop-target.state.js +14 -10
  30. package/dist/esm/components/drop-target/index.js +17 -1
  31. package/dist/esm/components/form/Form.js +4 -1
  32. package/dist/esm/components/form/index.js +17 -1
  33. package/dist/esm/components/icon/Icon.js +9 -3
  34. package/dist/esm/components/icon/icons.js +2 -1
  35. package/dist/esm/components/icon/index.js +18 -2
  36. package/dist/esm/components/index.js +28 -12
  37. package/dist/esm/components/markdown/Markdown.js +15 -9
  38. package/dist/esm/components/markdown/index.js +17 -1
  39. package/dist/esm/components/markdown-editor/MarkdownEditor.js +80 -44
  40. package/dist/esm/components/markdown-editor/index.js +17 -1
  41. package/dist/esm/components/markdown-editor/markdown-editor.state.js +11 -7
  42. package/dist/esm/components/menu/Menu.js +16 -10
  43. package/dist/esm/components/menu/MenuButton.js +31 -25
  44. package/dist/esm/components/menu/MenuSeparator.js +11 -5
  45. package/dist/esm/components/menu/index.js +22 -6
  46. package/dist/esm/components/menu/menu-constants.js +4 -1
  47. package/dist/esm/components/menu/menu-manager.js +18 -11
  48. package/dist/esm/components/menu/menu-settings.js +4 -1
  49. package/dist/esm/components/modal/index.d.ts +1 -0
  50. package/dist/esm/components/modal/index.js +1 -0
  51. package/dist/esm/components/pagination/Pagination.js +35 -29
  52. package/dist/esm/components/pagination/index.js +18 -2
  53. package/dist/esm/components/pagination/pagination-settings.js +4 -1
  54. package/dist/esm/components/panel-tree/PanelTree.js +27 -21
  55. package/dist/esm/components/panel-tree/index.d.ts +1 -0
  56. package/dist/esm/components/panel-tree/index.js +1 -0
  57. package/dist/esm/components/panel-tree/panel-tree-constants.js +5 -2
  58. package/dist/esm/components/panel-tree/panel-tree-store.js +13 -9
  59. package/dist/esm/components/panel-tree/panel-tree-utils.js +7 -3
  60. package/dist/esm/components/popover/index.d.ts +1 -0
  61. package/dist/esm/components/popover/index.js +1 -0
  62. package/dist/esm/components/reorderable-list/RedorderableList.js +17 -11
  63. package/dist/esm/components/reorderable-list/index.d.ts +1 -0
  64. package/dist/esm/components/reorderable-list/index.js +1 -0
  65. package/dist/esm/components/select/Select.js +18 -12
  66. package/dist/esm/components/select/SelectOptionsPanel.d.ts +0 -1
  67. package/dist/esm/components/select/SelectOptionsPanel.js +19 -13
  68. package/dist/esm/components/select/constants.js +5 -2
  69. package/dist/esm/components/select/index.js +18 -2
  70. package/dist/esm/components/select/select-options-manager.js +7 -3
  71. package/dist/esm/components/tab-panel/TabPanel.js +19 -13
  72. package/dist/esm/components/tab-panel/index.js +19 -3
  73. package/dist/esm/components/tab-panel/tab-panel-default-settings.js +4 -1
  74. package/dist/esm/components/tab-panel/tab-panel-settings.js +2 -1
  75. package/dist/esm/components/table/Table.d.ts +6 -2
  76. package/dist/esm/components/table/Table.js +24 -13
  77. package/dist/esm/components/table/index.js +17 -1
  78. package/dist/esm/components/toast/index.js +17 -1
  79. package/dist/esm/components/toast/toast.js +49 -9
  80. package/dist/esm/components/tooltip/index.js +19 -3
  81. package/dist/esm/components/tooltip/tooltip-defaults.js +4 -1
  82. package/dist/esm/components/tooltip/tooltip-function.d.ts +1 -1
  83. package/dist/esm/components/tooltip/tooltip-function.js +25 -21
  84. package/dist/esm/components/tooltip/tooltip-interfaces.js +2 -1
  85. package/dist/esm/components/tree/Tree.d.ts +30 -30
  86. package/dist/esm/components/tree/Tree.js +30 -23
  87. package/dist/esm/components/tree/index.js +19 -3
  88. package/dist/esm/components/tree/tree-node.interface.js +2 -1
  89. package/dist/esm/components/tree/tree-utils.js +4 -1
  90. package/dist/esm/index.js +18 -2
  91. package/dist/esm/utils/date-time.js +6 -2
  92. package/dist/esm/utils/dom.js +6 -2
  93. package/dist/esm/utils/events.js +4 -1
  94. package/dist/esm/utils/index.js +19 -3
  95. package/package.json +1 -1
@@ -1,55 +1,61 @@
1
- import m from "mithril";
2
- import { Icon } from "../icon";
3
- import { MENU_SETTINGS } from "./menu-settings";
4
- export const MenuButton = {
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.MenuButton = void 0;
7
+ const mithril_1 = __importDefault(require("mithril"));
8
+ const icon_1 = require("../icon");
9
+ const menu_settings_1 = require("./menu-settings");
10
+ exports.MenuButton = {
5
11
  view({ attrs }) {
6
12
  var _a, _b, _c, _d;
7
13
  return (attrs.href !== undefined) ? [
8
- m(m.route.Link, {
9
- class: `mico-menu-button ${(_a = attrs.class) !== null && _a !== void 0 ? _a : ""} ${MENU_SETTINGS.MENU_BUTTON_CLASS}`,
14
+ (0, mithril_1.default)(mithril_1.default.route.Link, {
15
+ class: `mico-menu-button ${(_a = attrs.class) !== null && _a !== void 0 ? _a : ""} ${menu_settings_1.MENU_SETTINGS.MENU_BUTTON_CLASS}`,
10
16
  style: `${(_b = attrs.style) !== null && _b !== void 0 ? _b : ""} width: 100%; height: 1.5rem; padding-right: 0.5rem; display: flex; align-items: center;`,
11
17
  href: attrs.href,
12
18
  disabled: attrs.disabled,
13
19
  onclick: (ev) => {
14
20
  var _a;
15
21
  (_a = attrs.onclick) === null || _a === void 0 ? void 0 : _a.call(attrs, ev);
16
- m.redraw();
22
+ mithril_1.default.redraw();
17
23
  },
18
24
  }, [
19
- m(ButtonIcon, { icon: attrs.icon }),
20
- m(ButtonLabel, { label: attrs.label }),
21
- m("", { style: "flex: 1 1 0%;" }),
22
- m(ButtonHint, { hint: attrs.hint }),
25
+ (0, mithril_1.default)(ButtonIcon, { icon: attrs.icon }),
26
+ (0, mithril_1.default)(ButtonLabel, { label: attrs.label }),
27
+ (0, mithril_1.default)("", { style: "flex: 1 1 0%;" }),
28
+ (0, mithril_1.default)(ButtonHint, { hint: attrs.hint }),
23
29
  ]),
24
30
  ] : [
25
- m("button", {
26
- class: `mico-menu-button ${(_c = attrs.class) !== null && _c !== void 0 ? _c : ""} ${MENU_SETTINGS.MENU_BUTTON_CLASS}`,
31
+ (0, mithril_1.default)("button", {
32
+ class: `mico-menu-button ${(_c = attrs.class) !== null && _c !== void 0 ? _c : ""} ${menu_settings_1.MENU_SETTINGS.MENU_BUTTON_CLASS}`,
27
33
  style: `${(_d = attrs.style) !== null && _d !== void 0 ? _d : ""} width: 100%; height: 1.5rem; padding-right: 0.5rem; display: flex; align-items: center;`,
28
34
  disabled: attrs.disabled,
29
35
  onclick: (ev) => {
30
36
  var _a;
31
37
  (_a = attrs.onclick) === null || _a === void 0 ? void 0 : _a.call(attrs, ev);
32
- m.redraw();
38
+ mithril_1.default.redraw();
33
39
  },
34
40
  }, [
35
- m(ButtonIcon, { icon: attrs.icon }),
36
- m(ButtonLabel, { label: attrs.label }),
37
- m("", { style: "flex: 1 1 0%;" }),
38
- m(ButtonHint, { hint: attrs.hint }),
41
+ (0, mithril_1.default)(ButtonIcon, { icon: attrs.icon }),
42
+ (0, mithril_1.default)(ButtonLabel, { label: attrs.label }),
43
+ (0, mithril_1.default)("", { style: "flex: 1 1 0%;" }),
44
+ (0, mithril_1.default)(ButtonHint, { hint: attrs.hint }),
39
45
  ]),
40
46
  ];
41
47
  }
42
48
  };
43
49
  const ButtonIcon = {
44
50
  view({ attrs }) {
45
- return m("", {
51
+ return (0, mithril_1.default)("", {
46
52
  // class: attrs.disabled ? "text-disabled" : "text-icon",
47
- class: `mico-menu-button-icon ${MENU_SETTINGS.MENU_BUTTON_ICON_CLASS}`,
53
+ class: `mico-menu-button-icon ${menu_settings_1.MENU_SETTINGS.MENU_BUTTON_ICON_CLASS}`,
48
54
  style: "width: 2rem; flex: none; display: flex; align-items: center; justify-content: space-around;",
49
55
  }, [
50
56
  attrs.icon ? [
51
57
  ("fas" in attrs.icon || "far" in attrs.icon || "fab" in attrs.icon)
52
- ? m(Icon, Object.assign({}, attrs.icon))
58
+ ? (0, mithril_1.default)(icon_1.Icon, Object.assign({}, attrs.icon))
53
59
  : attrs.icon,
54
60
  ] : [],
55
61
  ]);
@@ -57,8 +63,8 @@ const ButtonIcon = {
57
63
  };
58
64
  const ButtonLabel = {
59
65
  view({ attrs }) {
60
- return m("span", {
61
- class: `mico-menu-button-label ${MENU_SETTINGS.MENU_BUTTON_LABEL_CLASS}`,
66
+ return (0, mithril_1.default)("span", {
67
+ class: `mico-menu-button-label ${menu_settings_1.MENU_SETTINGS.MENU_BUTTON_LABEL_CLASS}`,
62
68
  style: "overflow: hidden; text-overflow: ellipsis; white-space: nowrap;",
63
69
  }, attrs.label);
64
70
  }
@@ -66,8 +72,8 @@ const ButtonLabel = {
66
72
  const ButtonHint = {
67
73
  view({ attrs }) {
68
74
  return attrs.hint
69
- ? m("span", {
70
- class: `mico-menu-button-hint ${MENU_SETTINGS.MENU_BUTTON_HINT_CLASS}`,
75
+ ? (0, mithril_1.default)("span", {
76
+ class: `mico-menu-button-hint ${menu_settings_1.MENU_SETTINGS.MENU_BUTTON_HINT_CLASS}`,
71
77
  style: "overflow: hidden; text-overflow: ellipsis; white-space: nowrap;",
72
78
  }, attrs.hint)
73
79
  : [];
@@ -1,10 +1,16 @@
1
- import m from "mithril";
2
- import { MENU_SETTINGS } from "./menu-settings";
3
- export const MenuSeparator = {
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.MenuSeparator = void 0;
7
+ const mithril_1 = __importDefault(require("mithril"));
8
+ const menu_settings_1 = require("./menu-settings");
9
+ exports.MenuSeparator = {
4
10
  view() {
5
11
  // return m(".my-2.ml-8.mr-2.border-b.border-slate-300");
6
- return m("", {
7
- class: `mico-menu-separator ${MENU_SETTINGS.MENU_SEPARATOR_CLASS}`,
12
+ return (0, mithril_1.default)("", {
13
+ class: `mico-menu-separator ${menu_settings_1.MENU_SETTINGS.MENU_SEPARATOR_CLASS}`,
8
14
  style: "margin: 0.25rem 0; border-bottom-width: 1px; border-bottom-style: solid;",
9
15
  });
10
16
  }
@@ -1,6 +1,22 @@
1
- export * from "./Menu";
2
- export * from "./MenuButton";
3
- export * from "./MenuSeparator";
4
- export * from "./menu-constants";
5
- export * from "./menu-manager";
6
- export * from "./menu-settings";
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./Menu"), exports);
18
+ __exportStar(require("./MenuButton"), exports);
19
+ __exportStar(require("./MenuSeparator"), exports);
20
+ __exportStar(require("./menu-constants"), exports);
21
+ __exportStar(require("./menu-manager"), exports);
22
+ __exportStar(require("./menu-settings"), exports);
@@ -1,4 +1,7 @@
1
- export const MENU_CONSTANTS = {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MENU_CONSTANTS = void 0;
4
+ exports.MENU_CONSTANTS = {
2
5
  MIN_WIDTH_PX: 200,
3
6
  MAX_WIDTH_PX: 500,
4
7
  };
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
3
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
4
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -7,17 +8,22 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
9
  });
9
10
  };
10
- import m from "mithril";
11
- import { BehaviorSubject } from "rxjs";
12
- import { Menu } from "./Menu";
13
- import { MENU_SETTINGS } from "./menu-settings";
14
- export class MenuManager {
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.menuMgr = exports.MenuManager = void 0;
16
+ const mithril_1 = __importDefault(require("mithril"));
17
+ const rxjs_1 = require("rxjs");
18
+ const Menu_1 = require("./Menu");
19
+ const menu_settings_1 = require("./menu-settings");
20
+ class MenuManager {
15
21
  get menuVnode() { return this._menuVnode.value; }
16
22
  get isOpen() {
17
23
  return Boolean(this.menuVnode);
18
24
  }
19
25
  constructor() {
20
- this._menuVnode = new BehaviorSubject(undefined);
26
+ this._menuVnode = new rxjs_1.BehaviorSubject(undefined);
21
27
  this.menuVnode$ = this._menuVnode.asObservable();
22
28
  this.containerEl = document.createElement("div");
23
29
  this.containerEl.classList.add("menu-container");
@@ -51,22 +57,23 @@ export class MenuManager {
51
57
  yield new Promise((resolve, reject) => {
52
58
  setTimeout(() => resolve(), 0);
53
59
  });
54
- const menuVnode = m(Menu, {
60
+ const menuVnode = (0, mithril_1.default)(Menu_1.Menu, {
55
61
  x: ev === null || ev === void 0 ? void 0 : ev.clientX,
56
- y: MENU_SETTINGS.ANCHOR === "page" ? ev === null || ev === void 0 ? void 0 : ev.pageY : ev === null || ev === void 0 ? void 0 : ev.clientY,
62
+ y: menu_settings_1.MENU_SETTINGS.ANCHOR === "page" ? ev === null || ev === void 0 ? void 0 : ev.pageY : ev === null || ev === void 0 ? void 0 : ev.clientY,
57
63
  options,
58
64
  }, [
59
65
  menuContents,
60
66
  ]);
61
67
  this._menuVnode.next(menuVnode);
62
- m.render(this.containerEl, menuVnode);
68
+ mithril_1.default.render(this.containerEl, menuVnode);
63
69
  // console.log("Added menu");
64
70
  });
65
71
  }
66
72
  hide() {
67
73
  this._menuVnode.next(undefined);
68
- m.render(this.containerEl, []);
74
+ mithril_1.default.render(this.containerEl, []);
69
75
  // console.log("Closed menu");
70
76
  }
71
77
  }
72
- export const menuMgr = new MenuManager();
78
+ exports.MenuManager = MenuManager;
79
+ exports.menuMgr = new MenuManager();
@@ -1,4 +1,7 @@
1
- export const MENU_SETTINGS = {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MENU_SETTINGS = void 0;
4
+ exports.MENU_SETTINGS = {
2
5
  ANCHOR: "page",
3
6
  MENU_CLASS: "",
4
7
  MENU_BUTTON_CLASS: "",
@@ -0,0 +1 @@
1
+ export {};
@@ -1 +1,2 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,66 +1,72 @@
1
- import m from "mithril";
2
- import { PAGINATION_DEFAULT_SETTINGS as SETTINGS } from "./pagination-settings";
3
- import { Icon } from "../icon";
4
- export const Pagination = {
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Pagination = void 0;
7
+ const mithril_1 = __importDefault(require("mithril"));
8
+ const pagination_settings_1 = require("./pagination-settings");
9
+ const icon_1 = require("../icon");
10
+ exports.Pagination = {
5
11
  view({ attrs }) {
6
12
  var _a, _b;
7
- const layout = (attrs.layout || SETTINGS.layout);
8
- return m(".mico-pagination", {
13
+ const layout = (attrs.layout || pagination_settings_1.PAGINATION_DEFAULT_SETTINGS.layout);
14
+ return (0, mithril_1.default)(".mico-pagination", {
9
15
  class: `${(_a = attrs.class) !== null && _a !== void 0 ? _a : ""}`,
10
16
  style: `${(_b = attrs.style) !== null && _b !== void 0 ? _b : ""} display: flex; align-items: center;`,
11
17
  }, [
12
- (layout === "middle" || layout === "right") ? m("", { style: "flex: 1;" }) : [],
18
+ (layout === "middle" || layout === "right") ? (0, mithril_1.default)("", { style: "flex: 1;" }) : [],
13
19
  (attrs.size) ? [
14
- m("span", `Page size:`),
15
- m("select.mico-pagination-select", {
20
+ (0, mithril_1.default)("span", `Page size:`),
21
+ (0, mithril_1.default)("select.mico-pagination-select", {
16
22
  value: attrs.size.size,
17
23
  oninput: (e) => attrs.size.onselect(Number(e.target.value)),
18
- }, (attrs.size.sizes || SETTINGS.pageSizes).map(s => m("option", s))),
24
+ }, (attrs.size.sizes || pagination_settings_1.PAGINATION_DEFAULT_SETTINGS.pageSizes).map(s => (0, mithril_1.default)("option", s))),
19
25
  ] : [],
20
26
  (attrs.xToYOfZ !== undefined) ? [
21
27
  (attrs.xToYOfZ === false) ? [] :
22
- (typeof attrs.xToYOfZ === "string") ? m("span.mico-pagination-xtoyofz", attrs.xToYOfZ) :
28
+ (typeof attrs.xToYOfZ === "string") ? (0, mithril_1.default)("span.mico-pagination-xtoyofz", attrs.xToYOfZ) :
23
29
  attrs.xToYOfZ,
24
30
  ] : [
25
- m("span.mico-pagination-xtoyofz", `${attrs.from}-${attrs.to} of ${attrs.of}`),
31
+ (0, mithril_1.default)("span.mico-pagination-xtoyofz", `${attrs.from}-${attrs.to} of ${attrs.of}`),
26
32
  ],
27
- (attrs.first !== undefined) ? m("button.mico-pagination-button", {
33
+ (attrs.first !== undefined) ? (0, mithril_1.default)("button.mico-pagination-button", {
28
34
  disabled: attrs.isAtStart,
29
35
  title: "First page",
30
36
  onclick: (ev) => { var _a; return (_a = attrs.first) === null || _a === void 0 ? void 0 : _a.call(attrs, ev); },
31
37
  }, [
32
- SETTINGS.iconComponents.first
33
- ? m(SETTINGS.iconComponents.first)
34
- : m(Icon, { fas: "angles-left" }),
38
+ pagination_settings_1.PAGINATION_DEFAULT_SETTINGS.iconComponents.first
39
+ ? (0, mithril_1.default)(pagination_settings_1.PAGINATION_DEFAULT_SETTINGS.iconComponents.first)
40
+ : (0, mithril_1.default)(icon_1.Icon, { fas: "angles-left" }),
35
41
  ]) : [],
36
- (attrs.prev !== undefined) ? m("button.mico-pagination-button", {
42
+ (attrs.prev !== undefined) ? (0, mithril_1.default)("button.mico-pagination-button", {
37
43
  disabled: attrs.isAtStart,
38
44
  title: "Previous page",
39
45
  onclick: (ev) => { var _a; return (_a = attrs.prev) === null || _a === void 0 ? void 0 : _a.call(attrs, ev); },
40
46
  }, [
41
- SETTINGS.iconComponents.prev
42
- ? m(SETTINGS.iconComponents.prev)
43
- : m(Icon, { fas: "angle-left" }),
47
+ pagination_settings_1.PAGINATION_DEFAULT_SETTINGS.iconComponents.prev
48
+ ? (0, mithril_1.default)(pagination_settings_1.PAGINATION_DEFAULT_SETTINGS.iconComponents.prev)
49
+ : (0, mithril_1.default)(icon_1.Icon, { fas: "angle-left" }),
44
50
  ]) : [],
45
- (attrs.next !== undefined) ? m("button.mico-pagination-button", {
51
+ (attrs.next !== undefined) ? (0, mithril_1.default)("button.mico-pagination-button", {
46
52
  disabled: attrs.isAtEnd,
47
53
  title: "Next page",
48
54
  onclick: (ev) => { var _a; return (_a = attrs.next) === null || _a === void 0 ? void 0 : _a.call(attrs, ev); },
49
55
  }, [
50
- SETTINGS.iconComponents.next
51
- ? m(SETTINGS.iconComponents.next)
52
- : m(Icon, { fas: "angle-right" }),
56
+ pagination_settings_1.PAGINATION_DEFAULT_SETTINGS.iconComponents.next
57
+ ? (0, mithril_1.default)(pagination_settings_1.PAGINATION_DEFAULT_SETTINGS.iconComponents.next)
58
+ : (0, mithril_1.default)(icon_1.Icon, { fas: "angle-right" }),
53
59
  ]) : [],
54
- (attrs.last !== undefined) ? m("button.mico-pagination-button", {
60
+ (attrs.last !== undefined) ? (0, mithril_1.default)("button.mico-pagination-button", {
55
61
  disabled: attrs.isAtEnd,
56
62
  title: "Last page",
57
63
  onclick: (ev) => { var _a; return (_a = attrs.last) === null || _a === void 0 ? void 0 : _a.call(attrs, ev); },
58
64
  }, [
59
- SETTINGS.iconComponents.last
60
- ? m(SETTINGS.iconComponents.last)
61
- : m(Icon, { fas: "angles-right" }),
65
+ pagination_settings_1.PAGINATION_DEFAULT_SETTINGS.iconComponents.last
66
+ ? (0, mithril_1.default)(pagination_settings_1.PAGINATION_DEFAULT_SETTINGS.iconComponents.last)
67
+ : (0, mithril_1.default)(icon_1.Icon, { fas: "angles-right" }),
62
68
  ]) : [],
63
- (layout === "middle" || layout === "left") ? m("", { style: "flex: 1;" }) : [],
69
+ (layout === "middle" || layout === "left") ? (0, mithril_1.default)("", { style: "flex: 1;" }) : [],
64
70
  ]);
65
71
  },
66
72
  };
@@ -1,2 +1,18 @@
1
- export * from "./Pagination";
2
- export * from "./pagination-settings";
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./Pagination"), exports);
18
+ __exportStar(require("./pagination-settings"), exports);
@@ -1,7 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PAGINATION_DEFAULT_SETTINGS = void 0;
1
4
  /**
2
5
  * Default common settings for pagination components
3
6
  */
4
- export const PAGINATION_DEFAULT_SETTINGS = {
7
+ exports.PAGINATION_DEFAULT_SETTINGS = {
5
8
  /** "left" | "middle" | "right" */
6
9
  layout: "right",
7
10
  pageSize: 25,
@@ -1,10 +1,16 @@
1
- import m from "mithril";
2
- import { PANEL_TREE_DEBUG, PANEL_TREE_PANEL_CLASS } from "./panel-tree-constants";
3
- import { PanelTreeStore } from "./panel-tree-store";
4
- import { PanelTreeUtils as PTUtils } from "./panel-tree-utils";
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.PanelTreeHandle = exports.PanelTreePanel = void 0;
7
+ const mithril_1 = __importDefault(require("mithril"));
8
+ const panel_tree_constants_1 = require("./panel-tree-constants");
9
+ const panel_tree_store_1 = require("./panel-tree-store");
10
+ const panel_tree_utils_1 = require("./panel-tree-utils");
5
11
  /** Data about the state of the ongoing drag operation */
6
- const PTStore = new PanelTreeStore();
7
- export const PanelTreePanel = {
12
+ const PTStore = new panel_tree_store_1.PanelTreeStore();
13
+ exports.PanelTreePanel = {
8
14
  oninit() {
9
15
  // this.isDragOver = false;
10
16
  },
@@ -45,7 +51,7 @@ export const PanelTreePanel = {
45
51
  ev.stopImmediatePropagation();
46
52
  ev.preventDefault();
47
53
  // PANEL_TREE_DEBUG ?? console.debug("is dragging over panel with parent " + parentType);
48
- const { dragEv, touchEv } = PTUtils.dragOrTouch(ev);
54
+ const { dragEv, touchEv } = panel_tree_utils_1.PanelTreeUtils.dragOrTouch(ev);
49
55
  PTStore.overEl = this.el;
50
56
  const isRecursive = (_a = PTStore.draggedPanel) === null || _a === void 0 ? void 0 : _a.contains(this.el);
51
57
  const isValidTarget = parentType !== undefined && PTStore.draggedData !== data && !isRecursive;
@@ -59,19 +65,19 @@ export const PanelTreePanel = {
59
65
  const overDiv = ev.currentTarget;
60
66
  const targetRect = overDiv.getBoundingClientRect();
61
67
  if (parentType === "row") {
62
- const leftToMouse = PTUtils.eventXPos(ev) - targetRect.left;
68
+ const leftToMouse = panel_tree_utils_1.PanelTreeUtils.eventXPos(ev) - targetRect.left;
63
69
  const isLeft = leftToMouse < (targetRect.width - leftToMouse);
64
70
  this.isOverStart = isLeft;
65
71
  }
66
72
  else {
67
- const topToMouse = PTUtils.eventYPos(ev) - targetRect.top;
73
+ const topToMouse = panel_tree_utils_1.PanelTreeUtils.eventYPos(ev) - targetRect.top;
68
74
  const isAbove = topToMouse < (targetRect.height - topToMouse);
69
75
  this.isOverStart = isAbove;
70
76
  }
71
- PANEL_TREE_DEBUG !== null && PANEL_TREE_DEBUG !== void 0 ? PANEL_TREE_DEBUG : console.debug(`dragging over valid target, ${this.isOverStart ? "over start" : "over end"}`);
77
+ panel_tree_constants_1.PANEL_TREE_DEBUG !== null && panel_tree_constants_1.PANEL_TREE_DEBUG !== void 0 ? panel_tree_constants_1.PANEL_TREE_DEBUG : console.debug(`dragging over valid target, ${this.isOverStart ? "over start" : "over end"}`);
72
78
  }
73
79
  else {
74
- PANEL_TREE_DEBUG !== null && PANEL_TREE_DEBUG !== void 0 ? PANEL_TREE_DEBUG : console.debug(`dragging over invalid target`);
80
+ panel_tree_constants_1.PANEL_TREE_DEBUG !== null && panel_tree_constants_1.PANEL_TREE_DEBUG !== void 0 ? panel_tree_constants_1.PANEL_TREE_DEBUG : console.debug(`dragging over invalid target`);
75
81
  }
76
82
  };
77
83
  const onDrop = (ev) => {
@@ -84,12 +90,12 @@ export const PanelTreePanel = {
84
90
  PTStore.dropTargetPanel = this.el;
85
91
  const isRecursive = (_a = PTStore.draggedPanel) === null || _a === void 0 ? void 0 : _a.contains(this.el);
86
92
  const movedData = PTStore.draggedData;
87
- PANEL_TREE_DEBUG !== null && PANEL_TREE_DEBUG !== void 0 ? PANEL_TREE_DEBUG : console.debug(`drag dropped, dataTransfer data: ${JSON.stringify(movedData)}`);
93
+ panel_tree_constants_1.PANEL_TREE_DEBUG !== null && panel_tree_constants_1.PANEL_TREE_DEBUG !== void 0 ? panel_tree_constants_1.PANEL_TREE_DEBUG : console.debug(`drag dropped, dataTransfer data: ${JSON.stringify(movedData)}`);
88
94
  if (movedData && movedData !== data && !isRecursive) {
89
95
  setTimeout(() => {
90
- PANEL_TREE_DEBUG !== null && PANEL_TREE_DEBUG !== void 0 ? PANEL_TREE_DEBUG : console.debug(`Instruct tree to insert subtree: ${JSON.stringify(movedData)}`);
96
+ panel_tree_constants_1.PANEL_TREE_DEBUG !== null && panel_tree_constants_1.PANEL_TREE_DEBUG !== void 0 ? panel_tree_constants_1.PANEL_TREE_DEBUG : console.debug(`Instruct tree to insert subtree: ${JSON.stringify(movedData)}`);
91
97
  attrs.insert(movedData, this.isOverStart);
92
- m.redraw();
98
+ mithril_1.default.redraw();
93
99
  }, 1);
94
100
  }
95
101
  PTStore.isDragging = false;
@@ -97,11 +103,11 @@ export const PanelTreePanel = {
97
103
  const onEnd = (ev) => {
98
104
  // ev.stopImmediatePropagation();
99
105
  // this.isDragOver = false;
100
- PANEL_TREE_DEBUG !== null && PANEL_TREE_DEBUG !== void 0 ? PANEL_TREE_DEBUG : console.debug("drag ended");
106
+ panel_tree_constants_1.PANEL_TREE_DEBUG !== null && panel_tree_constants_1.PANEL_TREE_DEBUG !== void 0 ? panel_tree_constants_1.PANEL_TREE_DEBUG : console.debug("drag ended");
101
107
  // No op?
102
108
  PTStore.isDragging = false;
103
109
  };
104
- return m(`.${PANEL_TREE_PANEL_CLASS}.flex-1.rounded.shadow-md`, {
110
+ return (0, mithril_1.default)(`.${panel_tree_constants_1.PANEL_TREE_PANEL_CLASS}.flex-1.rounded.shadow-md`, {
105
111
  // TODO
106
112
  // class: `${attrs.class ?? ""} ${mobileMode.isMob ? "p-1" : "p-2"} ${dragBorder}`,
107
113
  class: `${(_b = attrs.class) !== null && _b !== void 0 ? _b : ""} p-1 ${dragBorder}`,
@@ -135,14 +141,14 @@ export const PanelTreePanel = {
135
141
  }, children);
136
142
  },
137
143
  };
138
- export const PanelTreeHandle = {
144
+ exports.PanelTreeHandle = {
139
145
  oninit() { },
140
146
  oncreate({ dom }) {
141
147
  this.el = dom;
142
148
  },
143
149
  view({ attrs }) {
144
150
  const { data } = attrs;
145
- return m(".px-2.py-1.flex.items-center.cursor-move", {
151
+ return (0, mithril_1.default)(".px-2.py-1.flex.items-center.cursor-move", {
146
152
  // TODO
147
153
  // ...tooltipSpread("Reposition this element", { delay: 1_000 }),
148
154
  draggable: true,
@@ -155,12 +161,12 @@ export const PanelTreeHandle = {
155
161
  // Disable scrolling if there is an ongoing drag
156
162
  ev.stopImmediatePropagation();
157
163
  ev.preventDefault();
158
- PTUtils.dispatchTouchEventToHoveredPanel(ev);
164
+ panel_tree_utils_1.PanelTreeUtils.dispatchTouchEventToHoveredPanel(ev);
159
165
  }
160
166
  },
161
167
  ontouchend: (ev) => {
162
168
  // Re-dispatch the event first to set the drop target data
163
- PTUtils.dispatchTouchEventToLastHoveredPanel(ev);
169
+ panel_tree_utils_1.PanelTreeUtils.dispatchTouchEventToLastHoveredPanel(ev);
164
170
  // Next, handle the end of the drag and possibly call the function to remove the panel
165
171
  PTStore.onEndDraggingHandle(ev, data, () => { var _a; return (_a = attrs.remove) === null || _a === void 0 ? void 0 : _a.call(attrs); });
166
172
  },
@@ -168,7 +174,7 @@ export const PanelTreeHandle = {
168
174
  PTStore.isDragging = false;
169
175
  },
170
176
  }, [
171
- m("i.fas.fa-grip-vertical.text-icon"),
177
+ (0, mithril_1.default)("i.fas.fa-grip-vertical.text-icon"),
172
178
  ]);
173
179
  },
174
180
  };
@@ -0,0 +1 @@
1
+ export {};
@@ -1 +1,2 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PANEL_TREE_DEBUG = exports.PANEL_TREE_PANEL_CLASS = void 0;
1
4
  /** The CSS class applied all panel tree panels */
2
- export const PANEL_TREE_PANEL_CLASS = "panel-tree-panel";
3
- export const PANEL_TREE_DEBUG = false;
5
+ exports.PANEL_TREE_PANEL_CLASS = "panel-tree-panel";
6
+ exports.PANEL_TREE_DEBUG = false;
@@ -1,6 +1,9 @@
1
- import { PANEL_TREE_DEBUG } from "./panel-tree-constants";
2
- import { PanelTreeUtils as PTUtils } from "./panel-tree-utils";
3
- export class PanelTreeStore {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PanelTreeStore = void 0;
4
+ const panel_tree_constants_1 = require("./panel-tree-constants");
5
+ const panel_tree_utils_1 = require("./panel-tree-utils");
6
+ class PanelTreeStore {
4
7
  /** Whether the current drop operation is recursive */
5
8
  get isRecursive() {
6
9
  return (this.draggedPanel !== undefined) &&
@@ -28,14 +31,14 @@ export class PanelTreeStore {
28
31
  var _a;
29
32
  ev.stopImmediatePropagation();
30
33
  // ev.preventDefault();
31
- const { dragEv, touchEv } = PTUtils.dragOrTouch(ev);
32
- const parentPanel = PTUtils.findParentPanel(ev.currentTarget);
34
+ const { dragEv, touchEv } = panel_tree_utils_1.PanelTreeUtils.dragOrTouch(ev);
35
+ const parentPanel = panel_tree_utils_1.PanelTreeUtils.findParentPanel(ev.currentTarget);
33
36
  // logger.debug(``)
34
37
  if (parentPanel) {
35
38
  this.isDragging = true;
36
39
  this.draggedData = data;
37
40
  this.draggedPanel = parentPanel;
38
- PANEL_TREE_DEBUG !== null && PANEL_TREE_DEBUG !== void 0 ? PANEL_TREE_DEBUG : console.debug(`Begin dragging, handle data: ${JSON.stringify(data)}`);
41
+ panel_tree_constants_1.PANEL_TREE_DEBUG !== null && panel_tree_constants_1.PANEL_TREE_DEBUG !== void 0 ? panel_tree_constants_1.PANEL_TREE_DEBUG : console.debug(`Begin dragging, handle data: ${JSON.stringify(data)}`);
39
42
  const parentRect = parentPanel.getBoundingClientRect();
40
43
  if (dragEv) {
41
44
  (_a = dragEv.dataTransfer) === null || _a === void 0 ? void 0 : _a.setDragImage(parentPanel, dragEv.clientX - parentRect.left, dragEv.clientY - parentRect.top);
@@ -45,15 +48,16 @@ export class PanelTreeStore {
45
48
  /** The user has stopped dragging a handle of a panel */
46
49
  onEndDraggingHandle(ev, data, remove) {
47
50
  ev.stopImmediatePropagation();
48
- const { dragEv, touchEv } = PTUtils.dragOrTouch(ev);
51
+ const { dragEv, touchEv } = panel_tree_utils_1.PanelTreeUtils.dragOrTouch(ev);
49
52
  const isRecursive = this.isRecursive; // STORE.dropTargetPanel && STORE.draggedPanel?.contains(STORE.dropTargetPanel);
50
- PANEL_TREE_DEBUG !== null && PANEL_TREE_DEBUG !== void 0 ? PANEL_TREE_DEBUG : console.debug(`End dragging, dropEffect: ${this.dropEffect}, handle data: ${JSON.stringify(data)}`);
53
+ panel_tree_constants_1.PANEL_TREE_DEBUG !== null && panel_tree_constants_1.PANEL_TREE_DEBUG !== void 0 ? panel_tree_constants_1.PANEL_TREE_DEBUG : console.debug(`End dragging, dropEffect: ${this.dropEffect}, handle data: ${JSON.stringify(data)}`);
51
54
  if (this.dropEffect === "move") {
52
55
  if (this.dropTargetData !== data && !isRecursive) {
53
- PANEL_TREE_DEBUG !== null && PANEL_TREE_DEBUG !== void 0 ? PANEL_TREE_DEBUG : console.debug(`Instruct tree to remove subtree: ${JSON.stringify(data)}`);
56
+ panel_tree_constants_1.PANEL_TREE_DEBUG !== null && panel_tree_constants_1.PANEL_TREE_DEBUG !== void 0 ? panel_tree_constants_1.PANEL_TREE_DEBUG : console.debug(`Instruct tree to remove subtree: ${JSON.stringify(data)}`);
54
57
  remove === null || remove === void 0 ? void 0 : remove();
55
58
  }
56
59
  }
57
60
  this.isDragging = false;
58
61
  }
59
62
  }
63
+ exports.PanelTreeStore = PanelTreeStore;
@@ -1,14 +1,17 @@
1
- import { PANEL_TREE_PANEL_CLASS } from "./panel-tree-constants";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PanelTreeUtils = void 0;
4
+ const panel_tree_constants_1 = require("./panel-tree-constants");
2
5
  /**
3
6
  * Stateless utility functions used by the PanelTree component
4
7
  */
5
- export class PanelTreeUtils {
8
+ class PanelTreeUtils {
6
9
  /** Find the first parent element of the given element that contains the CSS class for panel tree panels */
7
10
  static findParentPanel(handleEl) {
8
11
  const parent = handleEl.parentElement;
9
12
  if (!parent)
10
13
  return;
11
- if (parent.classList.contains(PANEL_TREE_PANEL_CLASS))
14
+ if (parent.classList.contains(panel_tree_constants_1.PANEL_TREE_PANEL_CLASS))
12
15
  return parent;
13
16
  return this.findParentPanel(parent);
14
17
  }
@@ -53,3 +56,4 @@ export class PanelTreeUtils {
53
56
  }
54
57
  }
55
58
  }
59
+ exports.PanelTreeUtils = PanelTreeUtils;
@@ -0,0 +1 @@
1
+ export {};
@@ -1 +1,2 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });