@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.
Files changed (122) hide show
  1. package/dist/cjs/{f-button-4caf541a.js → f-button-033ed6d4.js} +1 -1
  2. package/dist/cjs/{f-cell-979c26ea.js → f-cell-ef276797.js} +5 -5
  3. package/dist/cjs/{f-chip-8957940b.js → f-chip-d4e26a2b.js} +2 -2
  4. package/dist/cjs/{f-image-e16fe10d.js → f-image-33be7baf.js} +1 -1
  5. package/dist/cjs/{f-paginator-utils-f2dd0322.js → f-paginator-utils-5a18cc19.js} +2 -2
  6. package/dist/cjs/{f-text-field-2fac8078.js → f-text-field-f03e97f8.js} +1 -1
  7. package/dist/cjs/index.cjs.js +1 -1
  8. package/dist/cjs/ketchup.cjs.js +1 -1
  9. package/dist/cjs/kup-accordion.cjs.entry.js +2 -2
  10. package/dist/cjs/kup-autocomplete_27.cjs.entry.js +18 -9
  11. package/dist/cjs/kup-box.cjs.entry.js +9 -9
  12. package/dist/cjs/kup-calendar.cjs.entry.js +4 -4
  13. package/dist/cjs/kup-card-list.cjs.entry.js +1 -1
  14. package/dist/cjs/kup-cell.cjs.entry.js +6 -6
  15. package/dist/cjs/kup-dashboard.cjs.entry.js +4 -4
  16. package/dist/cjs/kup-drawer.cjs.entry.js +1 -1
  17. package/dist/cjs/kup-echart.cjs.entry.js +1 -1
  18. package/dist/cjs/kup-family-tree.cjs.entry.js +3 -3
  19. package/dist/cjs/kup-grid.cjs.entry.js +1 -1
  20. package/dist/cjs/kup-iframe.cjs.entry.js +1 -1
  21. package/dist/cjs/kup-image-list.cjs.entry.js +6 -6
  22. package/dist/cjs/kup-lazy.cjs.entry.js +1 -1
  23. package/dist/cjs/kup-magic-box.cjs.entry.js +2 -2
  24. package/dist/cjs/{kup-manager-c63f4fb9.js → kup-manager-f90f1b6d.js} +125 -0
  25. package/dist/cjs/kup-nav-bar.cjs.entry.js +1 -1
  26. package/dist/cjs/kup-numeric-picker.cjs.entry.js +2 -2
  27. package/dist/cjs/kup-openai-interface.cjs.entry.js +146 -0
  28. package/dist/cjs/kup-photo-frame.cjs.entry.js +1 -1
  29. package/dist/cjs/kup-planner.cjs.entry.js +2 -2
  30. package/dist/cjs/kup-probe.cjs.entry.js +1 -1
  31. package/dist/cjs/kup-qlik.cjs.entry.js +1 -1
  32. package/dist/cjs/kup-snackbar.cjs.entry.js +3 -3
  33. package/dist/cjs/loader.cjs.js +1 -1
  34. package/dist/collection/collection-manifest.json +1 -0
  35. package/dist/collection/components/kup-box/kup-box.js +3 -3
  36. package/dist/collection/components/kup-data-table/kup-data-table.js +11 -2
  37. package/dist/collection/components/kup-image/assets/svg/open-ai.svg +1 -0
  38. package/dist/collection/components/kup-openai-interface/kup-openai-interface-declarations.js +11 -0
  39. package/dist/collection/components/kup-openai-interface/kup-openai-interface.css +64 -0
  40. package/dist/collection/components/kup-openai-interface/kup-openai-interface.js +340 -0
  41. package/dist/collection/managers/kup-manager/kup-manager.js +124 -0
  42. package/dist/components/kup-autocomplete2.js +11 -2
  43. package/dist/components/kup-box2.js +3 -3
  44. package/dist/components/kup-dashboard.js +1 -1
  45. package/dist/components/kup-magic-box.js +1 -1
  46. package/dist/components/kup-manager.js +125 -1
  47. package/dist/components/kup-openai-interface.d.ts +11 -0
  48. package/dist/components/kup-openai-interface.js +301 -0
  49. package/dist/esm/{f-button-5ccc2e50.js → f-button-ccde4447.js} +1 -1
  50. package/dist/esm/{f-cell-6f4290b2.js → f-cell-2ad41d52.js} +5 -5
  51. package/dist/esm/{f-chip-465aa432.js → f-chip-3df1c255.js} +2 -2
  52. package/dist/esm/{f-image-c5063342.js → f-image-5434b351.js} +1 -1
  53. package/dist/esm/{f-paginator-utils-6903534b.js → f-paginator-utils-b90cdd2b.js} +2 -2
  54. package/dist/esm/{f-text-field-28b2b26d.js → f-text-field-f0b81f8b.js} +1 -1
  55. package/dist/esm/index.js +1 -1
  56. package/dist/esm/ketchup.js +1 -1
  57. package/dist/esm/kup-accordion.entry.js +2 -2
  58. package/dist/esm/kup-autocomplete_27.entry.js +18 -9
  59. package/dist/esm/kup-box.entry.js +9 -9
  60. package/dist/esm/kup-calendar.entry.js +4 -4
  61. package/dist/esm/kup-card-list.entry.js +1 -1
  62. package/dist/esm/kup-cell.entry.js +6 -6
  63. package/dist/esm/kup-dashboard.entry.js +4 -4
  64. package/dist/esm/kup-drawer.entry.js +1 -1
  65. package/dist/esm/kup-echart.entry.js +1 -1
  66. package/dist/esm/kup-family-tree.entry.js +3 -3
  67. package/dist/esm/kup-grid.entry.js +1 -1
  68. package/dist/esm/kup-iframe.entry.js +1 -1
  69. package/dist/esm/kup-image-list.entry.js +6 -6
  70. package/dist/esm/kup-lazy.entry.js +1 -1
  71. package/dist/esm/kup-magic-box.entry.js +2 -2
  72. package/dist/esm/{kup-manager-bfea4e6f.js → kup-manager-e33d8d8c.js} +125 -1
  73. package/dist/esm/kup-nav-bar.entry.js +1 -1
  74. package/dist/esm/kup-numeric-picker.entry.js +2 -2
  75. package/dist/esm/kup-openai-interface.entry.js +142 -0
  76. package/dist/esm/kup-photo-frame.entry.js +1 -1
  77. package/dist/esm/kup-planner.entry.js +2 -2
  78. package/dist/esm/kup-probe.entry.js +1 -1
  79. package/dist/esm/kup-qlik.entry.js +1 -1
  80. package/dist/esm/kup-snackbar.entry.js +3 -3
  81. package/dist/esm/loader.js +1 -1
  82. package/dist/ketchup/assets/svg/open-ai.svg +1 -0
  83. package/dist/ketchup/index.esm.js +1 -1
  84. package/dist/ketchup/ketchup.esm.js +1 -1
  85. package/dist/ketchup/{p-f2df4ce9.entry.js → p-01aaf3e4.entry.js} +1 -1
  86. package/dist/ketchup/{p-ce9ef2d5.js → p-11e7be94.js} +1 -1
  87. package/dist/ketchup/{p-903d1b10.entry.js → p-190d0bc5.entry.js} +1 -1
  88. package/dist/ketchup/{p-95272714.entry.js → p-1a594e06.entry.js} +1 -1
  89. package/dist/ketchup/{p-7c5a1357.entry.js → p-1dbfcab5.entry.js} +1 -1
  90. package/dist/ketchup/{p-85279516.entry.js → p-23e4caa1.entry.js} +2 -2
  91. package/dist/ketchup/p-2681d3a2.entry.js +1 -0
  92. package/dist/ketchup/p-269a1dfe.entry.js +1 -0
  93. package/dist/ketchup/{p-829d7060.entry.js → p-2940b559.entry.js} +1 -1
  94. package/dist/ketchup/{p-4bc3b3a6.js → p-39ba3355.js} +1 -1
  95. package/dist/ketchup/{p-eae42bff.entry.js → p-4725191c.entry.js} +1 -1
  96. package/dist/ketchup/{p-097500fe.js → p-4afe8662.js} +1 -1
  97. package/dist/ketchup/{p-8591ac0b.entry.js → p-58798e2d.entry.js} +1 -1
  98. package/dist/ketchup/{p-e46470a6.entry.js → p-5b3d8636.entry.js} +1 -1
  99. package/dist/ketchup/{p-0f91d4de.entry.js → p-5fa089cd.entry.js} +1 -1
  100. package/dist/ketchup/{p-db93bc06.entry.js → p-645d881d.entry.js} +1 -1
  101. package/dist/ketchup/{p-d7b8295a.entry.js → p-6a8fcb02.entry.js} +1 -1
  102. package/dist/ketchup/{p-20aa95ae.entry.js → p-6f108540.entry.js} +1 -1
  103. package/dist/ketchup/{p-8ecdd076.entry.js → p-788da2d9.entry.js} +1 -1
  104. package/dist/ketchup/{p-69287f4a.entry.js → p-7e5d8532.entry.js} +1 -1
  105. package/dist/ketchup/{p-ee6305f5.js → p-95b31ede.js} +1 -1
  106. package/dist/ketchup/{p-4c1ec006.js → p-9df95b9f.js} +1 -1
  107. package/dist/ketchup/{p-7a72c4fa.entry.js → p-a5229d3d.entry.js} +1 -1
  108. package/dist/ketchup/{p-0cb5e9ae.entry.js → p-b104afb6.entry.js} +1 -1
  109. package/dist/ketchup/{p-8e180c01.entry.js → p-b857aab2.entry.js} +1 -1
  110. package/dist/ketchup/{p-1872c92e.entry.js → p-c0c65349.entry.js} +1 -1
  111. package/dist/ketchup/{p-f1efab38.entry.js → p-ddd25869.entry.js} +1 -1
  112. package/dist/ketchup/p-eea1ee1b.js +1 -0
  113. package/dist/ketchup/{p-21c640a5.js → p-f0e4e190.js} +1 -1
  114. package/dist/ketchup/{p-51f9b230.entry.js → p-f81d7218.entry.js} +1 -1
  115. package/dist/types/components/kup-openai-interface/kup-openai-interface-declarations.d.ts +10 -0
  116. package/dist/types/components/kup-openai-interface/kup-openai-interface.d.ts +59 -0
  117. package/dist/types/components.d.ts +86 -0
  118. package/dist/types/managers/kup-manager/kup-manager-declarations.d.ts +15 -0
  119. package/dist/types/managers/kup-manager/kup-manager.d.ts +17 -1
  120. package/package.json +1 -1
  121. package/dist/ketchup/p-612b46da.entry.js +0 -1
  122. 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 { LoadMoreMode as $, formatToNumber as A, KupObjects as B, Filters as C, FilterInterval as D, getValueForDisplay as E, FCellTypes as F, getValueForDisplay2 as G, KupData as H, compareCell as I, GroupLabelDisplayMode as J, KupManager as K, SelectionMode as L, KupDynamicPositionPlacement as M, KupLanguageGrouping as N, KupLanguageCheckbox as O, KupDebugCategory as P, KupLanguageSearch as Q, KupLanguagePage as R, SortMode as S, TotalMode as T, addColumnValueFromRow as U, KupGlobalFilterMode as V, TotalLabel as W, KupPointerEventTypes as X, kupDynamicPositionAttribute as Y, KupCardFamily as Z, identify as _, KupThemeColorValues as a, PaginatorPos as a0, ShowGrid as a1, kupDraggableColumnAttr as a2, kupDragActiveAttr as a3, KupDragEffect as a4, kupDraggableCellAttr as a5, KupDropEventTypes as a6, FixedCellsCSSVarsBase as a7, KupLanguageFontsize as a8, KupLanguageDensity as a9, KupLanguageGrid as aa, KupDataTableProps as ab, FixedCellsClasses as ac, iconColumn as ad, keyColumn as ae, fieldColumn as af, KupCardProps as ag, KupLanguageDashboard as ah, kupDropEvent as ai, kupDraggableRowAttr as aj, KupThemeIconValues as b, KupLanguageGeneric as c, kupTypes as d, editableTypes as e, KupTagNames as f, getProps as g, FCellShapes as h, fullWidthFieldsComps as i, FCellClasses as j, kupManagerInstance as k, autoCenterComps as l, getCellValueForDisplay as m, FCellEvents as n, FCellPadding as o, fillString as p, KupCardBuiltInClockElements as q, KupCardCSSClasses as r, setProps as s, KupLanguageTotals as t, KupLanguageColumn as u, KupDataNewColumnTypes as v, KupCardSubEvents as w, KupCardIds as x, KupLanguageRow as y, getColumnByName as z };
