@sme.up/ketchup 9.3.0 → 9.5.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-4caf541a.js → f-button-033ed6d4.js} +1 -1
- package/dist/cjs/{f-cell-979c26ea.js → f-cell-ef276797.js} +5 -5
- package/dist/cjs/{f-chip-8957940b.js → f-chip-d4e26a2b.js} +2 -2
- package/dist/cjs/{f-image-e16fe10d.js → f-image-33be7baf.js} +1 -1
- package/dist/cjs/{f-paginator-utils-f2dd0322.js → f-paginator-utils-5a18cc19.js} +2 -2
- package/dist/cjs/{f-text-field-2fac8078.js → f-text-field-f03e97f8.js} +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/ketchup.cjs.js +1 -1
- package/dist/cjs/kup-accordion.cjs.entry.js +2 -2
- package/dist/cjs/kup-autocomplete_27.cjs.entry.js +18 -9
- package/dist/cjs/kup-box.cjs.entry.js +9 -9
- package/dist/cjs/kup-calendar.cjs.entry.js +4 -4
- package/dist/cjs/kup-card-list.cjs.entry.js +1 -1
- package/dist/cjs/kup-cell.cjs.entry.js +6 -6
- package/dist/cjs/kup-dashboard.cjs.entry.js +4 -4
- package/dist/cjs/kup-drawer.cjs.entry.js +1 -1
- package/dist/cjs/kup-echart.cjs.entry.js +1 -1
- package/dist/cjs/kup-family-tree.cjs.entry.js +3 -3
- package/dist/cjs/kup-grid.cjs.entry.js +1 -1
- package/dist/cjs/kup-iframe.cjs.entry.js +1 -1
- package/dist/cjs/kup-image-list.cjs.entry.js +6 -6
- package/dist/cjs/kup-lazy.cjs.entry.js +1 -1
- package/dist/cjs/kup-magic-box.cjs.entry.js +2 -2
- package/dist/cjs/{kup-manager-c63f4fb9.js → kup-manager-f90f1b6d.js} +125 -0
- package/dist/cjs/kup-nav-bar.cjs.entry.js +1 -1
- package/dist/cjs/kup-numeric-picker.cjs.entry.js +2 -2
- package/dist/cjs/kup-openai-interface.cjs.entry.js +146 -0
- package/dist/cjs/kup-photo-frame.cjs.entry.js +1 -1
- package/dist/cjs/kup-planner.cjs.entry.js +2 -2
- package/dist/cjs/kup-probe.cjs.entry.js +1 -1
- package/dist/cjs/kup-qlik.cjs.entry.js +1 -1
- package/dist/cjs/kup-snackbar.cjs.entry.js +3 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/kup-box/kup-box.js +3 -3
- package/dist/collection/components/kup-data-table/kup-data-table.js +11 -2
- package/dist/collection/components/kup-image/assets/svg/open-ai.svg +1 -0
- package/dist/collection/components/kup-openai-interface/kup-openai-interface-declarations.js +11 -0
- package/dist/collection/components/kup-openai-interface/kup-openai-interface.css +64 -0
- package/dist/collection/components/kup-openai-interface/kup-openai-interface.js +340 -0
- package/dist/collection/managers/kup-manager/kup-manager.js +124 -0
- package/dist/components/kup-autocomplete2.js +11 -2
- package/dist/components/kup-box2.js +3 -3
- package/dist/components/kup-dashboard.js +1 -1
- package/dist/components/kup-magic-box.js +1 -1
- package/dist/components/kup-manager.js +125 -1
- package/dist/components/kup-openai-interface.d.ts +11 -0
- package/dist/components/kup-openai-interface.js +301 -0
- package/dist/esm/{f-button-5ccc2e50.js → f-button-ccde4447.js} +1 -1
- package/dist/esm/{f-cell-6f4290b2.js → f-cell-2ad41d52.js} +5 -5
- package/dist/esm/{f-chip-465aa432.js → f-chip-3df1c255.js} +2 -2
- package/dist/esm/{f-image-c5063342.js → f-image-5434b351.js} +1 -1
- package/dist/esm/{f-paginator-utils-6903534b.js → f-paginator-utils-b90cdd2b.js} +2 -2
- package/dist/esm/{f-text-field-28b2b26d.js → f-text-field-f0b81f8b.js} +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/ketchup.js +1 -1
- package/dist/esm/kup-accordion.entry.js +2 -2
- package/dist/esm/kup-autocomplete_27.entry.js +18 -9
- package/dist/esm/kup-box.entry.js +9 -9
- package/dist/esm/kup-calendar.entry.js +4 -4
- package/dist/esm/kup-card-list.entry.js +1 -1
- package/dist/esm/kup-cell.entry.js +6 -6
- package/dist/esm/kup-dashboard.entry.js +4 -4
- package/dist/esm/kup-drawer.entry.js +1 -1
- package/dist/esm/kup-echart.entry.js +1 -1
- package/dist/esm/kup-family-tree.entry.js +3 -3
- package/dist/esm/kup-grid.entry.js +1 -1
- package/dist/esm/kup-iframe.entry.js +1 -1
- package/dist/esm/kup-image-list.entry.js +6 -6
- package/dist/esm/kup-lazy.entry.js +1 -1
- package/dist/esm/kup-magic-box.entry.js +2 -2
- package/dist/esm/{kup-manager-bfea4e6f.js → kup-manager-e33d8d8c.js} +125 -1
- package/dist/esm/kup-nav-bar.entry.js +1 -1
- package/dist/esm/kup-numeric-picker.entry.js +2 -2
- package/dist/esm/kup-openai-interface.entry.js +142 -0
- package/dist/esm/kup-photo-frame.entry.js +1 -1
- package/dist/esm/kup-planner.entry.js +2 -2
- package/dist/esm/kup-probe.entry.js +1 -1
- package/dist/esm/kup-qlik.entry.js +1 -1
- package/dist/esm/kup-snackbar.entry.js +3 -3
- package/dist/esm/loader.js +1 -1
- package/dist/ketchup/assets/svg/open-ai.svg +1 -0
- package/dist/ketchup/index.esm.js +1 -1
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/{p-f2df4ce9.entry.js → p-01aaf3e4.entry.js} +1 -1
- package/dist/ketchup/{p-ce9ef2d5.js → p-11e7be94.js} +1 -1
- package/dist/ketchup/{p-903d1b10.entry.js → p-190d0bc5.entry.js} +1 -1
- package/dist/ketchup/{p-95272714.entry.js → p-1a594e06.entry.js} +1 -1
- package/dist/ketchup/{p-7c5a1357.entry.js → p-1dbfcab5.entry.js} +1 -1
- package/dist/ketchup/{p-85279516.entry.js → p-23e4caa1.entry.js} +2 -2
- package/dist/ketchup/p-2681d3a2.entry.js +1 -0
- package/dist/ketchup/p-269a1dfe.entry.js +1 -0
- package/dist/ketchup/{p-829d7060.entry.js → p-2940b559.entry.js} +1 -1
- package/dist/ketchup/{p-4bc3b3a6.js → p-39ba3355.js} +1 -1
- package/dist/ketchup/{p-eae42bff.entry.js → p-4725191c.entry.js} +1 -1
- package/dist/ketchup/{p-097500fe.js → p-4afe8662.js} +1 -1
- package/dist/ketchup/{p-8591ac0b.entry.js → p-58798e2d.entry.js} +1 -1
- package/dist/ketchup/{p-e46470a6.entry.js → p-5b3d8636.entry.js} +1 -1
- package/dist/ketchup/{p-0f91d4de.entry.js → p-5fa089cd.entry.js} +1 -1
- package/dist/ketchup/{p-db93bc06.entry.js → p-645d881d.entry.js} +1 -1
- package/dist/ketchup/{p-d7b8295a.entry.js → p-6a8fcb02.entry.js} +1 -1
- package/dist/ketchup/{p-20aa95ae.entry.js → p-6f108540.entry.js} +1 -1
- package/dist/ketchup/{p-8ecdd076.entry.js → p-788da2d9.entry.js} +1 -1
- package/dist/ketchup/{p-69287f4a.entry.js → p-7e5d8532.entry.js} +1 -1
- package/dist/ketchup/{p-ee6305f5.js → p-95b31ede.js} +1 -1
- package/dist/ketchup/{p-4c1ec006.js → p-9df95b9f.js} +1 -1
- package/dist/ketchup/{p-7a72c4fa.entry.js → p-a5229d3d.entry.js} +1 -1
- package/dist/ketchup/{p-0cb5e9ae.entry.js → p-b104afb6.entry.js} +1 -1
- package/dist/ketchup/{p-8e180c01.entry.js → p-b857aab2.entry.js} +1 -1
- package/dist/ketchup/{p-1872c92e.entry.js → p-c0c65349.entry.js} +1 -1
- package/dist/ketchup/{p-f1efab38.entry.js → p-ddd25869.entry.js} +1 -1
- package/dist/ketchup/p-eea1ee1b.js +1 -0
- package/dist/ketchup/{p-21c640a5.js → p-f0e4e190.js} +1 -1
- package/dist/ketchup/{p-51f9b230.entry.js → p-f81d7218.entry.js} +1 -1
- package/dist/types/components/kup-openai-interface/kup-openai-interface-declarations.d.ts +10 -0
- package/dist/types/components/kup-openai-interface/kup-openai-interface.d.ts +59 -0
- package/dist/types/components.d.ts +86 -0
- package/dist/types/managers/kup-manager/kup-manager-declarations.d.ts +15 -0
- package/dist/types/managers/kup-manager/kup-manager.d.ts +17 -1
- package/package.json +1 -1
- package/dist/ketchup/p-612b46da.entry.js +0 -1
- package/dist/ketchup/p-84be8f0b.js +0 -1
|
@@ -3,17 +3,17 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-8f2f4159.js');
|
|
6
|
-
const kupManager = require('./kup-manager-
|
|
6
|
+
const kupManager = require('./kup-manager-f90f1b6d.js');
|
|
7
7
|
const GenericVariables = require('./GenericVariables-1d52ba57.js');
|
|
8
|
-
const fImage = require('./f-image-
|
|
9
|
-
const fButton = require('./f-button-
|
|
8
|
+
const fImage = require('./f-image-33be7baf.js');
|
|
9
|
+
const fButton = require('./f-button-033ed6d4.js');
|
|
10
10
|
const fButtonDeclarations = require('./f-button-declarations-51ef6d9a.js');
|
|
11
|
-
const fCell = require('./f-cell-
|
|
11
|
+
const fCell = require('./f-cell-ef276797.js');
|
|
12
12
|
const component = require('./component-cb3b32f5.js');
|
|
13
13
|
require('./kup-dates-0e59b05d.js');
|
|
14
14
|
require('./f-checkbox-41864e53.js');
|
|
15
|
-
require('./f-text-field-
|
|
16
|
-
require('./f-chip-
|
|
15
|
+
require('./f-text-field-f03e97f8.js');
|
|
16
|
+
require('./f-chip-d4e26a2b.js');
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Props of the kup-image-list component.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-8f2f4159.js');
|
|
6
|
-
const kupManager = require('./kup-manager-
|
|
6
|
+
const kupManager = require('./kup-manager-f90f1b6d.js');
|
|
7
7
|
const GenericVariables = require('./GenericVariables-1d52ba57.js');
|
|
8
8
|
require('./kup-dates-0e59b05d.js');
|
|
9
9
|
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-8f2f4159.js');
|
|
6
|
-
const kupManager = require('./kup-manager-
|
|
6
|
+
const kupManager = require('./kup-manager-f90f1b6d.js');
|
|
7
7
|
const fButtonDeclarations = require('./f-button-declarations-51ef6d9a.js');
|
|
8
|
-
const fImage = require('./f-image-
|
|
8
|
+
const fImage = require('./f-image-33be7baf.js');
|
|
9
9
|
const GenericVariables = require('./GenericVariables-1d52ba57.js');
|
|
10
10
|
require('./kup-dates-0e59b05d.js');
|
|
11
11
|
|
|
@@ -17587,6 +17587,8 @@ class KupManager {
|
|
|
17587
17587
|
*/
|
|
17588
17588
|
constructor(overrides) {
|
|
17589
17589
|
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, tooltipFCellCallbacks = null;
|
|
17590
|
+
/** POI VIA */
|
|
17591
|
+
this.openAIInterface = { url: 'https://kokosstaging.smeup.com' };
|
|
17590
17592
|
if (overrides) {
|
|
17591
17593
|
const assetsPath = overrides.assetsPath;
|
|
17592
17594
|
const dates = overrides.dates;
|
|
@@ -17597,6 +17599,7 @@ class KupManager {
|
|
|
17597
17599
|
const scrollOnHover = overrides.scrollOnHover;
|
|
17598
17600
|
const theme = overrides.theme;
|
|
17599
17601
|
const tooltip = overrides.tooltip;
|
|
17602
|
+
const openAIUrl = overrides.openAIUrl;
|
|
17600
17603
|
if (assetsPath) {
|
|
17601
17604
|
index.setAssetPath(assetsPath);
|
|
17602
17605
|
}
|
|
@@ -17639,6 +17642,9 @@ class KupManager {
|
|
|
17639
17642
|
? tooltip.fCellCallbacks
|
|
17640
17643
|
: null;
|
|
17641
17644
|
}
|
|
17645
|
+
if (openAIUrl) {
|
|
17646
|
+
this.openAIInterface = { url: openAIUrl };
|
|
17647
|
+
}
|
|
17642
17648
|
}
|
|
17643
17649
|
this.data = new KupData();
|
|
17644
17650
|
this.dates = new kupDates.KupDates(datesLocale);
|
|
@@ -17647,6 +17653,7 @@ class KupManager {
|
|
|
17647
17653
|
this.interact = new KupInteract(dialogZIndex, dialogRestrictContainer);
|
|
17648
17654
|
this.language = new KupLanguage(languageList, languageName);
|
|
17649
17655
|
this.magicBox = null;
|
|
17656
|
+
this.openAI = null;
|
|
17650
17657
|
this.math = new KupMath();
|
|
17651
17658
|
this.overrides = overrides ? overrides : null;
|
|
17652
17659
|
this.objects = new KupObjects(objectsList);
|
|
@@ -17759,6 +17766,123 @@ class KupManager {
|
|
|
17759
17766
|
this.hideMagicBox();
|
|
17760
17767
|
}
|
|
17761
17768
|
}
|
|
17769
|
+
/**
|
|
17770
|
+
* Creates OpenAI component interface.
|
|
17771
|
+
*/
|
|
17772
|
+
async showOpenAI(data) {
|
|
17773
|
+
if (!this.openAIInterface || !this.openAIInterface.url) {
|
|
17774
|
+
return;
|
|
17775
|
+
}
|
|
17776
|
+
if (this.openAI) {
|
|
17777
|
+
return;
|
|
17778
|
+
}
|
|
17779
|
+
const response = await fetch(this.openAIInterface.url + '/api/init', {
|
|
17780
|
+
method: 'POST',
|
|
17781
|
+
headers: {
|
|
17782
|
+
'Content-Type': 'application/json',
|
|
17783
|
+
},
|
|
17784
|
+
body: JSON.stringify({ data: data }),
|
|
17785
|
+
});
|
|
17786
|
+
console.log('kup-manager.showOpenAI() response', response);
|
|
17787
|
+
if (response) {
|
|
17788
|
+
if (response.status != 200) {
|
|
17789
|
+
this.debug.logMessage(this, await response.text(), exports.KupDebugCategory.ERROR);
|
|
17790
|
+
return;
|
|
17791
|
+
}
|
|
17792
|
+
const responseJson = await response.json();
|
|
17793
|
+
this.openAIInterface.sessionInfo = {
|
|
17794
|
+
fileId: responseJson.fileId,
|
|
17795
|
+
threadId: responseJson.threadId,
|
|
17796
|
+
};
|
|
17797
|
+
}
|
|
17798
|
+
this.openAI = document.createElement('kup-openai-interface');
|
|
17799
|
+
this.openAI.id = 'kup-openai-interface';
|
|
17800
|
+
this.openAI.style.position = 'fixed';
|
|
17801
|
+
this.openAI.style.left = 'calc(50% - 250px)';
|
|
17802
|
+
this.openAI.style.top = 'calc(50% - 85px)';
|
|
17803
|
+
this.openAI.data = data;
|
|
17804
|
+
document.body.appendChild(this.openAI);
|
|
17805
|
+
}
|
|
17806
|
+
/**
|
|
17807
|
+
* Removes OpenAI component interface.
|
|
17808
|
+
*/
|
|
17809
|
+
async hideOpenAI() {
|
|
17810
|
+
if (!this.openAI) {
|
|
17811
|
+
return;
|
|
17812
|
+
}
|
|
17813
|
+
this.openAI.remove();
|
|
17814
|
+
this.openAI = null;
|
|
17815
|
+
if (!this.openAIInterface || !this.openAIInterface.url) {
|
|
17816
|
+
return;
|
|
17817
|
+
}
|
|
17818
|
+
if (!this.openAIInterface.sessionInfo) {
|
|
17819
|
+
return;
|
|
17820
|
+
}
|
|
17821
|
+
const response = await fetch(this.openAIInterface.url + '/api/finalize', {
|
|
17822
|
+
method: 'POST',
|
|
17823
|
+
headers: {
|
|
17824
|
+
'Content-Type': 'application/json',
|
|
17825
|
+
},
|
|
17826
|
+
body: JSON.stringify({
|
|
17827
|
+
fileId: this.openAIInterface.sessionInfo.fileId,
|
|
17828
|
+
threadId: this.openAIInterface.sessionInfo.threadId,
|
|
17829
|
+
}),
|
|
17830
|
+
});
|
|
17831
|
+
console.log('kup-manager.hideOpenAI() response', response);
|
|
17832
|
+
if (response) {
|
|
17833
|
+
if (response.status != 200) {
|
|
17834
|
+
this.debug.logMessage(this, await response.text(), exports.KupDebugCategory.ERROR);
|
|
17835
|
+
return;
|
|
17836
|
+
}
|
|
17837
|
+
this.openAIInterface.sessionInfo = null;
|
|
17838
|
+
}
|
|
17839
|
+
}
|
|
17840
|
+
/**
|
|
17841
|
+
* Creates or removes OpenAI component interface depending on its existence.
|
|
17842
|
+
*/
|
|
17843
|
+
toggleOpenAI(data) {
|
|
17844
|
+
if (!this.openAI) {
|
|
17845
|
+
this.showOpenAI(data);
|
|
17846
|
+
}
|
|
17847
|
+
else {
|
|
17848
|
+
this.hideOpenAI();
|
|
17849
|
+
}
|
|
17850
|
+
}
|
|
17851
|
+
async interactOpenAI(question) {
|
|
17852
|
+
if (!this.openAI) {
|
|
17853
|
+
return;
|
|
17854
|
+
}
|
|
17855
|
+
if (!this.openAIInterface || !this.openAIInterface.url) {
|
|
17856
|
+
return;
|
|
17857
|
+
}
|
|
17858
|
+
if (!this.openAIInterface.sessionInfo) {
|
|
17859
|
+
return;
|
|
17860
|
+
}
|
|
17861
|
+
const responseArray = [];
|
|
17862
|
+
const response = await fetch(this.openAIInterface.url + '/api/chat', {
|
|
17863
|
+
method: 'POST',
|
|
17864
|
+
headers: {
|
|
17865
|
+
'Content-Type': 'application/json',
|
|
17866
|
+
},
|
|
17867
|
+
body: JSON.stringify({
|
|
17868
|
+
fileId: this.openAIInterface.sessionInfo.fileId,
|
|
17869
|
+
threadId: this.openAIInterface.sessionInfo.threadId,
|
|
17870
|
+
question: question,
|
|
17871
|
+
}),
|
|
17872
|
+
});
|
|
17873
|
+
console.log('kup-manager.interactOpenAI() response', response);
|
|
17874
|
+
if (response) {
|
|
17875
|
+
if (response.status != 200) {
|
|
17876
|
+
this.debug.logMessage(this, await response.text(), exports.KupDebugCategory.ERROR);
|
|
17877
|
+
return;
|
|
17878
|
+
}
|
|
17879
|
+
const responseJson = await response.json();
|
|
17880
|
+
if (responseJson && responseJson.messages) {
|
|
17881
|
+
responseArray.push(...responseJson.messages);
|
|
17882
|
+
}
|
|
17883
|
+
}
|
|
17884
|
+
return responseArray;
|
|
17885
|
+
}
|
|
17762
17886
|
/**
|
|
17763
17887
|
* Sets both locale and language library-wide.
|
|
17764
17888
|
* @param {KupDatesLocales} locale - The supported locale.
|
|
@@ -17883,6 +18007,7 @@ exports.iconColumn = iconColumn;
|
|
|
17883
18007
|
exports.identify = identify;
|
|
17884
18008
|
exports.keyColumn = keyColumn;
|
|
17885
18009
|
exports.kupDragActiveAttr = kupDragActiveAttr;
|
|
18010
|
+
exports.kupDraggableAttr = kupDraggableAttr;
|
|
17886
18011
|
exports.kupDraggableCellAttr = kupDraggableCellAttr;
|
|
17887
18012
|
exports.kupDraggableColumnAttr = kupDraggableColumnAttr;
|
|
17888
18013
|
exports.kupDraggableRowAttr = kupDraggableRowAttr;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-8f2f4159.js');
|
|
6
|
-
const kupManager = require('./kup-manager-
|
|
6
|
+
const kupManager = require('./kup-manager-f90f1b6d.js');
|
|
7
7
|
const GenericVariables = require('./GenericVariables-1d52ba57.js');
|
|
8
8
|
require('./kup-dates-0e59b05d.js');
|
|
9
9
|
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-8f2f4159.js');
|
|
6
|
-
const kupManager = require('./kup-manager-
|
|
6
|
+
const kupManager = require('./kup-manager-f90f1b6d.js');
|
|
7
7
|
const GenericVariables = require('./GenericVariables-1d52ba57.js');
|
|
8
|
-
const fTextField = require('./f-text-field-
|
|
8
|
+
const fTextField = require('./f-text-field-f03e97f8.js');
|
|
9
9
|
const fTextFieldMdc = require('./f-text-field-mdc-08a06162.js');
|
|
10
10
|
require('./kup-dates-0e59b05d.js');
|
|
11
11
|
require('./component-cb3b32f5.js');
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-8f2f4159.js');
|
|
6
|
+
const kupManager = require('./kup-manager-f90f1b6d.js');
|
|
7
|
+
const GenericVariables = require('./GenericVariables-1d52ba57.js');
|
|
8
|
+
const fImage = require('./f-image-33be7baf.js');
|
|
9
|
+
require('./kup-dates-0e59b05d.js');
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Props of the kup-openai-interface component.
|
|
13
|
+
* Used to export every prop in an object.
|
|
14
|
+
*/
|
|
15
|
+
var KupOpenAiInterfaceProps;
|
|
16
|
+
(function (KupOpenAiInterfaceProps) {
|
|
17
|
+
KupOpenAiInterfaceProps["customStyle"] = "Custom style of the component.";
|
|
18
|
+
KupOpenAiInterfaceProps["data"] = "Sets the data that will be used for OpenAI comunication.";
|
|
19
|
+
KupOpenAiInterfaceProps["dialogTitle"] = "Sets the dialog title";
|
|
20
|
+
KupOpenAiInterfaceProps["label"] = "Sets the text area label";
|
|
21
|
+
})(KupOpenAiInterfaceProps || (KupOpenAiInterfaceProps = {}));
|
|
22
|
+
|
|
23
|
+
const kupOpenaiInterfaceCss = ":host{--kup_dialog_header_height:var(--kup-dialog-header-height, 2em);background-color:var(--kup-background-color);color:var(--kup-text-color);display:block;height:auto;min-width:500px;width:500px}.header{background-color:var(--kup-title-background-color);color:var(--kup-title-color);display:flex;flex-direction:row;height:var(--kup_dialog_header_height);position:relative;width:100%}.header__title{font-weight:bold;line-height:2em;padding-left:0.5em;padding-right:2em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.header__close.f-image{--kup-icon-color:var(--kup-title-color);cursor:pointer;margin-right:0;transition:opacity 0.25s;position:absolute;right:0;background:var(--kup-title-background-color);height:var(--kup_image_height);width:var(--kup_image_width)}.header__close.f-image:hover{opacity:0.5}.header__close.f-image .f-image__icon{height:var(--kup_image_height);width:var(--kup_image_width)}kup-text-field{padding-top:12px;padding-right:3px;padding-left:3px}kup-button{padding-top:8px;padding-left:3px;padding-bottom:2px}kup-data-table{padding-top:8px;padding-left:3px;padding-bottom:2px}";
|
|
24
|
+
|
|
25
|
+
var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
26
|
+
if (kind === "a" && !f)
|
|
27
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
28
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
29
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
30
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
31
|
+
};
|
|
32
|
+
var _KupOpenAiInterface_instances, _KupOpenAiInterface_openAiInteract, _KupOpenAiInterface_dataTableData;
|
|
33
|
+
const KupOpenAiInterface = class {
|
|
34
|
+
constructor(hostRef) {
|
|
35
|
+
index.registerInstance(this, hostRef);
|
|
36
|
+
this.kupReady = index.createEvent(this, "kup-openai-interface-ready", 6);
|
|
37
|
+
_KupOpenAiInterface_instances.add(this);
|
|
38
|
+
/*-------------------------------------------------*/
|
|
39
|
+
/* I n t e r n a l V a r i a b l e s */
|
|
40
|
+
/*-------------------------------------------------*/
|
|
41
|
+
this.dragHandler = null;
|
|
42
|
+
this.kupManager = kupManager.kupManagerInstance();
|
|
43
|
+
this.textArea = null;
|
|
44
|
+
this.dataTable = null;
|
|
45
|
+
this.button = null;
|
|
46
|
+
this.messages = [];
|
|
47
|
+
this.customStyle = '';
|
|
48
|
+
this.data = null;
|
|
49
|
+
this.dialogTitle = 'Open AI integration';
|
|
50
|
+
this.label = 'Insert natural language request...';
|
|
51
|
+
}
|
|
52
|
+
/*-------------------------------------------------*/
|
|
53
|
+
/* P u b l i c M e t h o d s */
|
|
54
|
+
/*-------------------------------------------------*/
|
|
55
|
+
/**
|
|
56
|
+
* Used to retrieve component's props values.
|
|
57
|
+
* @param {boolean} descriptions - When provided and true, the result will be the list of props with their description.
|
|
58
|
+
* @returns {Promise<GenericObject>} List of props as object, each key will be a prop.
|
|
59
|
+
*/
|
|
60
|
+
async getProps(descriptions) {
|
|
61
|
+
return kupManager.getProps(this, KupOpenAiInterfaceProps, descriptions);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* This method is used to trigger a new render of the component.
|
|
65
|
+
*/
|
|
66
|
+
async refresh() {
|
|
67
|
+
index.forceUpdate(this);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Sets the props to the component.
|
|
71
|
+
* @param {GenericObject} props - Object containing props that will be set to the component.
|
|
72
|
+
*/
|
|
73
|
+
async setProps(props) {
|
|
74
|
+
kupManager.setProps(this, KupOpenAiInterfaceProps, props);
|
|
75
|
+
}
|
|
76
|
+
/*-------------------------------------------------*/
|
|
77
|
+
/* L i f e c y c l e H o o k s */
|
|
78
|
+
/*-------------------------------------------------*/
|
|
79
|
+
componentWillLoad() {
|
|
80
|
+
this.kupManager.debug.logLoad(this, false);
|
|
81
|
+
this.kupManager.language.register(this);
|
|
82
|
+
this.kupManager.theme.register(this);
|
|
83
|
+
}
|
|
84
|
+
componentDidLoad() {
|
|
85
|
+
this.dragHandler =
|
|
86
|
+
this.rootElement.shadowRoot.querySelector('#drag-handle');
|
|
87
|
+
this.kupManager.interact.dialogify(this.rootElement, this.dragHandler);
|
|
88
|
+
this.kupReady.emit({
|
|
89
|
+
comp: this,
|
|
90
|
+
id: this.rootElement.id,
|
|
91
|
+
});
|
|
92
|
+
this.kupManager.debug.logLoad(this, true);
|
|
93
|
+
}
|
|
94
|
+
componentWillRender() {
|
|
95
|
+
this.kupManager.debug.logRender(this, false);
|
|
96
|
+
}
|
|
97
|
+
componentDidRender() {
|
|
98
|
+
this.kupManager.debug.logRender(this, true);
|
|
99
|
+
}
|
|
100
|
+
render() {
|
|
101
|
+
const dataTableProps = {};
|
|
102
|
+
dataTableProps.data = __classPrivateFieldGet(this, _KupOpenAiInterface_instances, "m", _KupOpenAiInterface_dataTableData).call(this);
|
|
103
|
+
const textAreaProps = {};
|
|
104
|
+
textAreaProps.textArea = true;
|
|
105
|
+
textAreaProps.label = this.label;
|
|
106
|
+
const buttonProps = {};
|
|
107
|
+
buttonProps.label = 'Confirm';
|
|
108
|
+
buttonProps.icon = 'check';
|
|
109
|
+
buttonProps.showSpinner = false;
|
|
110
|
+
return (index.h(index.Host, null, index.h("style", null, this.kupManager.theme.setKupStyle(this.rootElement)), index.h("div", { id: GenericVariables.componentWrapperId }, index.h("div", { class: "openai-interface-wrapper" }, index.h("div", { class: "actions", id: "drag-handle" }, index.h("div", { class: "header" }, this.dialogTitle ? (index.h("div", { class: "header__title" }, this.dialogTitle)) : null, index.h(fImage.FImage, { onClick: () => this.kupManager.hideOpenAI(), sizeX: "1.25em", sizeY: "1.25em", resource: "clear", wrapperClass: "header__close" })), index.h("kup-text-field", Object.assign({}, textAreaProps, { ref: (el) => (this.textArea = el) })), index.h("kup-button", Object.assign({}, buttonProps, { ref: (el) => (this.button = el), "onKup-button-click": () => __classPrivateFieldGet(this, _KupOpenAiInterface_instances, "m", _KupOpenAiInterface_openAiInteract).call(this) })), index.h("kup-data-table", Object.assign({}, dataTableProps, { ref: (el) => (this.dataTable = el) })))))));
|
|
111
|
+
}
|
|
112
|
+
disconnectedCallback() {
|
|
113
|
+
this.kupManager.language.unregister(this);
|
|
114
|
+
this.kupManager.theme.unregister(this);
|
|
115
|
+
}
|
|
116
|
+
get rootElement() { return index.getElement(this); }
|
|
117
|
+
};
|
|
118
|
+
_KupOpenAiInterface_instances = new WeakSet(), _KupOpenAiInterface_openAiInteract =
|
|
119
|
+
/*-------------------------------------------------*/
|
|
120
|
+
/* P r i v a t e M e t h o d s */
|
|
121
|
+
/*-------------------------------------------------*/
|
|
122
|
+
async function _KupOpenAiInterface_openAiInteract() {
|
|
123
|
+
this.button.showSpinner = true;
|
|
124
|
+
this.messages = await this.kupManager.interactOpenAI(await this.textArea.getValue());
|
|
125
|
+
this.dataTable.data = __classPrivateFieldGet(this, _KupOpenAiInterface_instances, "m", _KupOpenAiInterface_dataTableData).call(this);
|
|
126
|
+
this.button.showSpinner = false;
|
|
127
|
+
}, _KupOpenAiInterface_dataTableData = function _KupOpenAiInterface_dataTableData() {
|
|
128
|
+
const data = {};
|
|
129
|
+
data.columns = [{ name: 'mess', title: 'Message' }];
|
|
130
|
+
data.rows = [];
|
|
131
|
+
if (this.messages) {
|
|
132
|
+
for (let i = 0; i < this.messages.length; i++) {
|
|
133
|
+
const mess = this.messages[i];
|
|
134
|
+
if (mess) {
|
|
135
|
+
data.rows.push({
|
|
136
|
+
unselectable: true,
|
|
137
|
+
cells: { mess: { value: mess } },
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
return data;
|
|
143
|
+
};
|
|
144
|
+
KupOpenAiInterface.style = kupOpenaiInterfaceCss;
|
|
145
|
+
|
|
146
|
+
exports.kup_openai_interface = KupOpenAiInterface;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-8f2f4159.js');
|
|
6
|
-
const kupManager = require('./kup-manager-
|
|
6
|
+
const kupManager = require('./kup-manager-f90f1b6d.js');
|
|
7
7
|
const GenericVariables = require('./GenericVariables-1d52ba57.js');
|
|
8
8
|
require('./kup-dates-0e59b05d.js');
|
|
9
9
|
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-8f2f4159.js');
|
|
6
|
-
const kupManager$1 = require('./kup-manager-
|
|
6
|
+
const kupManager$1 = require('./kup-manager-f90f1b6d.js');
|
|
7
7
|
const kupPlannerDeclarations = require('./kup-planner-declarations-d3dec885.js');
|
|
8
8
|
const GenericVariables = require('./GenericVariables-1d52ba57.js');
|
|
9
9
|
const kupDates = require('./kup-dates-0e59b05d.js');
|
|
10
|
-
const fTextField = require('./f-text-field-
|
|
10
|
+
const fTextField = require('./f-text-field-f03e97f8.js');
|
|
11
11
|
const fTextFieldMdc = require('./f-text-field-mdc-08a06162.js');
|
|
12
12
|
require('./component-cb3b32f5.js');
|
|
13
13
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-8f2f4159.js');
|
|
6
|
-
const kupManager = require('./kup-manager-
|
|
6
|
+
const kupManager = require('./kup-manager-f90f1b6d.js');
|
|
7
7
|
const GenericVariables = require('./GenericVariables-1d52ba57.js');
|
|
8
8
|
require('./kup-dates-0e59b05d.js');
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-8f2f4159.js');
|
|
6
|
-
const kupManager = require('./kup-manager-
|
|
6
|
+
const kupManager = require('./kup-manager-f90f1b6d.js');
|
|
7
7
|
require('./kup-dates-0e59b05d.js');
|
|
8
8
|
|
|
9
9
|
const kupQlikCss = ".kup-qlik-container-fluid{width:100%}.kup-qlik-container{width:100%}@media (min-width: 576px){.kup-qlik-container{width:576px}.kup-qlik-row>.qvobject{flex:0 0 auto;min-width:100px;margin:0px auto 5px auto}}@media (min-width: 768px){.kup-qlik-container{width:768px}.kup-qlik-row>.qvobject{flex:0 0 auto;min-width:100px;margin:0px auto 5px auto}}@media (min-width: 992px){.kup-qlik-container{width:992px}.kup-qlik-row>.qvobject{flex:0 0 auto;min-width:100px;margin:0px auto 5px auto}}@media (min-width: 1200px){.kup-qlik-container{width:1200px}.kup-qlik-row>.qvobject{flex:0 0 auto;min-width:100px;margin:0px auto 5px auto}}.kup-qlik-row{display:flex;display:ms-flexbox;flex-wrap:wrap;-ms-flex-wrap:wrap;margin-bottom:5px}.kup-qlik-row .size-M{height:var(--lyo_obj-height)}.kup-qlik-row .size-S{height:calc(var(--lyo_obj-height) / 2)}.kup-qlik-row .size-XS{height:calc(var(--lyo_obj-height) / 3)}.kup-qlik-row .size-L{height:calc(var(--lyo_obj-height) * 2)}.kup-qlik-row .size-XL{height:calc(var(--lyo_obj-height) * 3)}.kup-qlik-row .bordered{border:1px solid var(--kup-border-color, #969696)}.kup-qlik-row .width-1{width:8.3333%}.kup-qlik-row .width-2{width:16.6666%}.kup-qlik-row .width-3{width:25%}.kup-qlik-row .width-4{width:33.3333%}.kup-qlik-row .width-5{width:41.6666%}.kup-qlik-row .width-6{width:50%}.kup-qlik-row .width-7{width:58.3333%}.kup-qlik-row .width-8{width:66.6666%}.kup-qlik-row .width-9{width:75%}.kup-qlik-row .width-10{width:83.3333%}.kup-qlik-row .width-11{width:91.6666%}.kup-qlik-row .width-12{width:100%}";
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-8f2f4159.js');
|
|
6
|
-
const kupManager = require('./kup-manager-
|
|
6
|
+
const kupManager = require('./kup-manager-f90f1b6d.js');
|
|
7
7
|
const GenericVariables = require('./GenericVariables-1d52ba57.js');
|
|
8
|
-
const fButton = require('./f-button-
|
|
8
|
+
const fButton = require('./f-button-033ed6d4.js');
|
|
9
9
|
require('./kup-dates-0e59b05d.js');
|
|
10
10
|
require('./f-button-declarations-51ef6d9a.js');
|
|
11
|
-
require('./f-image-
|
|
11
|
+
require('./f-image-33be7baf.js');
|
|
12
12
|
|
|
13
13
|
const snackbarClass = 'snackbar';
|
|
14
14
|
/**
|