@sme.up/ketchup 9.5.0 → 9.5.2

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 (132) hide show
  1. package/dist/cjs/{f-button-033ed6d4.js → f-button-357a3dff.js} +1 -1
  2. package/dist/cjs/{f-cell-ef276797.js → f-cell-1de0ea69.js} +5 -5
  3. package/dist/cjs/{f-chip-d4e26a2b.js → f-chip-bd5882a0.js} +2 -2
  4. package/dist/cjs/{f-image-33be7baf.js → f-image-30531fd0.js} +1 -1
  5. package/dist/cjs/{f-paginator-utils-5a18cc19.js → f-paginator-utils-ad8a4635.js} +2 -2
  6. package/dist/cjs/{f-text-field-f03e97f8.js → f-text-field-be758970.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 +125 -20
  11. package/dist/cjs/kup-box.cjs.entry.js +7 -7
  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-f90f1b6d.js → kup-manager-cefb1999.js} +492 -365
  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-photo-frame.cjs.entry.js +1 -1
  28. package/dist/cjs/kup-planner.cjs.entry.js +2 -2
  29. package/dist/cjs/kup-probe.cjs.entry.js +1 -1
  30. package/dist/cjs/kup-qlik.cjs.entry.js +1 -1
  31. package/dist/cjs/kup-snackbar.cjs.entry.js +3 -3
  32. package/dist/cjs/loader.cjs.js +1 -1
  33. package/dist/collection/assets/card.js +46 -0
  34. package/dist/collection/collection-manifest.json +0 -1
  35. package/dist/collection/components/kup-card/built-in/kup-card-built-in.js +9 -0
  36. package/dist/collection/components/kup-card/built-in/kup-card-openai.js +74 -0
  37. package/dist/collection/components/kup-card/kup-card-declarations.js +1 -0
  38. package/dist/collection/components/kup-card/kup-card.css +86 -0
  39. package/dist/collection/components/kup-card/kup-card.js +6 -0
  40. package/dist/collection/components/kup-data-table/kup-data-table.js +2 -3
  41. package/dist/collection/components/kup-dialog/kup-dialog.css +3 -3
  42. package/dist/collection/components/kup-dialog/kup-dialog.js +19 -5
  43. package/dist/collection/managers/kup-manager/kup-manager.js +6 -123
  44. package/dist/collection/managers/kup-openai/kup-openai-declarations.js +1 -0
  45. package/dist/collection/managers/kup-openai/kup-openai.js +247 -0
  46. package/dist/components/kup-autocomplete2.js +776 -546
  47. package/dist/components/kup-manager.js +492 -365
  48. package/dist/esm/{f-button-ccde4447.js → f-button-856a189a.js} +1 -1
  49. package/dist/esm/{f-cell-2ad41d52.js → f-cell-6324d838.js} +5 -5
  50. package/dist/esm/{f-chip-3df1c255.js → f-chip-e15fba8a.js} +2 -2
  51. package/dist/esm/{f-image-5434b351.js → f-image-26b1bc14.js} +1 -1
  52. package/dist/esm/{f-paginator-utils-b90cdd2b.js → f-paginator-utils-e8f62783.js} +2 -2
  53. package/dist/esm/{f-text-field-f0b81f8b.js → f-text-field-bbe1f236.js} +1 -1
  54. package/dist/esm/index.js +1 -1
  55. package/dist/esm/ketchup.js +1 -1
  56. package/dist/esm/kup-accordion.entry.js +2 -2
  57. package/dist/esm/kup-autocomplete_27.entry.js +125 -20
  58. package/dist/esm/kup-box.entry.js +7 -7
  59. package/dist/esm/kup-calendar.entry.js +4 -4
  60. package/dist/esm/kup-card-list.entry.js +1 -1
  61. package/dist/esm/kup-cell.entry.js +6 -6
  62. package/dist/esm/kup-dashboard.entry.js +4 -4
  63. package/dist/esm/kup-drawer.entry.js +1 -1
  64. package/dist/esm/kup-echart.entry.js +1 -1
  65. package/dist/esm/kup-family-tree.entry.js +3 -3
  66. package/dist/esm/kup-grid.entry.js +1 -1
  67. package/dist/esm/kup-iframe.entry.js +1 -1
  68. package/dist/esm/kup-image-list.entry.js +6 -6
  69. package/dist/esm/kup-lazy.entry.js +1 -1
  70. package/dist/esm/kup-magic-box.entry.js +2 -2
  71. package/dist/esm/{kup-manager-e33d8d8c.js → kup-manager-8d1df189.js} +492 -365
  72. package/dist/esm/kup-nav-bar.entry.js +1 -1
  73. package/dist/esm/kup-numeric-picker.entry.js +2 -2
  74. package/dist/esm/kup-photo-frame.entry.js +1 -1
  75. package/dist/esm/kup-planner.entry.js +2 -2
  76. package/dist/esm/kup-probe.entry.js +1 -1
  77. package/dist/esm/kup-qlik.entry.js +1 -1
  78. package/dist/esm/kup-snackbar.entry.js +3 -3
  79. package/dist/esm/loader.js +1 -1
  80. package/dist/ketchup/index.esm.js +1 -1
  81. package/dist/ketchup/ketchup.esm.js +1 -1
  82. package/dist/ketchup/{p-f81d7218.entry.js → p-07bed934.entry.js} +1 -1
  83. package/dist/ketchup/{p-5b3d8636.entry.js → p-0c124f99.entry.js} +1 -1
  84. package/dist/ketchup/{p-58798e2d.entry.js → p-0f6cb6e4.entry.js} +1 -1
  85. package/dist/ketchup/p-177f8008.entry.js +9 -0
  86. package/dist/ketchup/{p-f0e4e190.js → p-269a9af8.js} +1 -1
  87. package/dist/ketchup/p-2ab02da0.entry.js +1 -0
  88. package/dist/ketchup/{p-1a594e06.entry.js → p-3f028a71.entry.js} +1 -1
  89. package/dist/ketchup/{p-6a8fcb02.entry.js → p-4a18db68.entry.js} +1 -1
  90. package/dist/ketchup/{p-01aaf3e4.entry.js → p-4eb6d4e8.entry.js} +1 -1
  91. package/dist/ketchup/{p-eea1ee1b.js → p-63031c77.js} +1 -1
  92. package/dist/ketchup/{p-4725191c.entry.js → p-753f30d8.entry.js} +1 -1
  93. package/dist/ketchup/{p-a5229d3d.entry.js → p-8042dcd5.entry.js} +1 -1
  94. package/dist/ketchup/{p-1dbfcab5.entry.js → p-81c1d557.entry.js} +1 -1
  95. package/dist/ketchup/p-937a322f.js +29 -0
  96. package/dist/ketchup/{p-4afe8662.js → p-9ba8f169.js} +1 -1
  97. package/dist/ketchup/{p-645d881d.entry.js → p-a2d3aec9.entry.js} +1 -1
  98. package/dist/ketchup/{p-2940b559.entry.js → p-b115e1ec.entry.js} +1 -1
  99. package/dist/ketchup/{p-11e7be94.js → p-b396d0f8.js} +1 -1
  100. package/dist/ketchup/{p-7e5d8532.entry.js → p-c12a9759.entry.js} +1 -1
  101. package/dist/ketchup/{p-190d0bc5.entry.js → p-cadeb53d.entry.js} +1 -1
  102. package/dist/ketchup/{p-9df95b9f.js → p-caeed3c3.js} +1 -1
  103. package/dist/ketchup/{p-b104afb6.entry.js → p-d300948a.entry.js} +1 -1
  104. package/dist/ketchup/{p-95b31ede.js → p-d76cd8d6.js} +1 -1
  105. package/dist/ketchup/{p-b857aab2.entry.js → p-d9a1e5a4.entry.js} +1 -1
  106. package/dist/ketchup/{p-788da2d9.entry.js → p-dc370227.entry.js} +1 -1
  107. package/dist/ketchup/{p-5fa089cd.entry.js → p-f1cae1e1.entry.js} +1 -1
  108. package/dist/ketchup/{p-269a1dfe.entry.js → p-f417e794.entry.js} +1 -1
  109. package/dist/ketchup/{p-c0c65349.entry.js → p-f753c13f.entry.js} +1 -1
  110. package/dist/ketchup/{p-ddd25869.entry.js → p-f7980061.entry.js} +1 -1
  111. package/dist/types/components/kup-card/built-in/kup-card-built-in.d.ts +6 -0
  112. package/dist/types/components/kup-card/built-in/kup-card-openai.d.ts +3 -0
  113. package/dist/types/components/kup-card/kup-card-declarations.d.ts +20 -1
  114. package/dist/types/components.d.ts +0 -86
  115. package/dist/types/managers/kup-manager/kup-manager-declarations.d.ts +2 -14
  116. package/dist/types/managers/kup-manager/kup-manager.d.ts +3 -17
  117. package/dist/types/managers/kup-openai/kup-openai-declarations.d.ts +4 -0
  118. package/dist/types/managers/kup-openai/kup-openai.d.ts +29 -0
  119. package/package.json +1 -1
  120. package/dist/cjs/kup-openai-interface.cjs.entry.js +0 -146
  121. package/dist/collection/components/kup-openai-interface/kup-openai-interface-declarations.js +0 -11
  122. package/dist/collection/components/kup-openai-interface/kup-openai-interface.css +0 -64
  123. package/dist/collection/components/kup-openai-interface/kup-openai-interface.js +0 -340
  124. package/dist/components/kup-openai-interface.d.ts +0 -11
  125. package/dist/components/kup-openai-interface.js +0 -301
  126. package/dist/esm/kup-openai-interface.entry.js +0 -142
  127. package/dist/ketchup/p-23e4caa1.entry.js +0 -9
  128. package/dist/ketchup/p-2681d3a2.entry.js +0 -1
  129. package/dist/ketchup/p-39ba3355.js +0 -29
  130. package/dist/ketchup/p-6f108540.entry.js +0 -1
  131. package/dist/types/components/kup-openai-interface/kup-openai-interface-declarations.d.ts +0 -10
  132. package/dist/types/components/kup-openai-interface/kup-openai-interface.d.ts +0 -59