17985
+ export { LoadMoreMode as $, formatToNumber as A, KupObjects as B, Filters as C, FilterInterval as D, getValueForDisplay as E, FCellTypes as F, getValueForDisplay2 as G, KupData as H, compareCell as I, GroupLabelDisplayMode as J, KupManager as K, SelectionMode as L, KupDynamicPositionPlacement as M, KupLanguageGrouping as N, KupLanguageCheckbox as O, KupDebugCategory as P, KupLanguageSearch as Q, KupLanguagePage as R, SortMode as S, TotalMode as T, addColumnValueFromRow as U, KupGlobalFilterMode as V, TotalLabel as W, KupPointerEventTypes as X, kupDynamicPositionAttribute as Y, KupCardFamily as Z, identify as _, KupThemeColorValues as a, PaginatorPos as a0, ShowGrid as a1, kupDraggableColumnAttr as a2, kupDragActiveAttr as a3, KupDragEffect as a4, kupDraggableCellAttr as a5, KupDropEventTypes as a6, FixedCellsCSSVarsBase as a7, KupLanguageFontsize as a8, KupLanguageDensity as a9, KupLanguageGrid as aa, KupDataTableProps as ab, FixedCellsClasses as ac, iconColumn as ad, keyColumn as ae, fieldColumn as af, KupCardProps as ag, kupDraggableAttr as ah, KupLanguageDashboard as ai, kupDropEvent as aj, kupDraggableRowAttr as ak, KupThemeIconValues as b, KupLanguageGeneric as c, kupTypes as d, editableTypes as e, KupTagNames as f, getProps as g, FCellShapes as h, fullWidthFieldsComps as i, FCellClasses as j, kupManagerInstance as k, autoCenterComps as l, getCellValueForDisplay as m, FCellEvents as n, FCellPadding as o, fillString as p, KupCardBuiltInClockElements as q, KupCardCSSClasses as r, setProps as s, KupLanguageTotals as t, KupLanguageColumn as u, KupDataNewColumnTypes as v, KupCardSubEvents as w, KupCardIds as x, KupLanguageRow as y, getColumnByName as z };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface KupOpenaiInterface extends Components.KupOpenaiInterface, HTMLElement {}
4
+ export const KupOpenaiInterface: {
5
+ prototype: KupOpenaiInterface;
6
+ new (): KupOpenaiInterface;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,301 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, forceUpdate, h, Host } from '@stencil/core/internal/client';
2
+ import { k as kupManagerInstance, g as getProps, s as setProps } from './kup-manager.js';
3
+ import { c as componentWrapperId, F as FImage, d as defineCustomElement$2, a as defineCustomElement$3, b as defineCustomElement$4, e as defineCustomElement$5, f as defineCustomElement$6, g as defineCustomElement$7, h as defineCustomElement$8, i as defineCustomElement$9, j as defineCustomElement$a, k as defineCustomElement$b, l as defineCustomElement$c, m as defineCustomElement$d, n as defineCustomElement$e, o as defineCustomElement$f, p as defineCustomElement$g, q as defineCustomElement$h, r as defineCustomElement$i, s as defineCustomElement$j, t as defineCustomElement$k, u as defineCustomElement$l, v as defineCustomElement$m, w as defineCustomElement$n, x as defineCustomElement$o, y as defineCustomElement$p, z as defineCustomElement$q, A as defineCustomElement$r, B as defineCustomElement$s } from './kup-autocomplete2.js';
4
+
5
+ /**
6
+ * Props of the kup-openai-interface component.
7
+ * Used to export every prop in an object.
8
+ */
9
+ var KupOpenAiInterfaceProps;
10
+ (function (KupOpenAiInterfaceProps) {
11
+ KupOpenAiInterfaceProps["customStyle"] = "Custom style of the component.";
12
+ KupOpenAiInterfaceProps["data"] = "Sets the data that will be used for OpenAI comunication.";
13
+ KupOpenAiInterfaceProps["dialogTitle"] = "Sets the dialog title";
14
+ KupOpenAiInterfaceProps["label"] = "Sets the text area label";
15
+ })(KupOpenAiInterfaceProps || (KupOpenAiInterfaceProps = {}));
16
+
17
+ 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}";
18
+
19
+ var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
20
+ if (kind === "a" && !f)
21
+ throw new TypeError("Private accessor was defined without a getter");
22
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
23
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
24
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
25
+ };
26
+ var _KupOpenAiInterface_instances, _KupOpenAiInterface_openAiInteract, _KupOpenAiInterface_dataTableData;
27
+ const KupOpenAiInterface = /*@__PURE__*/ proxyCustomElement(class KupOpenAiInterface extends HTMLElement {
28
+ constructor() {
29
+ super();
30
+ this.__registerHost();
31
+ this.__attachShadow();
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 this; }
113
+ static get style() { return kupOpenaiInterfaceCss; }
114
+ }, [1, "kup-openai-interface", {
115
+ "customStyle": [1, "custom-style"],
116
+ "data": [1040],
117
+ "dialogTitle": [1, "dialog-title"],
118
+ "label": [1],
119
+ "getProps": [64],
120
+ "refresh": [64],
121
+ "setProps": [64]
122
+ }]);
123
+ _KupOpenAiInterface_instances = new WeakSet(), _KupOpenAiInterface_openAiInteract =
124
+ /*-------------------------------------------------*/
125
+ /* P r i v a t e M e t h o d s */
126
+ /*-------------------------------------------------*/
127
+ async function _KupOpenAiInterface_openAiInteract() {
128
+ this.button.showSpinner = true;
129
+ this.messages = await this.kupManager.interactOpenAI(await this.textArea.getValue());
130
+ this.dataTable.data = __classPrivateFieldGet(this, _KupOpenAiInterface_instances, "m", _KupOpenAiInterface_dataTableData).call(this);
131
+ this.button.showSpinner = false;
132
+ }, _KupOpenAiInterface_dataTableData = function _KupOpenAiInterface_dataTableData() {
133
+ const data = {};
134
+ data.columns = [{ name: 'mess', title: 'Message' }];
135
+ data.rows = [];
136
+ if (this.messages) {
137
+ for (let i = 0; i < this.messages.length; i++) {
138
+ const mess = this.messages[i];
139
+ if (mess) {
140
+ data.rows.push({
141
+ unselectable: true,
142
+ cells: { mess: { value: mess } },
143
+ });
144
+ }
145
+ }
146
+ }
147
+ return data;
148
+ };
149
+ function defineCustomElement$1() {
150
+ if (typeof customElements === "undefined") {
151
+ return;
152
+ }
153
+ const components = ["kup-openai-interface", "kup-autocomplete", "kup-badge", "kup-button", "kup-button-list", "kup-card", "kup-chart", "kup-checkbox", "kup-chip", "kup-color-picker", "kup-combobox", "kup-data-table", "kup-date-picker", "kup-dialog", "kup-dropdown-button", "kup-form", "kup-gauge", "kup-image", "kup-list", "kup-progress-bar", "kup-radio", "kup-rating", "kup-spinner", "kup-switch", "kup-tab-bar", "kup-text-field", "kup-time-picker", "kup-tree"];
154
+ components.forEach(tagName => { switch (tagName) {
155
+ case "kup-openai-interface":
156
+ if (!customElements.get(tagName)) {
157
+ customElements.define(tagName, KupOpenAiInterface);
158
+ }
159
+ break;
160
+ case "kup-autocomplete":
161
+ if (!customElements.get(tagName)) {
162
+ defineCustomElement$s();
163
+ }
164
+ break;
165
+ case "kup-badge":
166
+ if (!customElements.get(tagName)) {
167
+ defineCustomElement$r();
168
+ }
169
+ break;
170
+ case "kup-button":
171
+ if (!customElements.get(tagName)) {
172
+ defineCustomElement$q();
173
+ }
174
+ break;
175
+ case "kup-button-list":
176
+ if (!customElements.get(tagName)) {
177
+ defineCustomElement$p();
178
+ }
179
+ break;
180
+ case "kup-card":
181
+ if (!customElements.get(tagName)) {
182
+ defineCustomElement$o();
183
+ }
184
+ break;
185
+ case "kup-chart":
186
+ if (!customElements.get(tagName)) {
187
+ defineCustomElement$n();
188
+ }
189
+ break;
190
+ case "kup-checkbox":
191
+ if (!customElements.get(tagName)) {
192
+ defineCustomElement$m();
193
+ }
194
+ break;
195
+ case "kup-chip":
196
+ if (!customElements.get(tagName)) {
197
+ defineCustomElement$l();
198
+ }
199
+ break;
200
+ case "kup-color-picker":
201
+ if (!customElements.get(tagName)) {
202
+ defineCustomElement$k();
203
+ }
204
+ break;
205
+ case "kup-combobox":
206
+ if (!customElements.get(tagName)) {
207
+ defineCustomElement$j();
208
+ }
209
+ break;
210
+ case "kup-data-table":
211
+ if (!customElements.get(tagName)) {
212
+ defineCustomElement$i();
213
+ }
214
+ break;
215
+ case "kup-date-picker":
216
+ if (!customElements.get(tagName)) {
217
+ defineCustomElement$h();
218
+ }
219
+ break;
220
+ case "kup-dialog":
221
+ if (!customElements.get(tagName)) {
222
+ defineCustomElement$g();
223
+ }
224
+ break;
225
+ case "kup-dropdown-button":
226
+ if (!customElements.get(tagName)) {
227
+ defineCustomElement$f();
228
+ }
229
+ break;
230
+ case "kup-form":
231
+ if (!customElements.get(tagName)) {
232
+ defineCustomElement$e();
233
+ }
234
+ break;
235
+ case "kup-gauge":
236
+ if (!customElements.get(tagName)) {
237
+ defineCustomElement$d();
238
+ }
239
+ break;
240
+ case "kup-image":
241
+ if (!customElements.get(tagName)) {
242
+ defineCustomElement$c();
243
+ }
244
+ break;
245
+ case "kup-list":
246
+ if (!customElements.get(tagName)) {
247
+ defineCustomElement$b();
248
+ }
249
+ break;
250
+ case "kup-progress-bar":
251
+ if (!customElements.get(tagName)) {
252
+ defineCustomElement$a();
253
+ }
254
+ break;
255
+ case "kup-radio":
256
+ if (!customElements.get(tagName)) {
257
+ defineCustomElement$9();
258
+ }
259
+ break;
260
+ case "kup-rating":
261
+ if (!customElements.get(tagName)) {
262
+ defineCustomElement$8();
263
+ }
264
+ break;
265
+ case "kup-spinner":
266
+ if (!customElements.get(tagName)) {
267
+ defineCustomElement$7();
268
+ }
269
+ break;
270
+ case "kup-switch":
271
+ if (!customElements.get(tagName)) {
272
+ defineCustomElement$6();
273
+ }
274
+ break;
275
+ case "kup-tab-bar":
276
+ if (!customElements.get(tagName)) {
277
+ defineCustomElement$5();
278
+ }
279
+ break;
280
+ case "kup-text-field":
281
+ if (!customElements.get(tagName)) {
282
+ defineCustomElement$4();
283
+ }
284
+ break;
285
+ case "kup-time-picker":
286
+ if (!customElements.get(tagName)) {
287
+ defineCustomElement$3();
288
+ }
289
+ break;
290
+ case "kup-tree":
291
+ if (!customElements.get(tagName)) {
292
+ defineCustomElement$2();
293
+ }
294
+ break;
295
+ } });
296
+ }
297
+
298
+ const KupOpenaiInterface = KupOpenAiInterface;
299
+ const defineCustomElement = defineCustomElement$1;
300
+
301
+ export { KupOpenaiInterface, defineCustomElement };
@@ -1,6 +1,6 @@
1
1
  import { h } from './index-59f83f91.js';
