@sme.up/ketchup 9.6.1 → 9.6.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.
- package/dist/cjs/{f-button-623dfcc3.js → f-button-4c346ca8.js} +1 -1
- package/dist/cjs/{f-cell-9c718d83.js → f-cell-8f3d12fd.js} +5 -5
- package/dist/cjs/{f-chip-c8efad5b.js → f-chip-a6c800be.js} +2 -2
- package/dist/cjs/{f-image-b61cc967.js → f-image-40476fa6.js} +1 -1
- package/dist/cjs/{f-paginator-utils-f32382f6.js → f-paginator-utils-c652ceaa.js} +2 -2
- package/dist/cjs/{f-text-field-a09b1705.js → f-text-field-1f77ef23.js} +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/kup-accordion.cjs.entry.js +2 -2
- package/dist/cjs/kup-autocomplete_27.cjs.entry.js +91 -66
- package/dist/cjs/kup-box.cjs.entry.js +7 -7
- 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-editor.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-227c4be2.js → kup-manager-08f1585b.js} +54 -41
- 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-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/collection/components/kup-card/built-in/kup-card-openai.js +29 -1
- package/dist/collection/components/kup-card/kup-card.css +7 -0
- package/dist/collection/components/kup-data-table/kup-data-table.js +14 -17
- package/dist/collection/managers/kup-openai/kup-openai.js +53 -40
- package/dist/components/kup-autocomplete2.js +98 -73
- package/dist/components/kup-manager.js +54 -41
- package/dist/esm/{f-button-121958b3.js → f-button-90a7ea86.js} +1 -1
- package/dist/esm/{f-cell-959b83db.js → f-cell-fdd338c5.js} +5 -5
- package/dist/esm/{f-chip-915ddf53.js → f-chip-4e6341a6.js} +2 -2
- package/dist/esm/{f-image-98371dac.js → f-image-5210f0b3.js} +1 -1
- package/dist/esm/{f-paginator-utils-10fa5a7d.js → f-paginator-utils-3f179999.js} +2 -2
- package/dist/esm/{f-text-field-0df308e4.js → f-text-field-8429a853.js} +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/kup-accordion.entry.js +2 -2
- package/dist/esm/kup-autocomplete_27.entry.js +91 -66
- package/dist/esm/kup-box.entry.js +7 -7
- 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-editor.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-33b051d6.js → kup-manager-8b39f876.js} +54 -41
- package/dist/esm/kup-nav-bar.entry.js +1 -1
- package/dist/esm/kup-numeric-picker.entry.js +2 -2
- 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/ketchup/index.esm.js +1 -1
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/p-02820c2b.entry.js +1 -0
- package/dist/ketchup/{p-9d8d5070.entry.js → p-09d853c3.entry.js} +1 -1
- package/dist/ketchup/{p-81996620.entry.js → p-14e1a36b.entry.js} +1 -1
- package/dist/ketchup/{p-0a4595bd.entry.js → p-1936c6cd.entry.js} +1 -1
- package/dist/ketchup/{p-eb37ea7e.entry.js → p-318c9ecd.entry.js} +1 -1
- package/dist/ketchup/{p-e43d4ccc.js → p-35d503e2.js} +1 -1
- package/dist/ketchup/{p-060ae996.entry.js → p-35dce86e.entry.js} +1 -1
- package/dist/ketchup/{p-3ce8ce77.entry.js → p-4c20fefd.entry.js} +1 -1
- package/dist/ketchup/{p-9f31a129.entry.js → p-4eb70dd2.entry.js} +1 -1
- package/dist/ketchup/{p-3ff9a661.entry.js → p-5739cdc2.entry.js} +1 -1
- package/dist/ketchup/{p-41d6466e.entry.js → p-5ab3a88a.entry.js} +1 -1
- package/dist/ketchup/{p-7bda0684.js → p-5e16c9d3.js} +1 -1
- package/dist/ketchup/{p-a9b06bb8.js → p-6780a391.js} +1 -1
- package/dist/ketchup/{p-c1ade766.entry.js → p-67930d7c.entry.js} +1 -1
- package/dist/ketchup/{p-0dd0ae49.entry.js → p-6953f769.entry.js} +1 -1
- package/dist/ketchup/{p-babbffa4.entry.js → p-7d2fd8bd.entry.js} +1 -1
- package/dist/ketchup/{p-773bcc69.entry.js → p-8257141a.entry.js} +1 -1
- package/dist/ketchup/{p-9e63f56b.entry.js → p-82694fad.entry.js} +1 -1
- package/dist/ketchup/{p-ccc637ee.js → p-86f9b0d9.js} +1 -1
- package/dist/ketchup/{p-d5254caf.entry.js → p-8ea68d14.entry.js} +1 -1
- package/dist/ketchup/{p-4bf5e04f.entry.js → p-98c72335.entry.js} +1 -1
- package/dist/ketchup/{p-d15d1083.entry.js → p-ab8cac45.entry.js} +1 -1
- package/dist/ketchup/p-c089b961.js +1 -0
- package/dist/ketchup/{p-f0b882f4.entry.js → p-cdb24584.entry.js} +1 -1
- package/dist/ketchup/{p-ea625b2a.entry.js → p-d466d6d1.entry.js} +1 -1
- package/dist/ketchup/{p-11d5400a.entry.js → p-ee30e274.entry.js} +1 -1
- package/dist/ketchup/{p-610a03d4.js → p-f31530fc.js} +2 -2
- package/dist/ketchup/{p-2f4055ba.entry.js → p-f353805e.entry.js} +1 -1
- package/dist/ketchup/p-f515308d.entry.js +9 -0
- package/dist/ketchup/{p-dba484b8.js → p-f9766625.js} +1 -1
- package/dist/types/components/kup-card/kup-card-declarations.d.ts +1 -0
- package/dist/types/managers/kup-openai/kup-openai-declarations.d.ts +7 -0
- package/dist/types/managers/kup-openai/kup-openai.d.ts +8 -12
- package/package.json +1 -1
- package/dist/ketchup/p-102866cd.js +0 -1
- package/dist/ketchup/p-662d2f9b.entry.js +0 -1
- package/dist/ketchup/p-b3067fd0.entry.js +0 -9
|
@@ -3,6 +3,7 @@ import { KupCardCSSClasses, } from "../kup-card-declarations";
|
|
|
3
3
|
import { FButtonStyling } from "../../../f-components/f-button/f-button-declarations";
|
|
4
4
|
import { FImage } from "../../../f-components/f-image/f-image";
|
|
5
5
|
import { FButton } from "../../../f-components/f-button/f-button";
|
|
6
|
+
const dom = document.documentElement;
|
|
6
7
|
let inputArea = null;
|
|
7
8
|
let clearButton = null;
|
|
8
9
|
let submitButton = null;
|
|
@@ -41,12 +42,39 @@ export function prepareOpenAIInterface(component) {
|
|
|
41
42
|
h("div", { class: "text" }, "Your AI assistant is currently offline!"),
|
|
42
43
|
];
|
|
43
44
|
};
|
|
45
|
+
const getTextFormatted = (m) => {
|
|
46
|
+
if (m.type == 'request') {
|
|
47
|
+
return [h("div", { class: "paragraph" }, m.text)];
|
|
48
|
+
}
|
|
49
|
+
let result = [];
|
|
50
|
+
let matches = m.funs;
|
|
51
|
+
let text = m.text;
|
|
52
|
+
let lastIndex = 0;
|
|
53
|
+
for (const match of matches) {
|
|
54
|
+
result.push(h("div", { class: "paragraph" }, text.slice(lastIndex, match.index)));
|
|
55
|
+
let fun = match[0].trim();
|
|
56
|
+
if (fun.startsWith('#[')) {
|
|
57
|
+
fun = fun.replace('#[', '');
|
|
58
|
+
}
|
|
59
|
+
if (fun.endsWith(']#')) {
|
|
60
|
+
fun = fun.replace(']#', '');
|
|
61
|
+
}
|
|
62
|
+
result.push(h("div", { class: "fun", title: "Execute FUN.", onClick: () => {
|
|
63
|
+
if (dom.ketchup.openAI.onFunClick) {
|
|
64
|
+
dom.ketchup.openAI.onFunClick(fun);
|
|
65
|
+
}
|
|
66
|
+
} }, fun));
|
|
67
|
+
lastIndex = match.index + match[0].length;
|
|
68
|
+
}
|
|
69
|
+
result.push(h("div", { class: "paragraph" }, text.slice(lastIndex)));
|
|
70
|
+
return result;
|
|
71
|
+
};
|
|
44
72
|
const readyJsx = () => {
|
|
45
73
|
const genChat = () => {
|
|
46
74
|
const nodes = [];
|
|
47
75
|
if (options.messages && options.messages.length > 0) {
|
|
48
76
|
options.messages.forEach((m) => {
|
|
49
|
-
nodes.push(h("div", { class: "message-container" }, h("div", { class: m.type }, m
|
|
77
|
+
nodes.push(h("div", { class: "message-container" }, h("div", { class: m.type }, getTextFormatted(m)), h(FButton, { icon: "content-copy", onClick: () => {
|
|
50
78
|
navigator.clipboard.writeText(m.text);
|
|
51
79
|
}, title: "Copy text to clipboard.", wrapperClass: "copy" })));
|
|
52
80
|
});
|
|
@@ -1178,6 +1178,13 @@
|
|
|
1178
1178
|
right: 0;
|
|
1179
1179
|
transition: background-color 125ms ease, opacity 250ms ease;
|
|
1180
1180
|
}
|
|
1181
|
+
.built-in-layout-7 .fun {
|
|
1182
|
+
font-weight: bold;
|
|
1183
|
+
}
|
|
1184
|
+
.built-in-layout-7 .fun:hover {
|
|
1185
|
+
text-decoration: underline;
|
|
1186
|
+
cursor: pointer;
|
|
1187
|
+
}
|
|
1181
1188
|
|
|
1182
1189
|
.collapsible-layout-1 {
|
|
1183
1190
|
color: var(--kup-text-color);
|
|
@@ -14,7 +14,7 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
|
|
|
14
14
|
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
15
15
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
16
16
|
};
|
|
17
|
-
var _KupDataTable_instances, _KupDataTable_initialized, _KupDataTable_rows, _KupDataTable_rowsLength, _KupDataTable_paginatedRows, _KupDataTable_paginatedRowsLength, _KupDataTable_footer, _KupDataTable_kupManager, _KupDataTable_renderedRows, _KupDataTable_loadMoreEventCounter, _KupDataTable_loadMoreEventPreviousQuantity, _KupDataTable_theadRef, _KupDataTable_tableRef, _KupDataTable_originalData, _KupDataTable_tableAreaRef, _KupDataTable_stickyTheadRef, _KupDataTable_customizeTopButtonRef, _KupDataTable_customizeTopPanelRef, _KupDataTable_sizedColumns, _KupDataTable_intObserver, _KupDataTable_navBarHeight, _KupDataTable_theadIntersecting, _KupDataTable_tableIntersecting, _KupDataTable_isSafariBrowser, _KupDataTable_isRestoringState, _KupDataTable_globalFilterTimeout, _KupDataTable_totalMenuCoords, _KupDataTable_clickTimeout, _KupDataTable_thRefs, _KupDataTable_rowsRefs, _KupDataTable_oldWidth, _KupDataTable_hold, _KupDataTable_interactableDrag, _KupDataTable_interactableDrop, _KupDataTable_interactableResize, _KupDataTable_interactableTouch, _KupDataTable_dropareaRef, _KupDataTable_removeDropareaRef, _KupDataTable_groupsDropareaRef, _KupDataTable_clickCb, _KupDataTable_clickCbCustomPanel, _KupDataTable_clickCbDropCard, _KupDataTable_resizeTimeout, _KupDataTable_columnMenuInstance, _KupDataTable_filtersColumnMenuInstance, _KupDataTable_filtersRowsInstance, _KupDataTable_detailCard, _KupDataTable_insertCard, _KupDataTable_confirmDeleteCard, _KupDataTable_confirmDeleteDialog, _KupDataTable_columnMenuCard, _KupDataTable_columnDropCard, _KupDataTable_columnDropCardAnchor, _KupDataTable_insertCount, _KupDataTable_BUTTON_CANCEL_ID, _KupDataTable_BUTTON_SUBMIT_ID, _KupDataTable_FIELDS_FORM_ID, _KupDataTable_MESSAGE_ID, _KupDataTable_MESSAGE_WRAPPER_ID, _KupDataTable_INSERT_PREFIX, _KupDataTable_closeDropCard, _KupDataTable_createDropCard, _KupDataTable_calculateData, _KupDataTable_getRow, _KupDataTable__getRow, _KupDataTable_getTransposedData, _KupDataTable_setTransposedData, _KupDataTable_switchToTotalsMatrix, _KupDataTable_setObjForTotalsMatrix, _KupDataTable_stickyHeaderPosition, _KupDataTable_updateStickyHeaderSize, _KupDataTable_setObserver, _KupDataTable_didLoadInteractables, _KupDataTable_didRenderInteractables, _KupDataTable_didLoadObservers, _KupDataTable_didRenderObservers, _KupDataTable_didLoadEventHandling, _KupDataTable_scrollStickyHeader, _KupDataTable_checkScrollOnHover, _KupDataTable_customizePanelPosition, _KupDataTable_rowsPointLength, _KupDataTable_paginatedRowsPointLength, _KupDataTable__rowsLength,
|
|
17
|
+
var _KupDataTable_instances, _KupDataTable_initialized, _KupDataTable_rows, _KupDataTable_rowsLength, _KupDataTable_paginatedRows, _KupDataTable_paginatedRowsLength, _KupDataTable_footer, _KupDataTable_kupManager, _KupDataTable_renderedRows, _KupDataTable_loadMoreEventCounter, _KupDataTable_loadMoreEventPreviousQuantity, _KupDataTable_theadRef, _KupDataTable_tableRef, _KupDataTable_originalData, _KupDataTable_tableAreaRef, _KupDataTable_stickyTheadRef, _KupDataTable_customizeTopButtonRef, _KupDataTable_customizeTopPanelRef, _KupDataTable_sizedColumns, _KupDataTable_intObserver, _KupDataTable_navBarHeight, _KupDataTable_theadIntersecting, _KupDataTable_tableIntersecting, _KupDataTable_isSafariBrowser, _KupDataTable_isRestoringState, _KupDataTable_globalFilterTimeout, _KupDataTable_totalMenuCoords, _KupDataTable_clickTimeout, _KupDataTable_thRefs, _KupDataTable_rowsRefs, _KupDataTable_oldWidth, _KupDataTable_hold, _KupDataTable_interactableDrag, _KupDataTable_interactableDrop, _KupDataTable_interactableResize, _KupDataTable_interactableTouch, _KupDataTable_dropareaRef, _KupDataTable_removeDropareaRef, _KupDataTable_groupsDropareaRef, _KupDataTable_clickCb, _KupDataTable_clickCbCustomPanel, _KupDataTable_clickCbDropCard, _KupDataTable_resizeTimeout, _KupDataTable_columnMenuInstance, _KupDataTable_filtersColumnMenuInstance, _KupDataTable_filtersRowsInstance, _KupDataTable_detailCard, _KupDataTable_insertCard, _KupDataTable_confirmDeleteCard, _KupDataTable_confirmDeleteDialog, _KupDataTable_columnMenuCard, _KupDataTable_columnDropCard, _KupDataTable_columnDropCardAnchor, _KupDataTable_insertCount, _KupDataTable_BUTTON_CANCEL_ID, _KupDataTable_BUTTON_SUBMIT_ID, _KupDataTable_FIELDS_FORM_ID, _KupDataTable_MESSAGE_ID, _KupDataTable_MESSAGE_WRAPPER_ID, _KupDataTable_INSERT_PREFIX, _KupDataTable_closeDropCard, _KupDataTable_createDropCard, _KupDataTable_calculateData, _KupDataTable_getRow, _KupDataTable__getRow, _KupDataTable_getTransposedData, _KupDataTable_setTransposedData, _KupDataTable_switchToTotalsMatrix, _KupDataTable_setObjForTotalsMatrix, _KupDataTable_stickyHeaderPosition, _KupDataTable_updateStickyHeaderSize, _KupDataTable_setObserver, _KupDataTable_didLoadInteractables, _KupDataTable_didRenderInteractables, _KupDataTable_didLoadObservers, _KupDataTable_didRenderObservers, _KupDataTable_didLoadEventHandling, _KupDataTable_scrollStickyHeader, _KupDataTable_checkScrollOnHover, _KupDataTable_customizePanelPosition, _KupDataTable_rowsPointLength, _KupDataTable_paginatedRowsPointLength, _KupDataTable__rowsLength, _KupDataTable_resetSelectedRows, _KupDataTable_getSizedColumns, _KupDataTable_rowDetail, _KupDataTable_rowInsertForm, _KupDataTable_rowsDelete, _KupDataTable_getEventDetails, _KupDataTable_clickHandler, _KupDataTable_contextMenuHandler, _KupDataTable_dblClickHandler, _KupDataTable_initRows, _KupDataTable_filterRows, _KupDataTable_isGrouping, _KupDataTable_hasRowActions, _KupDataTable_removeGroup, _KupDataTable_hasTotals, _KupDataTable_tableHasAutoWidth, _KupDataTable_forceGroupExpansion, _KupDataTable_forceRowGroupExpansion, _KupDataTable_adjustPaginator, _KupDataTable_composeFixedCellStyleAndClass, _KupDataTable_updateFixedRowsAndColumnsCssVariables, _KupDataTable_onColumnSort, _KupDataTable_onRemoveFilter, _KupDataTable_getFilterValueForTooltip, _KupDataTable_onGlobalFilterChange, _KupDataTable_handlePageChange, _KupDataTable_handleRowsPerPageChange, _KupDataTable_onRowClick, _KupDataTable_selectColumn, _KupDataTable_deselectColumn, _KupDataTable_onDefaultRowActionClick, _KupDataTable_onRowActionExpanderClick, _KupDataTable_handleRowSelect, _KupDataTable_onRowExpand, _KupDataTable_onSelectAll, _KupDataTable_openTotalMenu, _KupDataTable_closeTotalMenu, _KupDataTable_isOpenedTotalMenuForColumn, _KupDataTable_groupRows, _KupDataTable_onLoadMoreClick, _KupDataTable_adjustGroupState, _KupDataTable_adjustGroupStateFromRow, _KupDataTable_sortRows, _KupDataTable_getSortIcon, _KupDataTable_getSortDecode, _KupDataTable_calculateColspan, _KupDataTable_isGroupExpanded, _KupDataTable_handleColumnSort, _KupDataTable_moveSortedColumns, _KupDataTable_applyLineBreaks, _KupDataTable_composeHeaderCellClassAndStyle, _KupDataTable_renderHeader, _KupDataTable_renderStickyHeader, _KupDataTable_totalMenuPosition, _KupDataTable_onTotalMenuOpen, _KupDataTable_renderRow, _KupDataTable_renderActions, _KupDataTable_onCustomSettingsClick, _KupDataTable_openCustomSettings, _KupDataTable_closeCustomSettings, _KupDataTable_renderPaginator, _KupDataTable_columnRemoveArea, _KupDataTable_columnGroupArea, _KupDataTable_hideShowColumnDropArea, _KupDataTable_handleColumnGroup, _KupDataTable_transcodeItem, _KupDataTable_createListData, _KupDataTable_FONTSIZE_CODES, _KupDataTable_FONTSIZE_DECODES, _KupDataTable_FONTSIZE_ICONS, _KupDataTable_getFontSizeCodeFromDecode, _KupDataTable_renderFontSizePanel, _KupDataTable_DENSITY_DECODES, _KupDataTable_DENSITY_ICONS, _KupDataTable_getDensityCodeFromDecode, _KupDataTable_renderDensityPanel, _KupDataTable_GRID_CODES, _KupDataTable_GRID_DECODES, _KupDataTable_GRID_ICONS, _KupDataTable_getGridCodeFromDecode, _KupDataTable_renderTransposeSwitch, _KupDataTable_renderTotalsMatrix, _KupDataTable_renderGridPanel;
|
|
18
18
|
import { forceUpdate, h, Host, } from "@stencil/core";
|
|
19
19
|
import { FixedCellsClasses, FixedCellsCSSVarsBase, GroupLabelDisplayMode, LoadMoreMode, PaginatorPos, ShowGrid, SortMode, TotalMode, TotalLabel, KupDataTableProps, fieldColumn, iconColumn, keyColumn, SelectionMode, } from "./kup-data-table-declarations";
|
|
20
20
|
import { getColumnByName } from "../../utils/cell-utils";
|
|
@@ -818,7 +818,6 @@ export class KupDataTable {
|
|
|
818
818
|
__classPrivateFieldGet(this, _KupDataTable_instances, "m", _KupDataTable_didRenderObservers).call(this);
|
|
819
819
|
__classPrivateFieldGet(this, _KupDataTable_instances, "m", _KupDataTable_didRenderInteractables).call(this);
|
|
820
820
|
__classPrivateFieldGet(this, _KupDataTable_instances, "m", _KupDataTable_hideShowColumnDropArea).call(this, false);
|
|
821
|
-
__classPrivateFieldGet(this, _KupDataTable_instances, "m", _KupDataTable_setDynPosElements).call(this);
|
|
822
821
|
if (this.headerIsPersistent &&
|
|
823
822
|
this.tableHeight === undefined &&
|
|
824
823
|
this.tableWidth === undefined) {
|
|
@@ -1105,7 +1104,10 @@ export class KupDataTable {
|
|
|
1105
1104
|
' Open AI ' +
|
|
1106
1105
|
'(' +
|
|
1107
1106
|
__classPrivateFieldGet(this, _KupDataTable_kupManager, "f").language.translate(KupLanguageGeneric.EXPERIMENTAL_FEAT) +
|
|
1108
|
-
')', icon: "open-ai", "onkup-button-click": () => __classPrivateFieldGet(this, _KupDataTable_kupManager, "f").openAI.show(
|
|
1107
|
+
')', icon: "open-ai", "onkup-button-click": () => __classPrivateFieldGet(this, _KupDataTable_kupManager, "f").openAI.show({
|
|
1108
|
+
context: this.rootElement.tagName,
|
|
1109
|
+
dataset: this.data,
|
|
1110
|
+
}) })) : null), totalsMatrix));
|
|
1109
1111
|
}
|
|
1110
1112
|
render() {
|
|
1111
1113
|
__classPrivateFieldSet(this, _KupDataTable_thRefs, [], "f");
|
|
@@ -1115,7 +1117,7 @@ export class KupDataTable {
|
|
|
1115
1117
|
__classPrivateFieldSet(this, _KupDataTable_sizedColumns, __classPrivateFieldGet(this, _KupDataTable_instances, "m", _KupDataTable_getSizedColumns).call(this), "f");
|
|
1116
1118
|
let rows = null;
|
|
1117
1119
|
if (__classPrivateFieldGet(this, _KupDataTable_paginatedRowsLength, "f") === 0) {
|
|
1118
|
-
rows = (h("tr", { key: '
|
|
1120
|
+
rows = (h("tr", { key: '9335ea21f2b6bdbd150ae6225485da12d48cf1e1', ref: (el) => __classPrivateFieldGet(this, _KupDataTable_rowsRefs, "f").push(el) }, h("td", { key: '40a2bffa4968d9de85c760a2b75edaa00162d911', colSpan: __classPrivateFieldGet(this, _KupDataTable_instances, "m", _KupDataTable_calculateColspan).call(this) }, this.emptyDataLabel)));
|
|
1119
1121
|
}
|
|
1120
1122
|
else {
|
|
1121
1123
|
rows = [];
|
|
@@ -1179,7 +1181,7 @@ export class KupDataTable {
|
|
|
1179
1181
|
for (let i = 0; i < chipsData.length; i++) {
|
|
1180
1182
|
props.onIconClick.push(() => __classPrivateFieldGet(this, _KupDataTable_instances, "m", _KupDataTable_removeGroup).call(this, i));
|
|
1181
1183
|
}
|
|
1182
|
-
groupChips = h(FChip, Object.assign({ key: '
|
|
1184
|
+
groupChips = h(FChip, Object.assign({ key: '61ab9155ed4ac49adca414c297c1b98b984e579f' }, props));
|
|
1183
1185
|
}
|
|
1184
1186
|
}
|
|
1185
1187
|
const tableClass = {
|
|
@@ -1212,7 +1214,7 @@ export class KupDataTable {
|
|
|
1212
1214
|
if (this.headerIsPersistent &&
|
|
1213
1215
|
this.tableHeight === undefined &&
|
|
1214
1216
|
this.tableWidth === undefined) {
|
|
1215
|
-
stickyEl = (h("sticky-header", { key: '
|
|
1217
|
+
stickyEl = (h("sticky-header", { key: '0c6567b602e3efaf000e125cf5c33ccbe8f6eb72', class: "hover-scrolling-child", hidden: !this.showHeader, ref: (el) => (__classPrivateFieldSet(this, _KupDataTable_stickyTheadRef, el, "f")) }, h("thead-sticky", { key: '9d9fdbba7d9562c167d4da9c1349849984dcf8d9' }, h("tr-sticky", { key: '32a5070049fd847130e388a19cfca4fd389d7575' }, stickyHeader))));
|
|
1216
1218
|
}
|
|
1217
1219
|
let belowClass = 'below-wrapper';
|
|
1218
1220
|
if (this.tableHeight !== undefined || this.tableWidth !== undefined) {
|
|
@@ -1235,11 +1237,11 @@ export class KupDataTable {
|
|
|
1235
1237
|
}
|
|
1236
1238
|
}
|
|
1237
1239
|
};
|
|
1238
|
-
const compCreated = (h(Host, { key: '
|
|
1240
|
+
const compCreated = (h(Host, { key: '4801724ab5230c778c411c614d664aa1129f456d', "onKup-cell-input": autoselectOnAction, "onKup-cell-update": autoselectOnAction }, h("style", { key: 'cc1e4c9d1e7ead054d92776378c37735c0bbebf8' }, __classPrivateFieldGet(this, _KupDataTable_kupManager, "f").theme.setKupStyle(this.rootElement)), h("div", { key: 'bdf2452f9219c630121c520580e11e782cc79c08', id: componentWrapperId }, h("div", { key: '0cf23b0bb3fd233fbfee9cebd5f09acff32484c2', class: "above-wrapper" }, this.globalFilter ? (h("div", { id: "global-filter" }, h(FTextField, { fullWidth: true, icon: KupThemeIconValues.SEARCH, label: __classPrivateFieldGet(this, _KupDataTable_kupManager, "f").language.translate(KupLanguageSearch.SEARCH), value: this.globalFilterValue, onInput: (event) => {
|
|
1239
1241
|
const t = event.target;
|
|
1240
1242
|
window.clearTimeout(__classPrivateFieldGet(this, _KupDataTable_globalFilterTimeout, "f"));
|
|
1241
1243
|
__classPrivateFieldSet(this, _KupDataTable_globalFilterTimeout, window.setTimeout(() => __classPrivateFieldGet(this, _KupDataTable_instances, "m", _KupDataTable_onGlobalFilterChange).call(this, t), 600, t), "f");
|
|
1242
|
-
} }))) : null, paginatorTop), h("div", { key: '
|
|
1244
|
+
} }))) : null, paginatorTop), h("div", { key: '26916a65abbf6324ccfee2dcd6d1ab4214bca5cc', class: "group-wrapper" }, groupChips), h("div", { key: '5c3f4d390bf371cf7b006c6b087fa02a3ef1af06', class: "actions-wrapper" }, this.insertMode !== '' ? (h(FButton, { icon: "plus", onClick: async () => {
|
|
1243
1245
|
var _a;
|
|
1244
1246
|
if (this.insertMode === 'form') {
|
|
1245
1247
|
__classPrivateFieldGet(this, _KupDataTable_instances, "m", _KupDataTable_rowInsertForm).call(this);
|
|
@@ -1287,9 +1289,9 @@ export class KupDataTable {
|
|
|
1287
1289
|
id: this.rootElement.id,
|
|
1288
1290
|
selectedRows: this.selectedRows,
|
|
1289
1291
|
});
|
|
1290
|
-
}, styling: FButtonStyling.OUTLINED, title: "History", wrapperClass: "history-button" })) : null), h("div", { key: '
|
|
1292
|
+
}, styling: FButtonStyling.OUTLINED, title: "History", wrapperClass: "history-button" })) : null), h("div", { key: 'c87846c5daeb2297668a7fff518601892a509e1d', class: "droparea", ref: (el) => (__classPrivateFieldSet(this, _KupDataTable_dropareaRef, el, "f")) }, this.showGroups ? __classPrivateFieldGet(this, _KupDataTable_instances, "m", _KupDataTable_columnGroupArea).call(this) : null, this.removableColumns
|
|
1291
1293
|
? __classPrivateFieldGet(this, _KupDataTable_instances, "m", _KupDataTable_columnRemoveArea).call(this)
|
|
1292
|
-
: null), h("div", { key: '
|
|
1294
|
+
: null), h("div", { key: '9354ce51cd005c435b9b7f1d314709c6b99690c6', style: elStyle, class: belowClass, ref: (el) => (__classPrivateFieldSet(this, _KupDataTable_tableAreaRef, el, "f")) }, this.showCustomization
|
|
1293
1295
|
? [
|
|
1294
1296
|
h("div", { class: "settings-trigger", onClick: () => {
|
|
1295
1297
|
__classPrivateFieldGet(this, _KupDataTable_instances, "m", _KupDataTable_onCustomSettingsClick).call(this);
|
|
@@ -1298,11 +1300,11 @@ export class KupDataTable {
|
|
|
1298
1300
|
} }, h(FImage, { color: `var(${KupThemeColorValues.TITLE})`, resource: "settings", sizeX: "10px" })),
|
|
1299
1301
|
this.renderCustomizePanel(),
|
|
1300
1302
|
]
|
|
1301
|
-
: null, h("table", { key: '
|
|
1303
|
+
: null, h("table", { key: '9c6e5b310a757cf81dd6a8eac749f2bffdd78ceb', class: tableClass, ref: (el) => (__classPrivateFieldSet(this, _KupDataTable_tableRef, el, "f")), onMouseLeave: (ev) => {
|
|
1302
1304
|
ev.stopPropagation();
|
|
1303
1305
|
}, onContextMenu: (e) => {
|
|
1304
1306
|
e.preventDefault();
|
|
1305
|
-
} }, h("thead", { key: '
|
|
1307
|
+
} }, h("thead", { key: '5d59c9afbb81ebfc999e190230fd33572da4b568', hidden: !this.showHeader, ref: (el) => (__classPrivateFieldSet(this, _KupDataTable_theadRef, el, "f")) }, h("tr", { key: '0f356d0dd3883abf72456bb31e875ceb0e23093b' }, header)), h("tbody", { key: '9c828bc56d24b00ae46c11697dcec623a8e7bbba' }, rows), this.showFooter || __classPrivateFieldGet(this, _KupDataTable_instances, "m", _KupDataTable_hasTotals).call(this)
|
|
1306
1308
|
? this.renderFooter()
|
|
1307
1309
|
: null), stickyEl), paginatorBottom)));
|
|
1308
1310
|
return compCreated;
|
|
@@ -4039,11 +4041,6 @@ _KupDataTable_initialized = new WeakMap(), _KupDataTable_rows = new WeakMap(), _
|
|
|
4039
4041
|
}
|
|
4040
4042
|
}
|
|
4041
4043
|
return count;
|
|
4042
|
-
}, _KupDataTable_setDynPosElements = function _KupDataTable_setDynPosElements() {
|
|
4043
|
-
// Column menu
|
|
4044
|
-
if (__classPrivateFieldGet(this, _KupDataTable_columnMenuCard, "f") && __classPrivateFieldGet(this, _KupDataTable_columnMenuCard, "f").data) {
|
|
4045
|
-
__classPrivateFieldGet(this, _KupDataTable_columnMenuCard, "f").data = __classPrivateFieldGet(this, _KupDataTable_columnMenuInstance, "f").prepData(this, getColumnByName(this.getVisibleColumns(), this.columnMenuAnchor), __classPrivateFieldGet(this, _KupDataTable_columnMenuCard, "f").data);
|
|
4046
|
-
}
|
|
4047
4044
|
}, _KupDataTable_resetSelectedRows = function _KupDataTable_resetSelectedRows() {
|
|
4048
4045
|
if (this.getRows().length === 0)
|
|
4049
4046
|
return;
|
|
@@ -5,7 +5,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
5
5
|
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
6
6
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
7
7
|
};
|
|
8
|
-
var _KupOpenAI_instances,
|
|
8
|
+
var _KupOpenAI_instances, _KupOpenAI_invalidPassword, _KupOpenAI_create, _KupOpenAI_connect, _KupOpenAI_disconnect;
|
|
9
9
|
import { KupCardFamily } from "../../components/kup-card/kup-card-declarations";
|
|
10
10
|
import { KupDebugCategory } from "../kup-debug/kup-debug-declarations";
|
|
11
11
|
const dom = document.documentElement;
|
|
@@ -16,15 +16,31 @@ export class KupOpenAI {
|
|
|
16
16
|
constructor(url) {
|
|
17
17
|
_KupOpenAI_instances.add(this);
|
|
18
18
|
this.card = null;
|
|
19
|
+
this.context = '';
|
|
19
20
|
this.data = null;
|
|
20
21
|
this.dialog = null;
|
|
21
22
|
this.sessionInfo = null;
|
|
22
23
|
this.url = null;
|
|
24
|
+
this.getFunFromText = (text) => {
|
|
25
|
+
const pattern = /#\[(?:F|C|A)\(([^)]*)\)\s*(?:\d\(([^)]*)\)\s*)?(?:INPUT\(([^)]*)\)\s*)?(?:SP\(([^)]*)\)\s*)?(?:P\(([^]*)\)\s*)?(?:CRO\(([^)]*)\)\s*)?(?:SS\(([^)]*)\)\s*)?(?:SERVER\(([^)]*)\)\s*)?(?:SG\(([^)]*)\)\s*)?(?:G\(([^)]*)\)\s*)?(?:NOTIFY\(([^)]*)\)\s*)?]\#/g;
|
|
26
|
+
return [...text.matchAll(pattern)];
|
|
27
|
+
};
|
|
23
28
|
this.container = document.createElement('div');
|
|
24
29
|
this.container.setAttribute('kup-openai', '');
|
|
25
30
|
document.body.appendChild(this.container);
|
|
26
31
|
this.url = url;
|
|
27
32
|
}
|
|
33
|
+
setError(message, _this, dontRefreshCard) {
|
|
34
|
+
if (!_this) {
|
|
35
|
+
_this = this;
|
|
36
|
+
}
|
|
37
|
+
dom.ketchup.debug.logMessage(_this, message, KupDebugCategory.ERROR);
|
|
38
|
+
if (dontRefreshCard) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
_this.getCardOptions().state = 'error';
|
|
42
|
+
_this.card.refresh();
|
|
43
|
+
}
|
|
28
44
|
getCardOptions() {
|
|
29
45
|
if (!this.card.data) {
|
|
30
46
|
this.card.data = {};
|
|
@@ -37,27 +53,24 @@ export class KupOpenAI {
|
|
|
37
53
|
}
|
|
38
54
|
return this.card.data.options;
|
|
39
55
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
this.
|
|
47
|
-
|
|
48
|
-
__classPrivateFieldGet(this, _KupOpenAI_instances, "m", _KupOpenAI_create).call(this);
|
|
56
|
+
async show(parameters) {
|
|
57
|
+
this.context = parameters.context;
|
|
58
|
+
this.data = parameters.dataset;
|
|
59
|
+
if (parameters.onFunClick) {
|
|
60
|
+
this.onFunClick = parameters.onFunClick;
|
|
61
|
+
}
|
|
62
|
+
if (this.card) {
|
|
63
|
+
await this.hide();
|
|
49
64
|
}
|
|
65
|
+
__classPrivateFieldGet(this, _KupOpenAI_instances, "m", _KupOpenAI_create).call(this);
|
|
50
66
|
}
|
|
51
|
-
|
|
52
|
-
* Hides the component.
|
|
53
|
-
*/
|
|
54
|
-
hide() {
|
|
67
|
+
async hide() {
|
|
55
68
|
if (this.card) {
|
|
56
69
|
this.card.remove();
|
|
57
70
|
this.card = null;
|
|
58
71
|
this.dialog.remove();
|
|
59
72
|
this.dialog = null;
|
|
60
|
-
__classPrivateFieldGet(this, _KupOpenAI_instances, "m", _KupOpenAI_disconnect).call(this);
|
|
73
|
+
await __classPrivateFieldGet(this, _KupOpenAI_instances, "m", _KupOpenAI_disconnect).call(this);
|
|
61
74
|
}
|
|
62
75
|
}
|
|
63
76
|
async auth(event) {
|
|
@@ -77,13 +90,13 @@ export class KupOpenAI {
|
|
|
77
90
|
});
|
|
78
91
|
}
|
|
79
92
|
catch (e) {
|
|
80
|
-
|
|
93
|
+
openAI.setError(e.message, openAI);
|
|
81
94
|
return;
|
|
82
95
|
}
|
|
83
96
|
if (response) {
|
|
84
97
|
if (response.status != 200) {
|
|
85
98
|
__classPrivateFieldGet(openAI, _KupOpenAI_instances, "m", _KupOpenAI_invalidPassword).call(openAI, event);
|
|
86
|
-
//this
|
|
99
|
+
//this.setError(await response.text());
|
|
87
100
|
return;
|
|
88
101
|
}
|
|
89
102
|
const responseJson = await response.json();
|
|
@@ -98,6 +111,10 @@ export class KupOpenAI {
|
|
|
98
111
|
openAI.card.refresh();
|
|
99
112
|
}
|
|
100
113
|
async chat(disableInteractivity, inputArea) {
|
|
114
|
+
const openAI = dom.ketchup.openAI;
|
|
115
|
+
if (!openAI.card) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
101
118
|
const communicate = async (question) => {
|
|
102
119
|
if (!openAI.url) {
|
|
103
120
|
return;
|
|
@@ -114,6 +131,7 @@ export class KupOpenAI {
|
|
|
114
131
|
'Content-Type': 'application/json',
|
|
115
132
|
},
|
|
116
133
|
body: JSON.stringify({
|
|
134
|
+
context: openAI.sessionInfo.context,
|
|
117
135
|
fileId: openAI.sessionInfo.fileId,
|
|
118
136
|
threadId: openAI.sessionInfo.threadId,
|
|
119
137
|
question: question,
|
|
@@ -121,41 +139,31 @@ export class KupOpenAI {
|
|
|
121
139
|
});
|
|
122
140
|
}
|
|
123
141
|
catch (e) {
|
|
124
|
-
|
|
142
|
+
openAI.setError(e.message, openAI);
|
|
125
143
|
}
|
|
126
144
|
if (response) {
|
|
127
145
|
if (response.status != 200) {
|
|
128
|
-
|
|
146
|
+
openAI.setError(await response.text(), openAI);
|
|
129
147
|
return;
|
|
130
148
|
}
|
|
131
149
|
const responseJson = await response.json();
|
|
132
150
|
if (responseJson && responseJson.messages) {
|
|
133
|
-
|
|
151
|
+
for (let i = 0; i < responseJson.messages.length; i++) {
|
|
152
|
+
const m = responseJson.messages[i];
|
|
153
|
+
m.funs = openAI.getFunFromText(m.text);
|
|
154
|
+
responseMessages.push(m);
|
|
155
|
+
}
|
|
134
156
|
}
|
|
135
157
|
}
|
|
136
158
|
return responseMessages;
|
|
137
159
|
};
|
|
138
|
-
const openAI = dom.ketchup.openAI;
|
|
139
|
-
if (!openAI.card) {
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
160
|
disableInteractivity(true);
|
|
143
161
|
openAI.getCardOptions().messages = await communicate(await inputArea.getValue());
|
|
144
162
|
openAI.card.refresh();
|
|
145
163
|
disableInteractivity(false);
|
|
146
164
|
}
|
|
147
165
|
}
|
|
148
|
-
_KupOpenAI_instances = new WeakSet(),
|
|
149
|
-
if (!_this) {
|
|
150
|
-
_this = this;
|
|
151
|
-
}
|
|
152
|
-
dom.ketchup.debug.logMessage(_this, message, KupDebugCategory.ERROR);
|
|
153
|
-
if (dontRefreshCard) {
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
_this.getCardOptions().state = 'error';
|
|
157
|
-
_this.card.refresh();
|
|
158
|
-
}, _KupOpenAI_invalidPassword = function _KupOpenAI_invalidPassword(event) {
|
|
166
|
+
_KupOpenAI_instances = new WeakSet(), _KupOpenAI_invalidPassword = function _KupOpenAI_invalidPassword(event) {
|
|
159
167
|
const field = event.detail.comp;
|
|
160
168
|
field.helper = 'Invalid password.';
|
|
161
169
|
field.rootElement.classList.add('kup-danger');
|
|
@@ -195,20 +203,24 @@ _KupOpenAI_instances = new WeakSet(), _KupOpenAI_setError = function _KupOpenAI_
|
|
|
195
203
|
headers: {
|
|
196
204
|
'Content-Type': 'application/json',
|
|
197
205
|
},
|
|
198
|
-
body: JSON.stringify({
|
|
206
|
+
body: JSON.stringify({
|
|
207
|
+
context: this.context,
|
|
208
|
+
data: this.data,
|
|
209
|
+
}),
|
|
199
210
|
});
|
|
200
211
|
}
|
|
201
212
|
catch (e) {
|
|
202
|
-
|
|
213
|
+
this.setError(e.message);
|
|
203
214
|
return;
|
|
204
215
|
}
|
|
205
216
|
if (response) {
|
|
206
217
|
if (response.status != 200) {
|
|
207
|
-
|
|
218
|
+
this.setError(await response.text());
|
|
208
219
|
return;
|
|
209
220
|
}
|
|
210
221
|
const responseJson = await response.json();
|
|
211
222
|
this.sessionInfo = {
|
|
223
|
+
context: this.context,
|
|
212
224
|
fileId: responseJson.fileId,
|
|
213
225
|
threadId: responseJson.threadId,
|
|
214
226
|
};
|
|
@@ -233,18 +245,19 @@ _KupOpenAI_instances = new WeakSet(), _KupOpenAI_setError = function _KupOpenAI_
|
|
|
233
245
|
'Content-Type': 'application/json',
|
|
234
246
|
},
|
|
235
247
|
body: JSON.stringify({
|
|
248
|
+
context: this.sessionInfo.context,
|
|
236
249
|
fileId: this.sessionInfo.fileId,
|
|
237
250
|
threadId: this.sessionInfo.threadId,
|
|
238
251
|
}),
|
|
239
252
|
});
|
|
240
253
|
}
|
|
241
254
|
catch (e) {
|
|
242
|
-
|
|
255
|
+
this.setError(e.message, undefined, true);
|
|
243
256
|
}
|
|
244
257
|
this.sessionInfo = null;
|
|
245
258
|
if (response) {
|
|
246
259
|
if (response.status != 200) {
|
|
247
|
-
|
|
260
|
+
this.setError(await response.text(), undefined, true);
|
|
248
261
|
}
|
|
249
262
|
}
|
|
250
263
|
};
|