@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
|
@@ -17585,6 +17585,8 @@ class KupManager {
|
|
|
17585
17585
|
*/
|
|
17586
17586
|
constructor(overrides) {
|
|
17587
17587
|
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;
|
|
17588
|
+
/** POI VIA */
|
|
17589
|
+
this.openAIInterface = { url: 'https://kokosstaging.smeup.com' };
|
|
17588
17590
|
if (overrides) {
|
|
17589
17591
|
const assetsPath = overrides.assetsPath;
|
|
17590
17592
|
const dates = overrides.dates;
|
|
@@ -17595,6 +17597,7 @@ class KupManager {
|
|
|
17595
17597
|
const scrollOnHover = overrides.scrollOnHover;
|
|
17596
17598
|
const theme = overrides.theme;
|
|
17597
17599
|
const tooltip = overrides.tooltip;
|
|
17600
|
+
const openAIUrl = overrides.openAIUrl;
|
|
17598
17601
|
if (assetsPath) {
|
|
17599
17602
|
setAssetPath(assetsPath);
|
|
17600
17603
|
}
|
|
@@ -17637,6 +17640,9 @@ class KupManager {
|
|
|
17637
17640
|
? tooltip.fCellCallbacks
|
|
17638
17641
|
: null;
|
|
17639
17642
|
}
|
|
17643
|
+
if (openAIUrl) {
|
|
17644
|
+
this.openAIInterface = { url: openAIUrl };
|
|
17645
|
+
}
|
|
17640
17646
|
}
|
|
17641
17647
|
this.data = new KupData();
|
|
17642
17648
|
this.dates = new KupDates(datesLocale);
|
|
@@ -17645,6 +17651,7 @@ class KupManager {
|
|
|
17645
17651
|
this.interact = new KupInteract(dialogZIndex, dialogRestrictContainer);
|
|
17646
17652
|
this.language = new KupLanguage(languageList, languageName);
|
|
17647
17653
|
this.magicBox = null;
|
|
17654
|
+
this.openAI = null;
|
|
17648
17655
|
this.math = new KupMath();
|
|
17649
17656
|
this.overrides = overrides ? overrides : null;
|
|
17650
17657
|
this.objects = new KupObjects(objectsList);
|
|
@@ -17757,6 +17764,123 @@ class KupManager {
|
|
|
17757
17764
|
this.hideMagicBox();
|
|
17758
17765
|
}
|
|
17759
17766
|
}
|
|
17767
|
+
/**
|
|
17768
|
+
* Creates OpenAI component interface.
|
|
17769
|
+
*/
|
|
17770
|
+
async showOpenAI(data) {
|
|
17771
|
+
if (!this.openAIInterface || !this.openAIInterface.url) {
|
|
17772
|
+
return;
|
|
17773
|
+
}
|
|
17774
|
+
if (this.openAI) {
|
|
17775
|
+
return;
|
|
17776
|
+
}
|
|
17777
|
+
const response = await fetch(this.openAIInterface.url + '/api/init', {
|
|
17778
|
+
method: 'POST',
|
|
17779
|
+
headers: {
|
|
17780
|
+
'Content-Type': 'application/json',
|
|
17781
|
+
},
|
|
17782
|
+
body: JSON.stringify({ data: data }),
|
|
17783
|
+
});
|
|
17784
|
+
console.log('kup-manager.showOpenAI() response', response);
|
|
17785
|
+
if (response) {
|
|
17786
|
+
if (response.status != 200) {
|
|
17787
|
+
this.debug.logMessage(this, await response.text(), KupDebugCategory.ERROR);
|
|
17788
|
+
return;
|
|
17789
|
+
}
|
|
17790
|
+
const responseJson = await response.json();
|
|
17791
|
+
this.openAIInterface.sessionInfo = {
|
|
17792
|
+
fileId: responseJson.fileId,
|
|
17793
|
+
threadId: responseJson.threadId,
|
|
17794
|
+
};
|
|
17795
|
+
}
|
|
17796
|
+
this.openAI = document.createElement('kup-openai-interface');
|
|
17797
|
+
this.openAI.id = 'kup-openai-interface';
|
|
17798
|
+
this.openAI.style.position = 'fixed';
|
|
17799
|
+
this.openAI.style.left = 'calc(50% - 250px)';
|
|
17800
|
+
this.openAI.style.top = 'calc(50% - 85px)';
|
|
17801
|
+
this.openAI.data = data;
|
|
17802
|
+
document.body.appendChild(this.openAI);
|
|
17803
|
+
}
|
|
17804
|
+
/**
|
|
17805
|
+
* Removes OpenAI component interface.
|
|
17806
|
+
*/
|
|
17807
|
+
async hideOpenAI() {
|
|
17808
|
+
if (!this.openAI) {
|
|
17809
|
+
return;
|
|
17810
|
+
}
|
|
17811
|
+
this.openAI.remove();
|
|
17812
|
+
this.openAI = null;
|
|
17813
|
+
if (!this.openAIInterface || !this.openAIInterface.url) {
|
|
17814
|
+
return;
|
|
17815
|
+
}
|
|
17816
|
+
if (!this.openAIInterface.sessionInfo) {
|
|
17817
|
+
return;
|
|
17818
|
+
}
|
|
17819
|
+
const response = await fetch(this.openAIInterface.url + '/api/finalize', {
|
|
17820
|
+
method: 'POST',
|
|
17821
|
+
headers: {
|
|
17822
|
+
'Content-Type': 'application/json',
|
|
17823
|
+
},
|
|
17824
|
+
body: JSON.stringify({
|
|
17825
|
+
fileId: this.openAIInterface.sessionInfo.fileId,
|
|
17826
|
+
threadId: this.openAIInterface.sessionInfo.threadId,
|
|
17827
|
+
}),
|
|
17828
|
+
});
|
|
17829
|
+
console.log('kup-manager.hideOpenAI() response', response);
|
|
17830
|
+
if (response) {
|
|
17831
|
+
if (response.status != 200) {
|
|
17832
|
+
this.debug.logMessage(this, await response.text(), KupDebugCategory.ERROR);
|
|
17833
|
+
return;
|
|
17834
|
+
}
|
|
17835
|
+
this.openAIInterface.sessionInfo = null;
|
|
17836
|
+
}
|
|
17837
|
+
}
|
|
17838
|
+
/**
|
|
17839
|
+
* Creates or removes OpenAI component interface depending on its existence.
|
|
17840
|
+
*/
|
|
17841
|
+
toggleOpenAI(data) {
|
|
17842
|
+
if (!this.openAI) {
|
|
17843
|
+
this.showOpenAI(data);
|
|
17844
|
+
}
|
|
17845
|
+
else {
|
|
17846
|
+
this.hideOpenAI();
|
|
17847
|
+
}
|
|
17848
|
+
}
|
|
17849
|
+
async interactOpenAI(question) {
|
|
17850
|
+
if (!this.openAI) {
|
|
17851
|
+
return;
|
|
17852
|
+
}
|
|
17853
|
+
if (!this.openAIInterface || !this.openAIInterface.url) {
|
|
17854
|
+
return;
|
|
17855
|
+
}
|
|
17856
|
+
if (!this.openAIInterface.sessionInfo) {
|
|
17857
|
+
return;
|
|
17858
|
+
}
|
|
17859
|
+
const responseArray = [];
|
|
17860
|
+
const response = await fetch(this.openAIInterface.url + '/api/chat', {
|
|
17861
|
+
method: 'POST',
|
|
17862
|
+
headers: {
|
|
17863
|
+
'Content-Type': 'application/json',
|
|
17864
|
+
},
|
|
17865
|
+
body: JSON.stringify({
|
|
17866
|
+
fileId: this.openAIInterface.sessionInfo.fileId,
|
|
17867
|
+
threadId: this.openAIInterface.sessionInfo.threadId,
|
|
17868
|
+
question: question,
|
|
17869
|
+
}),
|
|
17870
|
+
});
|
|
17871
|
+
console.log('kup-manager.interactOpenAI() response', response);
|
|
17872
|
+
if (response) {
|
|
17873
|
+
if (response.status != 200) {
|
|
17874
|
+
this.debug.logMessage(this, await response.text(), KupDebugCategory.ERROR);
|
|
17875
|
+
return;
|
|
17876
|
+
}
|
|
17877
|
+
const responseJson = await response.json();
|
|
17878
|
+
if (responseJson && responseJson.messages) {
|
|
17879
|
+
responseArray.push(...responseJson.messages);
|
|
17880
|
+
}
|
|
17881
|
+
}
|
|
17882
|
+
return responseArray;
|
|
17883
|
+
}
|
|
17760
17884
|
/**
|
|
17761
17885
|
* Sets both locale and language library-wide.
|
|
17762
17886
|
* @param {KupDatesLocales} locale - The supported locale.
|
|
@@ -17858,4 +17982,4 @@ function kupManagerInstance() {
|
|
|
17858
17982
|
return dom.ketchup;
|
|
17859
17983
|
}
|
|
17860
17984
|
|
|
17861
|
-
export { SortMode as $, getValueForDisplay2 as A, Filters as B, getValueForDisplay as C, KupLanguageSearch as D, FilterInterval as E, FCellShapes as F, GroupLabelDisplayMode as G, ShowGrid as H, TotalMode as I, kupDynamicPositionAttribute as J, KupManager as K, LoadMoreMode as L, KupPointerEventTypes as M, kupDraggableColumnAttr as N, kupDragActiveAttr as O, PaginatorPos as P, KupDragEffect as Q, kupDraggableCellAttr as R, SelectionMode as S, TotalLabel as T, KupDropEventTypes as U, FixedCellsCSSVarsBase as V, KupLanguageFontsize as W, KupLanguageDensity as X, KupLanguageGrid as Y, KupDataTableProps as Z, FixedCellsClasses as _, KupThemeIconValues as a, iconColumn as a0, keyColumn as a1, fieldColumn as a2, FCellTypes as a3, addColumnValueFromRow as a4, KupGlobalFilterMode as a5, editableTypes as a6, kupTypes as a7, KupTagNames as a8, fullWidthFieldsComps as a9, FCellClasses as aa, autoCenterComps as ab, getCellValueForDisplay as ac, FCellEvents as ad, KupData as ae, compareCell as af, KupLanguagePage as ag, KupLanguageDashboard as ah, kupDropEvent as ai, kupDraggableRowAttr as aj, KupDynamicPositionPlacement as b, KupThemeColorValues as c, KupDebugCategory as d, FCellPadding as e, fillString as f, getProps as g, KupCardBuiltInClockElements as h, KupCardCSSClasses as i, KupLanguageTotals as j, kupManagerInstance as k, KupLanguageGeneric as l, KupLanguageColumn as m, KupDataNewColumnTypes as n, KupCardSubEvents as o, KupCardIds as p, KupLanguageRow as q, KupCardFamily as r, setProps as s, KupCardProps as t, getColumnByName as u, formatToNumber as v, KupObjects as w, identify as x, KupLanguageGrouping as y, KupLanguageCheckbox as z };
|
|
17985
|
+
export { SortMode as $, getValueForDisplay2 as A, Filters as B, getValueForDisplay as C, KupLanguageSearch as D, FilterInterval as E, FCellShapes as F, GroupLabelDisplayMode as G, ShowGrid as H, TotalMode as I, kupDynamicPositionAttribute as J, KupManager as K, LoadMoreMode as L, KupPointerEventTypes as M, kupDraggableColumnAttr as N, kupDragActiveAttr as O, PaginatorPos as P, KupDragEffect as Q, kupDraggableCellAttr as R, SelectionMode as S, TotalLabel as T, KupDropEventTypes as U, FixedCellsCSSVarsBase as V, KupLanguageFontsize as W, KupLanguageDensity as X, KupLanguageGrid as Y, KupDataTableProps as Z, FixedCellsClasses as _, KupThemeIconValues as a, iconColumn as a0, keyColumn as a1, fieldColumn as a2, FCellTypes as a3, addColumnValueFromRow as a4, KupGlobalFilterMode as a5, editableTypes as a6, kupTypes as a7, KupTagNames as a8, fullWidthFieldsComps as a9, FCellClasses as aa, autoCenterComps as ab, getCellValueForDisplay as ac, FCellEvents as ad, KupData as ae, compareCell as af, KupLanguagePage as ag, KupLanguageDashboard as ah, kupDropEvent as ai, kupDraggableRowAttr as aj, kupDraggableAttr as ak, KupDynamicPositionPlacement as b, KupThemeColorValues as c, KupDebugCategory as d, FCellPadding as e, fillString as f, getProps as g, KupCardBuiltInClockElements as h, KupCardCSSClasses as i, KupLanguageTotals as j, kupManagerInstance as k, KupLanguageGeneric as l, KupLanguageColumn as m, KupDataNewColumnTypes as n, KupCardSubEvents as o, KupCardIds as p, KupLanguageRow as q, KupCardFamily as r, setProps as s, KupCardProps as t, getColumnByName as u, formatToNumber as v, KupObjects as w, identify as x, KupLanguageGrouping as y, KupLanguageCheckbox as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, d as getElement } from './index-59f83f91.js';
|
|
2
|
-
import { k as kupManagerInstance, g as getProps, s as setProps } from './kup-manager-
|
|
2
|
+
import { k as kupManagerInstance, g as getProps, s as setProps } from './kup-manager-e33d8d8c.js';
|
|
3
3
|
import { c as componentWrapperId } from './GenericVariables-d8d0541e.js';
|
|
4
4
|
import './kup-dates-15f89ea2.js';
|
|
5
5
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, d as getElement } from './index-59f83f91.js';
|
|
2
|
-
import { k as kupManagerInstance, b as KupDynamicPositionPlacement, r as KupCardFamily } from './kup-manager-
|
|
2
|
+
import { k as kupManagerInstance, b as KupDynamicPositionPlacement, r as KupCardFamily } from './kup-manager-e33d8d8c.js';
|
|
3
3
|
import { c as componentWrapperId } from './GenericVariables-d8d0541e.js';
|
|
4
|
-
import { F as FTextField } from './f-text-field-
|
|
4
|
+
import { F as FTextField } from './f-text-field-f0b81f8b.js';
|
|
5
5
|
import { F as FTextFieldMDC } from './f-text-field-mdc-c88bf688.js';
|
|
6
6
|
import './kup-dates-15f89ea2.js';
|
|
7
7
|
import './component-879e99bf.js';
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, d as getElement } from './index-59f83f91.js';
|
|
2
|
+
import { k as kupManagerInstance, g as getProps, s as setProps } from './kup-manager-e33d8d8c.js';
|
|
3
|
+
import { c as componentWrapperId } from './GenericVariables-d8d0541e.js';
|
|
4
|
+
import { F as FImage } from './f-image-5434b351.js';
|
|
5
|
+
import './kup-dates-15f89ea2.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Props of the kup-openai-interface component.
|
|
9
|
+
* Used to export every prop in an object.
|
|
10
|
+
*/
|
|
11
|
+
var KupOpenAiInterfaceProps;
|
|
12
|
+
(function (KupOpenAiInterfaceProps) {
|
|
13
|
+
KupOpenAiInterfaceProps["customStyle"] = "Custom style of the component.";
|
|
14
|
+
KupOpenAiInterfaceProps["data"] = "Sets the data that will be used for OpenAI comunication.";
|
|
15
|
+
KupOpenAiInterfaceProps["dialogTitle"] = "Sets the dialog title";
|
|
16
|
+
KupOpenAiInterfaceProps["label"] = "Sets the text area label";
|
|
17
|
+
})(KupOpenAiInterfaceProps || (KupOpenAiInterfaceProps = {}));
|
|
18
|
+
|
|
19
|
+
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}";
|
|
20
|
+
|
|
21
|
+
var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
22
|
+
if (kind === "a" && !f)
|
|
23
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
24
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
25
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
26
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
27
|
+
};
|
|
28
|
+
var _KupOpenAiInterface_instances, _KupOpenAiInterface_openAiInteract, _KupOpenAiInterface_dataTableData;
|
|
29
|
+
const KupOpenAiInterface = class {
|
|
30
|
+
constructor(hostRef) {
|
|
31
|
+
registerInstance(this, hostRef);
|
|
32
|
+
this.kupReady = createEvent(this, "kup-openai-interface-ready", 6);
|
|
33
|
+
_KupOpenAiInterface_instances.add(this);
|
|
34
|
+
/*-------------------------------------------------*/
|
|
35
|
+
/* I n t e r n a l V a r i a b l e s */
|
|
36
|
+
/*-------------------------------------------------*/
|
|
37
|
+
this.dragHandler = null;
|
|
38
|
+
this.kupManager = kupManagerInstance();
|
|
39
|
+
this.textArea = null;
|
|
40
|
+
this.dataTable = null;
|
|
41
|
+
this.button = null;
|
|
42
|
+
this.messages = [];
|
|
43
|
+
this.customStyle = '';
|
|
44
|
+
this.data = null;
|
|
45
|
+
this.dialogTitle = 'Open AI integration';
|
|
46
|
+
this.label = 'Insert natural language request...';
|
|
47
|
+
}
|
|
48
|
+
/*-------------------------------------------------*/
|
|
49
|
+
/* P u b l i c M e t h o d s */
|
|
50
|
+
/*-------------------------------------------------*/
|
|
51
|
+
/**
|
|
52
|
+
* Used to retrieve component's props values.
|
|
53
|
+
* @param {boolean} descriptions - When provided and true, the result will be the list of props with their description.
|
|
54
|
+
* @returns {Promise<GenericObject>} List of props as object, each key will be a prop.
|
|
55
|
+
*/
|
|
56
|
+
async getProps(descriptions) {
|
|
57
|
+
return getProps(this, KupOpenAiInterfaceProps, descriptions);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* This method is used to trigger a new render of the component.
|
|
61
|
+
*/
|
|
62
|
+
async refresh() {
|
|
63
|
+
forceUpdate(this);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Sets the props to the component.
|
|
67
|
+
* @param {GenericObject} props - Object containing props that will be set to the component.
|
|
68
|
+
*/
|
|
69
|
+
async setProps(props) {
|
|
70
|
+
setProps(this, KupOpenAiInterfaceProps, props);
|
|
71
|
+
}
|
|
72
|
+
/*-------------------------------------------------*/
|
|
73
|
+
/* L i f e c y c l e H o o k s */
|
|
74
|
+
/*-------------------------------------------------*/
|
|
75
|
+
componentWillLoad() {
|
|
76
|
+
this.kupManager.debug.logLoad(this, false);
|
|
77
|
+
this.kupManager.language.register(this);
|
|
78
|
+
this.kupManager.theme.register(this);
|
|
79
|
+
}
|
|
80
|
+
componentDidLoad() {
|
|
81
|
+
this.dragHandler =
|
|
82
|
+
this.rootElement.shadowRoot.querySelector('#drag-handle');
|
|
83
|
+
this.kupManager.interact.dialogify(this.rootElement, this.dragHandler);
|
|
84
|
+
this.kupReady.emit({
|
|
85
|
+
comp: this,
|
|
86
|
+
id: this.rootElement.id,
|
|
87
|
+
});
|
|
88
|
+
this.kupManager.debug.logLoad(this, true);
|
|
89
|
+
}
|
|
90
|
+
componentWillRender() {
|
|
91
|
+
this.kupManager.debug.logRender(this, false);
|
|
92
|
+
}
|
|
93
|
+
componentDidRender() {
|
|
94
|
+
this.kupManager.debug.logRender(this, true);
|
|
95
|
+
}
|
|
96
|
+
render() {
|
|
97
|
+
const dataTableProps = {};
|
|
98
|
+
dataTableProps.data = __classPrivateFieldGet(this, _KupOpenAiInterface_instances, "m", _KupOpenAiInterface_dataTableData).call(this);
|
|
99
|
+
const textAreaProps = {};
|
|
100
|
+
textAreaProps.textArea = true;
|
|
101
|
+
textAreaProps.label = this.label;
|
|
102
|
+
const buttonProps = {};
|
|
103
|
+
buttonProps.label = 'Confirm';
|
|
104
|
+
buttonProps.icon = 'check';
|
|
105
|
+
buttonProps.showSpinner = false;
|
|
106
|
+
return (h(Host, null, h("style", null, this.kupManager.theme.setKupStyle(this.rootElement)), h("div", { id: componentWrapperId }, h("div", { class: "openai-interface-wrapper" }, h("div", { class: "actions", id: "drag-handle" }, h("div", { class: "header" }, this.dialogTitle ? (h("div", { class: "header__title" }, this.dialogTitle)) : null, h(FImage, { onClick: () => this.kupManager.hideOpenAI(), sizeX: "1.25em", sizeY: "1.25em", resource: "clear", wrapperClass: "header__close" })), h("kup-text-field", Object.assign({}, textAreaProps, { ref: (el) => (this.textArea = el) })), h("kup-button", Object.assign({}, buttonProps, { ref: (el) => (this.button = el), "onKup-button-click": () => __classPrivateFieldGet(this, _KupOpenAiInterface_instances, "m", _KupOpenAiInterface_openAiInteract).call(this) })), h("kup-data-table", Object.assign({}, dataTableProps, { ref: (el) => (this.dataTable = el) })))))));
|
|
107
|
+
}
|
|
108
|
+
disconnectedCallback() {
|
|
109
|
+
this.kupManager.language.unregister(this);
|
|
110
|
+
this.kupManager.theme.unregister(this);
|
|
111
|
+
}
|
|
112
|
+
get rootElement() { return getElement(this); }
|
|
113
|
+
};
|
|
114
|
+
_KupOpenAiInterface_instances = new WeakSet(), _KupOpenAiInterface_openAiInteract =
|
|
115
|
+
/*-------------------------------------------------*/
|
|
116
|
+
/* P r i v a t e M e t h o d s */
|
|
117
|
+
/*-------------------------------------------------*/
|
|
118
|
+
async function _KupOpenAiInterface_openAiInteract() {
|
|
119
|
+
this.button.showSpinner = true;
|
|
120
|
+
this.messages = await this.kupManager.interactOpenAI(await this.textArea.getValue());
|
|
121
|
+
this.dataTable.data = __classPrivateFieldGet(this, _KupOpenAiInterface_instances, "m", _KupOpenAiInterface_dataTableData).call(this);
|
|
122
|
+
this.button.showSpinner = false;
|
|
123
|
+
}, _KupOpenAiInterface_dataTableData = function _KupOpenAiInterface_dataTableData() {
|
|
124
|
+
const data = {};
|
|
125
|
+
data.columns = [{ name: 'mess', title: 'Message' }];
|
|
126
|
+
data.rows = [];
|
|
127
|
+
if (this.messages) {
|
|
128
|
+
for (let i = 0; i < this.messages.length; i++) {
|
|
129
|
+
const mess = this.messages[i];
|
|
130
|
+
if (mess) {
|
|
131
|
+
data.rows.push({
|
|
132
|
+
unselectable: true,
|
|
133
|
+
cells: { mess: { value: mess } },
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return data;
|
|
139
|
+
};
|
|
140
|
+
KupOpenAiInterface.style = kupOpenaiInterfaceCss;
|
|
141
|
+
|
|
142
|
+
export { KupOpenAiInterface as kup_openai_interface };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, d as getElement } from './index-59f83f91.js';
|
|
2
|
-
import { k as kupManagerInstance, g as getProps, s as setProps } from './kup-manager-
|
|
2
|
+
import { k as kupManagerInstance, g as getProps, s as setProps } from './kup-manager-e33d8d8c.js';
|
|
3
3
|
import { c as componentWrapperId } from './GenericVariables-d8d0541e.js';
|
|
4
4
|
import './kup-dates-15f89ea2.js';
|
|
5
5
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, d as getElement, g as getAssetPath } from './index-59f83f91.js';
|
|
2
|
-
import { k as kupManagerInstance, ac as getCellValueForDisplay, g as getProps, s as setProps, a as KupThemeIconValues, D as KupLanguageSearch } from './kup-manager-
|
|
2
|
+
import { k as kupManagerInstance, ac as getCellValueForDisplay, g as getProps, s as setProps, a as KupThemeIconValues, D as KupLanguageSearch } from './kup-manager-e33d8d8c.js';
|
|
3
3
|
import { d as defaultStylingOptions, K as KupPlannerGanttRowType, a as KupPlannerTaskAction, b as KupPlannerLastOnChangeReceived, c as KupPlannerProps } from './kup-planner-declarations-b9345758.js';
|
|
4
4
|
import { c as componentWrapperId } from './GenericVariables-d8d0541e.js';
|
|
5
5
|
import { K as KupDatesFormats } from './kup-dates-15f89ea2.js';
|
|
6
|
-
import { F as FTextField } from './f-text-field-
|
|
6
|
+
import { F as FTextField } from './f-text-field-f0b81f8b.js';
|
|
7
7
|
import { F as FTextFieldMDC } from './f-text-field-mdc-c88bf688.js';
|
|
8
8
|
import './component-879e99bf.js';
|
|
9
9
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, f as forceUpdate, h, H as Host, d as getElement } from './index-59f83f91.js';
|
|
2
|
-
import { k as kupManagerInstance } from './kup-manager-
|
|
2
|
+
import { k as kupManagerInstance } from './kup-manager-e33d8d8c.js';
|
|
3
3
|
import { c as componentWrapperId } from './GenericVariables-d8d0541e.js';
|
|
4
4
|
import './kup-dates-15f89ea2.js';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h, d as getElement } from './index-59f83f91.js';
|
|
2
|
-
import { k as kupManagerInstance } from './kup-manager-
|
|
2
|
+
import { k as kupManagerInstance } from './kup-manager-e33d8d8c.js';
|
|
3
3
|
import './kup-dates-15f89ea2.js';
|
|
4
4
|
|
|
5
5
|
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%}";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, d as getElement } from './index-59f83f91.js';
|
|
2
|
-
import { k as kupManagerInstance, g as getProps, s as setProps } from './kup-manager-
|
|
2
|
+
import { k as kupManagerInstance, g as getProps, s as setProps } from './kup-manager-e33d8d8c.js';
|
|
3
3
|
import { c as componentWrapperId } from './GenericVariables-d8d0541e.js';
|
|
4
|
-
import { F as FButton } from './f-button-
|
|
4
|
+
import { F as FButton } from './f-button-ccde4447.js';
|
|
5
5
|
import './kup-dates-15f89ea2.js';
|
|
6
6
|
import './f-button-declarations-9bdc6f26.js';
|
|
7
|
-
import './f-image-
|
|
7
|
+
import './f-image-5434b351.js';
|
|
8
8
|
|
|
9
9
|
const snackbarClass = 'snackbar';
|
|
10
10
|
/**
|