balkan-orgchart-js 9.2.42 → 9.2.44

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.
package/orgchart.mjs CHANGED
@@ -23,7 +23,7 @@ e.prototype.init = function(t, n) {
23
23
  if (t && !this._initCalled) {
24
24
  this._initCalled = !0, (typeof t == "string" || t instanceof String) && (t = document.querySelector(t)), this.element = t;
25
25
  var r = this;
26
- if (this.config = e.mergeDeep(e._defaultConfig(n), n), this._layoutConfigs = { base: {
26
+ if (e._reorderNodeBinding(n), this.config = e.mergeDeep(e._defaultConfig(n), n), this._layoutConfigs = { base: {
27
27
  orientation: this.config.orientation,
28
28
  levelSeparation: this.config.levelSeparation,
29
29
  mixedHierarchyNodesSeparation: this.config.mixedHierarchyNodesSeparation,
@@ -848,7 +848,7 @@ e.prototype.init = function(t, n) {
848
848
  n._menuClickHandler.apply(n, [this, e]);
849
849
  });
850
850
  }
851
- }, e === void 0 && (e = {}), e.VERSION = "9.2.42", e.orientation = {}, e.orientation.top = 0, e.orientation.bottom = 1, e.orientation.right = 2, e.orientation.left = 3, e.orientation.top_left = 4, e.orientation.bottom_left = 5, e.orientation.right_top = 6, e.orientation.left_top = 7, e.anchor = {
851
+ }, e === void 0 && (e = {}), e.VERSION = "9.2.44", e.orientation = {}, e.orientation.top = 0, e.orientation.bottom = 1, e.orientation.right = 2, e.orientation.left = 3, e.orientation.top_left = 4, e.orientation.bottom_left = 5, e.orientation.right_top = 6, e.orientation.left_top = 7, e.anchor = {
852
852
  top_right: "top_right",
853
853
  right_top: "right_top",
854
854
  bottom_right: "bottom_right",
@@ -861,7 +861,7 @@ e.prototype.init = function(t, n) {
861
861
  bottom: "bottom",
862
862
  left: "left",
863
863
  right: "right"
864
- }, e.align = {}, e.align.center = e.CENTER = 8, e.align.orientation = e.ORIENTATION = 9, e.attr = {}, e.attr.l = "data-l", e.attr.id = "data-id", e.attr.sl = "data-sl", e.attr.lbl = "data-lbl", e.attr.val = "data-val", e.attr.tlbr = "data-tlbr", e.attr.item = "data-item", e.attr.layout = "data-layout", e.attr.node_id = "data-n-id", e.attr.link_id = "data-l-id", e.attr.field_name = "data-f-name", e.attr.c_link_to = "data-c-l-to", e.attr.c_link_from = "data-c-l-from", e.attr.s_link_to = "data-s-l-to", e.attr.s_link_from = "data-s-l-from", e.attr.control_add = "data-ctrl-add", e.attr.control_expcoll_id = "data-ctrl-ec-id", e.attr.control_up_id = "data-ctrl-up-id", e.attr.control_export_menu = "data-ctrl-menu", e.attr.control_node_menu_id = "data-ctrl-n-menu-id", e.attr.control_node_circle_menu_id = "data-ctrl-n-c-menu-id", e.attr.control_node_circle_menu_name = "data-ctrl-n-c-menu-name", e.attr.control_node_circle_menu_wrraper_id = "data-ctrl-n-c-menu-wrapper-id", e.attr.width = "data-width", e.attr.text_overflow = "data-text-overflow", e.ID = "id", e.PID = "pid", e.STPID = "stpid", e.TAGS = "tags", e.NODES = "nodes", e.ELASTIC = "elastic", e.ASSISTANT = "Assistant", e.action = {}, e.action.expand = 0, e.action.collapse = 1, e.action.maximize = 101, e.action.minimize = 102, e.action.expandCollapse = 501, e.action.edit = 1, e.action.zoom = 2, e.action.ctrlZoom = 22, e.action.scroll = 41, e.action.xScroll = 3, e.action.yScroll = 4, e.action.none = 5, e.action.init = 6, e.action.update = 7, e.action.move = 70, e.action.pan = 8, e.action.centerNode = 9, e.action.resize = 10, e.action.insert = 11, e.action.insertfirst = 12, e.action.details = 13, e.action.exporting = 14, e.none = 400001, e.scroll = {}, e.scroll.visible = !0, e.scroll.smooth = 12, e.scroll.speed = 120, e.scroll.safari = {
864
+ }, e.align = {}, e.align.center = e.CENTER = 8, e.align.orientation = e.ORIENTATION = 9, e.attr = {}, e.attr.l = "data-l", e.attr.id = "data-id", e.attr.sl = "data-sl", e.attr.lbl = "data-lbl", e.attr.val = "data-val", e.attr.tlbr = "data-tlbr", e.attr.item = "data-item", e.attr.layout = "data-layout", e.attr.node_id = "data-n-id", e.attr.link_id = "data-l-id", e.attr.field_name = "data-f-name", e.attr.c_link_to = "data-c-l-to", e.attr.c_link_from = "data-c-l-from", e.attr.s_link_to = "data-s-l-to", e.attr.s_link_from = "data-s-l-from", e.attr.control_add = "data-ctrl-add", e.attr.control_expcoll_id = "data-ctrl-ec-id", e.attr.control_up_id = "data-ctrl-up-id", e.attr.control_export_menu = "data-ctrl-menu", e.attr.control_node_menu_id = "data-ctrl-n-menu-id", e.attr.control_node_btn = "data-ctrl-n-btn", e.attr.control_node_circle_menu_id = "data-ctrl-n-c-menu-id", e.attr.control_node_circle_menu_name = "data-ctrl-n-c-menu-name", e.attr.control_node_circle_menu_wrraper_id = "data-ctrl-n-c-menu-wrapper-id", e.attr.width = "data-width", e.attr.text_overflow = "data-text-overflow", e.ID = "id", e.PID = "pid", e.STPID = "stpid", e.TAGS = "tags", e.NODES = "nodes", e.ELASTIC = "elastic", e.ASSISTANT = "Assistant", e.action = {}, e.action.expand = 0, e.action.collapse = 1, e.action.maximize = 101, e.action.minimize = 102, e.action.expandCollapse = 501, e.action.edit = 1, e.action.zoom = 2, e.action.ctrlZoom = 22, e.action.scroll = 41, e.action.xScroll = 3, e.action.yScroll = 4, e.action.none = 5, e.action.init = 6, e.action.update = 7, e.action.move = 70, e.action.pan = 8, e.action.centerNode = 9, e.action.resize = 10, e.action.insert = 11, e.action.insertfirst = 12, e.action.details = 13, e.action.exporting = 14, e.none = 400001, e.scroll = {}, e.scroll.visible = !0, e.scroll.smooth = 12, e.scroll.speed = 120, e.scroll.safari = {
865
865
  smooth: 12,
866
866
  speed: 250
867
867
  }, e.match = {}, e.match.height = 100001, e.match.width = 100002, e.match.boundary = 100003, e.match.boundaryIfOutside = 100004, e.match.none = 1, e.movable = {}, e.movable.node = "node", e.movable.tree = "tree", e.movable.detachTree = "detachTree", e.layout = {}, e.layout.normal = e.normal = 0, e.layout.mixed = e.mixed = 1, e.layout.tree = e.tree = 2, e.layout.treeLeftOffset = e.treeLeftOffset = 3, e.layout.treeRightOffset = e.treeRightOffset = 4, e.layout.treeLeft = 5, e.layout.treeRight = 6, e.layout.grid = -1, e.layout.treeList = -2, e.nodeOpenTag = "<g " + e.attr.node_id + "=\"{id}\" style=\"opacity: {opacity}\" transform=\"matrix(1,0,0,1,{x},{y})\" class=\"{class}\" " + e.attr.sl + "=\"{sl}\" " + e.attr.l + "=\"{level}\" {lcn}>", e.linkOpenTag = "<g " + e.attr.link_id + "=\"[{id}][{child-id}]\" class=\"{class}\">", e.expcollOpenTag = "<g " + e.attr.control_expcoll_id + "=\"{id}\" transform=\"matrix(1,0,0,1,{x},{y})\" style=\"cursor:pointer;\">", e.upOpenTag = "<g " + e.attr.control_up_id + "=\"{id}\" transform=\"matrix(1,0,0,1,{x},{y})\" style=\"cursor:pointer;\">", e.linkFieldsOpenTag = "<g transform=\"matrix(1,0,0,1,{x},{y}) rotate({rotate})\">", e.grCloseTag = "</g>", e.A5 = {
@@ -2664,6 +2664,13 @@ e.prototype.init = function(t, n) {
2664
2664
  this._nodeMenuClickHandler(a.id, r, n);
2665
2665
  return;
2666
2666
  }
2667
+ if (r.hasAttribute(e.attr.control_node_btn)) {
2668
+ n.stopPropagation(), n.preventDefault();
2669
+ for (var o = r.getAttribute(e.attr.control_node_btn); !r.hasAttribute(e.attr.node_id);) r = r.parentNode;
2670
+ var i = r.getAttribute(e.attr.node_id);
2671
+ e._onClickHandler(this, o, void 0, i, void 0);
2672
+ return;
2673
+ }
2667
2674
  if (r.hasAttribute(e.attr.control_node_circle_menu_id)) {
2668
2675
  n.stopPropagation(), n.preventDefault();
2669
2676
  var i = r.getAttribute(e.attr.control_node_circle_menu_id);
@@ -2806,10 +2813,10 @@ e.prototype.init = function(t, n) {
2806
2813
  up: "touchend",
2807
2814
  touchstart: "touchstart"
2808
2815
  }), this._treeListUpdateInterval &&= (clearInterval(this._treeListUpdateInterval), null);
2809
- for (var i = null, a = n.target; a != t && !a.hasAttribute(e.attr.control_node_menu_id) && !a.hasAttribute(e.attr.control_node_circle_menu_id);) {
2816
+ for (var i = null, a = n.target; a != t && !a.hasAttribute(e.attr.control_node_menu_id) && !a.hasAttribute(e.attr.control_node_btn) && !a.hasAttribute(e.attr.control_node_circle_menu_id);) {
2810
2817
  if (a.hasAttribute) {
2811
2818
  var o = null;
2812
- a.hasAttribute(e.attr.node_id) ? o = this.getNode(a.getAttribute(e.attr.node_id)) : a.hasAttribute(e.attr.control_expcoll_id) ? o = this.getNode(a.getAttribute(e.attr.control_expcoll_id)) : (a.hasAttribute(e.attr.control_node_menu_id) || a.hasAttribute(e.attr.control_node_menu_id)) && (o = this.getNode(a.getAttribute(e.attr.control_node_menu_id))), i ||= e._getScrollableTreeListNodeInTouchEnabledDevice(o);
2819
+ a.hasAttribute(e.attr.node_id) ? o = this.getNode(a.getAttribute(e.attr.node_id)) : a.hasAttribute(e.attr.control_expcoll_id) ? o = this.getNode(a.getAttribute(e.attr.control_expcoll_id)) : a.hasAttribute(e.attr.control_node_menu_id) ? o = this.getNode(a.getAttribute(e.attr.control_node_menu_id)) : a.hasAttribute(e.attr.control_node_btn) && (o = this.getNode(a.getAttribute(e.attr.control_node_btn))), i ||= e._getScrollableTreeListNodeInTouchEnabledDevice(o);
2813
2820
  }
2814
2821
  if (a.hasAttribute(e.attr.node_id) && !i && (this.config.enableDragDrop || this.config.movable)) {
2815
2822
  if (n.touches == null || n.touches.length <= 1) {
@@ -3558,7 +3565,7 @@ e.prototype.init = function(t, n) {
3558
3565
  var r = this.getNode(t);
3559
3566
  return r && e._hover._addSelectedStyle(this, r, r.id, n), this;
3560
3567
  }, e._hover = {}, e._hover._addSelectedStyle = function(t, n, r, i) {
3561
- n.isSplit || i != "none" && ((i == "parents" || i == "childrenAndParents") && e._hover._addSelectedStyleParents(t, n, r), (i == "children" || i == "childrenAndParents") && e._hover._addSelectedStyleChildren(t, n, r), i == "sameLevel" && e._hover._addSelectedStyleSameLevel(t, n, r), e._hover._addSelectedStyleSelf(t, n, r, i));
3568
+ n.isSplit || ((i == "parents" || i == "childrenAndParents") && e._hover._addSelectedStyleParents(t, n, r), (i == "children" || i == "childrenAndParents") && e._hover._addSelectedStyleChildren(t, n, r), i == "sameLevel" && e._hover._addSelectedStyleSameLevel(t, n, r), e._hover._addSelectedStyleSelf(t, n, r, i));
3562
3569
  }, e._hover._addSelectedStyleSelf = function(e, t, n, r) {
3563
3570
  var i = e.getNodeElement(t.id);
3564
3571
  i && (!i.classList.contains("boc-hover") && r == "self" && i.classList.add("boc-hover"), i.classList.add("boc-hover-self"));
@@ -4606,6 +4613,52 @@ e.prototype.init = function(t, n) {
4606
4613
  ],
4607
4614
  editFormHeaderColor: "#039BE5",
4608
4615
  treeListMaxHeight: 500
4616
+ }, e.templates.emily = Object.assign({}, e.templates.ana), e.templates.emily.size = [200, 270], e.templates.emily.defs = "<style>.boc-hover .boc-emily-fill{fill: #039BE5;}\n.boc-hover .boc-hoverable{stroke: #039BE5 !important;}\n.boc-emily-link:hover text{ fill: #F57C00; }\n.boc-emily-link:hover path, .boc-emily-link:hover rect{ stroke: #F57C00; }\n.boc-emily-white{ transition: all 0.3s ease-in-out; }\n.boc-hover-self:hover .boc-emily-white {height: calc(var(--boc-emily-h) - 45px);}\n.boc-hover-self .boc-emily-nodemenu{ opacity: 1; }\n.boc-emily-photo{ transition: all 0.3s ease-in-out; }\n.boc-emily-btn:hover{cursor:pointer;}\n.boc-emily-btn:hover path{fill:#F57C00 !important;}\n.boc-hover-self .boc-emily-photo{ transform: matrix(0.4,0,0,0.4,0,30) }\n</style>", e.templates.emily.padding = [
4617
+ 80,
4618
+ 0,
4619
+ 90,
4620
+ 0
4621
+ ], e.templates.emily.node = function(t, n, r, i) {
4622
+ var a = `<rect class="boc-emily-white" x="0.5" y="30" height="${t.h - 80}" width="${t.w - 1}" fill="#fff" style="--boc-emily-h:${t.h - 80}px"></rect>`;
4623
+ return t.treeList && (a = `<rect x="0.5" y="30" height="${t.h - 125}" width="${t.w - 1}" fill="#fff"></rect>`), `<rect class="boc-emily-fill" x="0" y="0" height="${t.h}" width="${t.w}" fill="#039BE5" stroke ="#aeaeae" stroke-width="1" rx="10" ry="10"></rect>
4624
+ ${a}
4625
+ <g ${e.attr.control_node_btn}="pdf_profile" class="boc-emily-btn " transform="matrix(1,0,0,1,${t.w - 70},40)">${e.icon.pdf(24, 24, "#039BE5")}<rect x="0" y="0" width="30" height="30" fill="red" fill-opacity="0"></rect></g>
4626
+ <g ${e.attr.control_node_btn}="share_profile" class="boc-emily-btn" transform="matrix(1,0,0,1,${t.w - 35},40)">${e.icon.share(24, 24, "#039BE5")}<rect x="0" y="0" width="30" height="30" fill="red" fill-opacity="0"></rect></g>
4627
+ `;
4628
+ }, e.templates.emily.field_0 = e.templates.emily.name = e.templates.emily.name = function(t, n, r, i, a) {
4629
+ return e.wrapText(a, `<text style="font-size: 18px;" x="${t.w / 2}" y="${t.h - 20}" fill="#fff" text-anchor="middle"></text>`, t.w - 10, 1);
4630
+ }, e.templates.emily.field_1 = e.templates.emily.title = e.templates.emily.title = function(t, n, r, i, a) {
4631
+ return e.wrapText(a, `<text style="font-size: 14px;" x="${t.w / 2}" y="19" fill="#fff" text-anchor="middle"></text>`, t.w - 10, 1);
4632
+ }, e.templates.emily.email = function(t, n, r, i, a) {
4633
+ return n.email ? `<a class="boc-emily-link" href="mailto:${a}">
4634
+ <g transform="matrix(1,0,0,1,7,${t.h - 150})">
4635
+ <rect x="3" y="5" width="18" height="14" rx="2" fill="none" stroke-width="2" stroke="#039BE5"/>
4636
+ <path d="m3 7 9 6 9-6" fill="none" stroke-width="2" stroke="#039BE5" />
4637
+ ${e.wrapText(a, "<text x=\"30\" y=\"15\" fill=\"#039BE5\" font-size=\"13\"></text>", t.w - 40, 1)}
4638
+ <rect style="opacity:0" x="0" y="0" width="${t.w - 14}" height="20" fill="red" />
4639
+ </g>
4640
+ </a>` : "";
4641
+ }, e.templates.emily.address = function(e, t, n, r, i) {
4642
+ return t.address ? `<a class="boc-emily-link" target="_blank" href="https://www.google.com/maps/place/${i}/" >
4643
+ <g transform="matrix(1,0,0,1,7,${e.h - 127})">
4644
+ <path d="M1 6l7-3 8 3 7-3v15l-7 3-8-3-7 3zM8 3v18M16 6v18" fill="none" stroke-width="2" stroke="#039BE5" />
4645
+ <text x="30" y="15" fill="#039BE5" font-size="13">${i}</text>
4646
+ <rect style="opacity:0" x="0" y="0" width="${e.w - 14}" height="20" fill="red" />
4647
+ </g>
4648
+ </a>` : "";
4649
+ }, e.templates.emily.description = function(t, n, r, i, a) {
4650
+ return e.wrapText(a, `<text style="font-size: 14px;" x="${t.w / 2}" y="${t.h - 70}" fill="#fff" text-anchor="middle"></text>`, t.w - 20, 3);
4651
+ }, e.templates.emily.img_0 = function(e, t, n, r, i) {
4652
+ return i && !e.treeList ? `<g class="boc-emily-photo" transform="matrix(1,0,0,1,0,30)" ><image preserveAspectRatio="xMidYMid slice" xlink:href="${i}" x="0.5" y="0" width="${e.w - 1}" height="${e.h - 80}" ></image></g>` : "";
4653
+ }, e.templates.emily.nodeMenuButton = function(e, t, n, r) {
4654
+ return `
4655
+ <g style="cursor:pointer;" transform="matrix(1,0,0,1, ${e.w - 25}, 8)" data-ctrl-n-menu-id="${e.id}">
4656
+ <rect x="0" y="0" width="18" height="2.5" rx="1.25" fill="#fff" />
4657
+ <rect x="0" y="6" width="18" height="2.5" rx="1.25" fill="#fff" />
4658
+ <rect x="0" y="12" width="18" height="2.5" rx="1.25" fill="#fff" />
4659
+ <rect x="-5" y="-5" width="30" height="25" fill="transparent" />
4660
+ </g>
4661
+ `;
4609
4662
  }, e.templates.split = Object.assign({}, e.templates.ana), e.templates.split.size = [10, 10], e.templates.split.node = "<circle cx=\"5\" cy=\"5\" r=\"5\" fill=\"none\" stroke-width=\"1\" stroke=\"#aeaeae\"></circle>", e.templates.split.field_0 = "", e.templates.split.field_1 = "", e.templates.split.img_0 = "", e.templates.dot = Object.assign({}, e.templates.split), e.templates.group = Object.assign({}, e.templates.ana), e.templates.group.size = [250, 120], e.templates.group.padding = [
4610
4663
  50,
4611
4664
  20,
@@ -6462,7 +6515,7 @@ e.prototype.init = function(t, n) {
6462
6515
  }]
6463
6516
  };
6464
6517
  i != null && (l.expandChildren = !1, l.pages[0].nodeId = i), t.pngPreviewUI.show(l);
6465
- } else n === "csv_export" || n === "csv" ? t.exportToCSV({ nodeId: i }) : n === "xml_export" || n === "xml" ? t.exportToXML({ nodeId: i }) : n === "json_export" || n === "json" ? t.exportToJSON({ nodeId: i }) : n === "fit" ? t.fit() : n === "expand_all" ? t.expand(null, "all") : n === "full_screen" ? t.toggleFullScreen() : n === "zoom_in" ? t.zoom(!0, null, !0) : n === "zoom_out" || n === "zoom_out" ? t.zoom(!1, null, !0) : n === "layout_mixed" ? t.setLayout(e.layout.mixed) : n === "layout_normal" ? t.setLayout(e.layout.normal) : n === "layout_right_offset" ? t.setLayout(e.layout.treeRightOffset) : n === "layout_left_offset" ? t.setLayout(e.layout.treeLeftOffset) : n === "layout_tree" ? t.setLayout(e.layout.tree) : n === "layout_grid" && t.setLayout(e.layout.grid);
6518
+ } else n === "pdf_profile" || n === "csv" ? t.exportToPDFProfile(i) : n === "share_profile" || n === "csv" ? t.shareProfile(i) : n === "csv_export" || n === "csv" ? t.exportToCSV({ nodeId: i }) : n === "xml_export" || n === "xml" ? t.exportToXML({ nodeId: i }) : n === "json_export" || n === "json" ? t.exportToJSON({ nodeId: i }) : n === "fit" ? t.fit() : n === "expand_all" ? t.expand(null, "all") : n === "full_screen" ? t.toggleFullScreen() : n === "zoom_in" ? t.zoom(!0, null, !0) : n === "zoom_out" || n === "zoom_out" ? t.zoom(!1, null, !0) : n === "layout_mixed" ? t.setLayout(e.layout.mixed) : n === "layout_normal" ? t.setLayout(e.layout.normal) : n === "layout_right_offset" ? t.setLayout(e.layout.treeRightOffset) : n === "layout_left_offset" ? t.setLayout(e.layout.treeLeftOffset) : n === "layout_tree" ? t.setLayout(e.layout.tree) : n === "layout_grid" && t.setLayout(e.layout.grid);
6466
6519
  else o = r.call(t, i, a);
6467
6520
  return o;
6468
6521
  }, e._isSVG = function(e) {
@@ -6644,6 +6697,14 @@ e.prototype.init = function(t, n) {
6644
6697
  e.width = s, e.height = c, i.drawImage(a, 0, 0, s, c), r(e.toDataURL("image/png"));
6645
6698
  }, a.onerror = i, a.src = e;
6646
6699
  });
6700
+ }, e._reorderNodeBinding = function(e) {
6701
+ if (!e.nodeBinding) return;
6702
+ let t = {};
6703
+ Object.keys(e.nodeBinding).filter((e) => !e.startsWith("img")).forEach((n) => {
6704
+ t[n] = e.nodeBinding[n];
6705
+ }), Object.keys(e.nodeBinding).filter((e) => e.startsWith("img")).forEach((n) => {
6706
+ t[n] = e.nodeBinding[n];
6707
+ }), e.nodeBinding = t;
6647
6708
  }, e.xScrollUI = function(t, n, r, i, a) {
6648
6709
  this.element = t, this.requestParams = r, this.config = n, this.onSetViewBoxCallback = i, this.onDrawCallback = a, this.position = 0, this.bar = null, this._event_id = e._guid();
6649
6710
  }, e.xScrollUI.prototype.addListener = function(t) {
package/package.json CHANGED
@@ -58,5 +58,5 @@
58
58
  "url": "git+https://github.com/BALKANGraph/OrgChartJS.git"
59
59
  },
60
60
  "dependencies": {},
61
- "version": "9.2.42"
61
+ "version": "9.2.44"
62
62
  }