@sme.up/ketchup 6.1.0-SNAPSHOT → 6.3.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.
- package/dist/cjs/{f-button-ac179257.js → f-button-94cb5f35.js} +4 -4
- package/dist/cjs/f-cell-76830a0d.js +416 -0
- package/dist/cjs/f-checkbox-cd977193.js +29 -0
- package/dist/cjs/{f-chip-b00897d7.js → f-chip-68d45fd3.js} +3 -3
- package/dist/cjs/{f-image-89f25556.js → f-image-0e71df7e.js} +2 -2
- package/dist/cjs/{f-paginator-utils-8fa501b3.js → f-paginator-utils-46689c0a.js} +80 -403
- package/dist/cjs/{f-text-field-e1e45ade.js → f-text-field-b4229cef.js} +11 -3
- package/dist/cjs/{index-eb556444.js → index-31125378.js} +15 -8
- package/dist/cjs/ketchup.cjs.js +3 -3
- package/dist/cjs/kup-accordion.cjs.entry.js +5 -6
- package/dist/cjs/kup-autocomplete_25.cjs.entry.js +331 -299
- package/dist/cjs/kup-box.cjs.entry.js +1304 -0
- package/dist/cjs/kup-calendar.cjs.entry.js +9 -11
- package/dist/cjs/kup-cell.cjs.entry.js +10 -11
- package/dist/cjs/kup-dash-list.cjs.entry.js +5 -7
- package/dist/cjs/kup-dash_2.cjs.entry.js +5 -9
- package/dist/cjs/kup-dashboard.cjs.entry.js +438 -0
- package/dist/cjs/kup-drawer.cjs.entry.js +5 -6
- package/dist/cjs/{kup-box_2.cjs.entry.js → kup-echart.cjs.entry.js} +66 -1353
- package/dist/cjs/kup-family-tree.cjs.entry.js +486 -0
- package/dist/cjs/kup-form.cjs.entry.js +478 -0
- package/dist/cjs/kup-iframe.cjs.entry.js +4 -5
- package/dist/cjs/kup-image-list.cjs.entry.js +73 -13
- package/dist/cjs/kup-lazy.cjs.entry.js +5 -6
- package/dist/cjs/kup-magic-box.cjs.entry.js +5 -6
- package/dist/cjs/{kup-manager-7a941909.js → kup-manager-7c514a30.js} +1787 -356
- package/dist/cjs/kup-nav-bar.cjs.entry.js +4 -5
- package/dist/cjs/kup-numeric-picker.cjs.entry.js +3 -3
- package/dist/cjs/kup-photo-frame.cjs.entry.js +6 -7
- package/dist/cjs/kup-probe.cjs.entry.js +2 -2
- package/dist/cjs/kup-qlik.cjs.entry.js +2 -2
- package/dist/cjs/kup-snackbar.cjs.entry.js +6 -7
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/collection/assets/dashboard.js +161 -0
- package/dist/collection/assets/data-table.js +59 -0
- package/dist/collection/assets/family-tree.js +2654 -0
- package/dist/collection/assets/form.js +433 -0
- package/dist/collection/assets/grid.js +17 -0
- package/dist/collection/assets/index.js +18 -6
- package/dist/collection/assets/kupinteract.js +68 -0
- package/dist/collection/collection-manifest.json +8 -7
- package/dist/collection/components/kup-autocomplete/kup-autocomplete.js +135 -129
- package/dist/collection/components/kup-box/kup-box.js +13 -2
- package/dist/collection/components/kup-button/kup-button.js +1 -0
- package/dist/collection/components/kup-combobox/kup-combobox.js +16 -13
- package/dist/collection/components/kup-dashboard/kup-dashboard-declarations.js +10 -0
- package/dist/collection/components/{kup-form-editor/kup-form-editor.css → kup-dashboard/kup-dashboard.css} +14 -6
- package/dist/collection/components/{kup-form-editor/kup-form-editor.js → kup-dashboard/kup-dashboard.js} +211 -152
- package/dist/collection/components/kup-data-table/kup-data-table-helper.js +42 -30
- package/dist/collection/components/kup-data-table/kup-data-table-state.js +1 -1
- package/dist/collection/components/kup-data-table/kup-data-table.js +7 -6
- package/dist/collection/components/kup-drawer/kup-drawer.css +5 -8
- package/dist/collection/components/kup-dropdown-button/kup-dropdown-button.js +1 -0
- package/dist/collection/components/kup-echart/kup-echart.js +9 -9
- package/dist/collection/components/kup-family-tree/kup-family-tree-declarations.js +14 -0
- package/dist/collection/components/kup-family-tree/kup-family-tree.css +171 -0
- package/dist/collection/components/kup-family-tree/kup-family-tree.js +854 -0
- package/dist/collection/components/kup-form/kup-form-declarations.js +25 -0
- package/dist/collection/components/kup-form/kup-form.css +99 -0
- package/dist/collection/components/kup-form/kup-form.js +647 -0
- package/dist/collection/components/kup-grid/kup-grid.js +1 -4
- package/dist/collection/components/kup-image-list/kup-image-list-state.js +9 -0
- package/dist/collection/components/kup-image-list/kup-image-list.css +0 -6
- package/dist/collection/components/kup-image-list/kup-image-list.js +113 -1
- package/dist/collection/components/kup-lazy/kup-lazy.css +13 -6
- package/dist/collection/components/kup-list/kup-list-helper.js +9 -3
- package/dist/collection/components/kup-photo-frame/kup-photo-frame.css +13 -3
- package/dist/collection/components/kup-photo-frame/kup-photo-frame.js +1 -1
- package/dist/collection/components/kup-text-field/kup-text-field-declarations.js +4 -0
- package/dist/collection/components/kup-text-field/kup-text-field.js +54 -0
- package/dist/collection/components/kup-time-picker/kup-time-picker.js +0 -6
- package/dist/collection/components/kup-tree/kup-tree.js +26 -9
- package/dist/collection/f-components/f-button/f-button.js +2 -2
- package/dist/collection/f-components/f-cell/f-cell-declarations.js +5 -1
- package/dist/collection/f-components/f-cell/f-cell.js +34 -114
- package/dist/collection/f-components/f-text-field/f-text-field.js +9 -1
- package/dist/collection/managers/kup-data/kup-data-cell-helper.js +48 -15
- package/dist/collection/managers/kup-data/kup-data-node-helper.js +69 -0
- package/dist/collection/managers/kup-data/kup-data.js +114 -6
- package/dist/collection/managers/kup-interact/kup-interact.js +3 -5
- package/dist/collection/managers/kup-language/kup-language-declarations.js +11 -0
- package/dist/collection/managers/kup-objects/kup-objects.js +10 -0
- package/dist/collection/managers/kup-scroll-on-hover/kup-scroll-on-hover-declarations.js +2 -0
- package/dist/collection/managers/kup-scroll-on-hover/kup-scroll-on-hover.js +131 -45
- package/dist/collection/managers/kup-theme/kup-theme-declarations.js +20 -3
- package/dist/collection/types/GenericTypes.js +3 -2
- package/dist/collection/utils/filters/filters-rows.js +4 -23
- package/dist/collection/utils/filters/filters-tree-items.js +2 -1
- package/dist/esm/{f-button-871a544b.js → f-button-cd948e50.js} +4 -4
- package/dist/esm/{f-cell-521ef17a.js → f-cell-474dd282.js} +46 -283
- package/dist/esm/f-checkbox-e06cf07b.js +27 -0
- package/dist/esm/{f-chip-1dda722f.js → f-chip-d6f2eb94.js} +3 -3
- package/dist/esm/{f-image-c468d8ae.js → f-image-914a03ef.js} +2 -2
- package/dist/esm/{f-paginator-utils-7dff8ff0.js → f-paginator-utils-a4a52732.js} +44 -366
- package/dist/esm/{f-text-field-d6c61c73.js → f-text-field-76341fe3.js} +11 -3
- package/dist/esm/{index-baeab1ac.js → index-e41330a5.js} +15 -8
- package/dist/esm/ketchup.js +3 -3
- package/dist/esm/kup-accordion.entry.js +3 -4
- package/dist/esm/kup-autocomplete_25.entry.js +222 -190
- package/dist/esm/kup-box.entry.js +1300 -0
- package/dist/esm/kup-calendar.entry.js +5 -7
- package/dist/esm/kup-cell.entry.js +7 -8
- package/dist/esm/kup-dash-list.entry.js +2 -4
- package/dist/esm/kup-dash_2.entry.js +3 -7
- package/dist/esm/kup-dashboard.entry.js +434 -0
- package/dist/esm/kup-drawer.entry.js +3 -4
- package/dist/esm/{kup-box_2.entry.js → kup-echart.entry.js} +61 -1347
- package/dist/esm/kup-family-tree.entry.js +482 -0
- package/dist/esm/kup-form.entry.js +474 -0
- package/dist/esm/kup-iframe.entry.js +2 -3
- package/dist/esm/kup-image-list.entry.js +70 -10
- package/dist/esm/kup-lazy.entry.js +3 -4
- package/dist/esm/kup-magic-box.entry.js +3 -4
- package/dist/esm/{kup-manager-58b075b4.js → kup-manager-86f440c7.js} +1762 -357
- package/dist/esm/kup-nav-bar.entry.js +2 -3
- package/dist/esm/kup-numeric-picker.entry.js +3 -3
- package/dist/esm/kup-photo-frame.entry.js +4 -5
- package/dist/esm/kup-probe.entry.js +2 -2
- package/dist/esm/kup-qlik.entry.js +2 -2
- package/dist/esm/kup-snackbar.entry.js +4 -5
- package/dist/esm/loader.js +3 -3
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/p-00e1133d.entry.js +9 -0
- package/dist/ketchup/p-066f344a.entry.js +1 -0
- package/dist/ketchup/p-0c6e0647.entry.js +1 -0
- package/dist/ketchup/p-151f7c17.entry.js +27 -0
- package/dist/ketchup/p-1e9c03b0.entry.js +1 -0
- package/dist/ketchup/p-21ea11cb.js +30 -0
- package/dist/ketchup/{p-fac1a08b.entry.js → p-2f4e6c50.entry.js} +1 -1
- package/dist/ketchup/p-3586f59c.js +1 -0
- package/dist/ketchup/p-359fd90d.entry.js +1 -0
- package/dist/ketchup/p-389fd0bf.js +1 -0
- package/dist/ketchup/p-5552f156.js +1 -0
- package/dist/ketchup/{p-f09f2f98.entry.js → p-77aff9c1.entry.js} +1 -1
- package/dist/ketchup/p-7cfdf53c.entry.js +39 -0
- package/dist/ketchup/p-853a5178.entry.js +1 -0
- package/dist/ketchup/{p-44ec4f03.js → p-8673bd4e.js} +1 -1
- package/dist/ketchup/p-8b55b786.entry.js +1 -0
- package/dist/ketchup/p-95f5834b.entry.js +1 -0
- package/dist/ketchup/p-a2c595c4.js +1 -0
- package/dist/ketchup/p-ae91f27e.entry.js +1 -0
- package/dist/ketchup/p-af664379.js +1 -0
- package/dist/ketchup/p-b0b3989b.js +2 -0
- package/dist/ketchup/p-b3b65a61.entry.js +1 -0
- package/dist/ketchup/p-bc306a53.entry.js +1 -0
- package/dist/ketchup/{p-f71a1675.entry.js → p-c3783b77.entry.js} +1 -1
- package/dist/ketchup/{p-7eff4eee.js → p-cd4fc3fb.js} +1 -1
- package/dist/ketchup/p-cee76b14.entry.js +1 -0
- package/dist/ketchup/p-cfaea29b.entry.js +1 -0
- package/dist/ketchup/p-d2f51e7b.entry.js +1 -0
- package/dist/ketchup/p-df8e6a4d.entry.js +1 -0
- package/dist/ketchup/p-e60a1170.entry.js +1 -0
- package/dist/ketchup/p-e9a1ba04.entry.js +1 -0
- package/dist/types/components/kup-autocomplete/kup-autocomplete.d.ts +1 -16
- package/dist/types/components/{kup-form-editor/kup-form-editor-declarations.d.ts → kup-dashboard/kup-dashboard-declarations.d.ts} +9 -27
- package/dist/types/components/{kup-form-editor/kup-form-editor.d.ts → kup-dashboard/kup-dashboard.d.ts} +17 -9
- package/dist/types/components/kup-data-table/kup-data-table-state.d.ts +1 -1
- package/dist/types/components/kup-family-tree/kup-family-tree-declarations.d.ts +37 -0
- package/dist/types/components/kup-family-tree/kup-family-tree.d.ts +82 -0
- package/dist/types/components/kup-form/kup-form-declarations.d.ts +60 -0
- package/dist/types/components/kup-form/kup-form.d.ts +63 -0
- package/dist/types/components/kup-image-list/kup-image-list-state.d.ts +6 -0
- package/dist/types/components/kup-image-list/kup-image-list.d.ts +17 -0
- package/dist/types/components/kup-text-field/kup-text-field-declarations.d.ts +4 -0
- package/dist/types/components/kup-text-field/kup-text-field.d.ts +10 -0
- package/dist/types/components/kup-time-picker/kup-time-picker.d.ts +0 -6
- package/dist/types/components/kup-tree/kup-tree-declarations.d.ts +2 -0
- package/dist/types/components/kup-tree/kup-tree.d.ts +0 -1
- package/dist/types/components.d.ts +492 -231
- package/dist/types/f-components/f-cell/f-cell-declarations.d.ts +4 -1
- package/dist/types/f-components/f-text-field/f-text-field-declarations.d.ts +2 -0
- package/dist/types/managers/kup-data/kup-data-cell-helper.d.ts +13 -6
- package/dist/types/managers/kup-data/kup-data-declarations.d.ts +8 -0
- package/dist/types/managers/kup-data/kup-data-node-helper.d.ts +15 -1
- package/dist/types/managers/kup-data/kup-data.d.ts +9 -2
- package/dist/types/managers/kup-language/kup-language-declarations.d.ts +11 -1
- package/dist/types/managers/kup-objects/kup-objects.d.ts +6 -0
- package/dist/types/managers/kup-scroll-on-hover/kup-scroll-on-hover-declarations.d.ts +9 -1
- package/dist/types/managers/kup-scroll-on-hover/kup-scroll-on-hover.d.ts +7 -5
- package/dist/types/types/GenericTypes.d.ts +3 -2
- package/dist/types/utils/filters/filters-rows.d.ts +0 -2
- package/package.json +2 -2
- package/dist/cjs/cell-utils-a78d6fac.js +0 -168
- package/dist/cjs/f-cell-69294bca.js +0 -653
- package/dist/cjs/kup-field.cjs.entry.js +0 -241
- package/dist/cjs/kup-form-editor.cjs.entry.js +0 -404
- package/dist/cjs/utils-6287d878.js +0 -447
- package/dist/collection/assets/form-editor.js +0 -338
- package/dist/collection/components/kup-field/kup-field-declarations.js +0 -15
- package/dist/collection/components/kup-field/kup-field.css +0 -48
- package/dist/collection/components/kup-field/kup-field.js +0 -514
- package/dist/collection/components/kup-form-editor/kup-form-editor-declarations.js +0 -23
- package/dist/esm/cell-utils-964da6b5.js +0 -160
- package/dist/esm/kup-field.entry.js +0 -237
- package/dist/esm/kup-form-editor.entry.js +0 -400
- package/dist/esm/utils-d7e4b3c2.js +0 -428
- package/dist/ketchup/p-1ae66cc5.js +0 -1
- package/dist/ketchup/p-34b74425.js +0 -1
- package/dist/ketchup/p-3c11e615.entry.js +0 -1
- package/dist/ketchup/p-4ffbc3ff.js +0 -1
- package/dist/ketchup/p-5264a3e6.entry.js +0 -1
- package/dist/ketchup/p-65974e48.entry.js +0 -1
- package/dist/ketchup/p-65b46587.entry.js +0 -40
- package/dist/ketchup/p-6dff70f8.entry.js +0 -1
- package/dist/ketchup/p-7454cb92.js +0 -1
- package/dist/ketchup/p-80968627.entry.js +0 -1
- package/dist/ketchup/p-8cdf61a4.js +0 -1
- package/dist/ketchup/p-954cc340.entry.js +0 -1
- package/dist/ketchup/p-976244f9.entry.js +0 -9
- package/dist/ketchup/p-99e0d768.entry.js +0 -1
- package/dist/ketchup/p-a0f6e25c.entry.js +0 -1
- package/dist/ketchup/p-a615a92b.entry.js +0 -1
- package/dist/ketchup/p-aca0e54b.js +0 -30
- package/dist/ketchup/p-b8939a8b.entry.js +0 -1
- package/dist/ketchup/p-bfc3bac7.js +0 -1
- package/dist/ketchup/p-c5ce8951.entry.js +0 -1
- package/dist/ketchup/p-d2ee56dd.entry.js +0 -1
- package/dist/ketchup/p-db71436b.entry.js +0 -27
- package/dist/ketchup/p-e0035c58.js +0 -1
- package/dist/ketchup/p-e1039cf2.entry.js +0 -1
- package/dist/ketchup/p-ea10176c.entry.js +0 -1
- package/dist/types/components/kup-field/kup-field-declarations.d.ts +0 -25
- package/dist/types/components/kup-field/kup-field.d.ts +0 -90
|
@@ -0,0 +1,486 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-31125378.js');
|
|
6
|
+
const fButton = require('./f-button-94cb5f35.js');
|
|
7
|
+
const fButtonDeclarations = require('./f-button-declarations-b611587f.js');
|
|
8
|
+
const fImage = require('./f-image-0e71df7e.js');
|
|
9
|
+
const kupManager = require('./kup-manager-7c514a30.js');
|
|
10
|
+
const GenericVariables = require('./GenericVariables-a9ed17ee.js');
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Props of the kup-family-tree component.
|
|
14
|
+
* Used to export every prop in an object.
|
|
15
|
+
*/
|
|
16
|
+
var KupFamilyTreeProps;
|
|
17
|
+
(function (KupFamilyTreeProps) {
|
|
18
|
+
KupFamilyTreeProps["autofitOnExpand"] = "The component will autofit everytime a node is expanded.";
|
|
19
|
+
KupFamilyTreeProps["autofitOnLoad"] = "The component's initial render will fit the container by invoking the runAutofit method.";
|
|
20
|
+
KupFamilyTreeProps["collapsible"] = "Nodes can be expanded/collapsed.";
|
|
21
|
+
KupFamilyTreeProps["customStyle"] = "Custom style of the component.";
|
|
22
|
+
KupFamilyTreeProps["data"] = "Actual data of the component";
|
|
23
|
+
KupFamilyTreeProps["layout"] = "Layout of the boxes.";
|
|
24
|
+
KupFamilyTreeProps["stackedLeaves"] = "Child nodes that have no children are arranged vertically.";
|
|
25
|
+
})(KupFamilyTreeProps || (KupFamilyTreeProps = {}));
|
|
26
|
+
|
|
27
|
+
const kupFamilyTreeCss = ":host{--kup_familytree_item_background_color:var(\n --kup-familytree-item-background-color,\n var(--kup-background-color)\n );--kup_familytree_item_color:var(\n --kup-familytree-item-color,\n var(--kup-text-color)\n );--kup_familytree_item_height:var(--kup-familytree-item-height, 80px);--kup_familytree_item_h_padding:var(--kup-familytree-item-h-padding, 8px);--kup_familytree_item_v_padding:var(--kup-familytree-item-v-padding, 10px);--kup_familytree_item_width:var(--kup-familytree-item-width, 280px);--kup_familytree_lines_color:var(\n --kup-familytree-lines-color,\n var(--kup-border-color)\n );display:block;overflow:hidden}.family-tree{cursor:grab;display:flex;transform:scale(var(--kup_familytree_scale, 1));transform-origin:0px 0px}.family-tree--dragging{cursor:grabbing}.family-tree__node{border-collapse:collapse;margin:auto}.family-tree__node--stacked{margin-bottom:4px}.family-tree__node__staff{align-items:center;display:flex;flex-direction:column;height:0;transform:translateX(calc( ( var(--kup_familytree_item_width) + (var(--kup_familytree_item_h_padding) * 2) ) / 2 )) translateY(calc( 0px - ( var(--kup_familytree_staffchildren) * var(--kup_familytree_item_height) + var(--kup_familytree_staffchildren) * (var(--kup_familytree_item_v_padding) * 2) ) ))}.family-tree__node__staff__item{padding:var(--kup_familytree_item_v_padding);text-align:left}.family-tree__node__staff__item:before{border-top:2px solid var(--kup_familytree_lines_color);content:\"\";position:absolute;transform:translateX(calc(100% + 2px)) translateY(calc(var(--kup_familytree_item_height) / 2));width:var(--kup_familytree_item_h_padding)}.family-tree__node td{vertical-align:top;padding:0}.family-tree__line--left{border-left:2px solid var(--kup_familytree_lines_color)}.family-tree__line--placeholder{height:calc(var(--kup_familytree_item_height) / 2)}.family-tree__line--staff{height:calc( var(--kup_familytree_staffchildren) * var(--kup_familytree_item_height) + var(--kup_familytree_staffchildren) * (var(--kup_familytree_item_v_padding) * 2) )}.family-tree__line--right{border-right:2px solid var(--kup_familytree_lines_color)}.family-tree__line--top{border-top:2px solid var(--kup_familytree_lines_color)}.family-tree__line--vertical{background-color:var(--kup_familytree_lines_color);margin-left:auto;margin-right:auto;width:2px}.family-tree__item{display:flex}.family-tree__item__wrapper{margin:auto}.family-tree__item__wrapper kup-box{margin:0 auto;overflow:hidden;padding:0 18px;width:var(--kup_familytree_item_width);z-index:1}.family-tree__item__wrapper .f-button{--kup-button-primary-color:var(--kup-text-color);--kup-button-primary-color-rgb:var(--kup-text-color-rgb);--kup-button-primary-color-h:var(--kup-text-color-h);--kup-button-primary-color-s:var(--kup-text-color-s);--kup-button-primary-color-l:var(--kup-text-color-l);margin:0 auto;width:max-content}.family-tree__item__wrapper .f-button button{height:32px;width:32px}.family-tree__item__layout{background-color:var(--kup_familytree_item_background_color);border:1px solid var(--kup_familytree_lines_color);border-radius:8px;box-sizing:border-box;display:flex;height:var(--kup_familytree_item_height);margin:0 18px;width:var(--kup_familytree_item_width)}.family-tree__item__layout--1{justify-content:center;color:var(--kup_familytree_item_color)}.family-tree__item__layout--1>.family-tree__item__layout__text__title{margin-top:auto;margin-bottom:auto}.family-tree__item__layout--2{background-color:var(--kup_familytree_item_background_color);justify-content:flex-start}.family-tree__item__layout__color{background-color:var(--kup-secondary-color);border-bottom-left-radius:8px;border-top-left-radius:8px;height:100%;width:10px}.family-tree__item__layout__image{display:flex;margin:auto 10px}.family-tree__item__layout__image img{border-radius:50px;object-fit:cover}.family-tree__item__layout__text{display:flex;flex-direction:column;justify-content:center}.family-tree__item__layout__text__title{font-size:18px;margin-bottom:5px}.family-tree__item__layout__text__subtitle{font-size:14px}.family-tree__item__layout__text__title,.family-tree__item__layout__text__subtitle{max-width:calc(var(--kup_familytree_item_width) - 30%);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}";
|
|
28
|
+
|
|
29
|
+
var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
30
|
+
if (kind === "a" && !f)
|
|
31
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
32
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
33
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
34
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
35
|
+
};
|
|
36
|
+
var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
37
|
+
if (kind === "m")
|
|
38
|
+
throw new TypeError("Private method is not writable");
|
|
39
|
+
if (kind === "a" && !f)
|
|
40
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
41
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
42
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
43
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
44
|
+
};
|
|
45
|
+
var _KupFamilyTree_instances, _KupFamilyTree_clickTimeout, _KupFamilyTree_hold, _KupFamilyTree_currentPanX, _KupFamilyTree_currentPanY, _KupFamilyTree_interactableTouch, _KupFamilyTree_kupManager, _KupFamilyTree_moveCb, _KupFamilyTree_shouldAutofit, _KupFamilyTree_wrapperEl, _KupFamilyTree_buildChildLine, _KupFamilyTree_buildNode, _KupFamilyTree_buildNodeLayout, _KupFamilyTree_buildNodeLayout1, _KupFamilyTree_buildNodeLayout2, _KupFamilyTree_buildNodes, _KupFamilyTree_createTree, _KupFamilyTree_isBoxLayout, _KupFamilyTree_startPanning, _KupFamilyTree_getEventPath, _KupFamilyTree_getEventDetails, _KupFamilyTree_clickHandler, _KupFamilyTree_contextMenuHandler, _KupFamilyTree_dblClickHandler, _KupFamilyTree_didLoadInteractables, _KupFamilyTree_zoomTree;
|
|
46
|
+
const KupFamilyTree = class {
|
|
47
|
+
constructor(hostRef) {
|
|
48
|
+
index.registerInstance(this, hostRef);
|
|
49
|
+
this.kupClick = index.createEvent(this, "kup-familytree-click", 6);
|
|
50
|
+
this.kupContextMenu = index.createEvent(this, "kup-familytree-contextmenu", 6);
|
|
51
|
+
this.kupDblClick = index.createEvent(this, "kup-familytree-dblclick", 6);
|
|
52
|
+
_KupFamilyTree_instances.add(this);
|
|
53
|
+
/*-------------------------------------------------*/
|
|
54
|
+
/* P r o p s */
|
|
55
|
+
/*-------------------------------------------------*/
|
|
56
|
+
/**
|
|
57
|
+
* The component will autofit everytime a node is expanded.
|
|
58
|
+
* @default true
|
|
59
|
+
*/
|
|
60
|
+
this.autofitOnExpand = true;
|
|
61
|
+
/**
|
|
62
|
+
* The component's initial render will fit the container by invoking the runAutofit method.
|
|
63
|
+
* @default true
|
|
64
|
+
*/
|
|
65
|
+
this.autofitOnLoad = true;
|
|
66
|
+
/**
|
|
67
|
+
* Nodes can be expanded/collapsed.
|
|
68
|
+
* @default true
|
|
69
|
+
*/
|
|
70
|
+
this.collapsible = true;
|
|
71
|
+
/**
|
|
72
|
+
* Custom style of the component.
|
|
73
|
+
* @default ""
|
|
74
|
+
* @see https://ketchup.smeup.com/ketchup-showcase/#/customization
|
|
75
|
+
*/
|
|
76
|
+
this.customStyle = '';
|
|
77
|
+
/**
|
|
78
|
+
* Actual data of the component.
|
|
79
|
+
* @default null
|
|
80
|
+
*/
|
|
81
|
+
this.data = null;
|
|
82
|
+
/**
|
|
83
|
+
* Layout of the boxes.
|
|
84
|
+
* @default null
|
|
85
|
+
*/
|
|
86
|
+
this.layout = null;
|
|
87
|
+
/**
|
|
88
|
+
* Child nodes that have no children are arranged vertically.
|
|
89
|
+
* @default false
|
|
90
|
+
*/
|
|
91
|
+
this.stackedLeaves = false;
|
|
92
|
+
/*-------------------------------------------------*/
|
|
93
|
+
/* I n t e r n a l V a r i a b l e s */
|
|
94
|
+
/*-------------------------------------------------*/
|
|
95
|
+
_KupFamilyTree_clickTimeout.set(this, []);
|
|
96
|
+
_KupFamilyTree_hold.set(this, false);
|
|
97
|
+
_KupFamilyTree_currentPanX.set(this, 0);
|
|
98
|
+
_KupFamilyTree_currentPanY.set(this, 0);
|
|
99
|
+
_KupFamilyTree_interactableTouch.set(this, []);
|
|
100
|
+
_KupFamilyTree_kupManager.set(this, kupManager.kupManagerInstance());
|
|
101
|
+
_KupFamilyTree_moveCb.set(this, (e) => {
|
|
102
|
+
const deltaX = e.clientX - __classPrivateFieldGet(this, _KupFamilyTree_currentPanX, "f");
|
|
103
|
+
const deltaY = e.clientY - __classPrivateFieldGet(this, _KupFamilyTree_currentPanY, "f");
|
|
104
|
+
this.rootElement.scrollTop -= deltaY;
|
|
105
|
+
this.rootElement.scrollLeft -= deltaX;
|
|
106
|
+
__classPrivateFieldSet(this, _KupFamilyTree_currentPanX, e.clientX, "f");
|
|
107
|
+
__classPrivateFieldSet(this, _KupFamilyTree_currentPanY, e.clientY, "f");
|
|
108
|
+
});
|
|
109
|
+
_KupFamilyTree_shouldAutofit.set(this, false);
|
|
110
|
+
_KupFamilyTree_wrapperEl.set(this, null);
|
|
111
|
+
}
|
|
112
|
+
/*-------------------------------------------------*/
|
|
113
|
+
/* P u b l i c M e t h o d s */
|
|
114
|
+
/*-------------------------------------------------*/
|
|
115
|
+
/**
|
|
116
|
+
* Collapses all nodes.
|
|
117
|
+
*/
|
|
118
|
+
async collapseAll(nodes = this.data.rows) {
|
|
119
|
+
__classPrivateFieldGet(this, _KupFamilyTree_kupManager, "f").data.node.setProperties(nodes, { isExpanded: false }, true);
|
|
120
|
+
this.refresh();
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Expands all nodes.
|
|
124
|
+
*/
|
|
125
|
+
async expandAll(nodes = this.data.rows) {
|
|
126
|
+
__classPrivateFieldGet(this, _KupFamilyTree_kupManager, "f").data.node.setProperties(nodes, { isExpanded: true }, true);
|
|
127
|
+
this.refresh();
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Used to retrieve component's props values.
|
|
131
|
+
* @param {boolean} descriptions - When provided and true, the result will be the list of props with their description.
|
|
132
|
+
* @returns {Promise<GenericObject>} List of props as object, each key will be a prop.
|
|
133
|
+
*/
|
|
134
|
+
async getProps(descriptions) {
|
|
135
|
+
return kupManager.getProps(this, KupFamilyTreeProps, descriptions);
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* This method is used to trigger a new render of the component.
|
|
139
|
+
*/
|
|
140
|
+
async refresh() {
|
|
141
|
+
index.forceUpdate(this);
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* This method causes the component to autofit its container's width.
|
|
145
|
+
*/
|
|
146
|
+
async runAutofit() {
|
|
147
|
+
const parentWidth = __classPrivateFieldGet(this, _KupFamilyTree_wrapperEl, "f").clientWidth;
|
|
148
|
+
const childWidth = __classPrivateFieldGet(this, _KupFamilyTree_wrapperEl, "f").children[0].clientWidth;
|
|
149
|
+
const multiplierStep = 0.01;
|
|
150
|
+
const minWidth = (85 / 100) * parentWidth;
|
|
151
|
+
const maxWidth = (95 / 100) * parentWidth;
|
|
152
|
+
let multiplier = 1;
|
|
153
|
+
let tooManyAttempts = 2000;
|
|
154
|
+
let tempWidth = childWidth;
|
|
155
|
+
while ((tempWidth < minWidth || tempWidth > maxWidth) &&
|
|
156
|
+
tooManyAttempts > 0 &&
|
|
157
|
+
multiplier > multiplierStep) {
|
|
158
|
+
tooManyAttempts--;
|
|
159
|
+
if (tempWidth < minWidth) {
|
|
160
|
+
multiplier = multiplier + multiplierStep;
|
|
161
|
+
}
|
|
162
|
+
else if (tempWidth > maxWidth) {
|
|
163
|
+
multiplier = multiplier - multiplierStep;
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
tooManyAttempts = 0;
|
|
167
|
+
}
|
|
168
|
+
tempWidth = childWidth * multiplier;
|
|
169
|
+
}
|
|
170
|
+
__classPrivateFieldGet(this, _KupFamilyTree_wrapperEl, "f").style.setProperty('--kup_familytree_scale', multiplier <= 1 ? multiplier.toFixed(2) : '1');
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Sets the props to the component.
|
|
174
|
+
* @param {GenericObject} props - Object containing props that will be set to the component.
|
|
175
|
+
*/
|
|
176
|
+
async setProps(props) {
|
|
177
|
+
kupManager.setProps(this, KupFamilyTreeProps, props);
|
|
178
|
+
}
|
|
179
|
+
/*-------------------------------------------------*/
|
|
180
|
+
/* L i f e c y c l e H o o k s */
|
|
181
|
+
/*-------------------------------------------------*/
|
|
182
|
+
componentWillLoad() {
|
|
183
|
+
__classPrivateFieldGet(this, _KupFamilyTree_kupManager, "f").debug.logLoad(this, false);
|
|
184
|
+
__classPrivateFieldGet(this, _KupFamilyTree_kupManager, "f").language.register(this);
|
|
185
|
+
__classPrivateFieldGet(this, _KupFamilyTree_kupManager, "f").theme.register(this);
|
|
186
|
+
}
|
|
187
|
+
componentDidLoad() {
|
|
188
|
+
__classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_didLoadInteractables).call(this);
|
|
189
|
+
if (this.autofitOnLoad) {
|
|
190
|
+
this.runAutofit();
|
|
191
|
+
}
|
|
192
|
+
__classPrivateFieldGet(this, _KupFamilyTree_kupManager, "f").debug.logLoad(this, true);
|
|
193
|
+
}
|
|
194
|
+
componentWillRender() {
|
|
195
|
+
__classPrivateFieldGet(this, _KupFamilyTree_kupManager, "f").debug.logRender(this, false);
|
|
196
|
+
}
|
|
197
|
+
componentDidRender() {
|
|
198
|
+
if (__classPrivateFieldGet(this, _KupFamilyTree_shouldAutofit, "f")) {
|
|
199
|
+
__classPrivateFieldSet(this, _KupFamilyTree_shouldAutofit, false, "f");
|
|
200
|
+
this.runAutofit();
|
|
201
|
+
}
|
|
202
|
+
__classPrivateFieldGet(this, _KupFamilyTree_kupManager, "f").debug.logRender(this, true);
|
|
203
|
+
}
|
|
204
|
+
render() {
|
|
205
|
+
return (index.h(index.Host, { onDrag: (e) => e.preventDefault(), onPointerDown: (e) => {
|
|
206
|
+
e.preventDefault();
|
|
207
|
+
__classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_startPanning).call(this, e);
|
|
208
|
+
}, onWheel: (e) => {
|
|
209
|
+
__classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_zoomTree).call(this, e);
|
|
210
|
+
} }, index.h("style", null, __classPrivateFieldGet(this, _KupFamilyTree_kupManager, "f").theme.setKupStyle(this.rootElement)), index.h("div", { id: GenericVariables.componentWrapperId }, __classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_createTree).call(this))));
|
|
211
|
+
}
|
|
212
|
+
disconnectedCallback() {
|
|
213
|
+
__classPrivateFieldGet(this, _KupFamilyTree_kupManager, "f").language.unregister(this);
|
|
214
|
+
__classPrivateFieldGet(this, _KupFamilyTree_kupManager, "f").theme.unregister(this);
|
|
215
|
+
}
|
|
216
|
+
get rootElement() { return index.getElement(this); }
|
|
217
|
+
};
|
|
218
|
+
_KupFamilyTree_clickTimeout = new WeakMap(), _KupFamilyTree_hold = new WeakMap(), _KupFamilyTree_currentPanX = new WeakMap(), _KupFamilyTree_currentPanY = new WeakMap(), _KupFamilyTree_interactableTouch = new WeakMap(), _KupFamilyTree_kupManager = new WeakMap(), _KupFamilyTree_moveCb = new WeakMap(), _KupFamilyTree_shouldAutofit = new WeakMap(), _KupFamilyTree_wrapperEl = new WeakMap(), _KupFamilyTree_instances = new WeakSet(), _KupFamilyTree_buildChildLine = function _KupFamilyTree_buildChildLine(first, last, alone, moreTwo) {
|
|
219
|
+
const content = [];
|
|
220
|
+
content.push(index.h("td", { class: {
|
|
221
|
+
'family-tree__line': true,
|
|
222
|
+
'family-tree__line--right': !first,
|
|
223
|
+
'family-tree__line--top': !first,
|
|
224
|
+
} }, index.h("div", { class: 'family-tree__line--placeholder' })));
|
|
225
|
+
content.push(index.h("td", { class: {
|
|
226
|
+
'family-tree__line': true,
|
|
227
|
+
'family-tree__line--left': first,
|
|
228
|
+
'family-tree__line--top': (first && !alone) || (moreTwo && !last),
|
|
229
|
+
} }, index.h("div", { class: 'family-tree__line--placeholder' })));
|
|
230
|
+
return content;
|
|
231
|
+
}, _KupFamilyTree_buildNode = function _KupFamilyTree_buildNode(node) {
|
|
232
|
+
var _a;
|
|
233
|
+
let children = null;
|
|
234
|
+
let staffChildren = null;
|
|
235
|
+
if (!this.collapsible || (this.collapsible && node.isExpanded)) {
|
|
236
|
+
(_a = node.children) === null || _a === void 0 ? void 0 : _a.forEach((child) => {
|
|
237
|
+
if (child.isStaff) {
|
|
238
|
+
if (!staffChildren) {
|
|
239
|
+
staffChildren = [];
|
|
240
|
+
}
|
|
241
|
+
staffChildren.push(child);
|
|
242
|
+
}
|
|
243
|
+
else {
|
|
244
|
+
if (!children) {
|
|
245
|
+
children = [];
|
|
246
|
+
}
|
|
247
|
+
children.push(child);
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
const stacked = this.stackedLeaves &&
|
|
252
|
+
children &&
|
|
253
|
+
children.every((c) => !c.children || c.children.length == 0);
|
|
254
|
+
const span1 = children ? children.length * 2 : 1;
|
|
255
|
+
const styleVLine = {
|
|
256
|
+
'family-tree__line': true,
|
|
257
|
+
'family-tree__line--placeholder': !!(children || staffChildren),
|
|
258
|
+
'family-tree__line--vertical': !!(children || staffChildren),
|
|
259
|
+
};
|
|
260
|
+
const data = {
|
|
261
|
+
columns: [
|
|
262
|
+
{ name: '*TREECOL', title: 'Fake column' },
|
|
263
|
+
...this.data.columns,
|
|
264
|
+
],
|
|
265
|
+
rows: [{ cells: Object.assign({ '*TREECOL': node }, node.cells) }],
|
|
266
|
+
};
|
|
267
|
+
const layout = node.layout || this.layout || 1;
|
|
268
|
+
const expandButtonProps = {
|
|
269
|
+
icon: node.isExpanded ? 'remove' : 'plus',
|
|
270
|
+
shaped: true,
|
|
271
|
+
slim: true,
|
|
272
|
+
styling: fButtonDeclarations.FButtonStyling.OUTLINED,
|
|
273
|
+
title: `${__classPrivateFieldGet(this, _KupFamilyTree_kupManager, "f").language.translate(kupManager.KupLanguageGeneric.EXPAND)}/${__classPrivateFieldGet(this, _KupFamilyTree_kupManager, "f").language.translate(kupManager.KupLanguageGeneric.COLLAPSE)} (CTRL + Click)`,
|
|
274
|
+
onClick: (e) => {
|
|
275
|
+
if (e.ctrlKey && node.children && node.children.length > 0) {
|
|
276
|
+
if (node.isExpanded) {
|
|
277
|
+
this.collapseAll(node.children);
|
|
278
|
+
}
|
|
279
|
+
else {
|
|
280
|
+
this.expandAll(node.children);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
node.isExpanded = !node.isExpanded;
|
|
284
|
+
if (this.autofitOnExpand) {
|
|
285
|
+
__classPrivateFieldSet(this, _KupFamilyTree_shouldAutofit, true, "f");
|
|
286
|
+
}
|
|
287
|
+
this.refresh();
|
|
288
|
+
},
|
|
289
|
+
wrapperClass: 'family-tree__item__expand',
|
|
290
|
+
};
|
|
291
|
+
const box = (index.h("div", { class: 'family-tree__item' }, index.h("div", { class: 'family-tree__item__wrapper' }, __classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_isBoxLayout).call(this, layout) ? (index.h("kup-box", { class: "kup-borderless kup-paddingless", customStyle: "#kup-component { background: var(--kup_familytree_item_background_color); border: 2px solid var(--kup_familytree_lines_color); box-sizing: border-box; height: var(--kup_familytree_item_height); padding: 0 var(--kup_familytree_item_h_padding); } #kup-component .box-component { background: var(--kup_familytree_item_background_color); box-sizing: border-box; height: 100%;} #kup-component .f-cell__text { color: var(--kup_familytree_item_color); }", data: data, layout: layout, showSelection: false })) : (__classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_buildNodeLayout).call(this, node, layout)), this.collapsible &&
|
|
292
|
+
node.children &&
|
|
293
|
+
node.children.length > 0 ? (index.h(fButton.FButton, Object.assign({}, expandButtonProps))) : undefined)));
|
|
294
|
+
const staffStyle = {
|
|
295
|
+
['--kup_familytree_staffchildren']: (staffChildren === null || staffChildren === void 0 ? void 0 : staffChildren.length.toString()) || '0',
|
|
296
|
+
};
|
|
297
|
+
//TODO: set data-cell and data-column if needed inside events
|
|
298
|
+
return (index.h("table", { class: {
|
|
299
|
+
'family-tree__node': true,
|
|
300
|
+
'family-tree__node--stacked': this.stackedLeaves &&
|
|
301
|
+
!node.isStaff &&
|
|
302
|
+
(!node.children || node.children.length == 0),
|
|
303
|
+
} }, index.h("tr", null, index.h("td", { "data-row": node, colSpan: span1 }, box)), index.h("tr", null, index.h("td", { colSpan: span1 }, index.h("div", { class: styleVLine }))), staffChildren
|
|
304
|
+
? [
|
|
305
|
+
index.h("tr", null, index.h("td", { colSpan: span1 }, index.h("div", { class: Object.assign(Object.assign({}, styleVLine), { 'family-tree__line--staff': true }), style: staffStyle }), index.h("div", { class: "family-tree__node__staff", style: staffStyle }, staffChildren.map((inode) => [
|
|
306
|
+
index.h("div", { class: "family-tree__node__staff__item" }, __classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_buildNode).call(this, inode)),
|
|
307
|
+
])))),
|
|
308
|
+
]
|
|
309
|
+
: null, staffChildren && children
|
|
310
|
+
? [
|
|
311
|
+
index.h("tr", null, index.h("td", { colSpan: span1 }, index.h("div", { class: styleVLine }))),
|
|
312
|
+
]
|
|
313
|
+
: null, children
|
|
314
|
+
? [
|
|
315
|
+
index.h("tr", null, stacked ? (index.h("td", { colSpan: span1 }, index.h("div", { class: styleVLine }))) : (children.map((inode) => __classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_buildChildLine).call(this, children.indexOf(inode) == 0, children.indexOf(inode) ==
|
|
316
|
+
children.length - 1, children.length == 1, children.length > 2)))),
|
|
317
|
+
index.h("tr", null, stacked ? (index.h("td", { colSpan: span1 }, children.map((inode) => __classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_buildNode).call(this, inode)))) : (children.map((inode) => (index.h("td", { colSpan: 2 }, __classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_buildNode).call(this, inode)))))),
|
|
318
|
+
]
|
|
319
|
+
: undefined));
|
|
320
|
+
}, _KupFamilyTree_buildNodeLayout = function _KupFamilyTree_buildNodeLayout(node, layout) {
|
|
321
|
+
switch (layout) {
|
|
322
|
+
case 2:
|
|
323
|
+
return __classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_buildNodeLayout2).call(this, node);
|
|
324
|
+
default:
|
|
325
|
+
return __classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_buildNodeLayout1).call(this, node);
|
|
326
|
+
}
|
|
327
|
+
}, _KupFamilyTree_buildNodeLayout1 = function _KupFamilyTree_buildNodeLayout1(node) {
|
|
328
|
+
return (index.h("div", { class: `family-tree__item__layout family-tree__item__layout--1` }, index.h("div", { class: 'family-tree__item__layout__text__title' }, node.value)));
|
|
329
|
+
}, _KupFamilyTree_buildNodeLayout2 = function _KupFamilyTree_buildNodeLayout2(node) {
|
|
330
|
+
return (index.h("div", { class: `family-tree__item__layout family-tree__item__layout--2` }, index.h("div", { class: 'family-tree__item__layout__color' }), index.h("div", { class: 'family-tree__item__layout__image' }, index.h(fImage.FImage, { resource: node.icon, sizeX: "48px", sizeY: "48px" })), index.h("div", { class: 'family-tree__item__layout__text' }, index.h("div", { class: 'family-tree__item__layout__text__title' }, node.value), node.title ? (index.h("div", { class: 'family-tree__item__layout__text__subtitle' }, node.title)) : null)));
|
|
331
|
+
}, _KupFamilyTree_buildNodes = function _KupFamilyTree_buildNodes(nodes) {
|
|
332
|
+
return nodes.map((node) => __classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_buildNode).call(this, node));
|
|
333
|
+
}, _KupFamilyTree_createTree = function _KupFamilyTree_createTree() {
|
|
334
|
+
const emptyData = !this.data || !this.data.rows || !this.data.rows.length;
|
|
335
|
+
return (index.h("div", { class: "family-tree", onContextMenu: (e) => {
|
|
336
|
+
e.preventDefault();
|
|
337
|
+
}, ref: (el) => (__classPrivateFieldSet(this, _KupFamilyTree_wrapperEl, el, "f")) }, emptyData ? (index.h("div", null, __classPrivateFieldGet(this, _KupFamilyTree_kupManager, "f").language.translate(kupManager.KupLanguageGeneric.EMPTY_DATA))) : (__classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_buildNodes).call(this, this.data.rows))));
|
|
338
|
+
}, _KupFamilyTree_isBoxLayout = function _KupFamilyTree_isBoxLayout(layout) {
|
|
339
|
+
const tmp = layout;
|
|
340
|
+
return tmp && tmp.sections && tmp.sections.length > 0;
|
|
341
|
+
}, _KupFamilyTree_startPanning = function _KupFamilyTree_startPanning(e) {
|
|
342
|
+
__classPrivateFieldSet(this, _KupFamilyTree_currentPanX, e.clientX, "f");
|
|
343
|
+
__classPrivateFieldSet(this, _KupFamilyTree_currentPanY, e.clientY, "f");
|
|
344
|
+
__classPrivateFieldGet(this, _KupFamilyTree_wrapperEl, "f").classList.add('family-tree--dragging');
|
|
345
|
+
const endPanning = () => {
|
|
346
|
+
document.removeEventListener('pointermove', __classPrivateFieldGet(this, _KupFamilyTree_moveCb, "f"));
|
|
347
|
+
document.removeEventListener('pointerup', endPanning);
|
|
348
|
+
__classPrivateFieldGet(this, _KupFamilyTree_wrapperEl, "f").classList.remove('family-tree--dragging');
|
|
349
|
+
};
|
|
350
|
+
document.addEventListener('pointermove', __classPrivateFieldGet(this, _KupFamilyTree_moveCb, "f"));
|
|
351
|
+
document.addEventListener('pointerup', endPanning);
|
|
352
|
+
}, _KupFamilyTree_getEventPath = function _KupFamilyTree_getEventPath(currentEl) {
|
|
353
|
+
const path = [];
|
|
354
|
+
while (currentEl &&
|
|
355
|
+
currentEl !== this.rootElement &&
|
|
356
|
+
currentEl !== document.body) {
|
|
357
|
+
path.push(currentEl);
|
|
358
|
+
currentEl = currentEl.parentNode
|
|
359
|
+
? currentEl.parentNode
|
|
360
|
+
: currentEl.host;
|
|
361
|
+
}
|
|
362
|
+
return path;
|
|
363
|
+
}, _KupFamilyTree_getEventDetails = function _KupFamilyTree_getEventDetails(path, e) {
|
|
364
|
+
let expandButton;
|
|
365
|
+
let td;
|
|
366
|
+
if (path) {
|
|
367
|
+
for (let i = path.length - 1; i >= 0; i--) {
|
|
368
|
+
const el = path[i];
|
|
369
|
+
if (!el.tagName) {
|
|
370
|
+
continue;
|
|
371
|
+
}
|
|
372
|
+
if (el.classList.contains('family-tree__item__expand')) {
|
|
373
|
+
expandButton = el;
|
|
374
|
+
}
|
|
375
|
+
switch (el.tagName.toUpperCase()) {
|
|
376
|
+
case 'TD': {
|
|
377
|
+
td = el;
|
|
378
|
+
break;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
let cell = null, column = null, row = null;
|
|
384
|
+
if (td) {
|
|
385
|
+
cell = td['data-cell'];
|
|
386
|
+
column = td['data-column'];
|
|
387
|
+
row = td['data-row'];
|
|
388
|
+
}
|
|
389
|
+
return {
|
|
390
|
+
cell: cell ? cell : null,
|
|
391
|
+
column: column ? column : null,
|
|
392
|
+
expandButton: expandButton ? expandButton : null,
|
|
393
|
+
originalEvent: e,
|
|
394
|
+
row: row ? row : null,
|
|
395
|
+
td: td ? td : null,
|
|
396
|
+
};
|
|
397
|
+
}, _KupFamilyTree_clickHandler = function _KupFamilyTree_clickHandler(e) {
|
|
398
|
+
const details = __classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_getEventDetails).call(this, __classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_getEventPath).call(this, e.target), e);
|
|
399
|
+
return details;
|
|
400
|
+
}, _KupFamilyTree_contextMenuHandler = function _KupFamilyTree_contextMenuHandler(e) {
|
|
401
|
+
const details = __classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_getEventDetails).call(this, __classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_getEventPath).call(this, e.target), e);
|
|
402
|
+
return details;
|
|
403
|
+
}, _KupFamilyTree_dblClickHandler = function _KupFamilyTree_dblClickHandler(e) {
|
|
404
|
+
const details = __classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_getEventDetails).call(this, __classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_getEventPath).call(this, e.target), e);
|
|
405
|
+
return details;
|
|
406
|
+
}, _KupFamilyTree_didLoadInteractables = function _KupFamilyTree_didLoadInteractables() {
|
|
407
|
+
__classPrivateFieldGet(this, _KupFamilyTree_interactableTouch, "f").push(this.rootElement);
|
|
408
|
+
const tapCb = (e) => {
|
|
409
|
+
if (__classPrivateFieldGet(this, _KupFamilyTree_hold, "f")) {
|
|
410
|
+
__classPrivateFieldSet(this, _KupFamilyTree_hold, false, "f");
|
|
411
|
+
return;
|
|
412
|
+
}
|
|
413
|
+
switch (e.button) {
|
|
414
|
+
// left click
|
|
415
|
+
case 0:
|
|
416
|
+
// Note: event must be cloned
|
|
417
|
+
// otherwise inside setTimeout will be exiting the Shadow DOM scope(causing loss of information, including target).
|
|
418
|
+
const clone = {};
|
|
419
|
+
for (const key in e) {
|
|
420
|
+
clone[key] = e[key];
|
|
421
|
+
}
|
|
422
|
+
__classPrivateFieldGet(this, _KupFamilyTree_clickTimeout, "f").push(setTimeout(() => {
|
|
423
|
+
this.kupClick.emit({
|
|
424
|
+
comp: this,
|
|
425
|
+
id: this.rootElement.id,
|
|
426
|
+
details: __classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_clickHandler).call(this, clone),
|
|
427
|
+
});
|
|
428
|
+
}, 300));
|
|
429
|
+
break;
|
|
430
|
+
// right click
|
|
431
|
+
case 2:
|
|
432
|
+
this.kupContextMenu.emit({
|
|
433
|
+
comp: this,
|
|
434
|
+
id: this.rootElement.id,
|
|
435
|
+
details: __classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_contextMenuHandler).call(this, e),
|
|
436
|
+
});
|
|
437
|
+
break;
|
|
438
|
+
}
|
|
439
|
+
};
|
|
440
|
+
const doubletapCb = (e) => {
|
|
441
|
+
switch (e.button) {
|
|
442
|
+
// left click
|
|
443
|
+
case 0:
|
|
444
|
+
for (let index = 0; index < __classPrivateFieldGet(this, _KupFamilyTree_clickTimeout, "f").length; index++) {
|
|
445
|
+
clearTimeout(__classPrivateFieldGet(this, _KupFamilyTree_clickTimeout, "f")[index]);
|
|
446
|
+
__classPrivateFieldGet(this, _KupFamilyTree_kupManager, "f").debug.logMessage(this, 'Cleared clickHandler timeout(' +
|
|
447
|
+
__classPrivateFieldGet(this, _KupFamilyTree_clickTimeout, "f")[index] +
|
|
448
|
+
').');
|
|
449
|
+
}
|
|
450
|
+
__classPrivateFieldSet(this, _KupFamilyTree_clickTimeout, [], "f");
|
|
451
|
+
this.kupDblClick.emit({
|
|
452
|
+
comp: this,
|
|
453
|
+
id: this.rootElement.id,
|
|
454
|
+
details: __classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_dblClickHandler).call(this, e),
|
|
455
|
+
});
|
|
456
|
+
break;
|
|
457
|
+
}
|
|
458
|
+
};
|
|
459
|
+
const holdCb = (e) => {
|
|
460
|
+
if (e.pointerType === 'pen' || e.pointerType === 'touch') {
|
|
461
|
+
__classPrivateFieldSet(this, _KupFamilyTree_hold, true, "f");
|
|
462
|
+
this.kupContextMenu.emit({
|
|
463
|
+
comp: this,
|
|
464
|
+
id: this.rootElement.id,
|
|
465
|
+
details: __classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_contextMenuHandler).call(this, e),
|
|
466
|
+
});
|
|
467
|
+
}
|
|
468
|
+
};
|
|
469
|
+
__classPrivateFieldGet(this, _KupFamilyTree_kupManager, "f").interact.on(this.rootElement, kupManager.KupPointerEventTypes.TAP, tapCb);
|
|
470
|
+
__classPrivateFieldGet(this, _KupFamilyTree_kupManager, "f").interact.on(this.rootElement, kupManager.KupPointerEventTypes.DOUBLETAP, doubletapCb);
|
|
471
|
+
__classPrivateFieldGet(this, _KupFamilyTree_kupManager, "f").interact.on(this.rootElement, kupManager.KupPointerEventTypes.HOLD, holdCb);
|
|
472
|
+
}, _KupFamilyTree_zoomTree = function _KupFamilyTree_zoomTree(e) {
|
|
473
|
+
if (e.ctrlKey) {
|
|
474
|
+
e.preventDefault();
|
|
475
|
+
const currentScale = parseFloat(__classPrivateFieldGet(this, _KupFamilyTree_wrapperEl, "f").style.getPropertyValue('--kup_familytree_scale')) || 1;
|
|
476
|
+
const delta = 0.05;
|
|
477
|
+
let value = e.deltaY > 0 ? currentScale - delta : currentScale + delta;
|
|
478
|
+
if (value < delta) {
|
|
479
|
+
value = delta;
|
|
480
|
+
}
|
|
481
|
+
__classPrivateFieldGet(this, _KupFamilyTree_wrapperEl, "f").style.setProperty('--kup_familytree_scale', value.toFixed(2));
|
|
482
|
+
}
|
|
483
|
+
};
|
|
484
|
+
KupFamilyTree.style = kupFamilyTreeCss;
|
|
485
|
+
|
|
486
|
+
exports.kup_family_tree = KupFamilyTree;
|