@@ -1,340 +0,0 @@
1
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
2
- if (kind === "a" && !f)
3
- throw new TypeError("Private accessor was defined without a getter");
4
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
5
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
6
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
7
- };
8
- var _KupOpenAiInterface_instances, _KupOpenAiInterface_openAiInteract, _KupOpenAiInterface_dataTableData;
9
- import { forceUpdate, h, Host, } from "@stencil/core";
10
- import { kupManagerInstance } from "../../managers/kup-manager/kup-manager";
11
- import { getProps, setProps } from "../../utils/utils";
12
- import { componentWrapperId } from "../../variables/GenericVariables";
13
- import { KupOpenAiInterfaceProps } from "./kup-openai-interface-declarations";
14
- import { FImage } from "../../f-components/f-image/f-image";
15
- export class KupOpenAiInterface {
16
- constructor() {
17
- _KupOpenAiInterface_instances.add(this);
18
- /*-------------------------------------------------*/
19
- /* I n t e r n a l V a r i a b l e s */
20
- /*-------------------------------------------------*/
21
- this.dragHandler = null;
22
- this.kupManager = kupManagerInstance();
23
- this.textArea = null;
24
- this.dataTable = null;
25
- this.button = null;
26
- this.messages = [];
27
- this.customStyle = '';
28
- this.data = null;
29
- this.dialogTitle = 'Open AI integration';
30
- this.label = 'Insert natural language request...';
31
- }
32
- /*-------------------------------------------------*/
33
- /* P u b l i c M e t h o d s */
34
- /*-------------------------------------------------*/
35
- /**
36
- * Used to retrieve component's props values.
37
- * @param {boolean} descriptions - When provided and true, the result will be the list of props with their description.
38
- * @returns {Promise<GenericObject>} List of props as object, each key will be a prop.
39
- */
40
- async getProps(descriptions) {
41
- return getProps(this, KupOpenAiInterfaceProps, descriptions);
42
- }
43
- /**
44
- * This method is used to trigger a new render of the component.
45
- */
46
- async refresh() {
47
- forceUpdate(this);
48
- }
49
- /**
50
- * Sets the props to the component.
51
- * @param {GenericObject} props - Object containing props that will be set to the component.
52
- */
53
- async setProps(props) {
54
- setProps(this, KupOpenAiInterfaceProps, props);
55
- }
56
- /*-------------------------------------------------*/
57
- /* L i f e c y c l e H o o k s */
58
- /*-------------------------------------------------*/
59
- componentWillLoad() {
60
- this.kupManager.debug.logLoad(this, false);
61
- this.kupManager.language.register(this);
62
- this.kupManager.theme.register(this);
63
- }
64
- componentDidLoad() {
65
- this.dragHandler =
66
- this.rootElement.shadowRoot.querySelector('#drag-handle');
67
- this.kupManager.interact.dialogify(this.rootElement, this.dragHandler);
68
- this.kupReady.emit({
69
- comp: this,
70
- id: this.rootElement.id,
71
- });
72
- this.kupManager.debug.logLoad(this, true);
73
- }
74
- componentWillRender() {
75
- this.kupManager.debug.logRender(this, false);
76
- }
77
- componentDidRender() {
78
- this.kupManager.debug.logRender(this, true);
79
- }
80
- render() {
81
- const dataTableProps = {};
82
- dataTableProps.data = __classPrivateFieldGet(this, _KupOpenAiInterface_instances, "m", _KupOpenAiInterface_dataTableData).call(this);
83
- const textAreaProps = {};
84
- textAreaProps.textArea = true;
85
- textAreaProps.label = this.label;
86
- const buttonProps = {};
87
- buttonProps.label = 'Confirm';
88
- buttonProps.icon = 'check';
89
- buttonProps.showSpinner = false;
90
- 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) })))))));
91
- }
92
- disconnectedCallback() {
93
- this.kupManager.language.unregister(this);
94
- this.kupManager.theme.unregister(this);
95
- }
96
- static get is() { return "kup-openai-interface"; }
97
- static get encapsulation() { return "shadow"; }
98
- static get originalStyleUrls() {
99
- return {
100
- "$": ["kup-openai-interface.scss"]
101
- };
102
- }
103
- static get styleUrls() {
104
- return {
105
- "$": ["kup-openai-interface.css"]
106
- };
107
- }
108
- static get properties() {
109
- return {
110
- "customStyle": {
111
- "type": "string",
112
- "mutable": false,
113
- "complexType": {
114
- "original": "string",
115
- "resolved": "string",
116
- "references": {}
117
- },
118
- "required": false,
119
- "optional": false,
120
- "docs": {
121
- "tags": [{
122
- "name": "default",
123
- "text": "\"\""
124
- }, {
125
- "name": "see",
126
- "text": "https://ketchup.smeup.com/ketchup-showcase/#/customization"
127
- }],
128
- "text": "Custom style of the component."
129
- },
130
- "attribute": "custom-style",
131
- "reflect": false,
132
- "defaultValue": "''"
133
- },
134
- "data": {
135
- "type": "unknown",
136
- "mutable": true,
137
- "complexType": {
138
- "original": "KupDataDataset",
139
- "resolved": "KupDataDataset",
140
- "references": {
141
- "KupDataDataset": {
142
- "location": "import",
143
- "path": "../../managers/kup-data/kup-data-declarations",
144
- "id": "src/managers/kup-data/kup-data-declarations.ts::KupDataDataset"
145
- }
146
- }
147
- },
148
- "required": false,
149
- "optional": false,
150
- "docs": {
151
- "tags": [{
152
- "name": "default",
153
- "text": "null"
154
- }],
155
- "text": "Sets the data that will be used for OpenAI comunication."
156
- },
157
- "defaultValue": "null"
158
- },
159
- "dialogTitle": {
160
- "type": "string",
161
- "mutable": false,
162
- "complexType": {
163
- "original": "string",
164
- "resolved": "string",
165
- "references": {}
166
- },
167
- "required": false,
168
- "optional": false,
169
- "docs": {
170
- "tags": [{
171
- "name": "default",
172
- "text": "\"Open AI integration\""
173
- }],
174
- "text": "Sets the dialog title"
175
- },
176
- "attribute": "dialog-title",
177
- "reflect": false,
178
- "defaultValue": "'Open AI integration'"
179
- },
180
- "label": {
181
- "type": "string",
182
- "mutable": false,
183
- "complexType": {
184
- "original": "string",
185
- "resolved": "string",
186
- "references": {}
187
- },
188
- "required": false,
189
- "optional": false,
190
- "docs": {
191
- "tags": [{
192
- "name": "default",
193
- "text": "\"Insert natural language request...\""
194
- }],
195
- "text": "Sets the text area label"
196
- },
197
- "attribute": "label",
198
- "reflect": false,
199
- "defaultValue": "'Insert natural language request...'"
200
- }
201
- };
202
- }
203
- static get events() {
204
- return [{
205
- "method": "kupReady",
206
- "name": "kup-openai-interface-ready",
207
- "bubbles": true,
208
- "cancelable": false,
209
- "composed": true,
210
- "docs": {
211
- "tags": [],
212
- "text": ""
213
- },
214
- "complexType": {
215
- "original": "KupEventPayload",
216
- "resolved": "KupEventPayload",
217
- "references": {
218
- "KupEventPayload": {
219
- "location": "import",
220
- "path": "../../types/GenericTypes",
221
- "id": "src/types/GenericTypes.ts::KupEventPayload"
222
- }
223
- }
224
- }
225
- }];
226
- }
227
- static get methods() {
228
- return {
229
- "getProps": {
230
- "complexType": {
231
- "signature": "(descriptions?: boolean) => Promise<GenericObject>",
232
- "parameters": [{
233
- "tags": [{
234
- "name": "param",
235
- "text": "descriptions - When provided and true, the result will be the list of props with their description."
236
- }],
237
- "text": "- When provided and true, the result will be the list of props with their description."
238
- }],
239
- "references": {
240
- "Promise": {
241
- "location": "global",
242
- "id": "global::Promise"
243
- },
244
- "GenericObject": {
245
- "location": "import",
246
- "path": "../../types/GenericTypes",
247
- "id": "src/types/GenericTypes.ts::GenericObject"
248
- }
249
- },
250
- "return": "Promise<GenericObject>"
251
- },
252
- "docs": {
253
- "text": "Used to retrieve component's props values.",
254
- "tags": [{
255
- "name": "param",
256
- "text": "descriptions - When provided and true, the result will be the list of props with their description."
257
- }, {
258
- "name": "returns",
259
- "text": "List of props as object, each key will be a prop."
260
- }]
261
- }
262
- },
263
- "refresh": {
264
- "complexType": {
265
- "signature": "() => Promise<void>",
266
- "parameters": [],
267
- "references": {
268
- "Promise": {
269
- "location": "global",
270
- "id": "global::Promise"
271
- }
272
- },
273
- "return": "Promise<void>"
274
- },
275
- "docs": {
276
- "text": "This method is used to trigger a new render of the component.",
277
- "tags": []
278
- }
279
- },
280
- "setProps": {
281
- "complexType": {
282
- "signature": "(props: GenericObject) => Promise<void>",
283
- "parameters": [{
284
- "tags": [{
285
- "name": "param",
286
- "text": "props - Object containing props that will be set to the component."
287
- }],
288
- "text": "- Object containing props that will be set to the component."
289
- }],
290
- "references": {
291
- "Promise": {
292
- "location": "global",
293
- "id": "global::Promise"
294
- },
295
- "GenericObject": {
296
- "location": "import",
297
- "path": "../../types/GenericTypes",
298
- "id": "src/types/GenericTypes.ts::GenericObject"
299
- }
300
- },
301
- "return": "Promise<void>"
302
- },
303
- "docs": {
304
- "text": "Sets the props to the component.",
305
- "tags": [{
306
- "name": "param",
307
- "text": "props - Object containing props that will be set to the component."
308
- }]
309
- }
310
- }
311
- };
312
- }
313
- static get elementRef() { return "rootElement"; }
314
- }
315
- _KupOpenAiInterface_instances = new WeakSet(), _KupOpenAiInterface_openAiInteract =
316
- /*-------------------------------------------------*/
317
- /* P r i v a t e M e t h o d s */
318
- /*-------------------------------------------------*/
319
- async function _KupOpenAiInterface_openAiInteract() {
320
- this.button.showSpinner = true;
321
- this.messages = await this.kupManager.interactOpenAI(await this.textArea.getValue());
322
- this.dataTable.data = __classPrivateFieldGet(this, _KupOpenAiInterface_instances, "m", _KupOpenAiInterface_dataTableData).call(this);
323
- this.button.showSpinner = false;
324
- }, _KupOpenAiInterface_dataTableData = function _KupOpenAiInterface_dataTableData() {
325
- const data = {};
326
- data.columns = [{ name: 'mess', title: 'Message' }];
327
- data.rows = [];
328
- if (this.messages) {
329
- for (let i = 0; i < this.messages.length; i++) {
330
- const mess = this.messages[i];
331
- if (mess) {
332
- data.rows.push({
333
- unselectable: true,
334
- cells: { mess: { value: mess } },
335
- });
336
- }
337
- }
338
- }
339
- return data;
340
- };
@@ -1,11 +0,0 @@
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;
@@ -1,301 +0,0 @@
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 };