2
2
  import { F as FButtonStyling } from './f-button-declarations-9bdc6f26.js';
3
- import { F as FImage } from './f-image-c5063342.js';
3
+ import { F as FImage } from './f-image-5434b351.js';
4
4
 
5
5
  /*-------------------------------------------------*/
6
6
  /* C o m p o n e n t */
@@ -1,10 +1,10 @@
1
- import { a6 as editableTypes, a7 as kupTypes, c as KupThemeColorValues, a3 as FCellTypes, a8 as KupTagNames, F as FCellShapes, a9 as fullWidthFieldsComps, aa as FCellClasses, ab as autoCenterComps, ac as getCellValueForDisplay, ad as FCellEvents } from './kup-manager-bfea4e6f.js';
1
+ import { a6 as editableTypes, a7 as kupTypes, c as KupThemeColorValues, a3 as FCellTypes, a8 as KupTagNames, F as FCellShapes, a9 as fullWidthFieldsComps, aa as FCellClasses, ab as autoCenterComps, ac as getCellValueForDisplay, ad as FCellEvents } from './kup-manager-e33d8d8c.js';
2
2
  import { h, g as getAssetPath } from './index-59f83f91.js';
3
3
  import { F as FCheckbox } from './f-checkbox-43481de2.js';
4
- import { F as FTextField } from './f-text-field-28b2b26d.js';
5
- import { F as FImage } from './f-image-c5063342.js';
6
- import { F as FChipType, a as FChip } from './f-chip-465aa432.js';
7
- import { F as FButton } from './f-button-5ccc2e50.js';
4
+ import { F as FTextField } from './f-text-field-f0b81f8b.js';
5
+ import { F as FImage } from './f-image-5434b351.js';
6
+ import { F as FChipType, a as FChip } from './f-chip-3df1c255.js';
7
+ import { F as FButton } from './f-button-ccde4447.js';
8
8
 
