@sme.up/ketchup 6.2.0 → 6.4.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-5b69d882.js → f-button-826a470e.js} +4 -4
- package/dist/cjs/{f-cell-3a740c48.js → f-cell-2d5bcf0c.js} +13 -15
- package/dist/cjs/{f-checkbox-57443ca3.js → f-checkbox-cd977193.js} +1 -1
- package/dist/cjs/{f-chip-02e83f82.js → f-chip-2fd3363e.js} +3 -3
- package/dist/cjs/{f-image-2a61ece2.js → f-image-0f17d599.js} +2 -2
- package/dist/cjs/{f-paginator-utils-09126bdd.js → f-paginator-utils-946b579d.js} +80 -403
- package/dist/cjs/{f-text-field-9ee20a67.js → f-text-field-d243e4d8.js} +13 -3
- package/dist/cjs/{index-06b131ea.js → index-31125378.js} +9 -4
- 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 +129 -115
- package/dist/cjs/kup-box.cjs.entry.js +20 -20
- package/dist/cjs/kup-calendar.cjs.entry.js +9 -11
- package/dist/cjs/kup-cell.cjs.entry.js +9 -11
- package/dist/cjs/kup-dash-list.cjs.entry.js +5 -7
- package/dist/cjs/kup-dash_2.cjs.entry.js +4 -5
- package/dist/cjs/kup-dashboard.cjs.entry.js +76 -17
- package/dist/cjs/kup-drawer.cjs.entry.js +4 -5
- package/dist/cjs/kup-echart.cjs.entry.js +42 -34
- package/dist/cjs/kup-family-tree.cjs.entry.js +140 -64
- package/dist/cjs/kup-form.cjs.entry.js +21 -15
- package/dist/cjs/kup-iframe.cjs.entry.js +4 -5
- package/dist/cjs/kup-image-list.cjs.entry.js +10 -12
- 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-02acbb37.js → kup-manager-a8eecc60.js} +1419 -375
- 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 +4 -5
- 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 +48 -0
- package/dist/collection/assets/family-tree.js +236 -19
- package/dist/collection/assets/form.js +41 -0
- package/dist/collection/assets/index.js +4 -0
- package/dist/collection/assets/kupinteract.js +68 -0
- package/dist/collection/collection-manifest.json +5 -5
- package/dist/collection/components/kup-box/kup-box.js +5 -3
- package/dist/collection/components/kup-button/kup-button-declarations.js +1 -0
- package/dist/collection/components/kup-button/kup-button.js +27 -0
- package/dist/collection/components/kup-dashboard/kup-dashboard.css +7 -0
- package/dist/collection/components/kup-dashboard/kup-dashboard.js +67 -7
- package/dist/collection/components/kup-data-table/kup-data-table-helper.js +42 -30
- package/dist/collection/components/kup-data-table/kup-data-table.js +3 -1
- package/dist/collection/components/kup-echart/kup-echart.js +34 -24
- package/dist/collection/components/kup-family-tree/kup-family-tree-declarations.js +3 -1
- package/dist/collection/components/kup-family-tree/kup-family-tree.css +79 -9
- package/dist/collection/components/kup-family-tree/kup-family-tree.js +253 -65
- package/dist/collection/components/kup-form/kup-form-declarations.js +1 -0
- package/dist/collection/components/kup-form/kup-form.css +8 -0
- package/dist/collection/components/kup-form/kup-form.js +31 -2
- package/dist/collection/components/kup-image/assets/svg/azure.svg +1 -0
- package/dist/collection/components/kup-lazy/kup-lazy.css +8 -2
- package/dist/collection/components/kup-progress-bar/kup-progress-bar.css +1 -0
- package/dist/collection/components/kup-text-field/kup-text-field-declarations.js +1 -0
- package/dist/collection/components/kup-text-field/kup-text-field.js +27 -0
- package/dist/collection/f-components/f-button/f-button.js +2 -2
- package/dist/collection/f-components/f-cell/f-cell.js +1 -1
- package/dist/collection/f-components/f-text-field/f-text-field.js +11 -1
- package/dist/collection/managers/kup-data/kup-data-cell-helper.js +49 -15
- package/dist/collection/managers/kup-data/kup-data.js +9 -11
- package/dist/collection/managers/kup-dates/kup-dates.js +14 -0
- package/dist/collection/managers/kup-interact/kup-interact.js +3 -5
- 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/utils/filters/filters-rows.js +4 -23
- package/dist/collection/utils/filters/filters-tree-items.js +4 -3
- package/dist/esm/{f-button-fd44ef70.js → f-button-2d0a5f21.js} +4 -4
- package/dist/esm/{f-cell-7b159a22.js → f-cell-ee7d7b5c.js} +7 -9
- package/dist/esm/{f-checkbox-c51c4a75.js → f-checkbox-e06cf07b.js} +1 -1
- package/dist/esm/{f-chip-c2e4c522.js → f-chip-0d29f91f.js} +3 -3
- package/dist/esm/{f-image-2ab4b9aa.js → f-image-ab131d59.js} +2 -2
- package/dist/esm/{f-paginator-utils-ef537d82.js → f-paginator-utils-aa52af0f.js} +44 -366
- package/dist/esm/{f-text-field-41c575eb.js → f-text-field-0729b19f.js} +13 -3
- package/dist/esm/{index-ad6ab214.js → index-e41330a5.js} +9 -4
- package/dist/esm/ketchup.js +3 -3
- package/dist/esm/kup-accordion.entry.js +3 -4
- package/dist/esm/kup-autocomplete_25.entry.js +30 -16
- package/dist/esm/kup-box.entry.js +14 -14
- package/dist/esm/kup-calendar.entry.js +5 -7
- package/dist/esm/kup-cell.entry.js +7 -9
- package/dist/esm/kup-dash-list.entry.js +2 -4
- package/dist/esm/kup-dash_2.entry.js +2 -3
- package/dist/esm/kup-dashboard.entry.js +74 -15
- package/dist/esm/kup-drawer.entry.js +2 -3
- package/dist/esm/kup-echart.entry.js +36 -28
- package/dist/esm/kup-family-tree.entry.js +138 -62
- package/dist/esm/kup-form.entry.js +18 -12
- package/dist/esm/kup-iframe.entry.js +2 -3
- package/dist/esm/kup-image-list.entry.js +8 -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-22a475e6.js → kup-manager-13b4f989.js} +1398 -376
- 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 +2 -3
- 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/assets/svg/azure.svg +1 -0
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/p-0986ad5d.js +1 -0
- package/dist/ketchup/{p-38d7584e.js → p-0cf10db0.js} +1 -1
- package/dist/ketchup/p-13666119.entry.js +27 -0
- package/dist/ketchup/p-18b68e86.entry.js +1 -0
- package/dist/ketchup/{p-1959f835.entry.js → p-28d514d0.entry.js} +1 -1
- package/dist/ketchup/p-2ffdbee1.entry.js +1 -0
- package/dist/ketchup/p-3dcfffbe.entry.js +1 -0
- package/dist/ketchup/p-3fe35411.entry.js +1 -0
- package/dist/ketchup/{p-cd5cfa7c.js → p-5552f156.js} +1 -1
- package/dist/ketchup/p-5f51009b.entry.js +1 -0
- package/dist/ketchup/{p-264b1b19.entry.js → p-816f0938.entry.js} +1 -1
- package/dist/ketchup/p-83c214d7.entry.js +1 -0
- package/dist/ketchup/p-84957bbf.entry.js +1 -0
- package/dist/ketchup/p-86795579.entry.js +1 -0
- package/dist/ketchup/p-8f85b8bb.entry.js +9 -0
- package/dist/ketchup/p-982d3e3a.entry.js +1 -0
- package/dist/ketchup/{p-e9366aaf.entry.js → p-adcfcd4f.entry.js} +4 -4
- package/dist/ketchup/p-b0b3989b.js +2 -0
- package/dist/ketchup/{p-dc62a30f.js → p-b705be3b.js} +1 -1
- package/dist/ketchup/{p-fc2b1229.js → p-b8c921ee.js} +3 -3
- package/dist/ketchup/{p-edae3076.js → p-bfe88b03.js} +1 -1
- package/dist/ketchup/p-d7091875.entry.js +1 -0
- package/dist/ketchup/p-d8656956.entry.js +1 -0
- package/dist/ketchup/p-dc69549c.entry.js +1 -0
- package/dist/ketchup/p-e01fa411.entry.js +1 -0
- package/dist/ketchup/p-e0f659c9.entry.js +1 -0
- package/dist/ketchup/p-e1d82570.entry.js +1 -0
- package/dist/ketchup/p-e21c744a.js +1 -0
- package/dist/ketchup/p-e5a9d60a.entry.js +1 -0
- package/dist/ketchup/p-f50cbed9.js +1 -0
- package/dist/ketchup/{p-42080355.entry.js → p-fa9f161a.entry.js} +1 -1
- package/dist/types/components/kup-box/kup-box-declarations.d.ts +1 -0
- package/dist/types/components/kup-button/kup-button-declarations.d.ts +1 -0
- package/dist/types/components/kup-button/kup-button.d.ts +5 -0
- package/dist/types/components/kup-dashboard/kup-dashboard.d.ts +6 -1
- package/dist/types/components/kup-family-tree/kup-family-tree-declarations.d.ts +7 -3
- package/dist/types/components/kup-family-tree/kup-family-tree.d.ts +26 -5
- package/dist/types/components/kup-form/kup-form-declarations.d.ts +1 -0
- package/dist/types/components/kup-form/kup-form.d.ts +5 -0
- package/dist/types/components/kup-text-field/kup-text-field-declarations.d.ts +1 -0
- package/dist/types/components/kup-text-field/kup-text-field.d.ts +5 -0
- package/dist/types/components.d.ts +69 -7
- package/dist/types/f-components/f-button/f-button-declarations.d.ts +1 -0
- package/dist/types/f-components/f-text-field/f-text-field-declarations.d.ts +1 -0
- package/dist/types/managers/kup-data/kup-data-cell-helper.d.ts +13 -6
- package/dist/types/managers/kup-data/kup-data.d.ts +3 -1
- 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/utils/filters/filters-rows.d.ts +0 -2
- package/dist/types/utils/filters/filters-tree-items.d.ts +1 -1
- package/package.json +2 -2
- package/dist/cjs/cell-utils-fe64a28c.js +0 -168
- package/dist/cjs/utils-4b208b48.js +0 -447
- package/dist/esm/cell-utils-cb5d4149.js +0 -160
- package/dist/esm/utils-2c1f4122.js +0 -428
- package/dist/ketchup/p-06c6cc68.js +0 -1
- package/dist/ketchup/p-0dacd4bc.entry.js +0 -1
- package/dist/ketchup/p-1c44dc62.entry.js +0 -1
- package/dist/ketchup/p-4bc9f98b.entry.js +0 -1
- package/dist/ketchup/p-578583db.entry.js +0 -1
- package/dist/ketchup/p-5866d507.entry.js +0 -1
- package/dist/ketchup/p-61059e9d.entry.js +0 -9
- package/dist/ketchup/p-664be494.entry.js +0 -1
- package/dist/ketchup/p-67cd575d.entry.js +0 -1
- package/dist/ketchup/p-682a367a.js +0 -1
- package/dist/ketchup/p-6ccf7eb2.entry.js +0 -1
- package/dist/ketchup/p-7230ab97.entry.js +0 -1
- package/dist/ketchup/p-752b4cef.entry.js +0 -1
- package/dist/ketchup/p-7de3e7ac.entry.js +0 -1
- package/dist/ketchup/p-928c5c36.js +0 -1
- package/dist/ketchup/p-9b36497d.entry.js +0 -1
- package/dist/ketchup/p-b982d137.entry.js +0 -1
- package/dist/ketchup/p-c0219e5e.js +0 -1
- package/dist/ketchup/p-c55fd0a7.entry.js +0 -1
- package/dist/ketchup/p-d154b3a0.entry.js +0 -1
- package/dist/ketchup/p-d2affb6f.entry.js +0 -27
- package/dist/ketchup/p-d3b542b3.js +0 -2
- package/dist/ketchup/p-d6c12c6c.js +0 -1
- package/dist/ketchup/p-da0eab60.entry.js +0 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, g as getElement } from './index-
|
|
2
|
-
import { k as kupManagerInstance } from './kup-manager-
|
|
3
|
-
import { g as getProps, s as setProps } from './utils-2c1f4122.js';
|
|
1
|
+
import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, g as getElement } from './index-e41330a5.js';
|
|
2
|
+
import { k as kupManagerInstance, g as getProps, s as setProps } from './kup-manager-13b4f989.js';
|
|
4
3
|
import { c as componentWrapperId } from './GenericVariables-665de00a.js';
|
|
5
4
|
|
|
6
5
|
const drawerClass = 'drawer';
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, g as getElement, a as getAssetPath } from './index-
|
|
2
|
-
import { k as kupManagerInstance, c as KupDebugCategory, b as KupThemeColorValues,
|
|
3
|
-
import { g as getProps, s as setProps } from './utils-2c1f4122.js';
|
|
1
|
+
import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, g as getElement, a as getAssetPath } from './index-e41330a5.js';
|
|
2
|
+
import { k as kupManagerInstance, g as getProps, s as setProps, c as KupDebugCategory, b as KupThemeColorValues, m as KupDataNewColumnTypes, t as getColumnByName } from './kup-manager-13b4f989.js';
|
|
4
3
|
import { c as componentWrapperId } from './GenericVariables-665de00a.js';
|
|
5
|
-
import { g as getColumnByName } from './cell-utils-cb5d4149.js';
|
|
6
4
|
|
|
7
5
|
/*! *****************************************************************************
|
|
8
6
|
Copyright (c) Microsoft Corporation.
|
|
@@ -93739,19 +93737,21 @@ _KupEchart_chartContainer = new WeakMap(), _KupEchart_chartEl = new WeakMap(), _
|
|
|
93739
93737
|
}
|
|
93740
93738
|
const y = {};
|
|
93741
93739
|
let objKey;
|
|
93742
|
-
|
|
93743
|
-
|
|
93744
|
-
|
|
93745
|
-
|
|
93746
|
-
const
|
|
93747
|
-
|
|
93748
|
-
|
|
93749
|
-
if (this.
|
|
93750
|
-
this.series
|
|
93751
|
-
|
|
93752
|
-
|
|
93740
|
+
if (this.axis) {
|
|
93741
|
+
for (const row of this.data.rows) {
|
|
93742
|
+
objKey = row.cells[this.axis].value;
|
|
93743
|
+
y[objKey] = [];
|
|
93744
|
+
for (const key of Object.keys(row.cells)) {
|
|
93745
|
+
const cell = row.cells[key];
|
|
93746
|
+
const value = cell.value;
|
|
93747
|
+
if (!this.axis.includes(key)) {
|
|
93748
|
+
if (this.series &&
|
|
93749
|
+
this.series.length > 0 &&
|
|
93750
|
+
!this.series.includes(key)) {
|
|
93751
|
+
continue;
|
|
93752
|
+
}
|
|
93753
|
+
y[objKey].push(value);
|
|
93753
93754
|
}
|
|
93754
|
-
y[objKey].push(value);
|
|
93755
93755
|
}
|
|
93756
93756
|
}
|
|
93757
93757
|
}
|
|
@@ -93815,6 +93815,12 @@ _KupEchart_chartContainer = new WeakMap(), _KupEchart_chartEl = new WeakMap(), _
|
|
|
93815
93815
|
'</div>');
|
|
93816
93816
|
}
|
|
93817
93817
|
};
|
|
93818
|
+
let axisColumn = __classPrivateFieldGet(this, _KupEchart_kupManager, "f").data.column.find(this.data, {
|
|
93819
|
+
name: this.axis,
|
|
93820
|
+
});
|
|
93821
|
+
let serieTitle = axisColumn && axisColumn.length > 0
|
|
93822
|
+
? axisColumn[0].title
|
|
93823
|
+
: 'No title';
|
|
93818
93824
|
const echartOption = Object.assign({ emphasis: {
|
|
93819
93825
|
label: {
|
|
93820
93826
|
show: true,
|
|
@@ -93847,9 +93853,7 @@ _KupEchart_chartContainer = new WeakMap(), _KupEchart_chartEl = new WeakMap(), _
|
|
|
93847
93853
|
padding: 4,
|
|
93848
93854
|
},
|
|
93849
93855
|
map: this.rootElement.id ? this.rootElement.id : '',
|
|
93850
|
-
name:
|
|
93851
|
-
name: this.axis,
|
|
93852
|
-
})[0].title,
|
|
93856
|
+
name: serieTitle,
|
|
93853
93857
|
roam: true,
|
|
93854
93858
|
select: {
|
|
93855
93859
|
itemStyle: {
|
|
@@ -93921,29 +93925,33 @@ _KupEchart_chartContainer = new WeakMap(), _KupEchart_chartEl = new WeakMap(), _
|
|
|
93921
93925
|
if (type == KupEchartTypes.GAUSSIAN) {
|
|
93922
93926
|
if (!__classPrivateFieldGet(this, _KupEchart_kupManager, "f").objects.isNumber(column.obj)) {
|
|
93923
93927
|
const newDataset = __classPrivateFieldGet(this, _KupEchart_kupManager, "f").data.distinct(this.data, [column.name]);
|
|
93924
|
-
values = __classPrivateFieldGet(this, _KupEchart_kupManager, "f").data.cell.
|
|
93925
|
-
column.name,
|
|
93926
|
-
]);
|
|
93928
|
+
values = __classPrivateFieldGet(this, _KupEchart_kupManager, "f").data.cell.getUnivocalValue(newDataset, column);
|
|
93927
93929
|
__classPrivateFieldGet(this, _KupEchart_gaussianDatasets, "f")[column.name] = newDataset;
|
|
93928
93930
|
}
|
|
93929
93931
|
else {
|
|
93930
|
-
values =
|
|
93932
|
+
values = [];
|
|
93933
|
+
for (let index = 0; index < y[key].length; index++) {
|
|
93934
|
+
const element = y[key][index];
|
|
93935
|
+
values.push({ value: element });
|
|
93936
|
+
}
|
|
93931
93937
|
}
|
|
93932
93938
|
}
|
|
93933
93939
|
else {
|
|
93934
93940
|
if (needSortDataset) {
|
|
93935
93941
|
// if there is only one series other than the Gaussian then I apply the sorting algorithm that arranges the data in "mountain"
|
|
93936
93942
|
__classPrivateFieldSet(this, _KupEchart_sortedDataset, __classPrivateFieldGet(this, _KupEchart_kupManager, "f").data.sort(this.data, 'normalDistribution', column.name), "f");
|
|
93937
|
-
values = __classPrivateFieldGet(this, _KupEchart_kupManager, "f").data.cell.getValue(__classPrivateFieldGet(this, _KupEchart_sortedDataset, "f"),
|
|
93943
|
+
values = __classPrivateFieldGet(this, _KupEchart_kupManager, "f").data.cell.getValue(__classPrivateFieldGet(this, _KupEchart_sortedDataset, "f"), column);
|
|
93938
93944
|
x = __classPrivateFieldGet(this, _KupEchart_instances, "m", _KupEchart_createX).call(this, __classPrivateFieldGet(this, _KupEchart_sortedDataset, "f"));
|
|
93939
93945
|
}
|
|
93940
93946
|
else {
|
|
93941
|
-
values = __classPrivateFieldGet(this, _KupEchart_kupManager, "f").data.cell.getValue(this.data,
|
|
93942
|
-
column.name,
|
|
93943
|
-
]);
|
|
93947
|
+
values = __classPrivateFieldGet(this, _KupEchart_kupManager, "f").data.cell.getValue(this.data, column);
|
|
93944
93948
|
}
|
|
93945
93949
|
}
|
|
93946
|
-
|
|
93950
|
+
const justValues = new Array();
|
|
93951
|
+
for (let i = 0; i < values.length; i++) {
|
|
93952
|
+
justValues.push(values[i].value);
|
|
93953
|
+
}
|
|
93954
|
+
__classPrivateFieldGet(this, _KupEchart_instances, "m", _KupEchart_addSeries).call(this, type, series, justValues, key, mixedSeries, needSortDataset);
|
|
93947
93955
|
i++;
|
|
93948
93956
|
}
|
|
93949
93957
|
// "any" because type is mismanaged inside echarts library
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, g as getElement } from './index-
|
|
2
|
-
import { F as FButton } from './f-button-
|
|
1
|
+
import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, g as getElement } from './index-e41330a5.js';
|
|
2
|
+
import { F as FButton } from './f-button-2d0a5f21.js';
|
|
3
3
|
import { F as FButtonStyling } from './f-button-declarations-b1b4cac4.js';
|
|
4
|
-
import {
|
|
5
|
-
import { g as getProps, s as setProps } from './
|
|
4
|
+
import { F as FImage } from './f-image-ab131d59.js';
|
|
5
|
+
import { k as kupManagerInstance, g as getProps, s as setProps, j as KupLanguageGeneric, N as KupPointerEventTypes } from './kup-manager-13b4f989.js';
|
|
6
6
|
import { c as componentWrapperId } from './GenericVariables-665de00a.js';
|
|
7
|
-
import './f-image-2ab4b9aa.js';
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
9
|
* Props of the kup-family-tree component.
|
|
@@ -12,14 +11,16 @@ import './f-image-2ab4b9aa.js';
|
|
|
12
11
|
*/
|
|
13
12
|
var KupFamilyTreeProps;
|
|
14
13
|
(function (KupFamilyTreeProps) {
|
|
15
|
-
KupFamilyTreeProps["
|
|
14
|
+
KupFamilyTreeProps["autofitOnExpand"] = "The component will autofit everytime a node is expanded.";
|
|
15
|
+
KupFamilyTreeProps["autofitOnLoad"] = "The component's initial render will fit the container by invoking the runAutofit method.";
|
|
16
16
|
KupFamilyTreeProps["collapsible"] = "Nodes can be expanded/collapsed.";
|
|
17
17
|
KupFamilyTreeProps["customStyle"] = "Custom style of the component.";
|
|
18
18
|
KupFamilyTreeProps["data"] = "Actual data of the component";
|
|
19
19
|
KupFamilyTreeProps["layout"] = "Layout of the boxes.";
|
|
20
|
+
KupFamilyTreeProps["stackedLeaves"] = "Child nodes that have no children are arranged vertically.";
|
|
20
21
|
})(KupFamilyTreeProps || (KupFamilyTreeProps = {}));
|
|
21
22
|
|
|
22
|
-
const kupFamilyTreeCss = ":host{--kup_familytree_item_background_color:var(\n --kup-familytree-item-background-color,\n var(--kup-
|
|
23
|
+
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}";
|
|
23
24
|
|
|
24
25
|
var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
25
26
|
if (kind === "a" && !f)
|
|
@@ -37,7 +38,7 @@ var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) ||
|
|
|
37
38
|
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
38
39
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
39
40
|
};
|
|
40
|
-
var _KupFamilyTree_instances, _KupFamilyTree_clickTimeout, _KupFamilyTree_hold, _KupFamilyTree_currentPanX, _KupFamilyTree_currentPanY, _KupFamilyTree_interactableTouch, _KupFamilyTree_kupManager, _KupFamilyTree_moveCb, _KupFamilyTree_wrapperEl, _KupFamilyTree_buildChildLine, _KupFamilyTree_buildNode, _KupFamilyTree_buildNodes, _KupFamilyTree_createTree, _KupFamilyTree_startPanning, _KupFamilyTree_getEventPath, _KupFamilyTree_getEventDetails, _KupFamilyTree_clickHandler, _KupFamilyTree_contextMenuHandler, _KupFamilyTree_dblClickHandler, _KupFamilyTree_didLoadInteractables, _KupFamilyTree_zoomTree
|
|
41
|
+
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;
|
|
41
42
|
const KupFamilyTree = class {
|
|
42
43
|
constructor(hostRef) {
|
|
43
44
|
registerInstance(this, hostRef);
|
|
@@ -49,10 +50,15 @@ const KupFamilyTree = class {
|
|
|
49
50
|
/* P r o p s */
|
|
50
51
|
/*-------------------------------------------------*/
|
|
51
52
|
/**
|
|
52
|
-
* The component
|
|
53
|
+
* The component will autofit everytime a node is expanded.
|
|
53
54
|
* @default true
|
|
54
55
|
*/
|
|
55
|
-
this.
|
|
56
|
+
this.autofitOnExpand = true;
|
|
57
|
+
/**
|
|
58
|
+
* The component's initial render will fit the container by invoking the runAutofit method.
|
|
59
|
+
* @default true
|
|
60
|
+
*/
|
|
61
|
+
this.autofitOnLoad = true;
|
|
56
62
|
/**
|
|
57
63
|
* Nodes can be expanded/collapsed.
|
|
58
64
|
* @default true
|
|
@@ -74,6 +80,11 @@ const KupFamilyTree = class {
|
|
|
74
80
|
* @default null
|
|
75
81
|
*/
|
|
76
82
|
this.layout = null;
|
|
83
|
+
/**
|
|
84
|
+
* Child nodes that have no children are arranged vertically.
|
|
85
|
+
* @default false
|
|
86
|
+
*/
|
|
87
|
+
this.stackedLeaves = false;
|
|
77
88
|
/*-------------------------------------------------*/
|
|
78
89
|
/* I n t e r n a l V a r i a b l e s */
|
|
79
90
|
/*-------------------------------------------------*/
|
|
@@ -91,11 +102,26 @@ const KupFamilyTree = class {
|
|
|
91
102
|
__classPrivateFieldSet(this, _KupFamilyTree_currentPanX, e.clientX, "f");
|
|
92
103
|
__classPrivateFieldSet(this, _KupFamilyTree_currentPanY, e.clientY, "f");
|
|
93
104
|
});
|
|
105
|
+
_KupFamilyTree_shouldAutofit.set(this, false);
|
|
94
106
|
_KupFamilyTree_wrapperEl.set(this, null);
|
|
95
107
|
}
|
|
96
108
|
/*-------------------------------------------------*/
|
|
97
109
|
/* P u b l i c M e t h o d s */
|
|
98
110
|
/*-------------------------------------------------*/
|
|
111
|
+
/**
|
|
112
|
+
* Collapses all nodes.
|
|
113
|
+
*/
|
|
114
|
+
async collapseAll(nodes = this.data.rows) {
|
|
115
|
+
__classPrivateFieldGet(this, _KupFamilyTree_kupManager, "f").data.node.setProperties(nodes, { isExpanded: false }, true);
|
|
116
|
+
this.refresh();
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Expands all nodes.
|
|
120
|
+
*/
|
|
121
|
+
async expandAll(nodes = this.data.rows) {
|
|
122
|
+
__classPrivateFieldGet(this, _KupFamilyTree_kupManager, "f").data.node.setProperties(nodes, { isExpanded: true }, true);
|
|
123
|
+
this.refresh();
|
|
124
|
+
}
|
|
99
125
|
/**
|
|
100
126
|
* Used to retrieve component's props values.
|
|
101
127
|
* @param {boolean} descriptions - When provided and true, the result will be the list of props with their description.
|
|
@@ -110,6 +136,35 @@ const KupFamilyTree = class {
|
|
|
110
136
|
async refresh() {
|
|
111
137
|
forceUpdate(this);
|
|
112
138
|
}
|
|
139
|
+
/**
|
|
140
|
+
* This method causes the component to autofit its container's width.
|
|
141
|
+
*/
|
|
142
|
+
async runAutofit() {
|
|
143
|
+
const parentWidth = __classPrivateFieldGet(this, _KupFamilyTree_wrapperEl, "f").clientWidth;
|
|
144
|
+
const childWidth = __classPrivateFieldGet(this, _KupFamilyTree_wrapperEl, "f").children[0].clientWidth;
|
|
145
|
+
const multiplierStep = 0.01;
|
|
146
|
+
const minWidth = (85 / 100) * parentWidth;
|
|
147
|
+
const maxWidth = (95 / 100) * parentWidth;
|
|
148
|
+
let multiplier = 1;
|
|
149
|
+
let tooManyAttempts = 2000;
|
|
150
|
+
let tempWidth = childWidth;
|
|
151
|
+
while ((tempWidth < minWidth || tempWidth > maxWidth) &&
|
|
152
|
+
tooManyAttempts > 0 &&
|
|
153
|
+
multiplier > multiplierStep) {
|
|
154
|
+
tooManyAttempts--;
|
|
155
|
+
if (tempWidth < minWidth) {
|
|
156
|
+
multiplier = multiplier + multiplierStep;
|
|
157
|
+
}
|
|
158
|
+
else if (tempWidth > maxWidth) {
|
|
159
|
+
multiplier = multiplier - multiplierStep;
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
tooManyAttempts = 0;
|
|
163
|
+
}
|
|
164
|
+
tempWidth = childWidth * multiplier;
|
|
165
|
+
}
|
|
166
|
+
__classPrivateFieldGet(this, _KupFamilyTree_wrapperEl, "f").style.setProperty('--kup_familytree_scale', multiplier <= 1 ? multiplier.toFixed(2) : '1');
|
|
167
|
+
}
|
|
113
168
|
/**
|
|
114
169
|
* Sets the props to the component.
|
|
115
170
|
* @param {GenericObject} props - Object containing props that will be set to the component.
|
|
@@ -127,12 +182,8 @@ const KupFamilyTree = class {
|
|
|
127
182
|
}
|
|
128
183
|
componentDidLoad() {
|
|
129
184
|
__classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_didLoadInteractables).call(this);
|
|
130
|
-
if (this.
|
|
131
|
-
|
|
132
|
-
const childWidth = __classPrivateFieldGet(this, _KupFamilyTree_wrapperEl, "f").children[0].clientWidth;
|
|
133
|
-
if (childWidth > parentWidth) {
|
|
134
|
-
__classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_autofit).call(this, parentWidth, childWidth);
|
|
135
|
-
}
|
|
185
|
+
if (this.autofitOnLoad) {
|
|
186
|
+
this.runAutofit();
|
|
136
187
|
}
|
|
137
188
|
__classPrivateFieldGet(this, _KupFamilyTree_kupManager, "f").debug.logLoad(this, true);
|
|
138
189
|
}
|
|
@@ -140,6 +191,10 @@ const KupFamilyTree = class {
|
|
|
140
191
|
__classPrivateFieldGet(this, _KupFamilyTree_kupManager, "f").debug.logRender(this, false);
|
|
141
192
|
}
|
|
142
193
|
componentDidRender() {
|
|
194
|
+
if (__classPrivateFieldGet(this, _KupFamilyTree_shouldAutofit, "f")) {
|
|
195
|
+
__classPrivateFieldSet(this, _KupFamilyTree_shouldAutofit, false, "f");
|
|
196
|
+
this.runAutofit();
|
|
197
|
+
}
|
|
143
198
|
__classPrivateFieldGet(this, _KupFamilyTree_kupManager, "f").debug.logRender(this, true);
|
|
144
199
|
}
|
|
145
200
|
render() {
|
|
@@ -147,7 +202,6 @@ const KupFamilyTree = class {
|
|
|
147
202
|
e.preventDefault();
|
|
148
203
|
__classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_startPanning).call(this, e);
|
|
149
204
|
}, onWheel: (e) => {
|
|
150
|
-
e.preventDefault();
|
|
151
205
|
__classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_zoomTree).call(this, e);
|
|
152
206
|
} }, h("style", null, __classPrivateFieldGet(this, _KupFamilyTree_kupManager, "f").theme.setKupStyle(this.rootElement)), h("div", { id: componentWrapperId }, __classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_createTree).call(this))));
|
|
153
207
|
}
|
|
@@ -157,7 +211,7 @@ const KupFamilyTree = class {
|
|
|
157
211
|
}
|
|
158
212
|
get rootElement() { return getElement(this); }
|
|
159
213
|
};
|
|
160
|
-
_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_wrapperEl = new WeakMap(), _KupFamilyTree_instances = new WeakSet(), _KupFamilyTree_buildChildLine = function _KupFamilyTree_buildChildLine(first, last, alone, moreTwo) {
|
|
214
|
+
_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) {
|
|
161
215
|
const content = [];
|
|
162
216
|
content.push(h("td", { class: {
|
|
163
217
|
'family-tree__line': true,
|
|
@@ -190,6 +244,9 @@ _KupFamilyTree_clickTimeout = new WeakMap(), _KupFamilyTree_hold = new WeakMap()
|
|
|
190
244
|
}
|
|
191
245
|
});
|
|
192
246
|
}
|
|
247
|
+
const stacked = this.stackedLeaves &&
|
|
248
|
+
children &&
|
|
249
|
+
children.every((c) => !c.children || c.children.length == 0);
|
|
193
250
|
const span1 = children ? children.length * 2 : 1;
|
|
194
251
|
const styleVLine = {
|
|
195
252
|
'family-tree__line': true,
|
|
@@ -203,24 +260,43 @@ _KupFamilyTree_clickTimeout = new WeakMap(), _KupFamilyTree_hold = new WeakMap()
|
|
|
203
260
|
],
|
|
204
261
|
rows: [{ cells: Object.assign({ '*TREECOL': node }, node.cells) }],
|
|
205
262
|
};
|
|
206
|
-
const layout = node.layout || this.layout ||
|
|
207
|
-
const
|
|
263
|
+
const layout = node.layout || this.layout || 1;
|
|
264
|
+
const expandButtonProps = {
|
|
208
265
|
icon: node.isExpanded ? 'remove' : 'plus',
|
|
209
|
-
|
|
266
|
+
shaped: true,
|
|
210
267
|
slim: true,
|
|
211
|
-
|
|
268
|
+
styling: FButtonStyling.OUTLINED,
|
|
269
|
+
title: `${__classPrivateFieldGet(this, _KupFamilyTree_kupManager, "f").language.translate(KupLanguageGeneric.EXPAND)}/${__classPrivateFieldGet(this, _KupFamilyTree_kupManager, "f").language.translate(KupLanguageGeneric.COLLAPSE)} (CTRL + Click)`,
|
|
270
|
+
onClick: (e) => {
|
|
271
|
+
if (e.ctrlKey && node.children && node.children.length > 0) {
|
|
272
|
+
if (node.isExpanded) {
|
|
273
|
+
this.collapseAll(node.children);
|
|
274
|
+
}
|
|
275
|
+
else {
|
|
276
|
+
this.expandAll(node.children);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
212
279
|
node.isExpanded = !node.isExpanded;
|
|
280
|
+
if (this.autofitOnExpand) {
|
|
281
|
+
__classPrivateFieldSet(this, _KupFamilyTree_shouldAutofit, true, "f");
|
|
282
|
+
}
|
|
213
283
|
this.refresh();
|
|
214
284
|
},
|
|
285
|
+
wrapperClass: 'family-tree__item__expand',
|
|
215
286
|
};
|
|
216
|
-
const box = (h("div", { class: 'family-tree__item' }, h("div", { class: 'family-tree__item__wrapper' }, h("kup-box", { class: "kup-borderless kup-paddingless", customStyle: "#kup-component { background: var(--kup_familytree_item_background_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 }), this.collapsible &&
|
|
287
|
+
const box = (h("div", { class: 'family-tree__item' }, h("div", { class: 'family-tree__item__wrapper' }, __classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_isBoxLayout).call(this, layout) ? (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 &&
|
|
217
288
|
node.children &&
|
|
218
|
-
node.children.length > 0 ? (h(FButton, Object.assign({},
|
|
289
|
+
node.children.length > 0 ? (h(FButton, Object.assign({}, expandButtonProps))) : undefined)));
|
|
219
290
|
const staffStyle = {
|
|
220
291
|
['--kup_familytree_staffchildren']: (staffChildren === null || staffChildren === void 0 ? void 0 : staffChildren.length.toString()) || '0',
|
|
221
292
|
};
|
|
222
293
|
//TODO: set data-cell and data-column if needed inside events
|
|
223
|
-
return (h("table", { class:
|
|
294
|
+
return (h("table", { class: {
|
|
295
|
+
'family-tree__node': true,
|
|
296
|
+
'family-tree__node--stacked': this.stackedLeaves &&
|
|
297
|
+
!node.isStaff &&
|
|
298
|
+
(!node.children || node.children.length == 0),
|
|
299
|
+
} }, h("tr", null, h("td", { "data-row": node, colSpan: span1 }, box)), h("tr", null, h("td", { colSpan: span1 }, h("div", { class: styleVLine }))), staffChildren
|
|
224
300
|
? [
|
|
225
301
|
h("tr", null, h("td", { colSpan: span1 }, h("div", { class: Object.assign(Object.assign({}, styleVLine), { 'family-tree__line--staff': true }), style: staffStyle }), h("div", { class: "family-tree__node__staff", style: staffStyle }, staffChildren.map((inode) => [
|
|
226
302
|
h("div", { class: "family-tree__node__staff__item" }, __classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_buildNode).call(this, inode)),
|
|
@@ -229,15 +305,25 @@ _KupFamilyTree_clickTimeout = new WeakMap(), _KupFamilyTree_hold = new WeakMap()
|
|
|
229
305
|
: null, staffChildren && children
|
|
230
306
|
? [
|
|
231
307
|
h("tr", null, h("td", { colSpan: span1 }, h("div", { class: styleVLine }))),
|
|
232
|
-
h("tr", null, h("td", { colSpan: span1 }, h("div", { class: styleVLine }))),
|
|
233
308
|
]
|
|
234
309
|
: null, children
|
|
235
310
|
? [
|
|
236
|
-
h("tr", null, children.map((inode) => __classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_buildChildLine).call(this, children.indexOf(inode) == 0, children.indexOf(inode) ==
|
|
237
|
-
children.length - 1, children.length == 1, children.length > 2))),
|
|
238
|
-
h("tr", null, children.map((inode) => (h("td", { colSpan: 2 }, __classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_buildNode).call(this, inode))))),
|
|
311
|
+
h("tr", null, stacked ? (h("td", { colSpan: span1 }, h("div", { class: styleVLine }))) : (children.map((inode) => __classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_buildChildLine).call(this, children.indexOf(inode) == 0, children.indexOf(inode) ==
|
|
312
|
+
children.length - 1, children.length == 1, children.length > 2)))),
|
|
313
|
+
h("tr", null, stacked ? (h("td", { colSpan: span1 }, children.map((inode) => __classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_buildNode).call(this, inode)))) : (children.map((inode) => (h("td", { colSpan: 2 }, __classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_buildNode).call(this, inode)))))),
|
|
239
314
|
]
|
|
240
315
|
: undefined));
|
|
316
|
+
}, _KupFamilyTree_buildNodeLayout = function _KupFamilyTree_buildNodeLayout(node, layout) {
|
|
317
|
+
switch (layout) {
|
|
318
|
+
case 2:
|
|
319
|
+
return __classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_buildNodeLayout2).call(this, node);
|
|
320
|
+
default:
|
|
321
|
+
return __classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_buildNodeLayout1).call(this, node);
|
|
322
|
+
}
|
|
323
|
+
}, _KupFamilyTree_buildNodeLayout1 = function _KupFamilyTree_buildNodeLayout1(node) {
|
|
324
|
+
return (h("div", { class: `family-tree__item__layout family-tree__item__layout--1` }, h("div", { class: 'family-tree__item__layout__text__title' }, node.value)));
|
|
325
|
+
}, _KupFamilyTree_buildNodeLayout2 = function _KupFamilyTree_buildNodeLayout2(node) {
|
|
326
|
+
return (h("div", { class: `family-tree__item__layout family-tree__item__layout--2` }, h("div", { class: 'family-tree__item__layout__color' }), h("div", { class: 'family-tree__item__layout__image' }, h(FImage, { resource: node.icon, sizeX: "48px", sizeY: "48px" })), h("div", { class: 'family-tree__item__layout__text' }, h("div", { class: 'family-tree__item__layout__text__title' }, node.value), node.title ? (h("div", { class: 'family-tree__item__layout__text__subtitle' }, node.title)) : null)));
|
|
241
327
|
}, _KupFamilyTree_buildNodes = function _KupFamilyTree_buildNodes(nodes) {
|
|
242
328
|
return nodes.map((node) => __classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_buildNode).call(this, node));
|
|
243
329
|
}, _KupFamilyTree_createTree = function _KupFamilyTree_createTree() {
|
|
@@ -245,12 +331,17 @@ _KupFamilyTree_clickTimeout = new WeakMap(), _KupFamilyTree_hold = new WeakMap()
|
|
|
245
331
|
return (h("div", { class: "family-tree", onContextMenu: (e) => {
|
|
246
332
|
e.preventDefault();
|
|
247
333
|
}, ref: (el) => (__classPrivateFieldSet(this, _KupFamilyTree_wrapperEl, el, "f")) }, emptyData ? (h("div", null, __classPrivateFieldGet(this, _KupFamilyTree_kupManager, "f").language.translate(KupLanguageGeneric.EMPTY_DATA))) : (__classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_buildNodes).call(this, this.data.rows))));
|
|
334
|
+
}, _KupFamilyTree_isBoxLayout = function _KupFamilyTree_isBoxLayout(layout) {
|
|
335
|
+
const tmp = layout;
|
|
336
|
+
return tmp && tmp.sections && tmp.sections.length > 0;
|
|
248
337
|
}, _KupFamilyTree_startPanning = function _KupFamilyTree_startPanning(e) {
|
|
249
338
|
__classPrivateFieldSet(this, _KupFamilyTree_currentPanX, e.clientX, "f");
|
|
250
339
|
__classPrivateFieldSet(this, _KupFamilyTree_currentPanY, e.clientY, "f");
|
|
340
|
+
__classPrivateFieldGet(this, _KupFamilyTree_wrapperEl, "f").classList.add('family-tree--dragging');
|
|
251
341
|
const endPanning = () => {
|
|
252
342
|
document.removeEventListener('pointermove', __classPrivateFieldGet(this, _KupFamilyTree_moveCb, "f"));
|
|
253
343
|
document.removeEventListener('pointerup', endPanning);
|
|
344
|
+
__classPrivateFieldGet(this, _KupFamilyTree_wrapperEl, "f").classList.remove('family-tree--dragging');
|
|
254
345
|
};
|
|
255
346
|
document.addEventListener('pointermove', __classPrivateFieldGet(this, _KupFamilyTree_moveCb, "f"));
|
|
256
347
|
document.addEventListener('pointerup', endPanning);
|
|
@@ -266,16 +357,20 @@ _KupFamilyTree_clickTimeout = new WeakMap(), _KupFamilyTree_hold = new WeakMap()
|
|
|
266
357
|
}
|
|
267
358
|
return path;
|
|
268
359
|
}, _KupFamilyTree_getEventDetails = function _KupFamilyTree_getEventDetails(path, e) {
|
|
360
|
+
let expandButton;
|
|
269
361
|
let td;
|
|
270
362
|
if (path) {
|
|
271
363
|
for (let i = path.length - 1; i >= 0; i--) {
|
|
272
|
-
|
|
273
|
-
if (!
|
|
364
|
+
const el = path[i];
|
|
365
|
+
if (!el.tagName) {
|
|
274
366
|
continue;
|
|
275
367
|
}
|
|
276
|
-
|
|
368
|
+
if (el.classList.contains('family-tree__item__expand')) {
|
|
369
|
+
expandButton = el;
|
|
370
|
+
}
|
|
371
|
+
switch (el.tagName.toUpperCase()) {
|
|
277
372
|
case 'TD': {
|
|
278
|
-
td =
|
|
373
|
+
td = el;
|
|
279
374
|
break;
|
|
280
375
|
}
|
|
281
376
|
}
|
|
@@ -290,6 +385,7 @@ _KupFamilyTree_clickTimeout = new WeakMap(), _KupFamilyTree_hold = new WeakMap()
|
|
|
290
385
|
return {
|
|
291
386
|
cell: cell ? cell : null,
|
|
292
387
|
column: column ? column : null,
|
|
388
|
+
expandButton: expandButton ? expandButton : null,
|
|
293
389
|
originalEvent: e,
|
|
294
390
|
row: row ? row : null,
|
|
295
391
|
td: td ? td : null,
|
|
@@ -369,37 +465,17 @@ _KupFamilyTree_clickTimeout = new WeakMap(), _KupFamilyTree_hold = new WeakMap()
|
|
|
369
465
|
__classPrivateFieldGet(this, _KupFamilyTree_kupManager, "f").interact.on(this.rootElement, KupPointerEventTypes.TAP, tapCb);
|
|
370
466
|
__classPrivateFieldGet(this, _KupFamilyTree_kupManager, "f").interact.on(this.rootElement, KupPointerEventTypes.DOUBLETAP, doubletapCb);
|
|
371
467
|
__classPrivateFieldGet(this, _KupFamilyTree_kupManager, "f").interact.on(this.rootElement, KupPointerEventTypes.HOLD, holdCb);
|
|
372
|
-
}, _KupFamilyTree_zoomTree = function _KupFamilyTree_zoomTree(
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
value = delta;
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
}, _KupFamilyTree_autofit = function _KupFamilyTree_autofit(parentWidth, childWidth) {
|
|
381
|
-
const multiplierStep = 0.01;
|
|
382
|
-
const minWidth = (85 / 100) * parentWidth;
|
|
383
|
-
const maxWidth = (95 / 100) * parentWidth;
|
|
384
|
-
let multiplier = 1;
|
|
385
|
-
let tooManyAttempts = 2000;
|
|
386
|
-
let tempWidth = childWidth;
|
|
387
|
-
while ((tempWidth < minWidth || tempWidth > maxWidth) &&
|
|
388
|
-
tooManyAttempts > 0 &&
|
|
389
|
-
multiplier > multiplierStep) {
|
|
390
|
-
tooManyAttempts--;
|
|
391
|
-
if (tempWidth < minWidth) {
|
|
392
|
-
multiplier = multiplier + multiplierStep;
|
|
393
|
-
}
|
|
394
|
-
else if (tempWidth > maxWidth) {
|
|
395
|
-
multiplier = multiplier - multiplierStep;
|
|
396
|
-
}
|
|
397
|
-
else {
|
|
398
|
-
tooManyAttempts = 0;
|
|
468
|
+
}, _KupFamilyTree_zoomTree = function _KupFamilyTree_zoomTree(e) {
|
|
469
|
+
if (e.ctrlKey) {
|
|
470
|
+
e.preventDefault();
|
|
471
|
+
const currentScale = parseFloat(__classPrivateFieldGet(this, _KupFamilyTree_wrapperEl, "f").style.getPropertyValue('--kup_familytree_scale')) || 1;
|
|
472
|
+
const delta = 0.05;
|
|
473
|
+
let value = e.deltaY > 0 ? currentScale - delta : currentScale + delta;
|
|
474
|
+
if (value < delta) {
|
|
475
|
+
value = delta;
|
|
399
476
|
}
|
|
400
|
-
|
|
477
|
+
__classPrivateFieldGet(this, _KupFamilyTree_wrapperEl, "f").style.setProperty('--kup_familytree_scale', value.toFixed(2));
|
|
401
478
|
}
|
|
402
|
-
__classPrivateFieldGet(this, _KupFamilyTree_wrapperEl, "f").style.setProperty('--kup_familytree_scale', multiplier.toFixed(2));
|
|
403
479
|
};
|
|
404
480
|
KupFamilyTree.style = kupFamilyTreeCss;
|
|
405
481
|
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { r as registerInstance, f as forceUpdate, h, H as Host, g as getElement } from './index-
|
|
2
|
-
import { k as kupManagerInstance,
|
|
3
|
-
import { i as identify, g as getProps, s as setProps } from './utils-2c1f4122.js';
|
|
1
|
+
import { r as registerInstance, f as forceUpdate, h, H as Host, g as getElement } from './index-e41330a5.js';
|
|
2
|
+
import { k as kupManagerInstance, y as identify, g as getProps, s as setProps, al as FCellTypes, j as KupLanguageGeneric } from './kup-manager-13b4f989.js';
|
|
4
3
|
import { c as componentWrapperId } from './GenericVariables-665de00a.js';
|
|
5
|
-
import { F as FCell } from './f-cell-
|
|
4
|
+
import { F as FCell } from './f-cell-ee7d7b5c.js';
|
|
6
5
|
import { F as FTextFieldMDC } from './f-text-field-mdc-d42d3f9e.js';
|
|
7
|
-
import './
|
|
8
|
-
import './f-checkbox-
|
|
9
|
-
import './f-text-field-
|
|
10
|
-
import './f-image-
|
|
11
|
-
import './f-chip-
|
|
6
|
+
import { F as FButton } from './f-button-2d0a5f21.js';
|
|
7
|
+
import './f-checkbox-e06cf07b.js';
|
|
8
|
+
import './f-text-field-0729b19f.js';
|
|
9
|
+
import './f-image-ab131d59.js';
|
|
10
|
+
import './f-chip-0d29f91f.js';
|
|
12
11
|
import './tslib.es6-3eea2234.js';
|
|
13
12
|
import './component-b1bedf1d.js';
|
|
13
|
+
import './f-button-declarations-b1b4cac4.js';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Props of the kup-form component.
|
|
@@ -20,6 +20,7 @@ var KupFormProps;
|
|
|
20
20
|
(function (KupFormProps) {
|
|
21
21
|
KupFormProps["customStyle"] = "Custom style of the component.";
|
|
22
22
|
KupFormProps["data"] = "Actual data of the form.";
|
|
23
|
+
KupFormProps["hiddenSubmitButton"] = "Creates a hidden submit button in order to submit the form with enter.";
|
|
23
24
|
KupFormProps["layout"] = "How the form will arrange its content.";
|
|
24
25
|
})(KupFormProps || (KupFormProps = {}));
|
|
25
26
|
var KupFormLabelAlignment;
|
|
@@ -38,7 +39,7 @@ var KupFormLabelPlacement;
|
|
|
38
39
|
KupFormLabelPlacement["TOP"] = "top";
|
|
39
40
|
})(KupFormLabelPlacement || (KupFormLabelPlacement = {}));
|
|
40
41
|
|
|
41
|
-
const kupFormCss = ":host{--kup_form_background_color:var(\n --kup-form-background-color,\n var(--kup-background-color)\n );--kup_form_color:var(--kup-form-color, var(--kup-text-color));--kup_form_font_family:var(--kup-form-font-family, var(--kup-font-family));--kup_form_font_size:var(--kup-form-font-size, var(--kup-font-size));--kup_form_label_alignment:var(--kup-form-label-alignment);--kup_form_label_width:var(--kup-form-label-width);display:block;font-family:var(--kup_form_font_family);font-size:var(--kup_form_font_size)}.form{background:var(--kup_form_background_color);color:var(--kup_form_color);display:flex;flex-grow:1;overflow:auto;position:relative}.form--column{flex-direction:column}.form__section{display:flex;flex:1 1 1%;flex-direction:row;flex-wrap:wrap}.form__section--column{flex-direction:column;flex-wrap:unset}.form__section--column>.form__section{flex:0 0 auto}.form__section--grid{display:grid}.form__section--titled{border:1px solid var(--kup-border-color);padding-top:5px;position:relative;margin:10px}.form__section--titled>h3{background:var(--kup-background-color);font-size:calc(var(--kup-font-size) * 1.15);position:absolute;margin:0px;padding:0 8px;top:-11px;left:5px;transition:background-color 0.25s ease}.form__section--left .form__label{width:var(--kup_form_label_width, 0)}.form__section--right .form__field{min-width:200px;width:0}.form__label{-webkit-font-smoothing:antialiased;box-sizing:border-box;font-size:0.875em;letter-spacing:0.0178571429em;white-space:nowrap;width:var(--kup_form_label_width)}.form__label--center{text-align:var(--kup_form_label_alignment, center)}.form__label--left{text-align:var(--kup_form_label_alignment, left)}.form__label--right{text-align:var(--kup_form_label_alignment, right)}.form__field{min-height:16px}.form__field img{height:auto}.form .f-cell.c-right-aligned:not(.c-centered) .f-cell__content{justify-content:flex-start}";
|
|
42
|
+
const kupFormCss = ":host{--kup_form_background_color:var(\n --kup-form-background-color,\n var(--kup-background-color)\n );--kup_form_color:var(--kup-form-color, var(--kup-text-color));--kup_form_font_family:var(--kup-form-font-family, var(--kup-font-family));--kup_form_font_size:var(--kup-form-font-size, var(--kup-font-size));--kup_form_label_alignment:var(--kup-form-label-alignment);--kup_form_label_width:var(--kup-form-label-width);display:block;font-family:var(--kup_form_font_family);font-size:var(--kup_form_font_size)}.form{background:var(--kup_form_background_color);color:var(--kup_form_color);display:flex;flex-grow:1;overflow:auto;padding:1em 0;position:relative}.form--column{flex-direction:column}.form__section{display:flex;flex:1 1 1%;flex-direction:row;flex-wrap:wrap}.form__section--column{flex-direction:column;flex-wrap:unset}.form__section--column>.form__section{flex:0 0 auto}.form__section--grid{display:grid}.form__section--titled{border:1px solid var(--kup-border-color);padding-top:5px;position:relative;margin:10px}.form__section--titled>h3{background:var(--kup-background-color);font-size:calc(var(--kup-font-size) * 1.15);position:absolute;margin:0px;padding:0 8px;top:-11px;left:5px;transition:background-color 0.25s ease}.form__section--left .form__label{width:var(--kup_form_label_width, 0)}.form__section--right .form__field{min-width:200px;width:0}.form__label{-webkit-font-smoothing:antialiased;box-sizing:border-box;font-size:0.875em;letter-spacing:0.0178571429em;white-space:nowrap;width:var(--kup_form_label_width)}.form__label--center{text-align:var(--kup_form_label_alignment, center)}.form__label--left{text-align:var(--kup_form_label_alignment, left)}.form__label--right{text-align:var(--kup_form_label_alignment, right)}.form__field{min-height:16px}.form__field img{height:auto}.form__submit{height:0;opacity:0;overflow:hidden;position:absolute;width:0}.form .f-cell.c-right-aligned:not(.c-centered) .f-cell__content{justify-content:flex-start}";
|
|
42
43
|
|
|
43
44
|
const dom = document.documentElement;
|
|
44
45
|
const KupForm = class {
|
|
@@ -58,6 +59,11 @@ const KupForm = class {
|
|
|
58
59
|
* @default null
|
|
59
60
|
*/
|
|
60
61
|
this.data = null;
|
|
62
|
+
/**
|
|
63
|
+
* Creates a hidden submit button in order to submit the form with enter.
|
|
64
|
+
* @default false
|
|
65
|
+
*/
|
|
66
|
+
this.hiddenSubmitButton = false;
|
|
61
67
|
/**
|
|
62
68
|
* How the form will arrange its content.
|
|
63
69
|
* @default null
|
|
@@ -201,7 +207,7 @@ const KupForm = class {
|
|
|
201
207
|
form: true,
|
|
202
208
|
'form--column': !horizontal,
|
|
203
209
|
};
|
|
204
|
-
return h("form", { class: classObj }, formContent);
|
|
210
|
+
return (h("form", { class: classObj, name: this.rootElement.id }, formContent, this.hiddenSubmitButton ? (h(FButton, { buttonType: "submit", label: "submit", wrapperClass: "form__submit" })) : null));
|
|
205
211
|
}
|
|
206
212
|
renderSection(section, parent, row, visibleColumns) {
|
|
207
213
|
var _a;
|
|
@@ -312,7 +318,7 @@ const KupForm = class {
|
|
|
312
318
|
return null;
|
|
313
319
|
}
|
|
314
320
|
const cellProps = {
|
|
315
|
-
cell:
|
|
321
|
+
cell: cell,
|
|
316
322
|
column: column,
|
|
317
323
|
component: this,
|
|
318
324
|
editable: true,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, g as getElement } from './index-
|
|
2
|
-
import { k as kupManagerInstance, c as KupDebugCategory } from './kup-manager-
|
|
3
|
-
import { g as getProps, s as setProps } from './utils-2c1f4122.js';
|
|
1
|
+
import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, g as getElement } from './index-e41330a5.js';
|
|
2
|
+
import { k as kupManagerInstance, g as getProps, s as setProps, c as KupDebugCategory } from './kup-manager-13b4f989.js';
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* Props of the kup-iframe component.
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, g as getElement } from './index-
|
|
2
|
-
import { k as kupManagerInstance,
|
|
3
|
-
import { g as getProps, s as setProps } from './utils-2c1f4122.js';
|
|
1
|
+
import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, g as getElement } from './index-e41330a5.js';
|
|
2
|
+
import { k as kupManagerInstance, g as getProps, s as setProps, j as KupLanguageGeneric, I as FCellPadding } from './kup-manager-13b4f989.js';
|
|
4
3
|
import { c as componentWrapperId } from './GenericVariables-665de00a.js';
|
|
5
|
-
import { F as FImage } from './f-image-
|
|
6
|
-
import { F as FButton } from './f-button-
|
|
4
|
+
import { F as FImage } from './f-image-ab131d59.js';
|
|
5
|
+
import { F as FButton } from './f-button-2d0a5f21.js';
|
|
7
6
|
import { F as FButtonStyling } from './f-button-declarations-b1b4cac4.js';
|
|
8
|
-
import { F as FCell } from './f-cell-
|
|
7
|
+
import { F as FCell } from './f-cell-ee7d7b5c.js';
|
|
9
8
|
import { M as MDCRipple } from './component-b1bedf1d.js';
|
|
10
|
-
import './
|
|
11
|
-
import './f-
|
|
12
|
-
import './f-
|
|
13
|
-
import './f-chip-c2e4c522.js';
|
|
9
|
+
import './f-checkbox-e06cf07b.js';
|
|
10
|
+
import './f-text-field-0729b19f.js';
|
|
11
|
+
import './f-chip-0d29f91f.js';
|
|
14
12
|
import './tslib.es6-3eea2234.js';
|
|
15
13
|
|
|
16
14
|
/**
|