@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
|
@@ -142,6 +142,7 @@ export class KupDashboard {
|
|
|
142
142
|
onChange: (e) => {
|
|
143
143
|
const { target } = e;
|
|
144
144
|
section.dim = target.value;
|
|
145
|
+
this.refresh();
|
|
145
146
|
},
|
|
146
147
|
};
|
|
147
148
|
const addButtonProp = {
|
|
@@ -227,6 +228,25 @@ export class KupDashboard {
|
|
|
227
228
|
? section.sections.map((childSection) => this.buildSection(childSection, section))
|
|
228
229
|
: undefined)));
|
|
229
230
|
}
|
|
231
|
+
calcSectionPosition(pointerY, pointerX, vertical, sectionCount, elements) {
|
|
232
|
+
let idx = sectionCount;
|
|
233
|
+
for (let index = 0; index < elements.length; index++) {
|
|
234
|
+
const element = elements[index];
|
|
235
|
+
const srect = element.getBoundingClientRect();
|
|
236
|
+
if (vertical && pointerY < srect.y) {
|
|
237
|
+
idx = index;
|
|
238
|
+
break;
|
|
239
|
+
}
|
|
240
|
+
else if (!vertical && pointerX < srect.x) {
|
|
241
|
+
idx = index;
|
|
242
|
+
break;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
//console.log(
|
|
246
|
+
// `pointer: ${pointerX}:${pointerY} - vertical: ${vertical} - index: ${idx}`
|
|
247
|
+
//);
|
|
248
|
+
return idx;
|
|
249
|
+
}
|
|
230
250
|
didRenderInteractables() {
|
|
231
251
|
try {
|
|
232
252
|
const items = [];
|
|
@@ -249,9 +269,17 @@ export class KupDashboard {
|
|
|
249
269
|
.querySelectorAll('.form-dropzone')
|
|
250
270
|
.forEach((x) => items.push(x));
|
|
251
271
|
items.forEach((item) => {
|
|
252
|
-
this.kupManager.interact.dropzone(item,
|
|
272
|
+
this.kupManager.interact.dropzone(item, {
|
|
273
|
+
ondropdeactivate: () => {
|
|
274
|
+
this.removeSectionPlaceHolder();
|
|
275
|
+
},
|
|
276
|
+
ondropmove: (ev) => {
|
|
277
|
+
this.removeSectionPlaceHolder();
|
|
278
|
+
this.dragEnter(ev.dragEvent.clientY, ev.dragEvent.clientX, ev.currentTarget);
|
|
279
|
+
},
|
|
280
|
+
}, null, {
|
|
253
281
|
drop: (ev) => {
|
|
254
|
-
this.dropped(ev.currentTarget, ev.relatedTarget);
|
|
282
|
+
this.dropped(ev, ev.currentTarget, ev.relatedTarget);
|
|
255
283
|
},
|
|
256
284
|
});
|
|
257
285
|
});
|
|
@@ -260,14 +288,33 @@ export class KupDashboard {
|
|
|
260
288
|
this.kupManager.debug.logMessage(this, error, KupDebugCategory.ERROR);
|
|
261
289
|
}
|
|
262
290
|
}
|
|
263
|
-
|
|
291
|
+
dragEnter(clientY, clientX, parent) {
|
|
292
|
+
if (parent.kupData.form) {
|
|
293
|
+
// form is the target of drop.
|
|
294
|
+
// calculate a new position for the section.
|
|
295
|
+
const nidx = this.calcSectionPosition(clientY, clientX, parent.kupData.form.layout == 'column', parent.kupData.form.sections.length, parent.children);
|
|
296
|
+
// set placeholder into target area.
|
|
297
|
+
this.setSectionPlaceHolder(parent, nidx);
|
|
298
|
+
}
|
|
299
|
+
else if (parent.kupData.section) {
|
|
300
|
+
// section is the target of drop.
|
|
301
|
+
// calculate a new position for the section.
|
|
302
|
+
const nidx = this.calcSectionPosition(clientY, clientX, parent.kupData.section.layout == 'column', parent.kupData.section.sections.length, parent.lastElementChild.children);
|
|
303
|
+
// set placeholder into target area.
|
|
304
|
+
this.setSectionPlaceHolder(parent.lastElementChild, nidx);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
dropped(event, parent, child) {
|
|
264
308
|
const idx = child.kupData.parent.sections.indexOf(child.kupData.section);
|
|
265
309
|
child.kupData.parent.sections.splice(idx, 1);
|
|
266
310
|
if (parent.kupData.form) {
|
|
267
311
|
// form is the target of drop.
|
|
268
312
|
if (!parent.kupData.form.sections)
|
|
269
313
|
parent.kupData.form.sections = [];
|
|
270
|
-
|
|
314
|
+
// calculate a new position for the section.
|
|
315
|
+
const nidx = this.calcSectionPosition(event.dragEvent.clientY, event.dragEvent.clientX, parent.kupData.form.layout == 'column', parent.kupData.form.sections.length, parent.children);
|
|
316
|
+
// set the section in 'nidx' position.
|
|
317
|
+
parent.kupData.form.sections.splice(nidx, 0, child.kupData.section);
|
|
271
318
|
child.kupData.parent = parent.kupData.form;
|
|
272
319
|
}
|
|
273
320
|
else if (parent.kupData.section) {
|
|
@@ -282,17 +329,20 @@ export class KupDashboard {
|
|
|
282
329
|
parent.kupData.section.sections = [];
|
|
283
330
|
parent.kupData.section.sections.push(newSec);
|
|
284
331
|
}
|
|
285
|
-
|
|
332
|
+
// calculate a new position for the section.
|
|
333
|
+
const nidx = this.calcSectionPosition(event.dragEvent.clientY, event.dragEvent.clientX, parent.kupData.section.layout == 'column', parent.kupData.section.sections.length, parent.lastElementChild.children);
|
|
334
|
+
// set the section in 'nidx' position.
|
|
335
|
+
parent.kupData.section.sections.splice(nidx, 0, child.kupData.section);
|
|
286
336
|
child.kupData.parent = parent.kupData.section;
|
|
287
337
|
}
|
|
288
338
|
this.resetData(this.internalData);
|
|
289
339
|
}
|
|
290
340
|
getGridStyle(entity) {
|
|
291
341
|
let bodyStyles = {};
|
|
292
|
-
if (
|
|
342
|
+
if (entity.sections) {
|
|
293
343
|
let gridTemplate = '';
|
|
294
344
|
entity.sections.forEach((childSection) => {
|
|
295
|
-
if (!childSection.dim)
|
|
345
|
+
if (this.enableDesign || !childSection.dim)
|
|
296
346
|
gridTemplate += ' 1fr';
|
|
297
347
|
else
|
|
298
348
|
gridTemplate +=
|
|
@@ -307,6 +357,16 @@ export class KupDashboard {
|
|
|
307
357
|
}
|
|
308
358
|
return bodyStyles;
|
|
309
359
|
}
|
|
360
|
+
setSectionPlaceHolder(element, index) {
|
|
361
|
+
const ph = document.createElement('div');
|
|
362
|
+
ph.className = 'section-placeholder';
|
|
363
|
+
element.insertBefore(ph, element.childNodes[index]);
|
|
364
|
+
}
|
|
365
|
+
removeSectionPlaceHolder() {
|
|
366
|
+
const ph = this.rootElement.shadowRoot.querySelector('.section-placeholder');
|
|
367
|
+
if (ph)
|
|
368
|
+
ph.parentElement.removeChild(ph);
|
|
369
|
+
}
|
|
310
370
|
resetData(form = null) {
|
|
311
371
|
if (form)
|
|
312
372
|
this.internalDataBackup = form;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { SortMode, TotalMode, } from './kup-data-table-declarations';
|
|
2
|
-
import { stringToNumber } from '../../utils/utils';
|
|
2
|
+
import { isNumber, stringToNumber } from '../../utils/utils';
|
|
3
3
|
import { getCellValueForDisplay, getColumnByName, compareCell, } from '../../utils/cell-utils';
|
|
4
4
|
import { FiltersRows } from '../../utils/filters/filters-rows';
|
|
5
|
+
import { KupDatesFormats } from '../../managers/kup-dates/kup-dates-declarations';
|
|
5
6
|
const dom = document.documentElement;
|
|
6
7
|
export function sortRows(rows = [], sort = []) {
|
|
7
8
|
if (!rows || rows.length === 0) {
|
|
@@ -567,8 +568,9 @@ export function calcTotals(rows = [], totals = {}) {
|
|
|
567
568
|
}
|
|
568
569
|
const keys = Object.keys(totals);
|
|
569
570
|
const footerRow = {};
|
|
571
|
+
const dateColumns = new Array();
|
|
570
572
|
// if there are only COUNT, no need to loop on rows
|
|
571
|
-
let onlyCount = keys.length === 0
|
|
573
|
+
let onlyCount = keys.length === 0 ||
|
|
572
574
|
keys.every((key) => totals[key] === TotalMode.COUNT);
|
|
573
575
|
if (onlyCount) {
|
|
574
576
|
keys.forEach((columnName) => (footerRow[columnName] = rows.length));
|
|
@@ -631,35 +633,40 @@ export function calcTotals(rows = [], totals = {}) {
|
|
|
631
633
|
// TODO DRY the MIN and MAX functions
|
|
632
634
|
}
|
|
633
635
|
else if (dom.ketchup.objects.isDate(cell.obj)) {
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
636
|
+
if (dateColumns.indexOf(key) == -1) {
|
|
637
|
+
dateColumns.push(key);
|
|
638
|
+
}
|
|
639
|
+
const momentValue = dom.ketchup.dates.toDayjs(cell.value);
|
|
637
640
|
if (dom.ketchup.dates.isValid(momentValue)) {
|
|
638
641
|
const cellValue = dom.ketchup.dates.toDate(momentValue);
|
|
639
|
-
const currentFooterValue = footerRow[key]
|
|
642
|
+
const currentFooterValue = footerRow[key]
|
|
643
|
+
? dom.ketchup.dates.toDate(dom.ketchup.dates.toDayjs(footerRow[key]))
|
|
644
|
+
: null;
|
|
640
645
|
switch (true) {
|
|
641
646
|
case totals[key] === TotalMode.MIN:
|
|
642
647
|
if (currentFooterValue) {
|
|
643
648
|
let moments = [];
|
|
644
649
|
moments.push(cellValue);
|
|
645
|
-
moments.push(
|
|
650
|
+
moments.push(currentFooterValue);
|
|
646
651
|
footerRow[key] =
|
|
647
|
-
dom.ketchup.dates.format(dom.ketchup.dates.min(moments));
|
|
652
|
+
dom.ketchup.dates.format(dom.ketchup.dates.min(moments), KupDatesFormats.ISO_DATE);
|
|
648
653
|
}
|
|
649
654
|
else {
|
|
650
|
-
footerRow[key] =
|
|
655
|
+
footerRow[key] =
|
|
656
|
+
dom.ketchup.dates.format(cellValue, KupDatesFormats.ISO_DATE);
|
|
651
657
|
}
|
|
652
658
|
break;
|
|
653
659
|
case totals[key] === TotalMode.MAX:
|
|
654
660
|
if (currentFooterValue) {
|
|
655
661
|
let moments = [];
|
|
656
662
|
moments.push(cellValue);
|
|
657
|
-
moments.push(
|
|
663
|
+
moments.push(currentFooterValue);
|
|
658
664
|
footerRow[key] =
|
|
659
|
-
dom.ketchup.dates.format(dom.ketchup.dates.max(moments));
|
|
665
|
+
dom.ketchup.dates.format(dom.ketchup.dates.max(moments), KupDatesFormats.ISO_DATE);
|
|
660
666
|
}
|
|
661
667
|
else {
|
|
662
|
-
footerRow[key] =
|
|
668
|
+
footerRow[key] =
|
|
669
|
+
dom.ketchup.dates.format(cellValue, KupDatesFormats.ISO_DATE);
|
|
663
670
|
}
|
|
664
671
|
break;
|
|
665
672
|
default:
|
|
@@ -676,25 +683,30 @@ export function calcTotals(rows = [], totals = {}) {
|
|
|
676
683
|
}
|
|
677
684
|
});
|
|
678
685
|
});
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
686
|
+
}
|
|
687
|
+
// fixing MATH, AVERAGE and COUNT
|
|
688
|
+
for (let key of keys) {
|
|
689
|
+
switch (true) {
|
|
690
|
+
case totals[key] === TotalMode.AVERAGE:
|
|
691
|
+
const sum = footerRow[key];
|
|
692
|
+
if (sum && rows.length > 0) {
|
|
693
|
+
footerRow[key] = sum / rows.length;
|
|
694
|
+
}
|
|
695
|
+
break;
|
|
696
|
+
case totals[key] === TotalMode.COUNT:
|
|
697
|
+
footerRow[key] = rows.length;
|
|
698
|
+
break;
|
|
699
|
+
case totals[key].indexOf(TotalMode.MATH) == 0:
|
|
700
|
+
footerRow[key] = dom.ketchup.math.formulas.custom(totals[key].substring(TotalMode.MATH.length), footerRow);
|
|
701
|
+
break;
|
|
702
|
+
default:
|
|
703
|
+
break;
|
|
704
|
+
}
|
|
705
|
+
if (footerRow[key]) {
|
|
706
|
+
if (dateColumns.indexOf(key) != -1) {
|
|
707
|
+
footerRow[key] = dom.ketchup.dates.format(footerRow[key]);
|
|
696
708
|
}
|
|
697
|
-
if (footerRow[key]) {
|
|
709
|
+
else if (isNumber(footerRow[key])) {
|
|
698
710
|
footerRow[key] = +footerRow[key].toFixed(2);
|
|
699
711
|
}
|
|
700
712
|
}
|
|
@@ -3350,7 +3350,9 @@ export class KupDataTable {
|
|
|
3350
3350
|
});
|
|
3351
3351
|
}
|
|
3352
3352
|
else {
|
|
3353
|
-
this.kupManager.debug.logMessage(this,
|
|
3353
|
+
this.kupManager.debug.logMessage(this, 'Grouped for a non-existent column! (' +
|
|
3354
|
+
group.column +
|
|
3355
|
+
')', KupDebugCategory.WARNING);
|
|
3354
3356
|
}
|
|
3355
3357
|
}
|
|
3356
3358
|
if (chipsData.length > 0) {
|
|
@@ -881,19 +881,21 @@ _KupEchart_chartContainer = new WeakMap(), _KupEchart_chartEl = new WeakMap(), _
|
|
|
881
881
|
}
|
|
882
882
|
const y = {};
|
|
883
883
|
let objKey;
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
const
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
if (this.
|
|
892
|
-
this.series
|
|
893
|
-
|
|
894
|
-
|
|
884
|
+
if (this.axis) {
|
|
885
|
+
for (const row of this.data.rows) {
|
|
886
|
+
objKey = row.cells[this.axis].value;
|
|
887
|
+
y[objKey] = [];
|
|
888
|
+
for (const key of Object.keys(row.cells)) {
|
|
889
|
+
const cell = row.cells[key];
|
|
890
|
+
const value = cell.value;
|
|
891
|
+
if (!this.axis.includes(key)) {
|
|
892
|
+
if (this.series &&
|
|
893
|
+
this.series.length > 0 &&
|
|
894
|
+
!this.series.includes(key)) {
|
|
895
|
+
continue;
|
|
896
|
+
}
|
|
897
|
+
y[objKey].push(value);
|
|
895
898
|
}
|
|
896
|
-
y[objKey].push(value);
|
|
897
899
|
}
|
|
898
900
|
}
|
|
899
901
|
}
|
|
@@ -957,6 +959,12 @@ _KupEchart_chartContainer = new WeakMap(), _KupEchart_chartEl = new WeakMap(), _
|
|
|
957
959
|
'</div>');
|
|
958
960
|
}
|
|
959
961
|
};
|
|
962
|
+
let axisColumn = __classPrivateFieldGet(this, _KupEchart_kupManager, "f").data.column.find(this.data, {
|
|
963
|
+
name: this.axis,
|
|
964
|
+
});
|
|
965
|
+
let serieTitle = axisColumn && axisColumn.length > 0
|
|
966
|
+
? axisColumn[0].title
|
|
967
|
+
: 'No title';
|
|
960
968
|
const echartOption = Object.assign({ emphasis: {
|
|
961
969
|
label: {
|
|
962
970
|
show: true,
|
|
@@ -989,9 +997,7 @@ _KupEchart_chartContainer = new WeakMap(), _KupEchart_chartEl = new WeakMap(), _
|
|
|
989
997
|
padding: 4,
|
|
990
998
|
},
|
|
991
999
|
map: this.rootElement.id ? this.rootElement.id : '',
|
|
992
|
-
name:
|
|
993
|
-
name: this.axis,
|
|
994
|
-
})[0].title,
|
|
1000
|
+
name: serieTitle,
|
|
995
1001
|
roam: true,
|
|
996
1002
|
select: {
|
|
997
1003
|
itemStyle: {
|
|
@@ -1063,29 +1069,33 @@ _KupEchart_chartContainer = new WeakMap(), _KupEchart_chartEl = new WeakMap(), _
|
|
|
1063
1069
|
if (type == KupEchartTypes.GAUSSIAN) {
|
|
1064
1070
|
if (!__classPrivateFieldGet(this, _KupEchart_kupManager, "f").objects.isNumber(column.obj)) {
|
|
1065
1071
|
const newDataset = __classPrivateFieldGet(this, _KupEchart_kupManager, "f").data.distinct(this.data, [column.name]);
|
|
1066
|
-
values = __classPrivateFieldGet(this, _KupEchart_kupManager, "f").data.cell.
|
|
1067
|
-
column.name,
|
|
1068
|
-
]);
|
|
1072
|
+
values = __classPrivateFieldGet(this, _KupEchart_kupManager, "f").data.cell.getUnivocalValue(newDataset, column);
|
|
1069
1073
|
__classPrivateFieldGet(this, _KupEchart_gaussianDatasets, "f")[column.name] = newDataset;
|
|
1070
1074
|
}
|
|
1071
1075
|
else {
|
|
1072
|
-
values =
|
|
1076
|
+
values = [];
|
|
1077
|
+
for (let index = 0; index < y[key].length; index++) {
|
|
1078
|
+
const element = y[key][index];
|
|
1079
|
+
values.push({ value: element });
|
|
1080
|
+
}
|
|
1073
1081
|
}
|
|
1074
1082
|
}
|
|
1075
1083
|
else {
|
|
1076
1084
|
if (needSortDataset) {
|
|
1077
1085
|
// if there is only one series other than the Gaussian then I apply the sorting algorithm that arranges the data in "mountain"
|
|
1078
1086
|
__classPrivateFieldSet(this, _KupEchart_sortedDataset, __classPrivateFieldGet(this, _KupEchart_kupManager, "f").data.sort(this.data, 'normalDistribution', column.name), "f");
|
|
1079
|
-
values = __classPrivateFieldGet(this, _KupEchart_kupManager, "f").data.cell.getValue(__classPrivateFieldGet(this, _KupEchart_sortedDataset, "f"),
|
|
1087
|
+
values = __classPrivateFieldGet(this, _KupEchart_kupManager, "f").data.cell.getValue(__classPrivateFieldGet(this, _KupEchart_sortedDataset, "f"), column);
|
|
1080
1088
|
x = __classPrivateFieldGet(this, _KupEchart_instances, "m", _KupEchart_createX).call(this, __classPrivateFieldGet(this, _KupEchart_sortedDataset, "f"));
|
|
1081
1089
|
}
|
|
1082
1090
|
else {
|
|
1083
|
-
values = __classPrivateFieldGet(this, _KupEchart_kupManager, "f").data.cell.getValue(this.data,
|
|
1084
|
-
column.name,
|
|
1085
|
-
]);
|
|
1091
|
+
values = __classPrivateFieldGet(this, _KupEchart_kupManager, "f").data.cell.getValue(this.data, column);
|
|
1086
1092
|
}
|
|
1087
1093
|
}
|
|
1088
|
-
|
|
1094
|
+
const justValues = new Array();
|
|
1095
|
+
for (let i = 0; i < values.length; i++) {
|
|
1096
|
+
justValues.push(values[i].value);
|
|
1097
|
+
}
|
|
1098
|
+
__classPrivateFieldGet(this, _KupEchart_instances, "m", _KupEchart_addSeries).call(this, type, series, justValues, key, mixedSeries, needSortDataset);
|
|
1089
1099
|
i++;
|
|
1090
1100
|
}
|
|
1091
1101
|
// "any" because type is mismanaged inside echarts library
|
|
@@ -4,9 +4,11 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export var KupFamilyTreeProps;
|
|
6
6
|
(function (KupFamilyTreeProps) {
|
|
7
|
-
KupFamilyTreeProps["
|
|
7
|
+
KupFamilyTreeProps["autofitOnExpand"] = "The component will autofit everytime a node is expanded.";
|
|
8
|
+
KupFamilyTreeProps["autofitOnLoad"] = "The component's initial render will fit the container by invoking the runAutofit method.";
|
|
8
9
|
KupFamilyTreeProps["collapsible"] = "Nodes can be expanded/collapsed.";
|
|
9
10
|
KupFamilyTreeProps["customStyle"] = "Custom style of the component.";
|
|
10
11
|
KupFamilyTreeProps["data"] = "Actual data of the component";
|
|
11
12
|
KupFamilyTreeProps["layout"] = "Layout of the boxes.";
|
|
13
|
+
KupFamilyTreeProps["stackedLeaves"] = "Child nodes that have no children are arranged vertically.";
|
|
12
14
|
})(KupFamilyTreeProps || (KupFamilyTreeProps = {}));
|
|
@@ -11,16 +11,16 @@
|
|
|
11
11
|
:host {
|
|
12
12
|
--kup_familytree_item_background_color: var(
|
|
13
13
|
--kup-familytree-item-background-color,
|
|
14
|
-
var(--kup-
|
|
14
|
+
var(--kup-background-color)
|
|
15
15
|
);
|
|
16
16
|
--kup_familytree_item_color: var(
|
|
17
17
|
--kup-familytree-item-color,
|
|
18
|
-
var(--kup-text-
|
|
18
|
+
var(--kup-text-color)
|
|
19
19
|
);
|
|
20
|
-
--kup_familytree_item_height: var(--kup-familytree-item-height,
|
|
20
|
+
--kup_familytree_item_height: var(--kup-familytree-item-height, 80px);
|
|
21
21
|
--kup_familytree_item_h_padding: var(--kup-familytree-item-h-padding, 8px);
|
|
22
22
|
--kup_familytree_item_v_padding: var(--kup-familytree-item-v-padding, 10px);
|
|
23
|
-
--kup_familytree_item_width: var(--kup-familytree-item-width,
|
|
23
|
+
--kup_familytree_item_width: var(--kup-familytree-item-width, 280px);
|
|
24
24
|
--kup_familytree_lines_color: var(
|
|
25
25
|
--kup-familytree-lines-color,
|
|
26
26
|
var(--kup-border-color)
|
|
@@ -30,20 +30,27 @@
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
.family-tree {
|
|
33
|
+
cursor: grab;
|
|
33
34
|
display: flex;
|
|
34
35
|
transform: scale(var(--kup_familytree_scale, 1));
|
|
35
36
|
transform-origin: 0px 0px;
|
|
36
37
|
}
|
|
38
|
+
.family-tree--dragging {
|
|
39
|
+
cursor: grabbing;
|
|
40
|
+
}
|
|
37
41
|
.family-tree__node {
|
|
38
42
|
border-collapse: collapse;
|
|
39
43
|
margin: auto;
|
|
40
44
|
}
|
|
45
|
+
.family-tree__node--stacked {
|
|
46
|
+
margin-bottom: 4px;
|
|
47
|
+
}
|
|
41
48
|
.family-tree__node__staff {
|
|
42
49
|
align-items: center;
|
|
43
50
|
display: flex;
|
|
44
51
|
flex-direction: column;
|
|
45
52
|
height: 0;
|
|
46
|
-
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) ) ));
|
|
53
|
+
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) ) ));
|
|
47
54
|
}
|
|
48
55
|
.family-tree__node__staff__item {
|
|
49
56
|
padding: var(--kup_familytree_item_v_padding);
|
|
@@ -67,7 +74,7 @@
|
|
|
67
74
|
height: calc(var(--kup_familytree_item_height) / 2);
|
|
68
75
|
}
|
|
69
76
|
.family-tree__line--staff {
|
|
70
|
-
height: calc( var(--kup_familytree_staffchildren) * var(--kup_familytree_item_height) + var(--kup_familytree_staffchildren) * var(--kup_familytree_item_v_padding) );
|
|
77
|
+
height: calc( var(--kup_familytree_staffchildren) * var(--kup_familytree_item_height) + var(--kup_familytree_staffchildren) * (var(--kup_familytree_item_v_padding) * 2) );
|
|
71
78
|
}
|
|
72
79
|
.family-tree__line--right {
|
|
73
80
|
border-right: 2px solid var(--kup_familytree_lines_color);
|
|
@@ -95,7 +102,70 @@
|
|
|
95
102
|
z-index: 1;
|
|
96
103
|
}
|
|
97
104
|
.family-tree__item__wrapper .f-button {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
105
|
+
--kup-button-primary-color: var(--kup-text-color);
|
|
106
|
+
--kup-button-primary-color-rgb: var(--kup-text-color-rgb);
|
|
107
|
+
--kup-button-primary-color-h: var(--kup-text-color-h);
|
|
108
|
+
--kup-button-primary-color-s: var(--kup-text-color-s);
|
|
109
|
+
--kup-button-primary-color-l: var(--kup-text-color-l);
|
|
110
|
+
margin: 0 auto;
|
|
111
|
+
width: max-content;
|
|
112
|
+
}
|
|
113
|
+
.family-tree__item__wrapper .f-button button {
|
|
114
|
+
height: 32px;
|
|
115
|
+
width: 32px;
|
|
116
|
+
}
|
|
117
|
+
.family-tree__item__layout {
|
|
118
|
+
background-color: var(--kup_familytree_item_background_color);
|
|
119
|
+
border: 1px solid var(--kup_familytree_lines_color);
|
|
120
|
+
border-radius: 8px;
|
|
121
|
+
box-sizing: border-box;
|
|
122
|
+
display: flex;
|
|
123
|
+
height: var(--kup_familytree_item_height);
|
|
124
|
+
margin: 0 18px;
|
|
125
|
+
width: var(--kup_familytree_item_width);
|
|
126
|
+
}
|
|
127
|
+
.family-tree__item__layout--1 {
|
|
128
|
+
justify-content: center;
|
|
129
|
+
color: var(--kup_familytree_item_color);
|
|
130
|
+
}
|
|
131
|
+
.family-tree__item__layout--1 > .family-tree__item__layout__text__title {
|
|
132
|
+
margin-top: auto;
|
|
133
|
+
margin-bottom: auto;
|
|
134
|
+
}
|
|
135
|
+
.family-tree__item__layout--2 {
|
|
136
|
+
background-color: var(--kup_familytree_item_background_color);
|
|
137
|
+
justify-content: flex-start;
|
|
138
|
+
}
|
|
139
|
+
.family-tree__item__layout__color {
|
|
140
|
+
background-color: var(--kup-secondary-color);
|
|
141
|
+
border-bottom-left-radius: 8px;
|
|
142
|
+
border-top-left-radius: 8px;
|
|
143
|
+
height: 100%;
|
|
144
|
+
width: 10px;
|
|
145
|
+
}
|
|
146
|
+
.family-tree__item__layout__image {
|
|
147
|
+
display: flex;
|
|
148
|
+
margin: auto 10px;
|
|
149
|
+
}
|
|
150
|
+
.family-tree__item__layout__image img {
|
|
151
|
+
border-radius: 50px;
|
|
152
|
+
object-fit: cover;
|
|
153
|
+
}
|
|
154
|
+
.family-tree__item__layout__text {
|
|
155
|
+
display: flex;
|
|
156
|
+
flex-direction: column;
|
|
157
|
+
justify-content: center;
|
|
158
|
+
}
|
|
159
|
+
.family-tree__item__layout__text__title {
|
|
160
|
+
font-size: 18px;
|
|
161
|
+
margin-bottom: 5px;
|
|
162
|
+
}
|
|
163
|
+
.family-tree__item__layout__text__subtitle {
|
|
164
|
+
font-size: 14px;
|
|
165
|
+
}
|
|
166
|
+
.family-tree__item__layout__text__title, .family-tree__item__layout__text__subtitle {
|
|
167
|
+
max-width: calc(var(--kup_familytree_item_width) - 30%);
|
|
168
|
+
overflow: hidden;
|
|
169
|
+
text-overflow: ellipsis;
|
|
170
|
+
white-space: nowrap;
|
|
101
171
|
}
|