@sme.up/ketchup 5.2.0-SNAPSHOT → 5.2.1-SNAPSHOT
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/{cell-utils-5b16c180.js → cell-utils-d96b2993.js} +2 -2
- package/dist/cjs/{f-button-3b9f32af.js → f-button-2b9b99b1.js} +2 -2
- package/dist/cjs/{f-cell-c6ad973a.js → f-cell-8351cb84.js} +8 -96
- package/dist/cjs/{f-chip-bed86c4a.js → f-chip-df59e1b0.js} +3 -3
- package/dist/cjs/{f-image-08a3d340.js → f-image-12bab3b5.js} +2 -2
- package/dist/cjs/f-text-field-e7c35b5b.js +94 -0
- package/dist/cjs/f-text-field-mdc-a67f5dfe.js +2852 -0
- package/dist/cjs/{index-8d7bb3be.js → index-eb556444.js} +2 -0
- package/dist/cjs/ketchup.cjs.js +3 -3
- package/dist/cjs/kup-accordion.cjs.entry.js +4 -4
- package/dist/cjs/kup-autocomplete_27.cjs.entry.js +365 -3041
- package/dist/cjs/kup-calendar.cjs.entry.js +7 -7
- package/dist/cjs/kup-cell.cjs.entry.js +8 -7
- package/dist/cjs/kup-dash-list.cjs.entry.js +4 -4
- package/dist/cjs/kup-dash_2.cjs.entry.js +3 -3
- package/dist/cjs/kup-drawer.cjs.entry.js +3 -3
- package/dist/cjs/kup-echart.cjs.entry.js +4 -4
- package/dist/cjs/kup-field.cjs.entry.js +2 -2
- package/dist/cjs/kup-iframe.cjs.entry.js +3 -3
- package/dist/cjs/kup-lazy.cjs.entry.js +3 -3
- package/dist/cjs/kup-magic-box.cjs.entry.js +4 -4
- package/dist/cjs/{kup-manager-4227f0a2.js → kup-manager-5c03da64.js} +373 -160
- package/dist/cjs/kup-nav-bar.cjs.entry.js +3 -3
- package/dist/cjs/kup-numeric-picker.cjs.entry.js +423 -0
- package/dist/cjs/kup-photo-frame.cjs.entry.js +3 -3
- 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 +5 -5
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{utils-b9df398c.js → utils-e99921c1.js} +1 -1
- package/dist/collection/assets/index.js +8 -0
- package/dist/collection/assets/kuptooltip.js +608 -0
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/kup-card/built-in/kup-card-built-in.js +10 -0
- package/dist/collection/components/kup-card/built-in/kup-card-numeric.js +153 -0
- package/dist/collection/components/kup-card/kup-card.css +35 -0
- package/dist/collection/components/kup-card/kup-card.js +1 -0
- package/dist/collection/components/kup-data-table/kup-data-table.js +34 -5
- package/dist/collection/components/kup-date-picker/kup-date-picker.js +1 -1
- package/dist/collection/components/kup-numeric-picker/kup-numeric-picker-declarations.js +16 -0
- package/dist/collection/components/kup-numeric-picker/kup-numeric-picker.css +50 -0
- package/dist/collection/components/kup-numeric-picker/kup-numeric-picker.js +895 -0
- package/dist/collection/managers/kup-debug/kup-debug.js +1 -0
- package/dist/collection/managers/kup-manager/kup-manager.js +12 -1
- package/dist/collection/managers/kup-math/kup-math.js +11 -1
- package/dist/collection/managers/kup-theme/kup-theme-declarations.js +1 -0
- package/dist/collection/managers/kup-tooltip/kup-tooltip-declarations.js +1 -0
- package/dist/collection/managers/kup-tooltip/kup-tooltip.js +191 -0
- package/dist/collection/types/GenericTypes.js +1 -0
- package/dist/collection/utils/kup-column-menu/kup-column-menu.js +1 -1
- package/dist/esm/{cell-utils-69f75e2e.js → cell-utils-f4bdbbc8.js} +2 -2
- package/dist/esm/{f-button-7e7607d8.js → f-button-54a49fd8.js} +2 -2
- package/dist/esm/{f-cell-e4d83c27.js → f-cell-d5dac50b.js} +8 -95
- package/dist/esm/{f-chip-51dfefaf.js → f-chip-a3035b4b.js} +3 -3
- package/dist/esm/{f-image-de331954.js → f-image-d32465e3.js} +2 -2
- package/dist/esm/f-text-field-c25cc63f.js +92 -0
- package/dist/esm/f-text-field-mdc-9fbbefc3.js +2850 -0
- package/dist/esm/{index-aeec9835.js → index-baeab1ac.js} +2 -1
- package/dist/esm/ketchup.js +3 -3
- package/dist/esm/kup-accordion.entry.js +4 -4
- package/dist/esm/kup-autocomplete_27.entry.js +349 -3025
- package/dist/esm/kup-calendar.entry.js +7 -7
- package/dist/esm/kup-cell.entry.js +8 -7
- package/dist/esm/kup-dash-list.entry.js +4 -4
- package/dist/esm/kup-dash_2.entry.js +3 -3
- package/dist/esm/kup-drawer.entry.js +3 -3
- package/dist/esm/kup-echart.entry.js +4 -4
- package/dist/esm/kup-field.entry.js +2 -2
- package/dist/esm/kup-iframe.entry.js +3 -3
- package/dist/esm/kup-lazy.entry.js +3 -3
- package/dist/esm/kup-magic-box.entry.js +4 -4
- package/dist/esm/{kup-manager-0ab94726.js → kup-manager-9316a184.js} +373 -160
- package/dist/esm/kup-nav-bar.entry.js +3 -3
- package/dist/esm/kup-numeric-picker.entry.js +419 -0
- package/dist/esm/kup-photo-frame.entry.js +3 -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 +5 -5
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{utils-35c7a90d.js → utils-f24319a0.js} +1 -1
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/{p-3813281b.entry.js → p-09d708c4.entry.js} +1 -1
- package/dist/ketchup/{p-4081f5f7.entry.js → p-11e72a8c.entry.js} +1 -1
- package/dist/ketchup/p-12773ca8.js +9 -0
- package/dist/ketchup/{p-0751aaf6.entry.js → p-203d6295.entry.js} +1 -1
- package/dist/ketchup/{p-33073f4a.js → p-34748c91.js} +1 -1
- package/dist/ketchup/{p-8be1337b.js → p-34b74425.js} +1 -1
- package/dist/ketchup/{p-10c8d755.js → p-40f97429.js} +1 -1
- package/dist/ketchup/{p-3aab1f0d.entry.js → p-4173422f.entry.js} +1 -1
- package/dist/ketchup/{p-8f735633.entry.js → p-41741c28.entry.js} +1 -1
- package/dist/ketchup/{p-b5e1dbfa.entry.js → p-44192f30.entry.js} +1 -1
- package/dist/ketchup/{p-c314b1e6.js → p-44f8da2a.js} +1 -1
- package/dist/ketchup/p-4f56932b.js +1 -0
- package/dist/ketchup/p-669bde31.js +1 -0
- package/dist/ketchup/p-67842f1e.entry.js +1 -0
- package/dist/ketchup/{p-5d190cf5.js → p-7a74ad17.js} +1 -1
- package/dist/ketchup/{p-96101f09.entry.js → p-7ba8fa4a.entry.js} +1 -1
- package/dist/ketchup/p-7de0d7e1.js +1 -0
- package/dist/ketchup/{p-f9c41e20.entry.js → p-8418e8fa.entry.js} +1 -1
- package/dist/ketchup/p-96bf19aa.entry.js +1 -0
- package/dist/ketchup/{p-9bcda66f.entry.js → p-9a61d8dc.entry.js} +1 -1
- package/dist/ketchup/p-b0ddcce9.entry.js +9 -0
- package/dist/ketchup/{p-24df4f29.entry.js → p-b6c21223.entry.js} +1 -1
- package/dist/ketchup/{p-68fc1428.entry.js → p-bb8844bf.entry.js} +1 -1
- package/dist/ketchup/{p-67c64257.entry.js → p-c58a2a81.entry.js} +1 -1
- package/dist/ketchup/{p-3445be1e.entry.js → p-ca3d585b.entry.js} +1 -1
- package/dist/ketchup/{p-fea316ab.entry.js → p-e6709c26.entry.js} +1 -1
- package/dist/ketchup/{p-d7af8156.entry.js → p-e8e3c9da.entry.js} +1 -1
- package/dist/ketchup/p-ecb7069b.js +135 -0
- package/dist/types/components/kup-card/built-in/kup-card-built-in.d.ts +7 -0
- package/dist/types/components/kup-card/built-in/kup-card-numeric.d.ts +2 -0
- package/dist/types/components/kup-card/kup-card-declarations.d.ts +26 -1
- package/dist/types/components/kup-data-table/kup-data-table-declarations.d.ts +2 -0
- package/dist/types/components/kup-data-table/kup-data-table.d.ts +4 -0
- package/dist/types/components/kup-numeric-picker/kup-numeric-picker-declarations.d.ts +19 -0
- package/dist/types/components/kup-numeric-picker/kup-numeric-picker.d.ts +121 -0
- package/dist/types/components.d.ts +144 -1
- package/dist/types/managers/kup-manager/kup-manager-declarations.d.ts +10 -0
- package/dist/types/managers/kup-manager/kup-manager.d.ts +2 -0
- package/dist/types/managers/kup-math/kup-math-declarations.d.ts +6 -0
- package/dist/types/managers/kup-math/kup-math.d.ts +2 -1
- package/dist/types/managers/kup-tooltip/kup-tooltip-declarations.d.ts +8 -0
- package/dist/types/managers/kup-tooltip/kup-tooltip.d.ts +40 -0
- package/dist/types/types/GenericTypes.d.ts +1 -0
- package/package.json +3 -3
- package/CHANGELOG.md +0 -5
- package/dist/ketchup/p-2d4f19f4.js +0 -1
- package/dist/ketchup/p-47b57d97.js +0 -1
- package/dist/ketchup/p-5186885c.entry.js +0 -1
- package/dist/ketchup/p-78223dc0.entry.js +0 -143
- package/dist/ketchup/p-ee33cbe9.js +0 -9
|
@@ -279,6 +279,7 @@ export class KupDebug {
|
|
|
279
279
|
break;
|
|
280
280
|
case 'kup-debug-locale-changer':
|
|
281
281
|
dom.ketchup.dates.setLocale(compEvent.detail.value);
|
|
282
|
+
dom.ketchup.math.setLocale(compEvent.detail.value);
|
|
282
283
|
break;
|
|
283
284
|
case 'kup-debug-theme-changer':
|
|
284
285
|
dom.ketchup.theme.set(compEvent.detail.value);
|
|
@@ -15,6 +15,8 @@ import { KupDebugCategory } from '../kup-debug/kup-debug-declarations';
|
|
|
15
15
|
import { KupSearch } from '../kup-search/kup-search';
|
|
16
16
|
import { KupMathLocales } from '../kup-math/kup-math-declarations';
|
|
17
17
|
import { KupMath } from '../kup-math/kup-math';
|
|
18
|
+
import { KupTooltip } from '../kup-tooltip/kup-tooltip';
|
|
19
|
+
import { setAssetPath } from '@stencil/core';
|
|
18
20
|
const dom = document.documentElement;
|
|
19
21
|
/**
|
|
20
22
|
* This class controls every other Ketchup utility suite.
|
|
@@ -25,8 +27,9 @@ export class KupManager {
|
|
|
25
27
|
* Initializes KupManager.
|
|
26
28
|
*/
|
|
27
29
|
constructor(overrides) {
|
|
28
|
-
let datesLocale = null, debugActive = null, debugAutoprint = null, debugLogLimit = null, dialogRestrictContainer = null, dialogZIndex = null, languageList = null, languageName = null, objectsList = null, scrollOnHoverDelay = null, scrollOnHoverStep = null, themeList = null, themeName = null;
|
|
30
|
+
let datesLocale = null, debugActive = null, debugAutoprint = null, debugLogLimit = null, dialogRestrictContainer = null, dialogZIndex = null, languageList = null, languageName = null, objectsList = null, scrollOnHoverDelay = null, scrollOnHoverStep = null, themeList = null, themeName = null, tooltipDelay = null;
|
|
29
31
|
if (overrides) {
|
|
32
|
+
const assetsPath = overrides.assetsPath;
|
|
30
33
|
const dates = overrides.dates;
|
|
31
34
|
const debug = overrides.debug;
|
|
32
35
|
const interact = overrides.interact;
|
|
@@ -34,6 +37,10 @@ export class KupManager {
|
|
|
34
37
|
const objects = overrides.objects;
|
|
35
38
|
const scrollOnHover = overrides.scrollOnHover;
|
|
36
39
|
const theme = overrides.theme;
|
|
40
|
+
const tooltip = overrides.tooltip;
|
|
41
|
+
if (assetsPath) {
|
|
42
|
+
setAssetPath(assetsPath);
|
|
43
|
+
}
|
|
37
44
|
if (dates) {
|
|
38
45
|
datesLocale = dates.locale ? dates.locale : null;
|
|
39
46
|
}
|
|
@@ -67,6 +74,9 @@ export class KupManager {
|
|
|
67
74
|
themeList = theme.list ? theme.list : null;
|
|
68
75
|
themeName = theme.name ? theme.name : null;
|
|
69
76
|
}
|
|
77
|
+
if (tooltip) {
|
|
78
|
+
tooltipDelay = tooltip.delay ? tooltip.delay : null;
|
|
79
|
+
}
|
|
70
80
|
}
|
|
71
81
|
this.data = new KupData();
|
|
72
82
|
this.dates = new KupDates(datesLocale);
|
|
@@ -102,6 +112,7 @@ export class KupManager {
|
|
|
102
112
|
};
|
|
103
113
|
this.theme = new KupTheme(themeList, themeName);
|
|
104
114
|
this.toolbar = new KupToolbar();
|
|
115
|
+
this.tooltip = new KupTooltip(tooltipDelay);
|
|
105
116
|
document.addEventListener('pointerdown', (e) => {
|
|
106
117
|
const paths = e.composedPath();
|
|
107
118
|
const lastString = paths[0].innerText || paths[0].value;
|
|
@@ -6,7 +6,7 @@ import 'numeral/locales/it';
|
|
|
6
6
|
import 'numeral/locales/pl';
|
|
7
7
|
import 'numeral/locales/ru';
|
|
8
8
|
import { KupDebugCategory } from '../kup-debug/kup-debug-declarations';
|
|
9
|
-
import { KupMathLocales } from './kup-math-declarations';
|
|
9
|
+
import { KupMathLocales, } from './kup-math-declarations';
|
|
10
10
|
import { customFormula, normalDistributionFormula } from './kup-math-helper';
|
|
11
11
|
const dom = document.documentElement;
|
|
12
12
|
/**
|
|
@@ -26,6 +26,16 @@ export class KupMath {
|
|
|
26
26
|
return normalDistributionFormula(average, variance, x);
|
|
27
27
|
},
|
|
28
28
|
};
|
|
29
|
+
this.numbers = {
|
|
30
|
+
toLocaleString(value) {
|
|
31
|
+
const maximumFractionDigits = 14;
|
|
32
|
+
if (value == null || value == '')
|
|
33
|
+
return value;
|
|
34
|
+
return Number(value).toLocaleString(dom.ketchup.math.locale, {
|
|
35
|
+
maximumFractionDigits: maximumFractionDigits,
|
|
36
|
+
});
|
|
37
|
+
},
|
|
38
|
+
};
|
|
29
39
|
this.locale = locale ? locale : KupMathLocales.en;
|
|
30
40
|
this.managedComponents = new Set();
|
|
31
41
|
this.numeral = numeral;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
+
};
|
|
6
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
7
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
9
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
10
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
11
|
+
};
|
|
12
|
+
var _KupTooltip_instances, _KupTooltip_clickCb, _KupTooltip_dynPos, _KupTooltip_create, _KupTooltip_setOptions;
|
|
13
|
+
import { KupDebugCategory } from '../kup-debug/kup-debug-declarations';
|
|
14
|
+
const dom = document.documentElement;
|
|
15
|
+
/**
|
|
16
|
+
* Handles application-wide tooltip using card component.
|
|
17
|
+
* @module KupTooltip
|
|
18
|
+
*/
|
|
19
|
+
export class KupTooltip {
|
|
20
|
+
/**
|
|
21
|
+
* Initializes KupTooltip.
|
|
22
|
+
*/
|
|
23
|
+
constructor(delay) {
|
|
24
|
+
_KupTooltip_instances.add(this);
|
|
25
|
+
this.currentAnchor = null;
|
|
26
|
+
this.delay = null;
|
|
27
|
+
this.element = null;
|
|
28
|
+
this.managedElements = null;
|
|
29
|
+
this.timeout = null;
|
|
30
|
+
_KupTooltip_clickCb.set(this, null);
|
|
31
|
+
this.delay = delay ? delay : 125;
|
|
32
|
+
this.managedElements = new Set();
|
|
33
|
+
document.addEventListener('pointermove', (e) => {
|
|
34
|
+
const paths = e.composedPath();
|
|
35
|
+
// Leaving the function when hovering on the tooltip itself
|
|
36
|
+
if (paths.includes(this.element)) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const enterHandler = (anchor) => {
|
|
40
|
+
this.timeout = null;
|
|
41
|
+
requestAnimationFrame(anchor.kupTooltip.enter.bind(anchor.kupTooltip.enter, e));
|
|
42
|
+
};
|
|
43
|
+
const overHandler = (anchor) => {
|
|
44
|
+
requestAnimationFrame(anchor.kupTooltip.over.bind(anchor.kupTooltip.over, e));
|
|
45
|
+
};
|
|
46
|
+
const leaveHandler = () => {
|
|
47
|
+
requestAnimationFrame(this.currentAnchor.kupTooltip.leave.bind(this.currentAnchor.kupTooltip.leave, e));
|
|
48
|
+
};
|
|
49
|
+
// If the current anchor exists and is not included in the event path,
|
|
50
|
+
// the leaving callback is fired.
|
|
51
|
+
if (this.currentAnchor && !paths.includes(this.currentAnchor)) {
|
|
52
|
+
if (this.timeout) {
|
|
53
|
+
clearTimeout(this.timeout);
|
|
54
|
+
this.timeout = null;
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
if (this.currentAnchor.kupTooltip.leave) {
|
|
58
|
+
leaveHandler();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
this.currentAnchor = null;
|
|
62
|
+
}
|
|
63
|
+
else if (!this.timeout) {
|
|
64
|
+
for (let index = 0; index < paths.length; index++) {
|
|
65
|
+
const element = paths[index];
|
|
66
|
+
if (this.managedElements.has(element)) {
|
|
67
|
+
// If the current anchor is the same as the registered element found
|
|
68
|
+
// in the path, the mouse over function is invoked
|
|
69
|
+
if (this.currentAnchor === element) {
|
|
70
|
+
if (element.kupTooltip.over) {
|
|
71
|
+
overHandler(element);
|
|
72
|
+
}
|
|
73
|
+
// Otherwise, the mouse enter callback will be invoked
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
this.currentAnchor = element;
|
|
77
|
+
if (element.kupTooltip.enter) {
|
|
78
|
+
if (this.delay) {
|
|
79
|
+
this.timeout = setTimeout(enterHandler.bind(enterHandler, element), this.delay);
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
enterHandler(element);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
hide() {
|
|
92
|
+
if (this.element) {
|
|
93
|
+
this.element.menuVisible = false;
|
|
94
|
+
dom.ketchup.dynamicPosition.stop(this.element);
|
|
95
|
+
dom.ketchup.removeClickCallback(__classPrivateFieldGet(this, _KupTooltip_clickCb, "f"));
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
show(anchor, options) {
|
|
99
|
+
// Creates the card or updates it with new options
|
|
100
|
+
if (!this.element) {
|
|
101
|
+
__classPrivateFieldGet(this, _KupTooltip_instances, "m", _KupTooltip_create).call(this, options);
|
|
102
|
+
}
|
|
103
|
+
else if (options) {
|
|
104
|
+
__classPrivateFieldGet(this, _KupTooltip_instances, "m", _KupTooltip_setOptions).call(this, options);
|
|
105
|
+
}
|
|
106
|
+
// If an anchor was provided, initializes or updates dynamic positioning
|
|
107
|
+
if (anchor) {
|
|
108
|
+
__classPrivateFieldGet(this, _KupTooltip_instances, "m", _KupTooltip_dynPos).call(this, anchor);
|
|
109
|
+
}
|
|
110
|
+
// If the tooltip is already visible, it's pointless to go on
|
|
111
|
+
if (this.element.menuVisible) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
// If the dynamic positioning is still to be registered, a warning is thrown
|
|
115
|
+
if (!dom.ketchup.dynamicPosition.isRegistered(this.element)) {
|
|
116
|
+
dom.ketchup.debug.logMessage('kup-tooltip', 'Unable to display KupTooltip without specifying a valid anchor point.', KupDebugCategory.WARNING);
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
this.element.menuVisible = true;
|
|
120
|
+
dom.ketchup.addClickCallback(__classPrivateFieldGet(this, _KupTooltip_clickCb, "f"), true);
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Returns whether an element was previously registered or not.
|
|
124
|
+
* @param {KupTooltipAnchor} element - Element to test.
|
|
125
|
+
* @returns {boolean} True if the element was registered.
|
|
126
|
+
*/
|
|
127
|
+
isRegistered(element) {
|
|
128
|
+
return !this.managedElements
|
|
129
|
+
? false
|
|
130
|
+
: this.managedElements.has(element);
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Registers an HTMLElement as KupTooltipAnchor, triggering callback invocation on mouse over.
|
|
134
|
+
* @param {KupTooltipAnchor} element - The HTML element to be registered.
|
|
135
|
+
* @param {(e: PointerEvent) => void} cbEnter - Callback invoked when hovering on the the element for the first time.
|
|
136
|
+
* @param {(e: PointerEvent) => void} cbOver - Callback invoked when hovering on the element.
|
|
137
|
+
* @param {(e: PointerEvent) => void} cbLeave - Callback invoked when leaving the element.
|
|
138
|
+
*/
|
|
139
|
+
register(element, cbEnter, cbOver, cbLeave) {
|
|
140
|
+
this.managedElements.add(element);
|
|
141
|
+
const kupTooltip = {
|
|
142
|
+
enter: cbEnter,
|
|
143
|
+
leave: cbLeave,
|
|
144
|
+
over: cbOver,
|
|
145
|
+
};
|
|
146
|
+
element.kupTooltip = kupTooltip;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Unregisters an HTMLElement, preventing its attached callback from being invoked.
|
|
150
|
+
*
|
|
151
|
+
* @param {KupTooltipAnchor} element - - The HTML element to be unregistered.
|
|
152
|
+
*/
|
|
153
|
+
unregister(element) {
|
|
154
|
+
if (this.managedElements) {
|
|
155
|
+
this.managedElements.delete(element);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
_KupTooltip_clickCb = new WeakMap(), _KupTooltip_instances = new WeakSet(), _KupTooltip_dynPos = function _KupTooltip_dynPos(anchor) {
|
|
160
|
+
if (dom.ketchup.dynamicPosition.isRegistered(this.element)) {
|
|
161
|
+
dom.ketchup.dynamicPosition.changeAnchor(this.element, anchor);
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
dom.ketchup.dynamicPosition.register(this.element, anchor, null, null, true);
|
|
165
|
+
}
|
|
166
|
+
dom.ketchup.dynamicPosition.start(this.element);
|
|
167
|
+
}, _KupTooltip_create = function _KupTooltip_create(options) {
|
|
168
|
+
this.element = document.createElement('kup-card');
|
|
169
|
+
this.element.id = 'kup-tooltip';
|
|
170
|
+
this.element.isMenu = true;
|
|
171
|
+
this.element.layoutNumber = 15;
|
|
172
|
+
this.element.sizeX = 'auto';
|
|
173
|
+
this.element.sizeY = 'auto';
|
|
174
|
+
if (options) {
|
|
175
|
+
__classPrivateFieldGet(this, _KupTooltip_instances, "m", _KupTooltip_setOptions).call(this, options);
|
|
176
|
+
}
|
|
177
|
+
document.body.appendChild(this.element);
|
|
178
|
+
__classPrivateFieldSet(this, _KupTooltip_clickCb, {
|
|
179
|
+
cb: () => {
|
|
180
|
+
this.hide();
|
|
181
|
+
},
|
|
182
|
+
el: this.element,
|
|
183
|
+
}, "f");
|
|
184
|
+
}, _KupTooltip_setOptions = function _KupTooltip_setOptions(options) {
|
|
185
|
+
for (const key in options) {
|
|
186
|
+
if (Object.prototype.hasOwnProperty.call(options, key)) {
|
|
187
|
+
const prop = options[key];
|
|
188
|
+
this.element[key] = prop;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
};
|
|
@@ -32,6 +32,7 @@ export var KupTagNames;
|
|
|
32
32
|
KupTagNames["LIST"] = "KUP-LIST";
|
|
33
33
|
KupTagNames["MAGIC_BOX"] = "KUP-MAGIC-BOX";
|
|
34
34
|
KupTagNames["NAV_BAR"] = "KUP-NAV-BAR";
|
|
35
|
+
KupTagNames["NUMERIC_PICKER"] = "KUP-NUMERIC-PICKER";
|
|
35
36
|
KupTagNames["PROBE"] = "KUP-PROBE";
|
|
36
37
|
KupTagNames["PROGRESS_BAR"] = "KUP-PROGRESS-BAR";
|
|
37
38
|
KupTagNames["QLIK"] = "KUP-QLIK";
|
|
@@ -342,7 +342,7 @@ export class KupColumnMenu {
|
|
|
342
342
|
let props = [];
|
|
343
343
|
if (comp.showFilters) {
|
|
344
344
|
if (this.filtersColumnMenuInstance.isColumnFiltrableByInterval(column)) {
|
|
345
|
-
props.concat(this.prepIntervalTextfield(comp, column));
|
|
345
|
+
props = props.concat(this.prepIntervalTextfield(comp, column));
|
|
346
346
|
}
|
|
347
347
|
else if (dom.ketchup.objects.isStringObject(column.obj)) {
|
|
348
348
|
let filterInitialValue = this.filtersColumnMenuInstance.getTextFilterValue(comp.filters, column.name);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { k as unformattedStringToFormattedStringNumber, m as unformattedStringToFormattedStringTime, o as unformattedStringToFormattedStringTimestamp, d as stringToNumber } from './utils-
|
|
2
|
-
import { d as KupDatesFormats } from './kup-manager-
|
|
1
|
+
import { k as unformattedStringToFormattedStringNumber, m as unformattedStringToFormattedStringTime, o as unformattedStringToFormattedStringTimestamp, d as stringToNumber } from './utils-f24319a0.js';
|
|
2
|
+
import { d as KupDatesFormats } from './kup-manager-9316a184.js';
|
|
3
3
|
|
|
4
4
|
const dom = document.documentElement;
|
|
5
5
|
// -------------
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { h } from './index-
|
|
1
|
+
import { h } from './index-baeab1ac.js';
|
|
2
2
|
import { F as FButtonStyling } from './f-button-declarations-b1b4cac4.js';
|
|
3
|
-
import { F as FImage } from './f-image-
|
|
3
|
+
import { F as FImage } from './f-image-d32465e3.js';
|
|
4
4
|
|
|
5
5
|
/*-------------------------------------------------*/
|
|
6
6
|
/* C o m p o n e n t */
|
|
@@ -1,97 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { h
|
|
3
|
-
import { b as getCellValueForDisplay } from './cell-utils-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { F as
|
|
7
|
-
|
|
8
|
-
/*-------------------------------------------------*/
|
|
9
|
-
/* C o m p o n e n t */
|
|
10
|
-
/*-------------------------------------------------*/
|
|
11
|
-
const FTextField = (props, children) => {
|
|
12
|
-
return (h("div", Object.assign({ class: `f-text-field ${props.danger ? 'kup-danger' : ''} ${props.fullHeight ? 'kup-full-height' : ''} ${props.fullWidth ? 'kup-full-width' : ''} ${props.info ? 'kup-info' : ''} ${props.secondary ? 'kup-secondary' : ''} ${props.shaped ? 'kup-shaped' : ''} ${props.success ? 'kup-success' : ''} ${props.warning ? 'kup-warning' : ''} ${props.wrapperClass ? props.wrapperClass : ''}` }, props.dataSet, { id: props.id, title: props.title }),
|
|
13
|
-
props.leadingLabel || props.trailingLabel ? (h("div", { class: `mdc-form-field ${props.leadingLabel ? 'mdc-form-field--align-end' : ''}` }, [
|
|
14
|
-
setContent(props),
|
|
15
|
-
setHelper(props),
|
|
16
|
-
h("label", null, props.label),
|
|
17
|
-
])) : ([setContent(props), setHelper(props)]),
|
|
18
|
-
children));
|
|
19
|
-
};
|
|
20
|
-
/*-------------------------------------------------*/
|
|
21
|
-
/* M e t h o d s */
|
|
22
|
-
/*-------------------------------------------------*/
|
|
23
|
-
function setContent(props) {
|
|
24
|
-
const isOutlined = props.textArea || props.outlined;
|
|
25
|
-
let labelEl;
|
|
26
|
-
let iconEl;
|
|
27
|
-
if (props.label && !props.leadingLabel && !props.trailingLabel) {
|
|
28
|
-
labelEl = (h("label", { class: "mdc-floating-label", htmlFor: "kup-input" }, props.label));
|
|
29
|
-
}
|
|
30
|
-
if (props.icon) {
|
|
31
|
-
let iconStyle;
|
|
32
|
-
let iconClass = '';
|
|
33
|
-
if (Object.values(KupThemeIconValues).indexOf(props.icon) > -1) {
|
|
34
|
-
iconClass = props.icon.replace('--', '');
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
let svg = `url('${getAssetPath(`./assets/svg/${props.icon}.svg`)}') no-repeat center`;
|
|
38
|
-
iconStyle = {
|
|
39
|
-
mask: svg,
|
|
40
|
-
webkitMask: svg,
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
iconEl = (h("span", { style: iconStyle, onClick: props.onIconClick, class: `mdc-text-field__icon kup-icon action ${iconClass}` }));
|
|
44
|
-
}
|
|
45
|
-
const classObj = {
|
|
46
|
-
'is-clearable': props.isClearable,
|
|
47
|
-
'mdc-text-field': true,
|
|
48
|
-
'mdc-text-field--disabled': props.disabled,
|
|
49
|
-
'mdc-text-field--filled': !props.fullWidth && !isOutlined,
|
|
50
|
-
'mdc-text-field--no-label': !props.label,
|
|
51
|
-
'mdc-text-field--fullwidth': props.fullWidth,
|
|
52
|
-
'mdc-text-field--outlined': isOutlined,
|
|
53
|
-
'mdc-text-field--textarea': props.textArea,
|
|
54
|
-
'mdc-text-field--with-leading-icon': props.icon && !props.trailingIcon,
|
|
55
|
-
'mdc-text-field--with-trailing-icon': props.icon && props.trailingIcon,
|
|
56
|
-
};
|
|
57
|
-
return (h("div", { class: classObj },
|
|
58
|
-
props.textArea && props.maxLength ? (h("div", { class: "mdc-text-field-character-counter" },
|
|
59
|
-
"'0 / ' + ",
|
|
60
|
-
props.maxLength)) : undefined,
|
|
61
|
-
!props.trailingIcon ? iconEl : undefined,
|
|
62
|
-
props.textArea ? (h("span", { class: "mdc-text-field__resizer" },
|
|
63
|
-
h("textarea", { class: "mdc-text-field__input", disabled: props.disabled, readOnly: props.readOnly, maxlength: props.maxLength, value: props.value, onBlur: props.onBlur, onClick: props.onClick, onChange: props.onChange, onFocus: props.onFocus, onInput: props.onInput, onKeyDown: props.onKeyDown }))) : (h("input", { type: props.inputType ? props.inputType : 'text', step: props.step, min: props.min, max: props.max, class: "mdc-text-field__input", disabled: props.disabled, readOnly: props.readOnly, placeholder: props.fullWidth ? props.label : undefined, maxlength: props.maxLength, value: props.value, onBlur: props.onBlur, onClick: props.onClick, onChange: props.onChange, onFocus: props.onFocus, onInput: props.onInput, onKeyDown: props.onKeyDown })),
|
|
64
|
-
props.isClearable ? (h("span", { class: `mdc-text-field__icon kup-icon ${KupThemeIconValues.CLEAR.replace('--', '')}`, onClick: props.onClearIconClick })) : undefined,
|
|
65
|
-
props.trailingIcon ? iconEl : undefined,
|
|
66
|
-
!props.fullWidth && !isOutlined ? labelEl : undefined,
|
|
67
|
-
isOutlined ? (h("div", { class: "mdc-notched-outline" },
|
|
68
|
-
h("div", { class: "mdc-notched-outline__leading" }),
|
|
69
|
-
h("div", { class: "mdc-notched-outline__notch" }, labelEl),
|
|
70
|
-
h("div", { class: "mdc-notched-outline__trailing" }))) : (h("span", { class: "mdc-line-ripple" }))));
|
|
71
|
-
}
|
|
72
|
-
function setHelper(props) {
|
|
73
|
-
if (props.helperEnabled !== false) {
|
|
74
|
-
if (props.helper) {
|
|
75
|
-
const classObj = {
|
|
76
|
-
'mdc-text-field-helper-text': true,
|
|
77
|
-
'mdc-text-field-helper-text--persistent': !props.helperWhenFocused,
|
|
78
|
-
};
|
|
79
|
-
return (h("div", { class: "mdc-text-field-helper-line" },
|
|
80
|
-
h("div", { class: classObj }, props.helper),
|
|
81
|
-
props.maxLength && !props.textArea ? (h("div", { class: "mdc-text-field-character-counter" },
|
|
82
|
-
"'0 / ' + ",
|
|
83
|
-
props.maxLength.toString())) : undefined));
|
|
84
|
-
}
|
|
85
|
-
else {
|
|
86
|
-
if (props.maxLength && !props.textArea) {
|
|
87
|
-
return (h("div", { class: "mdc-text-field-helper-line" },
|
|
88
|
-
h("div", { class: "mdc-text-field-character-counter" },
|
|
89
|
-
"'0 / ' + ",
|
|
90
|
-
props.maxLength)));
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
1
|
+
import { c as KupTagNames, b as KupThemeColorValues } from './kup-manager-9316a184.js';
|
|
2
|
+
import { h } from './index-baeab1ac.js';
|
|
3
|
+
import { b as getCellValueForDisplay } from './cell-utils-f4bdbbc8.js';
|
|
4
|
+
import { F as FTextField } from './f-text-field-c25cc63f.js';
|
|
5
|
+
import { d as stringToNumber } from './utils-f24319a0.js';
|
|
6
|
+
import { F as FImage } from './f-image-d32465e3.js';
|
|
7
|
+
import { F as FChip } from './f-chip-a3035b4b.js';
|
|
95
8
|
|
|
96
9
|
const autoAlignComps = [KupTagNames.DATA_TABLE, KupTagNames.TREE];
|
|
97
10
|
/**
|
|
@@ -734,4 +647,4 @@ function cellEvent(e, props, cellType, cellEventName) {
|
|
|
734
647
|
}
|
|
735
648
|
}
|
|
736
649
|
|
|
737
|
-
export {
|
|
650
|
+
export { FCell as F, FCheckbox as a, FCellPadding as b };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { h } from './index-
|
|
2
|
-
import { F as FImage } from './f-image-
|
|
3
|
-
import { a as KupThemeIconValues, i as KupLanguageGeneric, b as KupThemeColorValues } from './kup-manager-
|
|
1
|
+
import { h } from './index-baeab1ac.js';
|
|
2
|
+
import { F as FImage } from './f-image-d32465e3.js';
|
|
3
|
+
import { a as KupThemeIconValues, i as KupLanguageGeneric, b as KupThemeColorValues } from './kup-manager-9316a184.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Types of the f-chip component.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { h, a as getAssetPath } from './index-
|
|
2
|
-
import { b as KupThemeColorValues } from './kup-manager-
|
|
1
|
+
import { h, a as getAssetPath } from './index-baeab1ac.js';
|
|
2
|
+
import { b as KupThemeColorValues } from './kup-manager-9316a184.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* The type of a CSS step in CSS-drawing mode.
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { h, a as getAssetPath } from './index-baeab1ac.js';
|
|
2
|
+
import { a as KupThemeIconValues } from './kup-manager-9316a184.js';
|
|
3
|
+
|
|
4
|
+
/*-------------------------------------------------*/
|
|
5
|
+
/* C o m p o n e n t */
|
|
6
|
+
/*-------------------------------------------------*/
|
|
7
|
+
const FTextField = (props, children) => {
|
|
8
|
+
return (h("div", Object.assign({ class: `f-text-field ${props.danger ? 'kup-danger' : ''} ${props.fullHeight ? 'kup-full-height' : ''} ${props.fullWidth ? 'kup-full-width' : ''} ${props.info ? 'kup-info' : ''} ${props.secondary ? 'kup-secondary' : ''} ${props.shaped ? 'kup-shaped' : ''} ${props.success ? 'kup-success' : ''} ${props.warning ? 'kup-warning' : ''} ${props.wrapperClass ? props.wrapperClass : ''}` }, props.dataSet, { id: props.id, title: props.title }),
|
|
9
|
+
props.leadingLabel || props.trailingLabel ? (h("div", { class: `mdc-form-field ${props.leadingLabel ? 'mdc-form-field--align-end' : ''}` }, [
|
|
10
|
+
setContent(props),
|
|
11
|
+
setHelper(props),
|
|
12
|
+
h("label", null, props.label),
|
|
13
|
+
])) : ([setContent(props), setHelper(props)]),
|
|
14
|
+
children));
|
|
15
|
+
};
|
|
16
|
+
/*-------------------------------------------------*/
|
|
17
|
+
/* M e t h o d s */
|
|
18
|
+
/*-------------------------------------------------*/
|
|
19
|
+
function setContent(props) {
|
|
20
|
+
const isOutlined = props.textArea || props.outlined;
|
|
21
|
+
let labelEl;
|
|
22
|
+
let iconEl;
|
|
23
|
+
if (props.label && !props.leadingLabel && !props.trailingLabel) {
|
|
24
|
+
labelEl = (h("label", { class: "mdc-floating-label", htmlFor: "kup-input" }, props.label));
|
|
25
|
+
}
|
|
26
|
+
if (props.icon) {
|
|
27
|
+
let iconStyle;
|
|
28
|
+
let iconClass = '';
|
|
29
|
+
if (Object.values(KupThemeIconValues).indexOf(props.icon) > -1) {
|
|
30
|
+
iconClass = props.icon.replace('--', '');
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
let svg = `url('${getAssetPath(`./assets/svg/${props.icon}.svg`)}') no-repeat center`;
|
|
34
|
+
iconStyle = {
|
|
35
|
+
mask: svg,
|
|
36
|
+
webkitMask: svg,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
iconEl = (h("span", { style: iconStyle, onClick: props.onIconClick, class: `mdc-text-field__icon kup-icon action ${iconClass}` }));
|
|
40
|
+
}
|
|
41
|
+
const classObj = {
|
|
42
|
+
'is-clearable': props.isClearable,
|
|
43
|
+
'mdc-text-field': true,
|
|
44
|
+
'mdc-text-field--disabled': props.disabled,
|
|
45
|
+
'mdc-text-field--filled': !props.fullWidth && !isOutlined,
|
|
46
|
+
'mdc-text-field--no-label': !props.label,
|
|
47
|
+
'mdc-text-field--fullwidth': props.fullWidth,
|
|
48
|
+
'mdc-text-field--outlined': isOutlined,
|
|
49
|
+
'mdc-text-field--textarea': props.textArea,
|
|
50
|
+
'mdc-text-field--with-leading-icon': props.icon && !props.trailingIcon,
|
|
51
|
+
'mdc-text-field--with-trailing-icon': props.icon && props.trailingIcon,
|
|
52
|
+
};
|
|
53
|
+
return (h("div", { class: classObj },
|
|
54
|
+
props.textArea && props.maxLength ? (h("div", { class: "mdc-text-field-character-counter" },
|
|
55
|
+
"'0 / ' + ",
|
|
56
|
+
props.maxLength)) : undefined,
|
|
57
|
+
!props.trailingIcon ? iconEl : undefined,
|
|
58
|
+
props.textArea ? (h("span", { class: "mdc-text-field__resizer" },
|
|
59
|
+
h("textarea", { class: "mdc-text-field__input", disabled: props.disabled, readOnly: props.readOnly, maxlength: props.maxLength, value: props.value, onBlur: props.onBlur, onClick: props.onClick, onChange: props.onChange, onFocus: props.onFocus, onInput: props.onInput, onKeyDown: props.onKeyDown }))) : (h("input", { type: props.inputType ? props.inputType : 'text', step: props.step, min: props.min, max: props.max, class: "mdc-text-field__input", disabled: props.disabled, readOnly: props.readOnly, placeholder: props.fullWidth ? props.label : undefined, maxlength: props.maxLength, value: props.value, onBlur: props.onBlur, onClick: props.onClick, onChange: props.onChange, onFocus: props.onFocus, onInput: props.onInput, onKeyDown: props.onKeyDown })),
|
|
60
|
+
props.isClearable ? (h("span", { class: `mdc-text-field__icon kup-icon ${KupThemeIconValues.CLEAR.replace('--', '')}`, onClick: props.onClearIconClick })) : undefined,
|
|
61
|
+
props.trailingIcon ? iconEl : undefined,
|
|
62
|
+
!props.fullWidth && !isOutlined ? labelEl : undefined,
|
|
63
|
+
isOutlined ? (h("div", { class: "mdc-notched-outline" },
|
|
64
|
+
h("div", { class: "mdc-notched-outline__leading" }),
|
|
65
|
+
h("div", { class: "mdc-notched-outline__notch" }, labelEl),
|
|
66
|
+
h("div", { class: "mdc-notched-outline__trailing" }))) : (h("span", { class: "mdc-line-ripple" }))));
|
|
67
|
+
}
|
|
68
|
+
function setHelper(props) {
|
|
69
|
+
if (props.helperEnabled !== false) {
|
|
70
|
+
if (props.helper) {
|
|
71
|
+
const classObj = {
|
|
72
|
+
'mdc-text-field-helper-text': true,
|
|
73
|
+
'mdc-text-field-helper-text--persistent': !props.helperWhenFocused,
|
|
74
|
+
};
|
|
75
|
+
return (h("div", { class: "mdc-text-field-helper-line" },
|
|
76
|
+
h("div", { class: classObj }, props.helper),
|
|
77
|
+
props.maxLength && !props.textArea ? (h("div", { class: "mdc-text-field-character-counter" },
|
|
78
|
+
"'0 / ' + ",
|
|
79
|
+
props.maxLength.toString())) : undefined));
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
if (props.maxLength && !props.textArea) {
|
|
83
|
+
return (h("div", { class: "mdc-text-field-helper-line" },
|
|
84
|
+
h("div", { class: "mdc-text-field-character-counter" },
|
|
85
|
+
"'0 / ' + ",
|
|
86
|
+
props.maxLength)));
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export { FTextField as F };
|