9
9
  /**
10
10
  * Props of the kup-list component.
@@ -1,6 +1,6 @@
1
1
  import { h } from './index-59f83f91.js';
2
- import { F as FImage } from './f-image-c5063342.js';
3
- import { a as KupThemeIconValues, l as KupLanguageGeneric, c as KupThemeColorValues } from './kup-manager-bfea4e6f.js';
2
+ import { F as FImage } from './f-image-5434b351.js';
3
+ import { a as KupThemeIconValues, l as KupLanguageGeneric, c as KupThemeColorValues } from './kup-manager-e33d8d8c.js';
4
4
 
5
5
  /**
6
6
  * Types of the f-chip component.
@@ -1,5 +1,5 @@
1
1
  import { h, g as getAssetPath } from './index-59f83f91.js';
2
- import { c as KupThemeColorValues } from './kup-manager-bfea4e6f.js';
2
+ import { c as KupThemeColorValues } from './kup-manager-e33d8d8c.js';
3
3
 
4
4
  /**
5
5
  * The type of a CSS step in CSS-drawing mode.
@@ -1,7 +1,7 @@
1
- import { B as Filters, E as FilterInterval, C as getValueForDisplay, A as getValueForDisplay2, ac as getCellValueForDisplay, u as getColumnByName, w as KupObjects, ae as KupData, af as compareCell, I as TotalMode, $ as SortMode, ag as KupLanguagePage, q as KupLanguageRow, l as KupLanguageGeneric } from './kup-manager-bfea4e6f.js';
1
+ import { B as Filters, E as FilterInterval, C as getValueForDisplay, A as getValueForDisplay2, ac as getCellValueForDisplay, u as getColumnByName, w as KupObjects, ae as KupData, af as compareCell, I as TotalMode, $ as SortMode, ag as KupLanguagePage, q as KupLanguageRow, l as KupLanguageGeneric } from './kup-manager-e33d8d8c.js';
2
2
  import { K as KupDatesFormats } from './kup-dates-15f89ea2.js';
3
3
  import { h } from './index-59f83f91.js';
4
- import { F as FButton } from './f-button-5ccc2e50.js';
4
+ import { F as FButton } from './f-button-ccde4447.js';
5
5
  import { F as FButtonStyling } from './f-button-declarations-9bdc6f26.js';
6
6
 
7
7
  /**
@@ -1,5 +1,5 @@
1
1
  import { h, g as getAssetPath } from './index-59f83f91.js';
2
- import { a as KupThemeIconValues } from './kup-manager-bfea4e6f.js';
2
+ import { a as KupThemeIconValues } from './kup-manager-e33d8d8c.js';
3
3
 
4
4
  const dom = document.documentElement;
5
5
  /*-------------------------------------------------*/
package/dist/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { K as KupManager } from './kup-manager-bfea4e6f.js';
1
+ import { K as KupManager } from './kup-manager-e33d8d8c.js';
2
2
  import './kup-dates-15f89ea2.js';
3
3
  import './index-59f83f91.js';
4
4